### Combinatorial Testing

Combinatorial testing is a testing technique which is applied by combining the meaningful input as test cases. This method aims to reduce the number of test cases depends on the studies, which show that combinations of one value (one-pair) test cases can detect 20% to 68% of the defects; and combinations of two values (two-pair) test cases cover 65% to 97% of defects; and the combinations of more input values have higher defect-detection-ratio. If you remember the 7-testing-princible, I will mention two of them as “Testing shows presence of defects” and “Exhaustive testing is impossible”. These items explains that when we test an application we can only say that we have found these incidents which may be defect or not, but we cannot conclude that there is no defect remains in the system since you cannot find a %100 defect free application in the real world. What is more, testing the whole system including all part of the features and every line in the code base with every integration points in the system is a dream of daydreamers. Since, the aim of test engineering is to increase the efficiency of the testing process, combinatorial testing is very helpful on reducing the time spent for ineffective test inputs. The combinatorial testing can be divided into following applicable testing techniques:
• Category-Partition Testing
• Pairwise Testing

### Category-Partition Testing

This technique enables testers to create test cases by depending on the functional specification of a program. To create test cases, testers should understand the parameters of the functions which the program generates different result. Since the input values (as parameters of the function) can be classified (or taken into categories) test cases can be generated. Generally test cases can be generated by tools, so that program is tested by a systematic approach. This method can be applied with following steps:
1. Separate the requirements of the function so that test cases can be isolated
2. Discover the functional units by the help of requirement or specification for testing in isolation
3. Find input values (as parameters of the function) and specifications of test environments
4. Identify the categories by the help of the parameters and environments
5. Define the inhibition between the categories
6. Prepare the test specification by depending on the categories, inhibition, and parameters. Using Test Specification Language can be more helpful.
7. Create test frame. Test case generator can be used. The important point each categories should have one test frame.
8. Create test case for every options in each test frames
More information can be found at this document which will take you to 1988.

### Pairwise Testing

Pairwise testing is combining the input variables with systematical way as for creating test cases which covers the defined number-of-pairs. The meaning of “pair” shows the degree of combination of parameters, as an example 2-pair or pairwise means that there should be at least one combination for every combination of each two-parameters. As I explained, since testing all combinations of takes a long time pairwise testing is very effective for finding defects.

Pairwise testing is based on “Othogonal Array” in mathematics. Orthogonal array or matrix is a matrix which has number of t ordered coloums in which every coloums and the other coloums composed of the variables of ordered coloums, total number of each variables occur the same number of time. The called t is the strenght of the orthogonal array. For example, if the t is 2 and the coloums can have values as 1, 2, 3 then the following matrix is an othogonal array: First and the second coloums has ordered numbers of 1, 2, 3 so the other variables should be composed of these numbers. Total number of occurance of each variables is set to 9.

 1 1 1 1 2 2 1 3 3 2 1 2 2 2 1 2 3 1 3 1 3 3 2 3

After the orthogonal array is clarified explanations of the pairwise testing become easier, because it is the application of orthogonal array on testing. The differences are about in testing there are different number of parameters but orthogonal array it is fixed to the variables of ordered columns and in testing the parameters can be different that numbers. In pairwise testing the following parameters should be known:

Level: Number of parameter as input values

Index: If every parameter has the same number of options then the index is the number of option. Index is a must for Orthogonal Array but for testing, there is no assumption about this. If there is no index the array is called as Mixed-Alphabet Orthogonal Array.

Strength: number of pairs

The following examples are conculed the method; in this example we have three parameters which can have following values as A, B, C; 1, 2; X, Y which means that the number of combinations 3 x 2 x 2 = 12. If we want to test just 2-pairs or pairwise testing which covers every possible combination of two parameters, there should be 6 combinations. The highlighted test cases TC2, TC3, TC5, TC8, TC10, TC11 are not neccessary.

There are some tools for test case production, this make it easier and faster. You can find more information about the subject and tools for test case creation on the following links: