Saturday, November 12, 2011

How To Design Test Cases for testing the correctness of Calculation

How To Design Test Cases for testing the correctness of Calculation

I have found that many testers feel afraid when they are assigned to do software testing with the calculation module. Here is some guideline that will help you do software testing better.

calculation for black box testing

Learn how it calculates

It will be good if you understand what you will test. With this information, you can design the test strategy for software testing properly.

Apply Black Box testing technique

Apply Black Box testing technique; Equivalence partitioning, Boundary value analysis and Pairwise testing (All-pairs testing); for test cases design will improve the coverage of software testing.

We can use the equivalence partitioning testing technique to partition the possible cases. Don't forget to put the exception case from error guessing to the software testing scope as well (e.g., Divide by Zero case). From my experience, many bugs can be detected by testing the exception case.

The Boundary value analysis will help you to select the test case for checking also. Pairwise testing can be used for testing the formula that contains many input variables (e.g.,"=Floor(NUMBER,SIGNIFICANCE)" in MS Excel ).

Don't try to calculate manually for comparing the result

You should not calculate manually for comparison because it often contains the human error. Using the calculation from another program, e.g., MS Excel, is better because it does not contain human error. If the result is different, one of them should be wrong. So, the next step is to investigate this issue.

With this guideline, I hope that you will feel more confident when do software testing for any calculation.

8 ความคิดเห็น:

I do like this article
but am afraid that am testing a very complicated software itis image processing based for cardiac images analysis so the software use complicated equations to calculate some parameters for heart functions
the output are in shape of data numbers
or graphs or charts
have u any idea how to validate software like this

Interesting case. Could you provide the example of input and output with a way to calculate?

Sorry for being late in reply but I had a problem in internet connection
as an example of what am working on :
notice I will simplify what am working on :
Input :
1.dicom images of heart , the image could be simply represented as 2 circles inside each other which represent the left ventricle
2.these images are automatically segmented to extract the left ventricle

3.some calculations are done on the segmented part
a.Ejection fraction = (the volume of outer circle - volume of inner circle ) / volume of outer circle
b.for example also : I can calculate eularian and lagrangian strains

and there are many many other calculations

the problem is am testing blackbox testing
so the input of the equation is nearly unknown to validate the output

the second thing how to validate that am using the right equations not only the equations are working right

the third thing that the pathes I have are too many and can't be covered manually , also I can't depend only on blackbox testing techniques as any little problem cause severe issues

is there any kinds of random mathematical models that can validate complicated things like this



Here is my suggestion with the assumption that you have a way to check the correctness of result.

1st: As there are many equations in the blackbox, we should not check the correctness of each equation directly. We should use equivalence partitioning technique by splitting possible case. Then, select one pattern for each case as representative. If it is hard to split case, we should use every patterns because any escaped problem can cause severe problem.
2nd: To check if it is the right equation, it should be done at the requirement level. If it is impossible, using another tool as baseline should be good.
3rd: If there are many cases to be tested, you should implement a tool that can help you testing automatically. If you have more time to test, using this tool to do all remaining case.

I hope this will help you more or less.

thanks for your suggestions
ofcorse they will help somehow , although the validation of asoftware like this is very complicated, and need a kind of specified research based testing.

I have another question : are there any tools for blackbox testing techniques :
for example tool generates decision table , or generates state transition tree ?
Or I have to build my own

Let try CTE XL (See more detail in link below). It will help you for decision table. You can provide tool your input and build the test cases from tool.

thanks very much
the tool is very helpful and user friendly

Appreciate your help

Post a Comment


Twitter Delicious Facebook Digg Stumbleupon Favorites More