robust & secure programming
4 detailed 50-minute lessons with teaching scripts, worked examples, parent guides, and assessment criteria.
4 detailed 50-minute lessons with teaching scripts, worked examples, parent guides, and assessment criteria.

Write down everything you already know about robust & secure programming. Then check against the key terms: Validation, Validation vs Verification, Authentication. Use a mini-whiteboard or paper.
Start with the revision notes summary, then attempt: Name three types of validation check and give an example of each.
Your student states one thing they learned and one question they still have about robust & secure programming.
Quick recap: write 3 key points from Lesson 1 on robust & secure programming. Check them against the notes below.
| Term | Meaning | Example |
|---|---|---|
| Range check | Checks that a value is within a specified range | Age must be between 0 and 120 |
| Length check | Checks that a string has an acceptable number of characters | Password must be at least 8 characters |
| Type check | Checks that the data is of the correct data type | Age must be an integer, not a string |
| Presence check | Checks that a field has not been left empty | Name field cannot be blank |
| Format check | Checks that data follows a specific pattern | Email must contain @, date must be DD/MM/YYYY |
| Lookup check | Checks that a value exists in a predefined list | Country must be in the list of valid countries |
| Normal data | Typical, valid data that the program should accept | 25, 50, 80 |
| Boundary data | Data at the edge of valid ranges - the minimum and maximum acceptable values | 1, 120 (just within range) |
Q: Name three types of validation check and give an example of each.
Answer: Range check: age must be 0-120. Length check: password must be at least 8 characters. Type check: quantity must be an integer. Presence check: name cannot be empty. Format check: email must contain @.
Your student teaches the key points back to you without looking. Fill any gaps immediately.
Recall the key terms: Validation, Validation vs Verification, Authentication. Define each in one sentence.
Q1: Name three types of validation check and give an example of each.
Answer: Range check: age must be 0-120. Length check: password must be at least 8 characters. Type check: quantity must be an integer. Presence check: name cannot be empty. Format check: email must contain @.
Q2: A program asks for a test score between 0 and 100. Give examples of normal, boundary, and erroneous test data.
Answer: Normal: 75 (typical valid score). Boundary: 0, 100 (just within range), -1, 101 (just outside range). Erroneous: -50, 150, "hello" (clearly invalid).
Q3: Explain the difference between a syntax error and a logic error.
Answer: A syntax error is a mistake in the grammar of the programming language that prevents the program from running (e.g. missing ENDIF). A logic error is a mistake in the program's logic where it runs but produces incorrect results (e.g. dividing by the wrong number).
Q4: Write pseudo-code that validates a username to be between 3 and 20 characters.
Answer: REPEAT INPUT "Enter username (3-20 chars): ", username IF LENGTH(username) < 3 OR LENGTH(username) > 20 THEN OUTPUT "Username must be between 3 and 20 characters" ENDIF UNTIL LENGTH(username) >= 3 AND LENGTH(username) <= 20
Q5: Describe two techniques for debugging a logic error.
Answer: 1) Use a trace table to step through the program line by line, recording variable values and comparing with expected values. 2) Add temporary OUTPUT statements at key points to display variable values and check if they match expectations.
Review any questions answered incorrectly. Identify whether the error was knowledge, method, or reading the question.
Review what these command words require: state (one point), describe (say what happens), explain (say why), compare (both sides), evaluate (judgement).
Extended question: Full-Mark Response A program asks a user to enter their age (1-120). Describe three different validation checks that should be applied, and explain the difference between validation and verification. [5 marks] <div class="
Three validation checks: 1. Type check — ensure the input is an integer, not text or a decimal. 2. Range check — ensure the value is between 1 and 120 (inclusive). 3. Presence check — ensure the user has actually entered a value and not left it blank. Validation checks that data is reasonable and meets predefined rules (e.g. format, range, type). Verification checks that data entered is what the user intended, typically by asking them to enter it twice or showing a confirmation screen. Validation cannot guarantee accuracy — a user could enter 25 when their real age is 17, which passes validation but is incorrect.
You are ready for robust & secure programming - GCSE Computer Science Lessons when you can:
Tick each item honestly — if any box is unticked, re-read the relevant section above.
How examiners mark robust & secure programming - GCSE Computer Science Lessons: Read the command word carefully — State = one word/phrase (1 mark), Describe = pattern or detail (2 marks), Explain = reason with "because" (2–3 marks), Compare = similarities AND differences, Evaluate = both sides + conclusion. Method marks are awarded for correct working even if the final answer is wrong. Always show your working — unexplained answers score zero for AO2.
Success on robust & secure programming - GCSE Computer Science Lessons questions: Underline the command word, count the marks (one mark per point expected), and answer in the format the command word demands.
This lesson is examined by: AQA 8525 | Edexcel 1CP2 | OCR J277 | Eduqas on-screen+theory. Tier and paper details vary - always check your board's current specification.
Follow-up revision: CS13-robust-secure-programming on GCSE Revise (notes, flashcards and auto-graded target tests for this exact topic).