S3 Term 2 | ICT: Debugging – Tutor Lesson Plan | 45-minute flow, teaching script, common errors, practice with answers
- 2026-11-30
Lesson prep guide · S3 Term 2 ICT
Students edit at random when a program fails, until the working parts break too. Debugging has an order: reproduce, locate, then fix and retest, with three kinds of test data.
01 Prior knowledge check (first 3 minutes)
If any item below fails, fix it first, or this lesson stalls:
| Skill | Quick check | Pass standard |
|---|---|---|
| Error messages | First thing to do when a program errors | Read the message and find the line |
| Averages | The mean of 12, 18, 25, 30 and 15 | 20, from 100 over 5 |
| Boundaries | The largest index of a length-5 array | 4 |
02 Lesson flow (45 minutes)
| Time | Stage | Tutor does | Student does |
|---|---|---|---|
| 0–5 min | Opening: a faulty program | Show a mean calculation returning the wrong answer | Say where it goes wrong |
| 5–14 min | Three error types | Syntax, logic and runtime, with examples | Classify three examples |
| 14–23 min | Three steps | Model reproduce, locate, fix and retest | Walk through once |
| 23–32 min | Trace | Record variables step by step to find the first wrong one | Trace one themselves |
| 32–40 min | Three test types | Normal, boundary and invalid, noting the boundary most often missed | Design three tests |
| 40–45 min | Exit check | Collect three answers and sort type, step and test errors | Work without notes |
03 Teaching script (read it aloud)
Act one: three error types, three responses
Students restate: syntax is caught by the machine, logic by tests, runtime by input.
Act two: reproduce, locate, then fix and retest
Students restate: reproduce, locate, fix and retest, one change at a time.
Act three: three kinds of test data
Students restate: normal, boundary and invalid, with boundary the easiest to forget.
04 Question types and steps
| Type | Example | Steps | Answer |
|---|---|---|---|
| Classification | A missing closing bracket | The machine cannot read it | Syntax error |
| Classification | Averaging by summing | Readable but wrong | Logic error |
| Step | Smallest input that fails | Step one | Reproduce |
| Testing | Empty array or the last index | Extreme cases | Boundary test |
Debugging is not random editing. First reproduce with the smallest input that fails every time; second locate with a trace table or line-by-line output to find the first wrong step; third fix and retest with the same input plus a boundary case. Test data comes in three kinds, normal, boundary such as 0 or the last index, and invalid such as a negative number or an empty string. Syntax errors are caught by the machine, logic errors only by tests.
05 Three independent practice questions
| Question | Answer | What to observe |
|---|---|---|
| A program is missing a closing bracket: which error type? | Syntax, the machine cannot read it | Logic confuses the categories |
| A program runs but averages by summing: which type? | Logic, caught only by tests | Syntax would have been reported |
| A length-5 array: which index most needs testing? | Index 4, and the out-of-range index 5 | Index 0 alone misses the boundary |
06 Common errors and correction lines
| Error | Student usually writes | Tutor says |
|---|---|---|
| Running means correct | “It did not crash, so it must be right” | “Logic errors never crash, so compare output against a known answer.” |
| Many edits at once | “I changed three places, one will work” | “Change one at a time, or you cannot tell which mattered.” |
| Normal tests only | “One set of marks is enough” | “Add boundary and invalid tests; boundaries break first.” |
| Ignoring messages | “I see red text and rewrite” | “The message gives the line and the cause, so read before editing.” |
07 Homework (paper and question numbers)
- S3 ICT, algorithms and flowcharts, set 1, question 10, analysing a wrong answer Question 10 asks where a classmate reasoning fails, the locate step
- S3 ICT, algorithms and flowcharts, set 2, question 10, the while-loop misconception Question 10 corrects the claim that while always runs once, a logic error
- S3 ICT, algorithms and flowcharts, set 1, question 4, the trace Question 4 traces variables step by step, the locating tool of act two
08 Exit check (last 3 minutes)
| Question | Answer | Verdict |
|---|---|---|
| Name the three error types | Syntax, logic and runtime | One type is incomplete; reteach act one |
| Name the three debugging steps | Reproduce, locate, fix and retest | “Edit until it works” is not a method; reteach act two |
| Name the three test data types | Normal, boundary and invalid | Normal alone misses the boundaries; reteach act three |
09 Tutor FAQ
Which year is this page for?
S3 Term 2, the programming and debugging unit in local secondary ICT; later years add unit tests and version control.
Is 45 minutes enough for error types and testing?
Yes. Nine minutes on the types, nine on the steps, eight on tracing and nine on test data, with the rest for practice and the exit check.
Is there a matching worksheet?
Yes. The homework links to questions 4 and 10 of set 1 and question 10 of set 2 of the S3 ICT algorithms paper, all with answers.
Find a tutor freeTutor sign-up →
©2026 TutorZone · www.tutorzone.com.hk · Terms of use · All rights reserved. Original TutorZone material for personal study and teaching only; not for resale or republication.



