Debugging and test plans – Year 8 Computing lesson
Pupils learn to write a test plan with expected results, carry it out systematically and use it to find and fix logic errors.
Lesson 5 of 6 in unit 8.1 Python: Iteration and Boolean Operators, taught in Year 8, Autumn 1. It answers one big question: How do we prove a program works?
By the end, pupils can write a test plan with expected results, carry it out systematically and use it to find and fix logic errors.
- The Build (the main task)
- Complete a test plan for the password checker (test data, reason and expected result), run each test, record the actual result and fix the two logic errors it finds.
- Support version
- Part-filled test plan: the test data and reasons are given; pupils work out each expected result, then run the tests.
- Challenge
- Add two more tests that would catch an error the plan misses, and explain what each one checks.
- Real-world link
- Before an app is released, software testers run a planned set of tests to find mistakes; today pupils test the password checker before the Year 7 users try it.
- Key words
- Test plan, Logic error and Systematic, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “If a program runs with no error message, it works”; “Testing with one or two normal passwords is enough”.
- National Curriculum
- NC3 (two or more languages, at least one textual; data structures; modular programs with procedures or functions); NC4 (boolean logic (AND, OR, NOT) in circuits and programming; binary numbers, addition and conversion).
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.
- Also sold in the Python
- Iteration and Boolean Operators 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)
- Debugging and test plans - Quiz Quiz Trade Cards
- Single-teacher licence: use and adapt it with your own classes
More for KS3 Computing
See allPupils learn to use input, variables and if/else, and cast input to an integer so a program can compare and calculate with numbers.
Free sample lessonPupils learn to use if, elif and else with AND, OR and NOT to combine tests so a program chooses one outcome from several.
Pupils learn to write a for loop with range() that repeats a fixed number of times, and increment a counter inside a loop.
Written for the specifications named. Not endorsed by or affiliated with any exam board.