LightMySky

Finding a Bug by Changing One Thing at a Time

Changing several things at once hides which change mattered. Working one change at a time, with a prediction written down before each run, finds the fault and says what caused it.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • State what the program should do and what it does instead, before touching any code
  • Make one change, predict the result, run it, and record whether the prediction held
  • Narrow a fault to a single block or line and say which change proved it

1 · Read

Before you touch any code, even when each run surprises you, write two sentences. Say what the program should do, and say what it does instead. That gap is your target. If the bug keeps a schedule, say what is special about those runs. A shape that breaks only on Fridays points at Friday data or settings.

Try it together

Your program should draw a triangle but draws a square. You change one block, predict the drawing, run it, and write down whether your prediction held. Then you try the next single change.

Changing several things at once hides which change mattered. One change per run keeps the cause clear. A short list of tried changes stops you from repeating work.

When the drawing turns right, point at the change that did it. Give the single block or line and the run number behind it. That is your fix, not a lucky rewrite.

State the gap, change one thing with a prediction, record each run, and name the change that proved the fault.

2 · Watch

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Where this leads

Jobs that lean on this skill. Follow one to see everything it is built on.

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Finding a Bug by Changing One Thing at a Time · Computing, ages 12 to 13 · LightMySky