Paper 2 Section A: tracing and correcting code – OCR A Level Computer Science lesson (H446)
Students learn to dry run code in a trace table, find logic errors and correct them by line number.
Lesson 8 of 14 in unit 13.8 Synoptic Revision, taught in Year 13, Spring 2. It answers one big question: How do I find and fix errors the way examiners expect?
By the end, students can dry run code in a trace table, find logic errors and correct them by line number.
- What happens
- Bell Task (5 min), then a ten-question interleaved retrieval quiz without notes (8 min) – six questions on today's topics, four spaced from earlier blocks – self-marked in green pen, each wrong answer logged in the student's revision tracker. Topics revisited: 12.2 (iteration, selection, scope, IDE debugging tools), 12.4 recursion, 12.7 testing and software development, 12.8. Teacher models a dry run of a recursive function at the board, one row per change. Two reteach chunks (below). Exam practice: Trace (4–6 marks) a while loop, a do-until loop and a recursive function from Ravensgill Coastal Rescue's software, then Identify and Correct three logic errors, giving the line number and the corrected line. Targeting: students open their revision tracker (lesson 1) and do the practice set for their red topic first; students secure in both reteach points take the extension question. Exit: three questions on pre- and post-condition loops and globals.
- Main task
- Complete a trace table for Ravensgill Coastal Rescue's recursive tide-check function for the given input, then identify the two logic errors and correct each one by line number (8 marks).
Also sold in the Synoptic Revision unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
An independent resource written for OCR A Level Computer Science (H446). It is not endorsed by OCR or Cambridge University Press & Assessment. Programming project (NEA) lessons teach general skills on a made-up example project and give supervised time, within JCQ's rules on the help a centre may give.
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 A Level Computer Science
See allStudents learn to turn their mock and Progress Check results into a prioritised revision tracker with measurable weekly targets.
Students learn to link the fetch-decode-execute cycle, LMC, interrupts, scheduling and memory management in one connected explanation.
Students learn to convert and calculate with two's complement and floating point, apply masks and simplify Boolean expressions linked to hardware.
Written for the specifications named. Not endorsed by or affiliated with any exam board.