## Partition-Based Pairwise Testing

I have just finished writing a research paper for the SERP (Software Engineering Research and Practice) sub-conference of the 2009 World Congress in Computer Science, Computer Engineering, and Applied Computing. The paper presents the results of an investigation into the effectiveness of pairwise testing. In the paper I introduce the idea of what I call partition-based pairwise testing. The idea is best explained by example. Suppose you have a method under test named Evaluate(Card c1, Card c2, Card c3, Card c4, Card c5) which accepts representations of five objects which represent playing cards from a normal deck of 52 cards. Pure pairwise testing would treat all 52 cards as possible parameter values for each of the five system parameters. This would lead to an unmanageable number of test case inputs. The idea of partition-based pairwise testing is to divide the parameter values into some form of equivalence classes and then use some boundary values from each class. Suppose we divide the 52 card deck into low (2 through 6), medium (7, 8, 9), and high (10, Jack, Queen, King, Ace) classes, and ignore suit. If we use just the edge values from each class and arbitrarily select clubs as the suit, we get this set of input values:

c1: 2c, 6c, 7c, 9c, Tc, Ac
c2: 2c, 6c, 7c, 9c, Tc, Ac
c3: 2c, 6c, 7c, 9c, Tc, Ac
c4: 2c, 6c, 7c, 9c, Tc, Ac
c5: 2c, 6c, 7c, 9c, Tc, Ac

Now if we use a pairwise test set generation tool such as PICT, we generate 50 test case inputs:

c1  c2  c3  c4  c5
———————-
01: 2c  7c  6c  2c  2c
02: Tc  2c  9c  2c  6c
03: Ac  Ac  Tc  Tc  9c
(etc.)
50: 7c  9c  6c  2c  6c

This test set is much more manageable. Note that because there are many ways to partition an arbitrary set of values, you’d have to create several equivalence classes (for example, partitioning by suits) to get effective test coverage.