Blog
Pairwise Testing: Examples, Tools and How to Do it

Abhilash
Published on

Table of contents
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Testing every possible combination of inputs sounds like the safest option, but in practice it’s impossible. A feature with seven settings, each with three options, has more than 2,000 combinations. A configurable enterprise system with a dozen settings can have millions. Nobody runs all of those. So the real question isn’t whether to cut down the number of tests, it’s how to do it without missing the bugs that matter.
Pairwise testing answers that. It picks a small set of tests that still covers every pair of input values at least once. It works because most bugs are caused by just one or two settings interacting. So if you cover every pair, you catch most bugs at a fraction of the cost.
In this article, we’ll explain what pairwise testing is, why it works, how much it saves, a worked enterprise example, how to handle impossible combinations, when not to use it, how to go beyond pairs, how to do it step by step, which tools to use and why it matters even more with AI-written code.
What is Pairwise Testing?
Pairwise testing, also called all-pairs testing or 2-way combinatorial testing, is a test design technique that builds a set of test cases covering every possible pair of input parameter values at least once. It comes out when the full set of combinations is bigger than anyone could reasonably run.
A Simple Example
Say a checkout has three settings, each with three options:
Setting | Options |
|---|---|
Customer type | Guest, Member, Business |
Delivery | Standard, Express, Click and collect |
Payment | Card, PayPal, Gift card |
That’s 27 possible combinations (3 × 3 × 3). A pairwise set covers every pair of values in just nine tests:
Test | Customer Type | Delivery | Payment |
|---|---|---|---|
1 | Guest | Standard | Card |
2 | Guest | Express | PayPal |
3 | Guest | Click and collect | Gift card |
4 | Member | Standard | PayPal |
5 | Member | Express | Gift card |
6 | Member | Click and collect | Card |
7 | Business | Standard | Gift card |
8 | Business | Express | Card |
9 | Business | Click and collect | PayPal |

Pick any two settings and any two values, like Guest and PayPal, or Express and Gift card, and you’ll find them together in at least one row. Going from 27 tests to nine is handy here. With more settings, it’s the difference between possible and impossible.
That’s why pairwise testing matters for enterprise systems. You can’t test everything on a system with lots of settings, whatever your budget. Picking combinations at random gives you no guarantee about what you’ve covered. Pairwise testing gives you a real guarantee against the most common causes of bugs, in a number of tests you can actually run, and run again.
Why Pairwise Testing Works
The whole technique rests on a finding that surprised people when it landed. In a series of studies from 1999 to 2004, D. Richard Kuhn and colleagues at the US National Institute of Standards and Technology went through defect data across a range of software systems and kept seeing the same shape, namely that the great majority of defects came from just one or two parameters interacting, with the payoff falling away fast at three-way, four-way, and beyond.
Laid out as a rough profile, the pattern is what the rest of the argument leans on.
One and two-parameter interactions account for the bulk of defects across the systems studied.
Three-parameter interactions add a smaller slice on top.
Four, five, and six-parameter interactions mop up most of what is left.
Seven-way and higher interactions barely register in the data.
Follow that through and the conclusion is hard to argue with. If you guarantee coverage of every 2-way interaction, you catch most of the defects without ever running the full combination set, so the saving is huge and the price in missed bugs is small.
There is a second bit of maths that makes it even better, namely that a pairwise set grows roughly logarithmically as you add parameters, not exponentially. Bolting a tenth or twentieth parameter onto a system that already has five does not blow the test count up, it nudges it, so pairwise stays affordable exactly where exhaustive testing falls off a cliff.
How Much Pairwise Testing Saves
Scenario | All Combinations | Pairwise Set (Roughly) | Reduction |
|---|---|---|---|
3 settings, 3 options each | 27 | 9 | 3× fewer |
7 settings, 3 options each | 2,187 | 15 to 20 | Over 100× fewer |
12 settings, 4 options each | Over 16 million | 30 to 40 | From impossible to easy |
The exact size of a pairwise set depends on the tool you use and any rules you add, so treat these as ballpark figures.
What matters most is how many of the bug-causing interactions you still cover. Based on the NIST research, those 30 to 40 tests catch almost as many bugs as hundreds or thousands more would, because once every pair is covered, each extra test adds very little.
For most systems, pairwise is the sweet spot. Going much further mostly means paying to look for bugs that aren’t there.
Pairwise Testing Example: A Wealth Management App
Small examples like the checkout one above show how it works. But the savings really show up at scale, so here’s something closer to a real enterprise system: a wealth management app with seven settings that all affect one important journey.
Setting | Options | Count |
|---|---|---|
Account type | Individual, Joint, Trust, Corporate | 4 |
Base currency | GBP, USD, EUR, JPY | 4 |
Compliance regime | UK retail, US retail, EU professional, Asia institutional | 4 |
Device | Desktop, Tablet, Phone | 3 |
Browser engine | Blink, WebKit, Gecko | 3 |
User role | Investor, Adviser, Operations | 3 |
Session | New session, Re-authenticated, SSO redirect | 3 |

Multiply them together and you get 5,184 combinations. A pairwise set brings that down to about 20 to 25 tests, depending on your tool and any rules you add. Thousands of combinations become a couple of dozen tests.
Account types, currencies, compliance regimes and user roles all multiply quickly on wealth platforms.
To see how Virtuoso QA keeps portfolio, onboarding and reporting journeys tested across them, take a look at our wealth management software testing solution.
Add one real-world rule, for example that Asia institutional compliance isn’t available for Individual accounts, and the set gets even smaller. That one rule removes a whole group of combinations that could never happen, and a good tool handles it automatically. Writing good rules like this is what separates people who’ve used pairwise testing for real from people who’ve only read about it.
Here’s how you’d describe this to Microsoft’s free PICT tool, including that rule:
PICT model
The set you get back covers every pair of values at least once. Individual accounts are tested with every currency, every compliance regime they’re allowed, every device, every browser engine, every role and every session type, and the same goes for every other value.
What it doesn’t cover is every combination of three or more settings. So a bug that only appears for a Corporate account in EUR, on EU professional compliance, on a tablet using WebKit, in a re-authenticated session, might slip through. The bet you’re making is that bugs that specific are rare in production, and the research backs that bet.
Orthogonal Arrays and Covering Arrays
These are the maths behind how pairwise sets are built. You’ll see both terms in tool documentation, and the difference affects which tool you pick.
Orthogonal Array | Covering Array | |
|---|---|---|
How it covers pairs | Every pair appears the same number of times | Every pair appears at least once |
Size | Usually bigger | Usually smaller |
When it’s useful | When you need every pair tested equally often | Most software testing, where a smaller set matters more than perfect balance |
The nine-test checkout example above happens to be an orthogonal array, because every pair appears exactly once. For most software testing, covering arrays are the better choice, because a smaller set is worth more than perfect balance.
People often use the two terms as if they’re the same, but it matters when choosing a tool. Some produce orthogonal arrays and some produce covering arrays, and while the results look similar, they differ in size and properties.
Handling Impossible Combinations
When pairwise testing goes wrong in practice, impossible combinations are usually the reason. A pairwise set covers every pair on paper, but in real life plenty of pairs can’t happen together.
For example:
A guest checkout can’t use invoice billing
An iOS device can’t run an Android build
A Trust account can’t use a compliance regime meant for individual investors
If you don’t tell your tool about these, it’ll give you tests that can’t exist. Those tests fail in the least useful way: you can’t set them up, or the system shows a validation error instead of testing what you wanted. You end up spending time investigating failures that were never bugs, then either deleting the bad rows by hand or generating the set again with the rules in place.
It’s much better to add the rules up front. There are three types, and between them they cover almost everything:
Rule Type | What It Means | Example |
|---|---|---|
Exclusion | Two values can’t appear together | Guest checkout and invoice billing |
Inclusion | Two values must appear together in the set | A specific browser and device pair you always want tested |
Conditional | One value forces another | JPY as the base currency forces Asia institutional compliance |
Every modern tool handles all three. Your job is to make sure the rules are complete. Miss one and you get impossible tests. Be too cautious and you get a smaller set that quietly skips real combinations. The tool does the maths, and you bring the knowledge of how the system actually works.
When Not to Use Pairwise Testing
Knowing when not to use pairwise testing is as important as knowing when to use it.
Situation | Why Pairwise Doesn’t Fit | Use This Instead |
|---|---|---|
The settings don’t really affect each other | Pairing them adds nothing | Boundary value analysis or equivalence partitioning on each setting |
Bugs only appear when many settings combine | Pairwise misses these by design, as in complex rules engines or safety-critical logic | Higher n-way testing, or decision tables |
The inputs are steps in a sequence | The bugs are about order, not combinations | |
The values are continuous, like 0 to 1,000 | Pairwise needs a fixed list of values | Boundary value analysis, after splitting the range into representative values |
Your bug history points to specific combinations | A new pairwise set won’t target a pattern it doesn’t know about | Test those combinations directly |
Going Beyond Pairs: N-Way Testing
Pairwise covers pairs, but the same approach works for bigger combinations too. Each step up covers more, and costs more.
Level | What It Covers | When to Use It |
|---|---|---|
2-way (pairwise) | Every combination of any two settings | The starting point for most software |
3-way | Every combination of any three settings | When bugs involving three settings are a real risk |
K-way | Every combination of any k settings | When you need a specific level of coverage |
N-way | Every combination of all N settings | This is the same as testing every combination |
The NIST research tells you when it’s worth going higher. For everyday business software, 2-way catches so much that 3-way only adds a little, so using it everywhere is usually wasted effort. For safety-critical and rules-heavy systems, 2-way misses more, and 3-way or higher is worth the cost.
The sensible approach is to start with 2-way and run it. If bugs get through, check whether they involve more settings, and only increase coverage for the specific settings that need it. That way, you never pay for 4-way coverage across a whole system that didn’t need it. NIST’s ACTS and Microsoft’s PICT both support n-way testing, and handle rules the same way at every level.
How to Perform Pairwise Testing Step by Step
Theory is fine, but at some point someone has to actually do this, and the steps are the same whether the output feeds a manual run or an automated suite. Here is the path from a blank page to a set you can run.

List the Input Parameters
Write down everything the feature takes, pulling from requirements, a chat with the developers, and a bit of hands-on poking to catch the parameters nobody documented, then rank them by which ones are most likely to interact.
Pin Down the Values for Each
List the discrete values that represent the states worth caring about, leaning on equivalence classes and boundary values to keep it tight, and chop any continuous parameter into representative values first.
Write the Constraints
Get the exclusion, inclusion, and conditional rules down before you generate, not after, so the set that comes out is actually runnable.
Generate the Set
Feed the parameters, values, and constraints into a generator and let it produce the minimal set that covers every pair, because doing this by hand past three or four parameters is a good way to make mistakes.
Turn the Output into Test Cases
Make each row a test case with clear expected results, or point a single data-driven test at the rows and run it once per combination.
Run it and Read the Results
Execute, keep the parameter values attached to each result, and when something fails work out whether it is a real interaction bug or a broken test, then watch which values keep showing up in failures because that points at the root cause faster than staring at logs.
Pairwise Testing Tools
Tool | Who It’s From | Notes |
|---|---|---|
PICT | Microsoft | Free command-line tool. Supports rules, n-way coverage and weighting |
ACTS | NIST | Free tool from the team behind the original research. Supports higher-order coverage and rules |
allpairspy | Open source (Python) | A Python library for generating pairwise sets inside your own scripts and tests |
AllPairs | Satisfice (James Bach) | A simple, long-standing free tool, good for small models |
Pick a tool based on how complex your rules are and how well it fits into your workflow. If you’re generating sets regularly, choose one you can run from your pipeline, so you can regenerate whenever the settings change.
Pairwise Testing and AI-Written Code
AI coding tools are changing enterprise development, and that makes pairwise testing more useful, not less.
AI Can Add More Settings
An AI assistant will add an option, a flag, a feature toggle, a regional variant or a permission level, often without the design discussion that used to keep the number of settings down.
So AI-written apps can end up with more settings to test. The more settings you have, the more pairwise testing helps, because the total number of combinations explodes while the pairwise set only grows a little.
AI May Get Specific Combinations Wrong
AI models have seen each setting on its own many times, but specific pairings far less often. So bugs in AI-written code can cluster in the combinations the model saw least.
Put those together, and combinatorial testing becomes one of the most useful things a QA team can do when AI is writing a lot of the code.
How Pairwise Testing Works with Other Techniques
Pairwise testing is one tool among many, not a replacement for the others.
Technique | How It Works with Pairwise Testing |
|---|---|
Picks the edge values for each setting, and pairwise combines them | |
Finds the groups of values, so pairwise uses meaningful values rather than random ones | |
Spells out the business rules, while pairwise covers the combinations those rules run across | |
Pairwise covers the settings, and state transition testing covers the sequence of actions | |
Pairwise sets a minimum level of coverage, and exploratory testing finds the unusual cases no tool would generate |
If you only use pairwise testing, you’ll miss edge cases, boundary bugs and bugs that need many settings to trigger.
If you skip pairwise, you’ll miss the combination bugs it’s built to catch. A good test design uses both.
Related reads: white box testing and gray box testing cover other ways to design tests when you know something about how the system works inside.
How Virtuoso QA Helps with Pairwise Testing
Most pairwise testing efforts fail in the same place. Someone generates a good set, the product grows and the settings change, and the set slowly goes out of date, because regenerating it and updating the tests by hand always loses out to other work.
Generating the set is the easy part. Keeping it current as the system changes is the hard part.
That’s where Virtuoso QA helps:
Each row becomes a run of one test: You write the journey once in plain English, like “sign in as {Role}, open a {AccountType} account in {Currency} and check the {Compliance} disclosures show”, then feed in the pairwise rows as a data table. When you regenerate the set, you replace the table, not the tests.
Settings drafted from your requirements: Touchstone reads your specs and policy documents and drafts requirements and tests, each citing its source. That helps you spot settings and rules that are already written down, like which compliance regimes apply to which account types. Your team still approves every requirement.
Every browser engine in the set: the same journey can run across 2,000+ browser and OS combinations, so the Blink, WebKit and Gecko rows in your set actually run on the right browsers.
Tests that survive UI changes: when a screen changes, Virtuoso QA suggests a fix for your team to approve, so the journey keeps working for every row.
Clear failure details: when a row fails, you see the values it used, the failing step, screenshots and logs, which makes it much quicker to tell a real combination bug from a broken setup.
To keep your pairwise sets running on every release, not just once, take a look at Virtuoso QA’s regression testing.
Pairwise Testing Checklist
The most important point is the last one: your settings keep changing, so your pairwise set has to change with them. That’s the difference between teams that get years of value from pairwise testing and teams that generate one set and forget about it.
I’ve chosen the settings and values on purpose, and split any continuous ranges first
I’ve written down the exclusion, inclusion and conditional rules
I’ve picked a tool that handles my rules and fits my workflow
I’ve checked the output for impossible combinations the rules missed
I’ve added boundary value tests for each setting, decision table tests for key rules, and exploratory testing for the unusual cases
I’ve added higher-order coverage only where bug history shows it’s needed
I’ve linked the tests back to the requirements they check
I run the set in CI/CD, and regenerate it when the settings change rather than patching the old one
Related Reads
Pairwise Testing FAQs
How Many Test Cases Does Pairwise Testing Produce
What Is an Orthogonal Array in Pairwise Testing
How Do You Perform Pairwise Testing Manually
What Is N-Way Combinatorial Testing
How Does AI-Assisted Coding Affect Pairwise Testing
How Does Virtuoso QA Support Pairwise Testing












