0984

Problem Solving and Design

Algorithm Design and Problem Solving · 4 question types

Exam Frequency Analysis

Past paper frequency (2018 to 2024)

This topic accounts for approximately 6% of your exam marks.

stable
Low
Stable6%

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.

Login form rejecting an implausible email entry, showing a red error message asking the user to check the email and try again
Source: Validation in Computer Science by Save My Exams

The syllabus names six validation checks you should know.

Range check

Tests that a number falls within a specified range.

Length check

Tests that a string has the right number of characters.

Type check

Tests that the input is of the expected data type (integer, real, string, boolean, etc.).

Presence check

Tests that a value has actually been entered (the field is not blank).

Format check

Tests that the input matches a specific pattern.

Check digit

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.

Combining validation checks

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.

Exam tip

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.