Knowledge Organiser: Input Validation
Part of Input Validation · GCSE GCSE Computer Science revision
This topic summary covers Knowledge Organiser: Input Validation within Input Validation for GCSE Computer Science. Revise Input Validation in Robust Programs for GCSE Computer Science with 15 exam-style questions and 8 flashcards. This topic appears regularly enough that it should still be part of a steady revision cycle. It is section 6 of 6 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.
Topic position
Section 6 of 6
Practice
15 questions
Recall
8 flashcards
Knowledge Organiser: Input Validation
Key Terms
- Validation: Checking that data is acceptable and sensible before processing
- Range check: Ensures a value is within a minimum and maximum (e.g. age 0–120)
- Type check: Ensures data is the correct data type (e.g. integer, not text)
- Length check: Ensures data has the required number of characters
- Presence check: Ensures a required field is not left empty
- Format check: Ensures data matches an expected pattern (e.g. postcode format)
- Check digit: A calculated digit appended to data to detect errors (e.g. barcode)
Must-Know Facts
- Validation ensures data is sensible — it does NOT guarantee data is correct or accurate
- A user can enter a valid but wrong value (e.g. wrong age that still passes a range check)
- Validation ≠ Verification: verification checks data is what the user intended (e.g. entering twice)
- Multiple validation types can be applied to a single field
- Validation prevents programs from crashing due to unexpected input
Key Concepts
- Memory aid: RPTFL-C — Range, Presence, Type, Format, Length, Check digit
- Range check:
if age >= 0 AND age <= 120 then accept endif - Presence check:
if email != "" then accept endif - Length check:
if password.length >= 8 then accept endif
Common Mistakes
- Saying validation guarantees data is correct: Validation only checks data is acceptable/sensible — a user can enter a valid but wrong value (e.g. wrong date of birth that passes a range check)
- Confusing validation with verification: Validation checks data meets rules; verification checks data matches what the user intended (e.g. typing a password twice to confirm)
- Applying the wrong validation type to a scenario: A postcode needs a format check (pattern); an age field needs a range check (min/max) — match the check to the data type
- Forgetting the presence check: Presence check is a separate type — leaving a required field empty should trigger it, not a range or type check
- Describing validation as "stopping hackers": Validation primarily prevents program crashes from unexpected input; sanitisation (not validation) specifically prevents injection attacks
Revise this topic interactively on PrepWise — self-test mode, tap-to-reveal definitions, and Common Mistakes from examiners.
Try the interactive Knowledge Organiser — free →Keep building this topic
Read this section alongside the surrounding pages in Input Validation. That gives you the full topic sequence instead of a single isolated revision point.
Practice Questions for Input Validation
A program asks the user to enter a score between 1 and 10. Which validation check should be used to ensure the number is within this range?
A registration form collects a username. The username must: not be blank, contain only letters and numbers, and be between 6 and 20 characters long. Identify three validation checks and explain what each one does for this input.
Quick Recall Flashcards
15 questions on Input Validation — practise free
Instant marking, adaptive difficulty, and 8 spaced repetition flashcards. Free until your GCSEs.
Try PrepWise Free