Free GCSE Computer Science lessons for clear revision.

Free Lessons -> GCSE / Key Stage 4 -> Computer Science

GCSE Computer Science · Data checks

Validation and verification

Check whether input is sensible and whether copied data matches the original source.

Programming45-60 minutesSelf-contained lesson

Lesson overview

Check whether input is sensible and whether copied data matches the original source.

Focus: Validation and verification.

What you will learn

  • Define validation as checking whether data is reasonable or allowed.
  • Define verification as checking whether data was entered or copied accurately.
  • Choose suitable validation checks for a scenario.
  • Explain why valid data can still be incorrect.

Before you start

  • Input, processing and output.
  • Boolean conditions.
  • Subroutines and functions.

Input-checking examples

Use the age, postcode, password and email examples below to choose sensible validation and verification methods.

Validation and verification infographic

Photorealistic GCSE Computer Science infographic showing validation checks on entered data and verification checks comparing data against the original source.
Use this visual to separate checking whether data is sensible from checking whether it was copied accurately.Download visual

Explanation

Validation checks whether data is sensible for the program. A range check can reject an age of -5, and a presence check can reject an empty surname field.

Verification checks whether data has been copied or entered accurately. Double entry for an email address is a common example.

Validation does not prove data is true. The age 15 may pass a range check but could still be the wrong age for that person.

Worked examples

Choosing a check

A form asks for the number of tickets, from 1 to 6.

The program should reject 0, 8 and text such as 'three'.

The user may also be asked to confirm their email address.

Answer: Use a range check and type check for tickets, and double-entry verification for the email address.

Quick checks

1. What does validation mainly check?

  1. a. Whether hardware is fast
  2. b. Whether data is sensible or allowed
  3. c. Whether a file is encrypted
Reveal answer

Answer: b. Correct. Validation checks whether data meets rules.

Not quite. Focus on rules applied to input data.

2. Why can valid data still be wrong?

  1. a. It is always encrypted
  2. b. It cannot be stored
  3. c. It may pass rules but not match the real value
Reveal answer

Answer: c. Correct. Validation checks rules, not truth.

Not quite. A value can be sensible but still inaccurate.

Practice

1. Name a validation check for a required surname field.

Reveal answer

Answer: Presence check.

Marking: Credit checking that the field is not blank.

2. Name a validation check for an exam mark from 0 to 80.

Reveal answer

Answer: Range check.

Marking: Credit lower and upper limits.

3. A user enters their email twice and the system compares both entries. Is this validation or verification?

Reveal answer

Answer: Verification.

Marking: Credit checking copied or entered data against another version.

4. Why is a type check useful for age?

Reveal answer

Answer: It can reject non-numeric input.

Marking: Credit ensuring the value has the expected data type.

Exam practice ladder

  • Fluency: recall the key term and use it accurately.
  • Application: apply the idea to the scenario rather than giving a generic definition.
  • Algorithmic reasoning: show the steps, condition or variable change clearly.
  • Evaluation: explain why one method, structure or control is suitable.

Answers and marking guidance

Exact answers and marking guidance are hidden under each question. For this lesson, earn marks by naming the correct Computer Science idea, applying it to the scenario and showing the logic or value change clearly.

Common mistakes

  • Saying validation proves the data is correct.
  • Confusing range checks with type checks.
  • Using verification when the scenario needs a rule-based input check.
  • Not applying the check to the context in the question.

Extension

Write pseudocode for a loop that keeps asking for a password until it has at least eight characters.

Next lesson

Next, continue with Errors, Testing and Debugging.

Exam-board guidance

Aplailasain is an independent learning resource and is not endorsed by any exam board.

AQA GCSE Computer Science

AQA GCSE Computer Science: this skill supports problem solving, clear algorithms and accurate programming explanations.

OCR GCSE Computer Science

OCR GCSE Computer Science: expect precise algorithm reasoning, trace work and careful use of programming vocabulary.

Pearson Edexcel GCSE Computer Science

Pearson Edexcel GCSE Computer Science: practise explaining the method as well as giving the final answer or code.

Eduqas GCSE Computer Science

Eduqas GCSE Computer Science: secure the transferable idea first, then check how your class applies it in tasks.

WJEC Wales

WJEC Wales: use accurate terminology and show enough working for the examiner to follow your logic.

CCEA

CCEA: connect the idea to your class route and use the same algorithm, programming or systems vocabulary your teacher uses.