Debugging as a Method: Reproduce, Isolate, Fix · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Cornering bugs step by step

Computing · Programming · ages 17-18
Name ______________________   Date ____________
  1. What counts as a reproduction?

    • Steps showing the fault every run
    • A guess about the cause
    • A finished fix
  2. What is your first move on a vague fault report?

    • Edit five lines at once
    • Build steps that reproduce it every time
    • Rewrite the whole file
  3. How do you halve the suspect region?

    • Read the whole file slowly
    • Switch off half and see if the fault stays
    • Delete the tests
  4. What is a debugging hypothesis?

    • Five edits applied together
    • A backup copy of the file
    • A cause claim plus one check refuting it
  5. Your hand trace and the machine disagree on a line. What does that mean?

    • The computer is always wrong
    • Tracing never helps
    • Your model breaks exactly there
  6. After forming a hypothesis, change one thing and rerun the reproduction.

    Circle one:   True   False

  7. A student changed five things and the fault vanished. What is the risk?

    • The code runs too fast now
    • Notes write themselves
    • Nobody knows which change mattered
  8. The fault is cornered to one line. What now?

    • Rewrite unrelated modules too
    • Ship without rerunning
    • Change one thing and rerun to verify
LightMySky · lightmysky.comW1-mt_2JGE4ICRf6-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Cornering bugs step by step W1-mt_2JGE4ICRf6-s1

  1. Steps showing the fault every run · Reproduction means reliable, not lucky.
  2. Build steps that reproduce it every time · A repeatable case grounds every later check.
  3. Switch off half and see if the fault stays · Halving rules out half the code per check.
  4. A cause claim plus one check refuting it · Even a failed check teaches where the bug is not.
  5. Your model breaks exactly there · The gap marks where your reading differs from the run.
  6. True · Single changes keep cause and effect readable.
  7. Nobody knows which change mattered · Without one change per check, the cause stays unknown.
  8. Change one thing and rerun to verify · Editing is allowed once the line is cornered and checked.
Worksheet · LightMySky