Validation, Verification and Testing: Question 2
Syllabus 7.5
GreenCommute is a cycle-hire app used at a university campus. Riders unlock a bike by entering a HireCode shown on a label on the bike's frame.
(a) The app refuses to let a rider continue until at least one character has been typed into the HireCode field. Identify the validation check being used here, and state what the app should do if the field is left empty. [2]
(b) Every valid HireCode is exactly 8 characters long. Identify the validation check that tests this rule, and explain what would happen if a rider typed the 3-character code "GC4". [2]
(c) New riders fill in a paper sign-up form. A staff member then types each rider's chosen HelmetSize ("S", "M" or "L") into the app while looking at the paper form. Identify a suitable verification check for this step, and describe how it works. [2]
Show worked solution Hide worked solution
Worked solution
Part (a): Presence check
The rule described. The app “refuses to let a rider continue until at least one character has been typed into the HireCode field”, is testing only whether the field is empty, not its size or content. This is a presence check.
If HireCode is left empty, the app should reject the attempt and display an error message telling the rider to enter a HireCode before they can continue. [2 marks]: [1] for naming the presence check, [1] for correctly describing the rejection/error-message behaviour.
Part (b): Length check
Here the rule is specifically about a character count: “every valid HireCode is exactly 8 characters long.” Counting characters and comparing the count to a required value is exactly what a length check does.
"GC4" contains only 3 characters, so the length check would find that the count (3) does not
match the required 8, and the app would reject the code and ask the rider to re-enter it.
[2 marks]: [1] for naming the length check, [1] for correctly explaining that “GC4” is
rejected because it does not contain 8 characters.
Part (c): Visual check
This part is different: a staff member is copying data from one place (the paper form) to another (the app), rather than the software automatically applying a rule. That makes it a verification check, not a validation check.
Since only one person is typing the data in once, and comparing it against the original source by eye, the suitable check is a visual check: the staff member reads the HelmetSize on the paper form, reads what has just appeared on the app’s screen, and compares the two, correcting the entry if they don’t match. (A double entry check would instead require the same value to be typed in a second time and compared automatically, that isn’t what’s happening here.) [2 marks]: [1] for naming the visual check, [1] for correctly describing the comparison against the paper source.
Final answers
- (a) Presence check, reject the empty entry and prompt for a HireCode.
- (b) Length check. “GC4” is rejected as it is not 8 characters long.
- (c) Visual check, compare the on-screen HelmetSize against the paper form by eye.