Algorithm Design and Problem Solving · 4 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 6% of your exam marks.
Decomposition, abstraction and structure charts appear as design-focused questions.
Validation is an automated check carried out by the program that an input is plausible and obeys the rules of the field it belongs to, applied the moment the data is entered.
Validation cannot guarantee that an input is correct (no program can tell whether a typed name is really the user's name). It can only guarantee that the input is plausible. A well-validated form accepts everything that is plausible and rejects everything that is obviously wrong.
The syllabus names six validation checks you should know.
Tests that a number falls within a specified range.
Tests that a string has the right number of characters.
Tests that the input is of the expected data type (integer, real, string, boolean, etc.).
Tests that a value has actually been entered (the field is not blank).
Tests that the input matches a specific pattern.
An extra digit appended to a numerical code (e.g. ISBN, barcode) that is calculated from the other digits and used to verify that the code was entered correctly.
Check digits were covered in detail in topic 5 (Error Detection); the same idea is reused as a validation method on input forms.
A single field may need several validation checks at once. A password field might use a length check (at least 8 characters), a presence check (not blank), and a format check (must contain a letter and a digit). Each check rules out one kind of invalid input.
Validation checks
Naming the validation check for a described rule comes up regularly, so you need to know the exact names — range, format, length, type, presence check, and check digit — and use the precise term: "limit"/"boundary check" are not accepted, and double-entry/visual checks are verification, not validation.