Validation, Verification and Testing: Question 3
Syllabus 7.6
A lift (elevator) in a 25-storey office tower accepts a floor request typed on its control panel. The lift only serves whole-number floors from −2 (the lowest basement level) up to 25 (the top floor). Any request outside this range is rejected. Floors 26 to 29 are mechanical plant levels and can never be requested.
A range check is used to validate the floor request against −2 to 25 inclusive.
(a) Give an example of normal test data for the floor-request field, and explain why it is normal. [2]
(b) Give an example of abnormal test data for the floor-request field, and explain why it is abnormal. [2]
(c) Give a pair of boundary test data for the upper limit of the floor-request field. One value that must be accepted, and the very next whole number, which must be rejected, and explain what this pair is testing. [2]
Show worked solution Hide worked solution
Worked solution
Part (a): Normal test data
Normal data is a typical, comfortably valid value. One that a user might realistically enter and that the range check should accept without any fuss. A floor like 12 sits well inside −2 to 25, with plenty of room on both sides, so it is a good example of normal data.
Values right at the edges of the range (such as 25 or −2) are not good choices here, because they are extreme values, not typical ones. [2 marks]: [1] for a valid in-range value, [1] for a reason that correctly identifies it as a typical, non-edge value.
Part (b): Abnormal test data
Abnormal data is data that is invalid and that the range check should reject. A floor request of 40 is a clear example: 40 is nowhere near −2 to 25, so it must be rejected. A non-numeric entry (such as a letter typed by mistake) would also work, since it fails a type check as well as a range check.
It’s important that this value isn’t chosen from the basement levels: −1 and −2 are valid floors, not abnormal ones, even though they’re negative. [2 marks]: [1] for a value that is genuinely outside the accepted range (or of the wrong type), [1] for a reason that correctly explains why it must be rejected.
Part (c): Boundary test data
Boundary data is used to test exactly where the system switches from accepting to rejecting. For the upper limit of this range, that means giving two values together: the highest floor that must still be accepted (25), and the very next whole number, which must be rejected (26).
Testing this pair checks that the range check hasn’t been written with an off-by-one mistake, for example, that the system doesn’t accidentally accept 26 as well, or reject 25 by mistake. A single value on its own (just 26, or just 25) cannot show that the line has been drawn in the right place. Only the pair can do that. [2 marks]: [1] for the correct pair (25 and 26), [1] for a reason that explains the pair is testing the exact accept/reject boundary.
Final answers
- (a) Normal: 12 (or any comfortably mid-range value). Clearly valid, should be accepted.
- (b) Abnormal: 40 (or a non-numeric entry). Clearly invalid, should be rejected.
- (c) Boundary: 25 (accepted) and 26 (rejected), tests the exact upper accept/reject line.