A program accepts a whole number from 1 to 100 inclusive.
Give an example of each type of test data for this program.
(a) Normal [1] (b) Boundary [1] (c) Invalid [1] (d) Erroneous [1]
- (a) Any whole number from 2 to 99, e.g. 50 (1 and 100 are boundary data)(1)
- (b) 1 or 100; do not accept 0 or 101 (J277 defines boundary data as the correct type at the edge of what is valid, so 0 and 101 are invalid data)(1)
- (c) A whole number outside the range, e.g. 0, 101, 150 or −5; do not accept a decimal or text (wrong data type = erroneous)(1)
- (d) Data of the wrong type, e.g. "ten" / a letter / 4.5 (not a whole number)(1)
- Answer: (a) 50; (b) 100; (c) 150; (d) "ten"
- Examiner tip: Invalid data is the right type but outside the range. Erroneous data is the wrong type altogether. Don't swap them.