All-Pairs Testing: All Pairs of Variables. This Significantly Reduces The Number of Tests That Must Be Created and Run
All-Pairs Testing: All Pairs of Variables. This Significantly Reduces The Number of Tests That Must Be Created and Run
All-Pairs Testing: All Pairs of Variables. This Significantly Reduces The Number of Tests That Must Be Created and Run
Possible solutions:
Test all combinations [once], but delay the project so it misses its market window so that everyone
quits from stress, or the company goes out of business.
Choose one or two tests and hope for the best.
Choose the tests that you have already run, perhaps as part of programmer-led testing. Incorporate
them into a formal test plan and run them again.
Choose the tests that are easy to create and run. Ignore whether they provide useful information
about the quality of the product.
Make a list of all the combinations and choose the first few.
By magic, choose a specially selected, fairly small subset that finds a great many defectsmore
than you would expect from such a subset
The answer is not to attempt to test all the combinations for all the values for all the variables but to test
all pairs of variables. This significantly reduces the number of tests that must be created and run.
In a case study published by Brownlie of AT&T regarding the testing of a local-area network-
based electronic mail system, pairwise testing detected 28 percent more defects than their original
plan of developing and executing 1,500 test cases (later reduced to 1,000 because of time
constraints) and took 50 percent less effort.
A study by the National Institute of Standards and Technology published by Wallace and Kuhn on
software defects in recalled medical devices reviewed fifteen years of defect data. They concluded
that 98 percent of the reported software flaws could have been detected by testing all pairs of
parameter settings.
Kuhn and Reilly analyzed defects recorded in the Mozilla Web browser database. They
determined that pairwise testing would have detected 76 percent of the reported errors.
1. Orthogonal arrays
Notation:
1
Tools: The rdExpert tool from Phadke Associates implements the orthogonal array
approach. See http://www.phadkeassociates.com
Reference: Neil J.A. Sloane maintains a very comprehensive catalog of orthogonal arrays
at http://www.research.att.com/~njas/oadir/index.html
The process of using orthogonal arrays to select pairwise subsets for testing is:
The variables are Browser, Plug-in, Client operating system, Server, and Server operating
system.
Browser - Internet Explorer 5.0, 5.5, and 6.0, Netscape 6.0, 6.1, and 7.0, Mozilla 1.1, and
Opera 7 (8 choices).
Plug-in - None, RealPlayer, and MediaPlayer (3 choices).
Client operating system - Windows 95, 98, ME, NT, 2000, and XP (6 choices).
Server - IIS, Apache, and WebLogic (3 choices).
Server operating system - Windows NT, 2000, and Linux (3 choices).
Multiplying 8 x 3 x 6 x 3 x 3 we find there are 1,296 combinations. For "complete" test
coverage, each of these combinations should be tested.
3. Locate an orthogonal array that has a column for each variable and values within the
columns that correspond to the choices of each variable.
What size array is needed? First, it must have five columns, one for each variable in this
example. The first column must support eight different levels (1 through 8). The second
column must support three levels (1 through 3). The third requires six levels. The fourth and
the fifth each require three levels. The perfect size orthogonal array would be 816133 (one
column of 1 through 8, one column of 1 through 6, and three columns of 1 through 3).
Unfortunately, one of this exact size does not exist. When this occurs, we simply pick the next
larger array.
The L64(8243) orthogonal array meets our requirements. The requirement of 8161 (one column
of 1 through 8 and 1 column of 1 through 6) is met by 82 (two columns of 1 through 8). The
requirement of 33 (three columns of 1 through 3) is met by 43 (three columns of 1 through 4).
2
The number of combinations of all the values of all the variables is 1,296 and thus 1,296 test cases
should be created and run for complete coverage. Using this orthogonal array, all pairs of all the
values of all the variables can be covered in only 64 tests, a 95% reduction in the number of test
cases.
1 1 1 1 1 1 21 2 1 5 4 3 41 7 3 1 2 4
2 1 4 3 4 4 22 2 4 7 1 2 42 7 2 3 3 1
3 1 4 2 4 4 23 2 4 6 1 2 43 7 2 2 3 1
4 1 1 4 1 1 24 2 1 8 4 3 44 7 3 4 2 4
5 1 3 5 3 3 25 4 2 1 4 3 45 7 1 5 4 2
6 1 2 7 2 2 26 4 3 3 1 2 46 7 4 7 1 3
7 1 2 6 2 2 27 4 3 2 1 2 47 7 4 6 1 3
8 1 3 8 3 3 28 4 2 4 4 3 48 7 1 8 4 2
9 3 4 1 3 3 29 4 4 5 2 1 49 6 4 1 3 2
10 3 1 3 2 2 30 4 1 7 3 4 50 6 1 3 2 3
11 3 1 2 2 2 31 4 1 6 3 4 51 6 1 2 2 3
12 3 4 4 3 3 32 4 4 8 2 1 52 6 4 4 3 2
13 3 2 5 1 1 33 5 2 1 4 2 53 6 2 5 1 4
14 3 3 7 4 4 34 5 3 3 1 3 54 6 3 7 4 1
15 3 3 6 4 4 35 5 3 2 1 3 55 6 3 6 4 1
16 3 2 8 1 1 36 5 2 4 4 2 56 6 2 8 1 4
17 2 3 1 2 1 37 5 4 5 2 4 57 8 1 1 1 4
18 2 2 3 3 4 38 5 1 7 3 1 58 8 4 3 4 1
19 2 2 2 3 4 39 5 1 6 3 1 59 8 4 2 4 1
20 2 3 4 2 1 40 5 4 8 2 4 60 8 1 4 1 4
3
L64(8243) Orthogonal Array L64(8243) Orthogonal Array L64(8243) Orthogonal Array
?/th> ?/th> ?/th>
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
61 8 3 5 3 2 62 8 2 7 2 3 64 8 3 8 3 2
63 8 2 6 2 3
For example, the Browser choices will be mapped onto column 1. Cells containing a 1 will
represent IE 5.0; cells with a 2 will represent IE5.5; cells with a 3 will represent IE 6.0; etc.
o 1 IE 5.0
o 2 IE 5.5
o 3 IE 6.0
o 4 Netscape 6.0
o 5 Netscape 6.1
o 6 Netscape 7.0
o 7 Mozilla 1.1
o 8 Opera 7
If the perfect size array does not exist, choose one that is slightly bigger and apply these two rules
to deal with the "excess."
The first rule deals with extra columns. If the orthogonal array chosen has more columns
than needed for a particular test scenario, simply delete them. The array will remain
orthogonal.
The second rule deals with extra values for a variable. In the current example, column 3
runs from 1 to 8 but only 1 through 6 is needed. It is tempting to delete the rows that
contain these cells but DON'T. The "orthogonalness" may be lost. Each row in the array
exists to provide at least one pair combination that appears nowhere else in the array. If
you delete a row, you lose that test case. Instead of deleting them, simply convert the extra
cells to valid values. Some automated tools randomly choose from the set of valid values
for each cell while others choose one valid value and use it in every cell within a column.
Either approach is acceptable. Using this second approach, we'll complete the orthogonal
array. Note that it may be difficult to maintain the "balanced" aspect of the array when
assigning values to these extra cells.
4
L64 (8243) with a full mapping of all its columns including the L64 (8243) with a full mapping of all its columns including the
"extra" cells. "extra" cells.
?/th> ?/th>
Browser Plug-in Client Server Server Browser Plug-in Client Server Server
OS OS OS OS
2 IE 5.0 None Win ME IIS Win NT 22 IE 5.5 None Win 95 IIS Win
2000
12 IE 6.0 None Win NT WebLogic Linux 32 Net 6.0 None Win 98 Apache Win NT
13 IE 6.0 RealPlayer Win IIS Win NT 33 Net 6.1 RealPlayer Win 95 IIS Win
2000 2000
14 IE 6.0 MediaPlayer Win 95 IIS Win NT 34 Net 6.1 MediaPlayer Win ME IIS Linux
15 IE 6.0 MediaPlayer Win XP IIS Win NT 35 Net 6.1 MediaPlayer Win 98 IIS Linux
16 IE 6.0 RealPlayer Win 98 IIS Win NT 36 Net 6.1 RealPlayer Win NT IIS Win
2000
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
L64 (8243) with a full mapping of all its columns including the L64 (8243) with a full mapping of all its columns including the
"extra" cells. "extra" cells.
?/th> ?/th>
Browser Plug-in Client Server Server Browser Plug-in Client Server Server
OS OS OS OS
41 Moz 1.1 MediaPlayer Win 95 Apache Win NT 53 Net 7.0 RealPlayer Win IIS Win NT
2000
46 Moz 1.1 None Win 95 IIS Linux 58 Opera 7 None Win ME IIS Win NT
47 Moz 1.1 None Win XP IIS Linux 59 Opera 7 None Win 98 IIS Win NT
48 Moz 1.1 None Win 98 IIS Win 60 Opera 7 None Win NT IIS Win NT
2000
2. Allpairs algorithm
A second way is to use an algorithm that generates the pairs directly without resorting to an "external"
device like an orthogonal array.
James Bach provides a tool to generate all pairs combinations at http://www.satisfice.com.
Click on Test Methodology and look for Allpairs.
Ward Cunningham provides further discussion and the source code for a Java program to
generate all pairs combinations at http://fit.c2.com/wiki.cgi?AllPairs.
When a particular value in the test case doesn't matter, because all of its pairings have already
been selected, it is marked with a ~.
Output from the Allpairs program. Output from the Allpairs program.
?/th> ?/th>
Browser Client OS Plug-in Server Server OS Browser Client OS Plug-in Server Server OS
1 IE 5.0 Win 95 None IIS Win NT 2 IE 5.0 Win 98 Real Player Apache Win 2000
35
Output from the Allpairs program.
?/th>
Browser Client OS Plug-in Server Server OS
36
Output from the Allpairs program.
?/th>
Browser Client OS Plug-in Server Server OS
37