The Combinatorial Explosion

When a system has multiple input parameters, each with several possible values, the total number of combinations grows exponentially. A web form with 5 fields, each having 4 possible values, has 4^5 = 1,024 combinations. Add a few more fields and you quickly reach millions.

Testing all combinations is rarely feasible. But testing too few risks missing critical interaction faults — defects that only appear when specific parameter values combine in unexpected ways. Combinatorial testing strategies provide systematic approaches that balance thoroughness with practicality.

Coverage Strategies Spectrum

From least to most thorough:

1. Each-Choice Coverage

Every value of every parameter appears in at least one test case.

For 3 parameters with 3 values each: you need only 3 test cases (one per row where each column cycles through its values).

Strength: Minimal test count. Weakness: Does not test any interaction between parameters.

2. Base-Choice Coverage

Select a “base” test case (typically the most common or default configuration). Then create one test case for each non-base value of each parameter, varying only that parameter from the base.

For 3 parameters with 3 values each (1 base + 2 others per parameter): 1 base + 3 * 2 = 7 test cases.

Strength: Tests each value against a known-good configuration. Weakness: Only tests single-parameter deviations from base.

3. Pairwise (2-Way) Coverage

Every pair of parameter values appears in at least one test case. This is the most commonly used combinatorial strategy.

Strength: Research shows that 70-90% of software faults involve interactions between at most 2 parameters (Kuhn et al., NIST studies). Weakness: Misses 3-way and higher interactions.

4. T-Way Coverage (t = 3, 4, …)

Every t-tuple of parameter values appears in at least one test case. Higher t means more interaction coverage but more tests.

ParametersValues EachAll CombosPairwise (2-way)3-way4-way
53243~15~45~81
10359,049~20~60~120
154~1 billion~30~120~350

5. All-Combinations Coverage

Every possible combination of all parameter values is tested. Feasible only for very small parameter spaces.

NIST Research: How Many Parameters Interact?

Research by Rick Kuhn and colleagues at NIST analyzed real software failure databases:

Interaction StrengthCumulative Faults Detected
1-way (single)40-65%
2-way (pairwise)70-90%
3-way90-98%
4-way96-100%
5-way~100%
6-way100%

This means pairwise testing alone catches the vast majority of interaction faults, and 4-6 way testing catches virtually all of them.

Covering Arrays

The mathematical foundation of combinatorial testing is the covering array.

A covering array CA(N; t, k, v) is:

  • N rows (test cases)
  • k columns (parameters)
  • v values per parameter
  • Every N x t sub-array contains all v^t value combinations

For pairwise (t=2) with k=4 parameters having v=3 values each, a covering array might look like:

TestP1P2P3P4
1AAAA
2ABBB
3ACCC
4BABC
5BBCA
6BCAB
7CACB
8CBAC
9CCBA

9 tests instead of 81 all-combinations, and every pair of parameter values appears.

Tools for Combinatorial Test Generation

PICT (Microsoft)

# model.pict
OS: Windows, macOS, Linux
Browser: Chrome, Firefox, Safari, Edge
Language: EN, ES, RU, FR
Theme: Light, Dark

# Constraints
IF [Browser] = "Safari" THEN [OS] = "macOS";
pict model.pict

ACTS (NIST)

Java-based tool supporting mixed-strength covering arrays and constraints. Free from NIST.

Other Tools

  • Jenny — C-based, fast, open source
  • Hexawise — Commercial, web-based with constraint handling
  • AllPairs — James Bach’s lightweight tool
  • tcases — Test case generation from OpenAPI specs

Constraints in Combinatorial Testing

Real parameters often have dependencies. For example, Safari only runs on macOS. Without constraints, invalid combinations pollute your test suite.

Most tools support constraints:

  • IF-THEN: IF Browser = Safari THEN OS = macOS
  • Exclusion: {OS = Linux, Browser = Safari} is forbidden
  • Requirement: IF PaymentType = CreditCard THEN CardNumber IS NOT empty

Exercise: Combinatorial Test Design

Problem 1

An e-commerce checkout has these parameters:

ParameterValues
Payment MethodCredit Card, PayPal, Apple Pay, Bank Transfer
ShippingStandard, Express, Overnight, Pickup
CurrencyUSD, EUR, GBP
Gift WrapYes, No
Discount CodeNone, Percentage, Fixed Amount

Calculate the number of test cases for: all-combinations, pairwise, and 3-way. Then generate a pairwise test suite.

Solution

All-combinations: 4 * 4 * 3 * 2 * 3 = 288 test cases

Pairwise (estimated): ~16-20 test cases (tools optimize this)

3-way (estimated): ~40-50 test cases

Pairwise suite (one valid solution):

#PaymentShippingCurrencyGiftDiscount
1Credit CardStandardUSDYesNone
2Credit CardExpressEURNoPercentage
3Credit CardOvernightGBPYesFixed
4Credit CardPickupUSDNoNone
5PayPalStandardEURYesFixed
6PayPalExpressGBPNoNone
7PayPalOvernightUSDNoPercentage
8PayPalPickupEURYesPercentage
9Apple PayStandardGBPNoPercentage
10Apple PayExpressUSDYesFixed
11Apple PayOvernightEURYesNone
12Apple PayPickupGBPNoFixed
13Bank TransferStandardUSDNoFixed
14Bank TransferExpressEURYesNone
15Bank TransferOvernightGBPNoPercentage
16Bank TransferPickupUSDYesPercentage

16 tests cover all pairwise combinations (verify: every pair of values from any two columns appears at least once).

Problem 2

Add these constraints to Problem 1 and regenerate:

  • Apple Pay is only available for USD and EUR
  • Pickup does not support gift wrapping
  • Bank Transfer does not support Overnight shipping
Solution

Constraints eliminate invalid combinations. A PICT model:

Payment: CreditCard, PayPal, ApplePay, BankTransfer
Shipping: Standard, Express, Overnight, Pickup
Currency: USD, EUR, GBP
Gift: Yes, No
Discount: None, Percentage, Fixed

IF [Payment] = "ApplePay" THEN [Currency] IN {"USD", "EUR"};
IF [Shipping] = "Pickup" THEN [Gift] = "No";
IF [Payment] = "BankTransfer" THEN [Shipping] <> "Overnight";

With constraints, the pairwise suite will still be roughly 16-20 tests but all combinations will be valid. Tools like PICT automatically handle this — they generate only valid test cases that satisfy all constraints.

Choosing the Right Coverage Level

SituationRecommended Strategy
Low risk, many parametersPairwise (2-way)
Safety-critical system4-6 way
Configuration testingPairwise with constraints
Quick smoke testEach-choice or base-choice
Regulatory compliance3-way or higher, documented

Key Takeaways

  • Combinatorial explosion makes all-combinations testing infeasible for most systems
  • Each-choice is minimal but misses interactions; all-combinations is thorough but impractical
  • Pairwise (2-way) testing catches 70-90% of interaction faults with dramatically fewer tests
  • NIST research shows most faults involve 2-6 parameter interactions
  • Covering arrays provide the mathematical foundation for t-way test generation
  • Tools (PICT, ACTS, Jenny) automate test suite generation with constraint support
  • Always model constraints to avoid generating invalid test combinations
  • Choose coverage strength based on risk: pairwise for most cases, higher t for critical systems