Homeschool Guide: These lesson plans are a guide for parents. Content may contain errors — always cross-reference with official exam board specifications.
robust & secure programming
FoundationHigherAll Boards
4 detailed 50-minute lessons with teaching scripts, worked examples, parent guides, and assessment criteria.
Lesson Overview
Total Lessons: 4 Tier: Foundation and Higher Duration: 50 minutes per lesson (200 minutes total) Exam Boards: AQA, Edexcel, OCR, Eduqas, CCEA
Learning Objectives
Explain the key ideas of robust & secure programming
Apply robust & secure programming to exam-style questions
Key vocab to pre-teach: Validation, Validation vs Verification, Authentication
Basic skills: reading the summary notes and answering the practice questions there
Materials & Equipment
Exercise book, coloured pens
Ruler
Printed revision notes (link below)
Internet for videos (see Resources)
Lesson 1: Introduction: robust & secure programming
Duration: 50 minutes
Starter Activity (5 minutes)
Quick Recall
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.
Main Content (35 minutes)
Parent/Teacher Guide: Before lesson: Read the script below. Pre-teach key vocab: Validation, Validation vs Verification, Authentication. If stuck: Re-read the revision notes (link above), then break the content into smaller steps. Extension: See the Stretch & Challenge ideas in Lesson 4.
Teaching Script (35 mins): Mins 0-5 - Hook: "Today: robust & secure programming. By the end you will be able to answer exam questions on it unaided. It connects to the rest of Computer Science because the ideas here recur across the spec." Mins 5-20 - Direct Instruction: Work through the core ideas below one at a time; after each, ask your student to explain it back in their own words. Mins 20-30 - Guided Practice: Model the worked example together, then let your student attempt the first practice question with guidance. Mins 30-35 - Independent Practice: 2-3 practice questions from Lesson 3 below, with immediate feedback.
First Look
Start with the revision notes summary, then attempt: Name three types of validation check and give an example of each.
Plenary (5 minutes)
Check Out
Your student states one thing they learned and one question they still have about robust & secure programming.
Lesson 2: Core Concepts: robust & secure programming
Duration: 50 minutes
Starter Activity (5 minutes)
Review Previous Lesson
Quick recap: write 3 key points from Lesson 1 on robust & secure programming. Check them against the notes below.
Main Content (35 minutes)
Validation: is the process of checking that input data is reasonable, sensible, and within acceptable limits before it is processed. Validation does NOT check if data is accurate - only that it is acceptable.
Validation vs Verification: Validation checks if data is reasonable. Verification checks if data is correct (e.g. double-entry where you type the data twice to confirm it). They are different processes!
Authentication: is the process of verifying a user's identity. The most common method is a username and password system. Authentication ensures that only authorised users can access a system.
Testing: is the process of running a program with various inputs to check it works correctly. Good testing uses a range of test data to find errors.
Exam Tip: Boundary data tests the exact limits. For a range of 1-100, boundary data is 1, 100, 0, and 101. The boundary values that are just outside the valid range are especially important.
Syntax errors: are mistakes in the grammar/rules of the programming language. The program cannot run at all. Logic errors are mistakes in the program's logic - the program runs but produces incorrect results.
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)
Practice (10 minutes)
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 @.
Plenary (5 minutes)
Explain Back
Your student teaches the key points back to you without looking. Fill any gaps immediately.
Lesson 3: Application: robust & secure programming
Duration: 50 minutes
Starter Activity (5 minutes)
Quick Recall
Recall the key terms: Validation, Validation vs Verification, Authentication. Define each in one sentence.
Main Content (35 minutes)
Parent/Teacher Guide: Let your student attempt each question alone first, then compare with the model answer. Award method marks for correct working even if the final answer is wrong.
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.
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.
Plenary (5 minutes)
Error Review
Review any questions answered incorrectly. Identify whether the error was knowledge, method, or reading the question.
Lesson 4: Exam Practice: robust & secure programming
Duration: 50 minutes
Starter Activity (5 minutes)
Command Words
Review what these command words require: state (one point), describe (say what happens), explain (say why), compare (both sides), evaluate (judgement).
Main Content (35 minutes)
Extended Answer
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.
Exam Tips: Know all six validation types: range, length, type, presence, format, lookup | Remember: validation checks if data is reasonable, verification checks if it is correct | For test data, always provide normal, boundary, AND erroneous examples | Boundary data includes values just inside AND just outside the valid range | Syntax errors prevent running; logic errors allow running but produce wrong output | When debugging, use trace tables and output statements to track variable values
Common Errors: ✗ Confusing validation and verification ✓ Validation checks if data is reasonable/acceptable (e.g. range checks); verification checks if data is correct by confirming it (e.g. double entry of passwords). ✗ Thinking validation guarantees data is correct ✓ Validation only checks that data meets rules (format, range, type); it cannot check if the data is factually correct. A valid age of 150 passes a type check but is wrong. ✗ Forgetting to validate BOTH input range and type ✓ Robust programs should check that input is the correct data type AND within an acceptable range. Type checking alone does not prevent unreasonable values. ✗ Believing authentication and authorisation are the same ✓ Authen
Stretch & Challenge (Grade 8-9):
Synoptic links: explain how robust & secure programming connects to another Computer Science topic you have studied
Real-world: research one real-world use or example of robust & secure programming
Critical: "What are the limitations of the models used in robust & secure programming?"
Plenary (5 minutes)
Assessment Criteria
Got it: Confident explanation + correct worked examples
Getting there: Main points OK, needs support with detail
Not yet: Confused on key concepts - re-run Lesson 2
Homework & Consolidation
Consolidation: Re-answer any Lesson 3 practice questions answered incorrectly (20 mins)
Retrieval: Write flashcards for the key terms: Validation, Validation vs Verification, Authentication (10 mins)
Exam practice: One past-paper question on robust & secure programming from the board websites (15 mins)
Extension: Explain robust & secure programming to someone else in your own words (10 mins)