← All articles
QA · 12 min read

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.

PartitionExample valueExpected result
Below range12Error: too young
Valid range35Accepted
Above range80Error: 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.

invalidvalidinvalid17186566Two-value boundary testing for an age field that accepts 18–65
Values on both sides of each boundary catch the most common off-by-one bugs.

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.

Boundaries are not only numbers: string length (0, 1, max, max+1 characters), dates (Feb 28/29, end of year, time zones), file sizes, list sizes, prices around a discount threshold.

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.

RuleOrder ≥ $50Premium memberExpress deliveryShipping cost
R1YesYesYes$0
R2YesYesNo$0
R3YesNoYes$9
R4YesNoNo$0
R5NoYesYes$5
R6NoYesNo$0
R7NoNoYes$15
R8NoNoNo$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 \ EventPayShipDeliverCancel
NewPaid✗✗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.

ParameterValues
BrowserChrome, Safari, Firefox
OSWindows, macOS, Android, iOS
LanguageEN, UK, DE
User typeGuest, 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

  1. Read the requirement and list inputs, conditions and states.
  2. Apply equivalence classes and boundaries to every input.
  3. Use a decision table where rules combine.
  4. Draw states and transitions for anything with a life cycle.
  5. Reduce configuration combinations with pairwise.
  6. Finish with an exploratory session based on risk.
A good test suite is not the biggest one. It is the smallest one that would fail if something important broke.