Course outline
Pairwise testing tool
Every pair of values in a few rows instead of every combination, with the pairs that can never happen left out.
Five settings with three or four values each already make 216 combinations, and every new setting multiplies them again. No team tests them all. Yet most bugs caused by settings need only two of them to meet: Safari with a declined card, a phone with a coupon.
Pairwise testing (all-pairs) builds a short list of tests in which every pair of values of every two settings meets at least once. Enter the parameters and their values, mark any pair that can never happen (or that you will test on its own), and the tool writes the tests and proves that each pair is covered.
Use the tool
One per line, "Name: value, value". A pair that cannot happen: "Never: Name = value, Name = value".
14 tests cover 88 of 88 pairs. Every combination would take 216 tests.
| Test | Browser | Device | Card | Coupon | Shopper |
|---|---|---|---|---|---|
| 1 | Chrome | Desktop | approved | none | guest |
| 2 | Chrome | Phone | declined | CEDAR10 | signed in |
| 3 | Chrome | Tablet | slow bank | WELCOME5 | signed in |
| 4 | Firefox | Desktop | declined | WELCOME5 | signed in |
| 5 | Firefox | Phone | approved | none | guest |
| 6 | Firefox | Tablet | approved | CEDAR10 | guest |
| 7 | Safari | Desktop | slow bank | CEDAR10 | guest |
| 8 | Safari | Phone | approved | WELCOME5 | signed in |
| 9 | Safari | Tablet | declined | none | guest |
| 10 | Edge | Desktop | approved | none | signed in |
| 11 | Edge | Phone | slow bank | none | guest |
| 12 | Edge | Tablet | declined | CEDAR10 | guest |
| 13 | Firefox | Desktop | slow bank | none | guest |
| 14 | Edge | Desktop | approved | WELCOME5 | signed in |
How the method works
The tool starts with every combination of the two parameters that have the most values. It then adds the other parameters one at a time: each test takes the value that covers the most pairs still missing, and when pairs are left over, it adds tests for them. This greedy method is known as IPOG (in-parameter-order generation).
A pair marked "Never" is one the system cannot produce, or one you will test on its own (here, a guest with the welcome code: "once per account" does not say what a shopper without an account gets, which is a question for the product owner): the tool never puts it in a test and does not count it. The result is rarely the smallest possible list, but it is close, it is fast, and every pair is there.
- One parameter per line: "Name: value, value, value" (up to 12 parameters of 12 values).
- A pair that can never happen, or that you will test on its own: "Never: Name = value, Name = value".
- Run each test; when one fails, the two values that met in it are the first suspects.
A worked example on Cedar Books
Checkout at Cedar Books depends on the browser, the device, the test card, the coupon and whether the shopper is signed in. Every combination would take 216 tests. The welcome code WELCOME5 is "once per account", and the requirement does not say what a guest gets, so that pair is left out of the set and tested on its own once the product owner answers. All pairs fit in these tests:
14 tests cover all 88 pairs (every combination would take 216).
| Test | Browser | Device | Card | Coupon | Shopper |
|---|---|---|---|---|---|
| 1 | Chrome | Desktop | approved | none | guest |
| 2 | Chrome | Phone | declined | CEDAR10 | signed in |
| 3 | Chrome | Tablet | slow bank | WELCOME5 | signed in |
| 4 | Firefox | Desktop | declined | WELCOME5 | signed in |
| 5 | Firefox | Phone | approved | none | guest |
| 6 | Firefox | Tablet | approved | CEDAR10 | guest |
| 7 | Safari | Desktop | slow bank | CEDAR10 | guest |
| 8 | Safari | Phone | approved | WELCOME5 | signed in |
| 9 | Safari | Tablet | declined | none | guest |
| 10 | Edge | Desktop | approved | none | signed in |
| 11 | Edge | Phone | slow bank | none | guest |
| 12 | Edge | Tablet | declined | CEDAR10 | guest |
| 13 | Firefox | Desktop | slow bank | none | guest |
| 14 | Edge | Desktop | approved | WELCOME5 | signed in |
Each row is one checkout to run. Put them in a regression suite and run them after every release: the pairs keep their coverage as long as no new value is added.