Test design
Techniques for choosing a small set of tests with the best chance of finding defects, from reviews to exploratory charters.
Test design answers one question: out of an infinite number of possible tests, which few are worth running? Good test design finds more defects with fewer tests and makes coverage visible instead of accidental.
Static techniques: before anything runs
| Technique | What it looks like | Finds |
|---|---|---|
| Informal review | A colleague reads a requirement or pull request | Obvious gaps, unclear wording |
| Walkthrough | The author guides the team through the material | Misunderstandings, missing scenarios |
| Technical review | Peers check against standards | Design flaws, risky decisions |
| Inspection | Formal process with roles and checklists | Defects in critical documents and code |
| Static analysis | Linters, type checkers, security scanners | Code smells, vulnerabilities, typos |
Black-box techniques
- Equivalence partitioning: split inputs into groups that behave the same and test one value from each
- Boundary value analysis: test values on and next to the edges of each group
- Decision tables: list every combination of conditions and the expected outcome
- State transition testing: check valid and invalid moves between states of an object
- Pairwise testing: cover every pair of parameter values instead of every full combination
- Use case testing: follow realistic end-to-end scenarios, including alternative and error paths
We walk through all of these with worked examples in Test design techniques in practice.
White-box techniques
White-box techniques measure how much of the code structure tests exercise. Statement coverage checks that every line ran at least once; branch coverage checks that every decision went both ways (if true and false). Coverage is a useful signal of untested code, but high coverage doesn't guarantee good tests: a test can run a line without checking its result.
function shippingCost(total, isPremium) {
if (total >= 50) return 0; // branch A: true / false
if (isPremium) return 0; // branch B: true / false
return 6;
}
// 100% branch coverage needs 3 tests:
// (60, false) -> 0 (20, true) -> 0 (20, false) -> 6
Experience-based techniques
- Error guessing: using knowledge of typical mistakes — empty values, special characters, double submissions, time zones
- Checklist-based testing: a short list of high-level conditions to verify, reused across releases
- Exploratory testing: time-boxed sessions with a charter, for example “Explore the profile page with very long names and non-Latin scripts for 30 minutes”, with notes on what was covered and found
Choosing techniques
| Situation | Start with |
|---|---|
| Form fields and numeric inputs | Equivalence classes + boundaries |
| Business rules with several conditions | Decision table |
| Orders, subscriptions, workflows | State transitions |
| Many configurations or settings | Pairwise |
| New feature, unclear requirements | Exploratory session + review |
| Critical algorithm | White-box with branch coverage |