Generate Pairwise Combinations
Purpose
Cover all two-way interactions between parameters with a fraction of the full combination count, since most interaction defects are triggered by one or two parameters, while keeping constraints valid and residual risk visible.
When to use
- Configuration or compatibility testing across environments, devices, locales or settings.
- Features with many independent options (product configurators, search filters, feature flags).
- The exhaustive combination count exceeds the time available.
When not to use
- Outcomes are governed by explicit rules per combination. Use
decision-table-testing.
- A single parameter's ranges matter. Use
equivalence-boundary-analysis first to pick values.
- Parameters are not independent but sequential (workflow). Use
state-transition-testing.
Inputs
Required:
- Parameters and their values.
Optional, improves quality:
- Constraints (invalid or mandatory combinations), usage share per value, known risky interactions.
- Required strength (2-way default; 3-way for critical parameter groups).
If parameters or values are missing, ask for them. If values are ranges, reduce them to partitions first.
Process
- List parameters and values; reduce each value set with equivalence partitioning so values are behaviorally distinct.
- Capture constraints as explicit rules (e.g. Payment = Apple Pay ⇒ Browser = Safari; Guest ⇒ no saved card).
- Compute the exhaustive count and the theoretical pairwise lower bound (product of the two largest value counts).
- Construct the covering array: start with the two largest parameters as the base grid, then fill remaining parameters row by row, choosing values that cover the most uncovered pairs and satisfy constraints. For large models, state that a pairwise generator should be used and provide the model in a neutral text format.
- Verify coverage: list every value pair and confirm it appears in at least one valid row; pairs excluded by constraints are listed as not applicable.
- Add seeded rows: high-usage configurations (most common browser + payment) and known risky combinations, even if already pair-covered.
- Raise strength to 3-way for parameter subsets with high risk (e.g. payment x currency x country) if capacity allows.
- Replace "don't care" cells with the most frequently used value.
- Report the reduction, the residual risk (untested higher-order interactions) and how to map rows to test cases.
- Label assumed parameter values or constraints
[ASSUMPTION]; if the user continues, suggest test-case-writing to turn rows into cases or test-data-design for the data.
Output format
# Pairwise Combinations: <feature>
Parameters: <P1 (n values), P2 (n values), ...>
Constraints: <list>
Exhaustive: <n> · Pairwise rows: <n> · Strength: 2-way (+3-way for <subset>)
| Row | P1 | P2 | P3 | ... | Note (seeded / risky) |
|---|---|---|---|---|---|
## Coverage Check
- All valid pairs covered: <Yes / list of missing>
- Pairs excluded by constraints: <list>
## Residual Risk
- <higher-order interactions not covered>
Quality checklist
Common pitfalls
- Forgetting constraints, producing rows that cannot be executed.
- Using pairwise where outcome rules are explicit; you may miss the exact rule combination.
- Treating pairwise as complete testing. It covers pairs, not every three-way interaction.
Example
Input: "4 browsers, 3 payments, 2 user types, 3 delivery options, coupon yes/no; Apple Pay only on Safari."
Excerpt of output:
Exhaustive: 144 · Pairwise rows: 13 (lower bound 12, +1 for constraint)
| 1 | Chrome | Card | Member | Standard | Yes | seeded (top usage) |
| 5 | Safari | Apple Pay | Guest | Express | No | |
- Excluded pairs: Apple Pay with Chrome, Firefox, Edge.
1---2name: pairwise-testing3description: "Generates a reduced set of test combinations that covers every pair of parameter values (or higher strength for critical parameters), respecting constraints between values, and explains the reduction and residual risk. Use when many parameters or configurations (browsers, devices, roles, settings, product options) combine into too many cases to test exhaustively."4license: MIT5metadata:6 source: https://skillmd.com/skills/muratdincer/pairwise-testing7 version: "1.0.0"8 language: en9 category: 06-quality10 role: qa-analyst11 area: design12 title: "Generate pairwise combinations"13 related: "equivalence-boundary-analysis, decision-table-testing, test-case-writing, risk-based-testing, test-data-design"14 prompt: "Generate pairwise combinations for checkout: 4 browsers, 3 payment methods, 2 user types, 3 delivery options, coupon yes/no. Apple Pay only on Safari."15---1617# Generate Pairwise Combinations1819## Purpose20Cover all two-way interactions between parameters with a fraction of the full combination count, since most interaction defects are triggered by one or two parameters, while keeping constraints valid and residual risk visible.2122## When to use23- Configuration or compatibility testing across environments, devices, locales or settings.24- Features with many independent options (product configurators, search filters, feature flags).25- The exhaustive combination count exceeds the time available.2627## When not to use28- Outcomes are governed by explicit rules per combination. Use `decision-table-testing`.29- A single parameter's ranges matter. Use `equivalence-boundary-analysis` first to pick values.30- Parameters are not independent but sequential (workflow). Use `state-transition-testing`.3132## Inputs33Required:34- Parameters and their values.3536Optional, improves quality:37- Constraints (invalid or mandatory combinations), usage share per value, known risky interactions.38- Required strength (2-way default; 3-way for critical parameter groups).3940If parameters or values are missing, ask for them. If values are ranges, reduce them to partitions first.4142## Process431. List parameters and values; reduce each value set with equivalence partitioning so values are behaviorally distinct.442. Capture constraints as explicit rules (e.g. Payment = Apple Pay ⇒ Browser = Safari; Guest ⇒ no saved card).453. Compute the exhaustive count and the theoretical pairwise lower bound (product of the two largest value counts).464. Construct the covering array: start with the two largest parameters as the base grid, then fill remaining parameters row by row, choosing values that cover the most uncovered pairs and satisfy constraints. For large models, state that a pairwise generator should be used and provide the model in a neutral text format.475. Verify coverage: list every value pair and confirm it appears in at least one valid row; pairs excluded by constraints are listed as not applicable.486. Add seeded rows: high-usage configurations (most common browser + payment) and known risky combinations, even if already pair-covered.497. Raise strength to 3-way for parameter subsets with high risk (e.g. payment x currency x country) if capacity allows.508. Replace "don't care" cells with the most frequently used value.519. Report the reduction, the residual risk (untested higher-order interactions) and how to map rows to test cases.5210. Label assumed parameter values or constraints `[ASSUMPTION]`; if the user continues, suggest `test-case-writing` to turn rows into cases or `test-data-design` for the data.5354## Output format55```markdown56# Pairwise Combinations: <feature>57Parameters: <P1 (n values), P2 (n values), ...>58Constraints: <list>59Exhaustive: <n> · Pairwise rows: <n> · Strength: 2-way (+3-way for <subset>)6061| Row | P1 | P2 | P3 | ... | Note (seeded / risky) |62|---|---|---|---|---|---|6364## Coverage Check65- All valid pairs covered: <Yes / list of missing>66- Pairs excluded by constraints: <list>6768## Residual Risk69- <higher-order interactions not covered>70```7172## Quality checklist73- [ ] Every valid value pair appears in at least one row.74- [ ] No row violates a constraint.75- [ ] High-usage and known risky combinations are included explicitly.76- [ ] Parameter values are behaviorally distinct partitions, not arbitrary samples.77- [ ] Residual risk is stated.78- [ ] All checks pass; if any fails, revise the output and re-run this checklist before answering.7980## Common pitfalls81- Forgetting constraints, producing rows that cannot be executed.82- Using pairwise where outcome rules are explicit; you may miss the exact rule combination.83- Treating pairwise as complete testing. It covers pairs, not every three-way interaction.8485## Example86Input: "4 browsers, 3 payments, 2 user types, 3 delivery options, coupon yes/no; Apple Pay only on Safari."8788Excerpt of output:89Exhaustive: 144 · Pairwise rows: 13 (lower bound 12, +1 for constraint)90| 1 | Chrome | Card | Member | Standard | Yes | seeded (top usage) |91| 5 | Safari | Apple Pay | Guest | Express | No | |92- Excluded pairs: Apple Pay with Chrome, Firefox, Edge.