Test case design

Test case design is the activity of deriving test cases from a specification, a model or the code by applying a test design technique. The technique decides which inputs, conditions and sequences are worth a test, so the resulting set is small, covers what it claims to cover and can be explained to someone else.

The longer version

A tester asked to check a car park's pricing by intuition might try a stay of thirty minutes, one of two hours and one of a full day. All three could pass while the charge is wrong for a stay of exactly one hour, for a car that leaves after midnight or for a ticket paid twice. Test case design replaces the guess with a method. The tester reads the test basis, meaning the requirement, user story or code being tested, works out where behaviour could differ, and derives cases that each cover a named part of it.

The techniques are usually sorted into three families, the classification the ISTQB Foundation syllabus uses: black-box, white-box and experience-based. Black-box techniques work from the specified behaviour. Equivalence partitioning and boundary value analysis deal with ranges of values, decision table testing with rules that combine conditions, state transition testing with behaviour that depends on history, use case testing with flows, and pairwise testing with many independent parameters. White-box techniques work from the structure of the code. Experience-based techniques, such as error guessing and exploratory testing, work from what the tester knows. Each has its own entry in this glossary.

A technique buys three things that intuition does not. The first is a stopping rule: once every partition, boundary or table column has a case, the set is complete by that technique's measure, and the tester can say what it leaves out. The second is economy, since a technique picks one case to stand for many and avoids ten cases that prove the same thing. The third is a set of cases that can be reviewed, because a colleague can check the partitions or the table without running anything. The syllabus makes a similar point when it says test techniques help to develop a relatively small, but sufficient, set of test cases in a systematic way.

Common questions

What is test case design?

Test case design is the work of deciding which test cases to write and deriving them from a requirement, a model or the code with a defined technique. Its output is a set of cases, each fixing one check with its preconditions, inputs, any steps and expected result, that covers the chosen part of the product.

What are the main test case design techniques?

The main groups are black-box techniques, which derive cases from specified behaviour, white-box techniques, which derive them from code structure, and experience-based techniques, which draw on the tester's knowledge. Equivalence partitioning, boundary value analysis, decision table testing and state transition testing are the black-box techniques the ISTQB Foundation syllabus covers.

Why use a test design technique instead of intuition?

A technique gives a reason for every case and a measure of when to stop, so the set can be reviewed and its gaps named. Cases chosen by intuition depend on who chose them, and nothing in them shows what was left untested.

When does test case design happen?

Test case design starts as soon as there is something to design from, such as a draft requirement or user story, and it can finish before the code is ready. Designing early also exposes unclear requirements, because a tester who cannot derive an expected result has found a gap in the specification.

What is the difference between test analysis and test case design?

Test analysis decides what to test by studying the test basis and listing test conditions. Test case design decides how to test each condition by deriving concrete cases with preconditions, inputs and expected results. The ISTQB Foundation syllabus sums up the pair as the questions what to test and how to test.

Bug reports that arrive ready to triage.

Collect replay, console, network and browser context with the Free plan.

<script src="…/widget.js" data-key="pb_pub_…">