Topic Guide

Debugging

Debugging begins with a precise difference: what should have happened, and what happened instead?

Why this matters

Guessing becomes expensive as a project grows. Students reproduce the problem, inspect a relevant value, choose one possible cause, and run a test that can prove them wrong.

Beyond this topic

If a bicycle chain slips only in one gear, that detail matters. A useful game bug report works the same way: it records the exact state and actions that produce the fault.

Math and logic

Expected result

Write down what should happen before editing.

Observed result

Describe what happened, without adding a guessed cause.

Hypothesis

Name one possible explanation.

Controlled test

Inspect or change one thing that bears on that explanation.

Small examples

1

Show coordinates

Read x and y when movement goes wrong.

2

Display state

Check whether the game records PLAYING, WON, or LOST.

3

Test a smaller part

Run one sprite, sensor, or rule by itself.

4

Reproduce the bug

Find a sequence that makes the same problem happen again.

Program connections

Where this topic appears.

Active now

Scratch & Game Design

Students author games, animations, simulations, and strange interactive stories while learning how events, rules, and state fit together.

Active now

Robotics

Students write commands, wire simple circuits, read sensors, and trace physical cause and effect through the Sense–Decide–Act loop.

Coming later

Roblox Studio / Lua

A possible later step from visual programming into Lua, 3D objects, events, and larger game rules.

Coming later

AI & Smart Machines

A possible later program for testing patterns, predictions, prompts, mistakes, and the limits of AI tools.

Common mistakes

Editing several scripts

The bug disappears, but the useful evidence disappears with it.

Trying only the happy path

The centre of the stage works while the edge remains broken.

Blaming Scratch

A mistaken sign or state rule is left unexamined.

Covering the symptom

Extra blocks hide the fault without correcting the underlying value.

Put the idea to work

Read the Lesson
Scratch & Game Design Guided Project

Escape from the Giant Pigeon

Build a fast chase game with known positions, collision rules, win and loss states, and reliable restart behaviour.

  • Scratch
  • Coordinates
  • Movement
  • Collision
See how it works
Robotics Guided Project

Robot Maze Logic

Write a robot route, predict where it will end, and trace the first command that goes wrong.

  • Commands
  • Sequences
  • Movement
  • Direction
See how it works
Robotics Guided Project

micro:bit Reaction Timer

Build a reaction timer with a random delay, an early-press rule, and results in the correct units.

  • Input
  • Timing
  • Variables
  • Randomness
See how it works