Test Design: Pick the Test Data
Five short cases: read the requirement and pick the test data set using equivalence partitioning or boundary value analysis.
Requirement
Questions and explanations
Find an explanation for each question here. To test yourself, take the quiz above first.
Participant age
Users aged 18 to 60 inclusive can register. Age is entered as a whole number. Which set tests both boundaries and their neighbouring values?
A) 18, 25, 40, 60 B) 17, 18, 19, 59, 60, 61 C) 16, 20, 40, 58, 62
We test the lower boundary with 17, 18, 19 and the upper one with 59, 60, 61. Set A has no values outside the boundaries, and set C misses the boundary values themselves.
Number of tickets
One order can contain 1 to 8 tickets inclusive. The field accepts whole numbers only. Which set has exactly one representative of each class: below the allowed range, allowed, above the allowed range?
A) 1, 4, 8 B) 0, 9, 15 C) 0, 4, 10
0 is too few, 4 is allowed, 10 is too many. In set A all three values come from the same valid class; set B has no valid value, and 9 and 15 are from the same class.
Username length
A username must be 3 to 15 characters long inclusive. Which lengths should be tested at both boundaries and next to them?
A) 2, 3, 4, 14, 15, 16 B) 3, 6, 10, 15 C) 1, 5, 13, 17
We test the values right before, at, and right after each boundary: 2, 3, 4 and 14, 15, 16. Set B has no values outside the boundaries, and the values in set C are too far from them.
Quantity discount
The number of items is a positive whole number. 1 to 4 items: no discount. 5 to 9 items: 10% discount. 10 or more items: 15% discount. Which set has one representative of each of the three discount classes?
A) 1, 2, 4 B) 2, 7, 12 C) 5, 7, 10
2 gets no discount, 7 gets 10%, 12 gets 15%. In set A every value gets no discount; set C has no value without a discount, and 5 and 7 are from the same class.
Free delivery
Delivery is free for orders of 50 € or more. Below 50 €, delivery costs 5 €. The order total is precise to 0.01 €. Which set tests the free delivery boundary and the nearest values?
A) 40 €, 50 €, 60 € B) 49 €, 50 €, 51 € C) 49.99 €, 50 €, 50.01 €
The smallest step of the total is one cent, so the nearest values to the boundary are 49.99 € and 50.01 €. The values 49 € and 51 € skip, for example, 49.50 €, where a bug is also possible.
Quick reference
Equivalence partitioning
Input data is split into groups (classes) in which the system behaves the same way. One value per class is enough: if it works, the other values in the class most likely work too. Classes can be valid (acceptable data) or invalid (unacceptable data).
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.