Testing and errors – AQA GCSE Computer Science lesson (8525)
Pupils learn to explain why programs are tested, tell syntax errors from logic errors, and correct errors in algorithms and in programs written in the class's language.
Lesson 11 of 14 in unit 11.1 Cyber Security and Robust Programs, taught in Year 11, Autumn 1. It answers one big question: Why do we test programs, and what errors do we find?
By the end, pupils can explain why programs are tested, tell syntax errors from logic errors, and correct errors in algorithms and in programs written in the class's language.
- The Build (the main task)
- Explain the difference between a syntax error and a logic error. (2 marks) Identify the line of the delivery program that contains the logic error, and write the corrected line. (2 marks)
- Support version
- The program with line numbers and a hint for which block to check.
- Challenge
- Complete a test that would show the logic error in Kickstand's delivery program: give the test data, the expected result and the actual result. (3 marks) This program should input the pairs sold on each of the 7 days of a week and output the total. It has one syntax error and one logic error. Identify the line of each error and write each corrected line. (4 marks)
- Real-world link
- A bug in Kickstand's delivery charge.
- Key words
- Syntax error, Logic error and Correct, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “A logic error stops the program from running”; “Describing the error is enough to correct it”.
- AQA 8525 specification
- 3.2.11 (robust and secure programming: validation, authentication, testing, test data, errors).
Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.
Pupils can do it all on paper.
Also sold in the Cyber Security and Robust Programs unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
Choose your school's Paper 1 language when you buy: C#, Python or VB.NET. You get that language's files: every program, code example, worked answer and programming task is written in it, and lessons with no code are the same in all three. Algorithms are also shown in AQA pseudo-code, as in the exam.
An independent resource written for AQA GCSE Computer Science (8525). It is not endorsed by AQA.
What's included
- Slide deck (PowerPoint)
- Lesson plan (Word)
- Worksheet (Word)
- Support worksheet with scaffolds (Word)
- Single-teacher licence: use and adapt it with your own classes
- Your choice of Paper 1 language: C#, Python or VB.NET
More for GCSE Computer Science (AQA)
See allPupils learn to define cyber security, describe its purposes, and describe viruses, trojans and spyware and how to protect against them.
Pupils learn to explain what a subroutine is, tell procedures from functions, and write and call both in the class's language and AQA pseudo-code.
Pupils learn to describe blagging, phishing and shouldering and how to protect against social engineering.
Written for the specifications named. Not endorsed by or affiliated with any exam board.