Test design techniques in practice: find more bugs with fewer tests
Equivalence classes, boundary values, decision tables, state transitions and pairwise testing, each applied to a real example you can reuse tomorrow.
You can never test everything. A simple form with five fields and ten possible values each already has 100,000 combinations. Test design is the discipline of choosing the small set of tests that has the best chance of finding defects. Below are the five techniques we use daily, each with a worked example.
1. Equivalence partitioning
Split all possible inputs into groups (partitions) that the system should treat the same way. If one value from a group works, the others very likely will too, so one test per group is enough.
Example: an online insurance form accepts drivers aged 18 to 65.
| Partition | Example value | Expected result |
|---|---|---|
| Below range | 12 | Error: too young |
| Valid range | 35 | Accepted |
| Above range | 80 | Error: outside allowed age |
| Not a number | “abc” | Validation error |
| Empty | (blank) | “Field is required” |
Five tests instead of hundreds, and each one checks a different behaviour.
2. Boundary value analysis
Developers make mistakes at the edges: < instead of <=, off-by-one in loops, wrong rounding. Boundary value analysis tests values on and right next to each boundary.
For the age field we test 17, 18, 65 and 66. A three-value approach adds 19 and 64. Combined with equivalence partitioning, that is around eight tests for the field, and they catch the vast majority of real defects in it.
3. Decision tables
When behaviour depends on a combination of conditions, a decision table makes sure no combination is forgotten. Example: shipping cost in an online store.
| Rule | Order ≥ $50 | Premium member | Express delivery | Shipping cost |
|---|---|---|---|---|
| R1 | Yes | Yes | Yes | $0 |
| R2 | Yes | Yes | No | $0 |
| R3 | Yes | No | Yes | $9 |
| R4 | Yes | No | No | $0 |
| R5 | No | Yes | Yes | $5 |
| R6 | No | Yes | No | $0 |
| R7 | No | No | Yes | $15 |
| R8 | No | No | No | $6 |
Each row is a test case. Building the table often reveals gaps in the requirements themselves: in our experience, the question “what should R5 cost?” is frequently one the business hasn't answered yet. Finding that before coding is the cheapest bug fix there is.
4. State transition testing
Many objects live through states: an order, a subscription, a bug ticket, a game character. State transition testing checks that valid transitions work and invalid ones are blocked.
| From \ Event | Pay | Ship | Deliver | Cancel |
|---|---|---|---|---|
| New | Paid | ✗ | ✗ | Cancelled |
| Paid | ✗ | Shipped | ✗ | Cancelled + refund |
| Shipped | ✗ | ✗ | Delivered | ✗ (return flow) |
| Delivered | ✗ | ✗ | ✗ | ✗ (return flow) |
The ✗ cells are where bugs hide: can an order be shipped before it is paid? Can a delivered order be cancelled through an old browser tab? We write at least one test for every valid transition and one for each risky invalid one.
5. Pairwise (all-pairs) testing
For configuration testing the number of combinations explodes. Most defects are caused by a single parameter or an interaction of two, so testing every pair of values covers most of the risk with a fraction of the tests.
| Parameter | Values |
|---|---|
| Browser | Chrome, Safari, Firefox |
| OS | Windows, macOS, Android, iOS |
| Language | EN, UK, DE |
| User type | Guest, Registered |
All combinations: 3 × 4 × 3 × 2 = 72. A pairwise set covering every pair of values needs only about 12 runs. Tools such as PICT or online pairwise generators build the set for you; impossible pairs (Safari on Android) are excluded with constraints.
6. Experience-based techniques
Formal techniques are the backbone, but experienced testers add error guessing (typical failure points: empty lists, double clicks, slow networks, special characters like O'Brien or emoji) and exploratory testing in time-boxed sessions with a clear charter, for example: “Explore checkout with unstable network for 45 minutes, looking for duplicate orders”.
Putting it together
- Read the requirement and list inputs, conditions and states.
- Apply equivalence classes and boundaries to every input.
- Use a decision table where rules combine.
- Draw states and transitions for anything with a life cycle.
- Reduce configuration combinations with pairwise.
- Finish with an exploratory session based on risk.