One short program on the board, and a promise: it contains exactly one bug. Your job is to find it by reading β€” no running, no random guessing. Programs fail in a handful of predictable ways, and learning to spot them cold is what turns a panicked debugging session into the calm routine of Debugging Step by Step.

How to run it

  1. Read the whole program before judging any line β€” bugs love the line you skimmed.
  2. Decide: will it crash, or run and quietly do the wrong thing?
  3. Name the line, name the fault, predict the exact error message.
  4. Only then run it β€” and read the real message, bottom line first.

One variation

Show only a traceback β€” no program at all β€” and work backwards: what kind of line must have produced this message?

Error messages are not insults

They are the most honest writing you will read all day β€” what went wrong, and where. Read them calmly, bottom line first, every time.

Curriculum connection

C2.6

interpret program errors and implement strategies to resolve them

Link to original