Specification-based
Derive cases from externally observable behavior. The internal code is not needed.
- Equivalence partitioning
- Boundary value analysis
- Decision tables
- State transitions
- Use-case testing
A practical map for turning a large input space, a specification, or a model into a small set of powerful test cases—without confusing a technique with a test level.
Test techniques give a systematic way to identify test conditions, test cases, and test data. They reduce arbitrary guessing and make the intended coverage visible.
Derive cases from externally observable behavior. The internal code is not needed.
Derive cases from statements, branches, conditions, paths, or data flow in the implementation.
Use tester skill, defect history, risk, and domain knowledge to anticipate failures.
Divide the input or output domain into partitions whose members are expected to be processed in the same way. Test at least one representative from every identified partition.
Read the functional specification and list valid and invalid ranges, sets, formats, and business categories.
Every value belongs to one partition for the rule being tested. Separate classes whenever the expected behavior changes.
Choose a typical member from each partition, then define the expected result from the test oracle.
Representatives might be 12, 40, and 72. One happy-path value alone misses both invalid classes.
Do not split merely because values look different. Split when the specification implies different processing or results. Include invalid partitions—they often expose weak validation.
BVA extends partitioning by selecting values at, immediately below, and immediately above each boundary. It is especially useful for ordered numeric and sequential domains.
| Rule | Boundary targets | Why each matters |
|---|---|---|
| 18 ≤ age ≤ 65 | 17, 18, 19 and 64, 65, 66 | Exercises each side of both lower and upper boundaries. |
| Password length 8–20 | 7, 8, 9 and 19, 20, 21 characters | Finds off-by-one and incorrect comparison operators. |
| Quantity 1–99 | 0, 1, 2 and 98, 99, 100 | Separates invalid, valid, and invalid partitions at their closest points. |
Exercise the boundary and its nearest neighbor in the adjacent partition. This is smaller but may provide less diagnostic detail.
Exercise the boundary and one value on either side. This directly checks below/on/above behavior.
If values have no meaningful order or adjacency—such as colors or account roles—equivalence partitioning is more natural than BVA.
A decision table connects conditions to actions. Each feasible rule column is a combination to test, making omissions and contradictory requirements easier to see.
| Conditions / actions | R1 | R2 | R3 | R4 |
|---|---|---|---|---|
| Member? | Y | Y | N | N |
| Order ≥ 200? | Y | N | Y | N |
| Apply discount | ✓ | — | — | — |
| Free shipping | ✓ | — | ✓ | — |
Behavior depends on combinations: pricing, permissions, eligibility, insurance, workflow routing, or validation rules.
A dash means “don’t care.” Merge columns only when the ignored condition cannot change the action.
n Boolean conditions can produce 2ⁿ combinations. Eliminate infeasible rules and prioritize by risk without hiding a required outcome.
Model states, events, transitions, and actions. A test checks not just the current input, but whether an event is valid from the current state and leads to the correct next state.
Locked + successful administrator reset → unlock account → Active.
Locked + ordinary password login → reject attempt → remain Locked.
Active → three failed logins → Locked → reset → Active. Sequence testing catches history-dependent defects.
Derive end-to-end scenarios from actors, preconditions, the main success path, alternate flows, exceptions, and postconditions.
Start with the normal actor goal and verify the promised postcondition.
Cover legitimate choices: another payment method, saved address, retry, cancel, or return.
Cover failures and recovery: timeout, invalid credentials, unavailable inventory, declined payment, or interrupted service.
Experience-based testing complements formal models. It is strongest when guided by risk and recorded so the learning can be reused.
Attack nulls, empty strings, duplicates, overflow, malformed formats, zero, negative numbers, lost connections, and repeated submissions based on defect history.
These activities happen together in a time-boxed session. A charter defines the mission; notes and debriefing preserve evidence and discoveries.
Apply a maintained list derived from standards, recurring defects, domain risks, and team experience. Checklists should evolve rather than become ceremonial.
No single technique proves absence of defects. Use the test objective, risk, test basis, lifecycle constraints, and available skills to select a complementary set.
| If the question emphasizes… | Think first… | Typical target |
|---|---|---|
| Ranges or categories | Equivalence partitioning | One representative per valid/invalid class |
| Minimum, maximum, limit | Boundary value analysis | Values around each edge |
| Combinations of rules | Decision table | Each feasible rule column |
| Status, mode, history | State transition | States, transitions, invalid events |
| Actor goal or workflow | Use-case testing | Main, alternate, exception flows |
| Known weak spots or little documentation | Experience-based | Risks, defect patterns, discoveries |