Orthogonal Array Testing
What is Orthogonal Array Testing?
Orthogonal array testing (OAT) is a black box technique used to efficiently test systems with multiple input parameters, each having multiple possible values, without testing every possible combination.
How It Works
Instead of testing all combinations (which can be an enormous number), an orthogonal array is used to select a much smaller, statistically balanced subset of combinations that still covers all pairwise interactions between parameters.
When to Use It
- When the number of input parameters and their possible values makes exhaustive combination testing impractical.
- When testing configuration settings, compatibility matrices, or systems with many independent variables.
Benefit
Orthogonal array testing significantly reduces the number of test cases required while still providing strong confidence that interactions between parameters are adequately tested.
A Worked Example With the L9 Array
Imagine a checkout page that must be tested across four factors, each with three options:
- Browser: Chrome, Firefox, Safari
- Operating system: Windows, macOS, Linux
- Language: English, Hindi, French
- Payment: Card, UPI, Net banking
Testing every combination means 3 × 3 × 3 × 3 = 81 tests. The standard L9 orthogonal array handles up to four factors with three levels each in just 9 rows, and every pair of values from any two factors appears exactly once. Mapping level 1, 2 and 3 to the options above gives:
| Test | Browser | OS | Language | Payment |
|---|---|---|---|---|
| 1 | Chrome | Windows | English | Card |
| 2 | Chrome | macOS | Hindi | UPI |
| 3 | Chrome | Linux | French | Net banking |
| 4 | Firefox | Windows | Hindi | Net banking |
| 5 | Firefox | macOS | French | Card |
| 6 | Firefox | Linux | English | UPI |
| 7 | Safari | Windows | French | UPI |
| 8 | Safari | macOS | English | Net banking |
| 9 | Safari | Linux | Hindi | Card |
Pick any two columns and you will find all nine pairs, for instance Firefox with each operating system once, and UPI with each language once.
Applying the Technique Step by Step
- List the factors (parameters) and the levels (values) for each.
- Choose an array with at least as many columns as factors and the right number of levels. If factors have different numbers of levels, use a mixed-level array or a pairwise tool.
- Map each factor to a column and each level to a value.
- Check every row for impossible combinations and adjust.
- Write the expected result for each row and run the tests.
Handling Invalid Rows and Using Tools
The table above has a problem: rows 7 and 9 put Safari on Windows and Linux, which are not realistic test environments. Pure orthogonal arrays do not understand such constraints, so testers usually generate pairwise sets with a tool instead. Microsoft's free command-line tool PICT is a common choice. You describe the factors and constraints in a text file:
Browser: Chrome, Firefox, Safari
OS: Windows, macOS, Linux
Language: English, Hindi, French
Payment: Card, UPI, NetBanking
IF [Browser] = "Safari" THEN [OS] = "macOS";
Running pict model.txt prints a compact set of rows that covers every allowed pair and never breaks the rule. Python users can get similar results from the allpairspy package.
Limits to Keep in Mind
- Pairwise coverage finds bugs caused by two interacting factors. A bug that needs three specific values together may be missed, so add targeted tests for known high-risk combinations.
- Choosing the wrong levels defeats the method. If "Card" really covers debit and credit cards that behave differently, split them.
- The array reduces test count, not test quality. Each row still needs a clear expected outcome.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.