---
title: "Finding a Bug by Changing One Thing at a Time"
description: "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."
canonical: https://lightmysky.com/learn/computing/finding-a-bug-by-changing-one-thing-at-a-time-mt_DMgajrUSy_
source: https://lightmysky.com/learn/computing/finding-a-bug-by-changing-one-thing-at-a-time-mt_DMgajrUSy_.md
retrieved: 2026-09-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# 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.

Subject: Computing · Area: Computing Fundamentals · Ages 12 to 13
Page: https://lightmysky.com/learn/computing/finding-a-bug-by-changing-one-thing-at-a-time-mt_DMgajrUSy_

## Ready when they can

- 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

## Lesson: Fix bugs one change at a time

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.

**Example.** 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.

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

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [Random Numbers and Programs That Differ Each Run](https://lightmysky.com/learn/computing/random-numbers-and-programs-that-differ-each-run-mt_t8GTOW3hyN)

## Opens up

- [Debugging as a Method: Reproduce, Isolate, Fix](https://lightmysky.com/learn/computing/debugging-as-a-method-reproduce-isolate-fix-mt_2JGE4ICRf6)
- [Reading a Program Someone Else Wrote](https://lightmysky.com/learn/computing/reading-a-program-someone-else-wrote-mt_VdxhuxjBSn)
