Why pairs
A form with five fields of three to four values each has hundreds of combinations, and most teams test a handful picked by feel. Pairwise testing picks a set in which every value of every parameter appears together with every value of every other parameter at least once. Many defects need only two settings to line up, Safari with a German locale, say, and a pairwise set catches every such pair at a fraction of the cost of testing everything.
The example above has 4 browsers, 3 operating systems, 3 locales, 3 plans and 2 payment methods: 216 combinations. The pairwise set covers every allowed pair in 13 to 16 cases, depending on the seed.
How to write the model
One parameter per line, the name, a colon and the values separated by commas:
Browser: Chrome, Firefox, Safari, Edge
OS: Windows, macOS, LinuxThis is the same layout as the basic model file of PICT, Microsoft's pairwise tool, so a model you write here also works there.
Exclusions are combinations that can never happen, one per line, written as Parameter=Value pairs separated by commas:
Browser=Safari, OS=Windows
Plan=Free, Payment=InvoiceExclusions are applied while the cases are built. Deleting the bad rows afterwards would also delete the valid pairs those rows were the only ones to cover, a point PICT's documentation makes too. Pairs that no allowed case can contain are listed under the results, so an exclusion that is broader than you meant shows up at once.
How the cases are built
The generator is greedy, in the style of the AETG system: each new case starts from a pair not yet covered, fills the other parameters with the values that cover the most new pairs, keeps the best of 30 such tries and repeats until every allowed pair is covered. The best possible size is at least the product of the two largest value counts (here 4 × 3 = 12), and the greedy result is usually a few cases above it.
The random choices come from a seeded generator, so the same model and seed give the same cases every time, and a different seed can give a slightly smaller set. Save the seed with the cases if you need to rebuild them.
Where pairs aren't enough
Pairwise covers interactions of two. A defect that needs three settings at once, such as a specific browser, locale and plan, can slip through; for a few high-risk parameters, test all their combinations and keep pairwise for the rest. Pairwise also says nothing about which values to choose: pick them with equivalence partitioning and the boundary value calculator first.
Sources
Get new posts by email.
Occasional email with new Testland posts and plugin releases.
Unsubscribe any time. Privacy policy