~/qa-guides

~/qa-guides/3-way-combinatorial-testing

>_ 3-Way Combinatorial Testing: Covering Arrays and Test Cases

A print preview drops page four even though every pair of settings has been tested. Build an eight-row covering array, check the output, and adapt the suite to a driver constraint.

Combinatorial testingCovering arraysTest design

Published

Short answer

3-way combinatorial testing selects test cases so that, for every choice of three different parameters, every feasible combination of their values occurs together in at least one case. A table of complete test configurations with that property is a covering array of strength 3. Each row also needs an expected result that tells the tester whether the system handled those inputs correctly.

Consider a print preview that drops the last page when duplex, landscape, and two pages per side are enabled together. A suite can cover every pair of settings and still miss that configuration. With four binary settings, the example below extends six existing cases to eight and shows exactly which gaps the two new cases close.

Define four settings and an observable result

Use a four-page document. Give each page a large black number from 1 through 4 and a colored patch. The numbers let you detect a missing, duplicated, or misplaced page. The patches let you check color handling even when the text looks identical. Use one copy, all four pages, a fixed paper size, and a preview that shows the front and back of each sheet.

Write each configuration as four digits in the order ABCD. On the reference printer all 16 configurations are available. The placement rules below belong to this example so you can substitute the rules for your own preview.

Setting01
A. DuplexOne-sidedDouble-sided
B. LandscapePortraitLandscape
C. Layout1 per side2 per side
D. GrayscaleColorGrayscale

First work out the expected layout from the source document. With C=0, expect four occupied sides. With C=1, expect two occupied sides, with pages 1 and 2 on the first side and 3 and 4 on the next, in that reading order. With duplex off, each occupied side takes a separate sheet. With duplex on, consecutive sides use the front and back of the same sheet. An unused reverse side does not count as an occupied side.

Check B against the shape of the sheet in the preview. A landscape sheet should be wider than it is tall, including when two source pages share it. For D, inspect the patch inside each page image. In color mode it should keep its source hue. In grayscale mode it should remain visible in a neutral shade. This fixture specifies no exact shade of gray.

Eight print-preview test cases

Open the same document for each case, apply all four settings, and confirm their effective values before reading the preview. A saved printer preset can otherwise change the next run's starting state. Count the occupied sides and sheets, then read the page numbers on each side. All four numbers must appear once, in order.

The first six rows below are the existing pairwise suite. The final two are the proposed additions. The preview column gives the expected sheet orientation and patch appearance.

ABCDPreviewSidesSheets
0011Portrait, grayscale22
0101Landscape, grayscale44
0110Landscape, color22
1001Portrait, grayscale42
1010Portrait, color21
1100Landscape, color42
0000Portrait, color44
1111Landscape, grayscale21

For example, 0110 and 1010 both put two source pages on each occupied side. In 0110, pages 3 and 4 belong on the front of a second sheet. In 1010, those same pages belong on the back of the first sheet. A thumbnail strip showing two perfectly legible thumbnails could satisfy the side count in both cases. Inspecting the sheet boundaries distinguishes the two expected outputs.

Audit the jump from pairwise to 3-way coverage

Start with the first six rows. Each turns on a different pair of settings. Pick any two columns. Their values are 11 in the row that enables both and 00 in the row that enables the other two. Each mixed value, 01 or 10, also appears when just one of the selected settings and one outside the pair are enabled. Six choices of two columns times four assignments gives 24 of 24 pair targets covered. For a worked introduction to selecting and counting those pairs, see the pairwise testing guide.

A three-way target identifies both its columns and its values. For example, row 1010 contributes ABC=101, ABD=100, ACD=110, and BCD=010. To audit a spreadsheet, keep the column labels with each three-digit value and count distinct entries. Set the row ID column to text when importing a CSV to preserve the leading zeros. For the formal column test, see NIST's definition of a covering array.

There are four groups of three columns. Each group has eight binary assignments, giving 32 distinct triple targets. For any one group, the six original rows produce 001, 010, 011, 100, 101, and 110. They cannot produce 111 because only two settings are on. They cannot produce 000 because only two are off. The baseline therefore covers 24 of 32 triples (75%).

Add 0000 and each group gains its missing 000. Add 1111 and each gains its missing 111. The eight rows now cover 32 of 32 triples while executing 8 of the 16 complete configurations. Eight is also the minimum for this particular model. Just the ABC group needs eight different assignments, and a single run can supply only one of them. If you start from a different pairwise suite, inspect its missing triples before deciding which rows to add.

Diagnose a missing page after a failed case

Suppose the first seven cases pass. In 1111, the preview shows one landscape sheet in grayscale. Its front contains pages 1 and 2. On the back, page 3 appears beside an empty slot. Both counts in the test matrix are correct. Reading the page IDs exposes the defect. Save the front and back previews, the input file, the effective settings, and the build so someone can reproduce the observation.

Run 1110 next. It holds duplex, orientation, and pages per side fixed while switching back to color. Expect the same placement on one landscape sheet, with colored patches. If page 4 is also missing here, the symptom persists with either value of D when ABC is 111. If page 4 returns, record grayscale as a condition that distinguishes the two observations. Either outcome gives engineering a more precise report than a single failed configuration.

To investigate A, B, and C in turn, hold D at 1 and switch off one setting at a time from 1111. Use 0111 to check page 4 on the front of sheet two, 1011 to check it on the back of a portrait sheet, and 1101 to check it alone on the back of sheet two. The location changes with each control, so finding a blank in the original slot is insufficient evidence. Record where page 4 actually went. These follow-up runs answer a diagnostic question even though the planned suite already covers every triple.

Report a blocked run separately from a failed output

If all eight configurations reach the preview and one shows the blank slot, report eight executed, seven passed, one failed, and 32 of 32 triples exercised. A rendering bug can coexist with complete input coverage.

If the reference printer goes offline before 1111 takes effect, only seven configurations reached the preview. The four all-on triples from that row are still outstanding. Report 28 of 32 triples exercised (87.5%) and one blocked case. Repeating a successful row can check reproducibility, but it contributes the same four targets as the first run.

Recalculate coverage when a driver rules out a combination

Now switch to a driver that supports duplex only in grayscale. This is a separate model. Any row with A=1 and D=0 is impossible on this driver, even when the controls let you request it. If the driver silently switches to grayscale, use the effective D value when auditing the preview. Whether the interface should announce the change is a separate acceptance check.

There are three legal assignments for AD and four for BC, hence 12 valid full configurations. ABC can still take all eight assignments because D can always be 1. BCD can take all eight because A can always be 0. ABD and ACD each have only six assignments. The new denominator is 28 feasible triples. A triple is feasible if at least one legal full configuration contains it. Section 3.3.1 discusses the risk of losing feasible interactions when deleting invalid rows in NIST's Practical Combinatorial Testing.

Drop the two disallowed cases, 1010 and 1100, from the eight-row matrix. The six retained cases cover 24 of the 28 feasible targets. To keep those six cases and recover full coverage, add the four rows below. Each missing target has only one legal completion here.

TripleAdd ABCDReason
ABC=1011011Duplex requires D on
ABC=1101101Duplex requires D on
BCD=0100010Color requires A off
BCD=1000100Color requires A off

The repaired suite covers all 28 feasible triples in ten cases. Why does the driver with fewer valid configurations need two more tests? All four combinations of B and C must occur in duplex, which requires grayscale. All four must also occur in color, which requires one-sided printing. Those eight distinct runs leave one-sided grayscale untouched. It still needs both orientations, so any suite for this driver needs at least ten runs.

FAQ

Yes, for the values and constraints in that model. With exactly three parameters, selecting three columns selects the entire configuration. As soon as you introduce a fourth parameter, several complete configurations can share the same triple.

Suppose pages per side can be 1, 2, or 4 and all other settings stay binary and independent. Each of the three column groups containing that parameter has 12 assignments. The one group without it still has eight, giving 44 triple targets. The largest group alone requires at least 12 runs. Specify where all four page IDs should appear in the new four-per-side mode before reusing the cases.

Yes. For example, require every pair across the driver and all eight assignments of ABC. That is a variable-strength coverage goal. If a report identifies one exact failing configuration, you can also preserve just that row as a regression case. Write down which target you chose so the next tester can audit it.

The array describes the effective configuration when the preview renders. If enabling duplex and then changing orientation loses a page, also try applying the same two changes in reverse order. A difference with the same final settings makes the sequence of actions part of the reproduction steps.

Use an output that exposes the driver's page placement, such as its rendered sheet images or a physical test print from the same job. A PDF export can serve as evidence if it uses the same layout path. If the available output exposes only counts, record which counts passed and leave page identity unverified.

Ready to turn this guide into a working QA project with statuses, comments, and CSV export?