Test Design Techniques and Practice
Test design is choosing what to check: which data to enter and which scenarios to run to find as many defects as possible in reasonable time. Testing everything is impossible: even an “Age” field has thousands of possible values. Test design techniques help you pick a small set of tests that covers the requirements and catches typical bugs.
What you gain: you do not miss important checks or waste time on duplicate ones, you can explain why you chose exactly these tests, and you answer test design questions in a job interview with confidence.
Equivalence partitioning
Input data is split into groups (classes) in which the system behaves the same way. You take one value from each class: if it works, the other values in the class most likely work too. Classes can be valid (acceptable data) or invalid (unacceptable data).
Example. A licence is issued to people aged 18 to 80 inclusive. Classes: 0–17 (declined), 18–80 (approved), 81 and over (declined), plus an empty field and a decimal number. Five tests are enough, for example 10, 40, 90, empty, and 17.5.
Practise it
- Boundary Values: Driving LicenceEquivalence partitioning and boundary value analysis on an age check.
- Boundary Values: UsernameEquivalence partitioning and boundary value analysis for a text field: length and allowed characters.
- Test Design: Pick the Test DataFive short cases: read the requirement and pick the test data set using equivalence partitioning or boundary value analysis.
Boundary value analysis
Bugs most often hide at the edges of ranges, for example when “<” and “≤” are mixed up in a condition. So you test the boundary value itself and the nearest value on the other side of the boundary. The technique complements equivalence partitioning: first find the classes, then test their boundaries.
Example. For the 18–80 range you test 17 and 18 at the lower boundary and 80 and 81 at the upper one. If the code says “age > 18” instead of “≥ 18”, the test with 18 catches it.
Practise it
- Boundary Values: Order Total DiscountEquivalence partitioning and boundary value analysis on a three-product cart with an order total discount.
- Boundary Values: Driving LicenceEquivalence partitioning and boundary value analysis on an age check.
- Test Design: Pick the Test DataFive short cases: read the requirement and pick the test data set using equivalence partitioning or boundary value analysis.
State transition testing
A technique for systems whose behaviour depends not only on the input but also on what happened before. A state is a situation the system is in, an event is something that happens, and a transition is a change of state in response to an event. The minimum is to visit every state; a stronger goal is to cover every transition. Invalid transitions are checked separately.
Example. After three wrong passwords the account is locked. The correct password lets you in before the lockout but not after it: the same action gives different results in different states.
Practise it
Error guessing
A technique based on the tester’s experience: you guess where the developer might have made a mistake and check exactly those places. A list of typical errors helps: empty values and strings of spaces, a wrong format, special values, data lost after saving. Error guessing is combined with formal techniques to catch what they miss.
Example. In a date of birth field, check 29 February in a leap year and in a common year, the 31st in a short month, and today’s date.