pairwise testing

Tuesday, 14 October 2014 13:02

Let our program take a dozen parameters. To test all combinations is very difficult, so you should choose the most common and potentially affecting each other. Bugs that arise by a particular combination of all ten parameters are rare.

The most common are bugs that arise by a particular combination of two parameters. The more information about the mutual influence of the parameters (more precisely – of the mutual non-influence), the more combinations we can not test. In the absence of such information, as well as by complex algorithms of program behavior, you should apply the method of pairwise testing.

Thus, we can simplify our task and test all the possible values ​​for each pair of parameters.
Let’s consider an example. Suppose we have three input parameters – 3 checkboxes. The number of all possible combinations – 2 to Grade 3 Total 8, then you need to do 8 tests. Let’s try to save time by testing the check boxes in pairs.

We test two pairs of parameters: the first with the second and second to the third with the help of 4 sets of input data (4 tests). It remains to test the couple of “first to the third.”

We bring the second column to its rightful place. It turns out that the last 2 tests can be run at any values ​​of the second parameter.

For certainty, we can add the zeros in these blanks:

As a result, we obtain 6 instead of 8 tests for a complete listing. Can you save more? You can:).

Wow! What do we see? By changing the order of the values ​​in column 3, we combined the 2-nd and 3-rd and 1-st to 3-rd parameters.

Total, there ate only 4 lines, i.e. 4 tests, equivalent to the original 6:

Exhaustive search of all possible combinations in the third column is guaranteed to give the minimum number of tests. However, judging by the fact that such minimizing algorithms are still developed, an exhaustive search is not acceptable because of too big time costs. There are programs that give acceptable results in reasonable time, such as PICT program from Microsoft, Allpairs etc. But more about that we’ll talk next time. If you’d like we apply our experience and knowledge to make your software better, you might be interested in our software testing service.

100.000 visitors per second? the story behind a startup in the cave of lions More