Validation, Verification and Testing: Question 9
Syllabus 7.6
A website's registration form validates the Password field using a length check: a password must contain from 8 to 16 characters inclusive to be accepted.
(a) Give an example of normal test data for the Password field, and explain why it is normal. [2]
(b) Give TWO examples of extreme test data for the Password field. One for each edge of the accepted length, and explain why each is extreme. [2]
(c) Give an example of abnormal test data for the Password field, and explain why it is abnormal. [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 length check should accept without any fuss. Counting the characters in
"SunflowerBed1" gives 13 (Sunflower = 9 letters, Bed = 3 letters, 1 = 1 digit, so
9 + 3 + 1 = 13), which sits well inside 8 to 16, with room on both sides. [2 marks]: [1]
for a value with a character count genuinely inside 8 to 16, [1] for a reason that correctly
identifies it as a typical, non-edge value.
Part (b): Extreme test data
Extreme data is valid data that sits exactly at the very edge of the accepted range. Here, that means one example with exactly 8 characters and one with exactly 16, since a length check has two separate limits to test.
"Tulip123"has 8 characters (Tulip= 5 letters,123= 3 digits, so 5 + 3 = 8). The smallest length that must still be accepted."Chrysanthemum123"has 16 characters (Chrysanthemum= 13 letters,123= 3 digits, so 13 + 3 = 16). The largest length that must still be accepted.
Both are valid, accepted values, but each sits precisely on one edge of the accepted length, which is what makes them extreme rather than merely normal. [2 marks]: [1] for a value with exactly 8 characters, [1] for a value with exactly 16 characters, both correctly explained as sitting on an accepted edge.
Part (c): Abnormal test data
Abnormal data is data that is invalid and that the length check should reject. Counting
the characters in "Rose12" gives 6 (Rose = 4 letters, 12 = 2 digits, so 4 + 2 = 6), which is
fewer than the minimum of 8 characters required, so the length check should reject it. [2
marks]: [1] for a value with a character count genuinely outside 8 to 16, [1] for a
reason that correctly explains why it must be rejected.
Final answers
- (a) Normal: SunflowerBed1 (13 characters). Comfortably mid-range, should be accepted.
- (b) Extreme: Tulip123 (8 characters) and Chrysanthemum123 (16 characters), the two accepted edges of the length check.
- (c) Abnormal: Rose12 (6 characters). Below the minimum of 8, should be rejected.