Testing: purpose, types and errors – OCR GCSE Computer Science lesson (J277)
Pupils learn to explain the purpose of testing, describe iterative and final testing, and identify and fix syntax and logic errors in a program.
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 the purpose of testing, describe iterative and final testing, and identify and fix syntax and logic errors in a program.
- The Build (the main task)
- Identify the two syntax errors and the logic error in Kickstand's basket-total program, state the type of each, and write the corrected lines.
- Support version
- The program with the three faulty lines highlighted, and a table with columns: line, type of error, corrected line.
- Challenge
- Explain why a logic error can be more harmful to Kickstand than a syntax error.
- Real-world link
- Kickstand's basket total has been charging some customers the wrong amount.
- Key words
- Syntax error, Logic error and Purpose, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “If a program runs without an error message, it works”; “A logic error stops the program from running”.
- OCR J277 specification
- 2.3.2 (testing: the purpose of testing, iterative and final testing, syntax and logic errors, normal, boundary, invalid and erroneous test data, and refining algorithms).
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.
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
More for GCSE Computer Science (OCR)
See allPupils learn to describe how viruses, worms, trojans, spyware and ransomware work and the harm each can do to a business like Kickstand.
Free sample lessonPupils learn to write and call a procedure and a function in Python, and explain the difference between them and why subprograms are reused.
Pupils learn to describe phishing and other social engineering, spot the signs in a fake message, and explain how staff training reduces the risk.
Written for the specifications named. Not endorsed by or affiliated with any exam board.