Skip to content

    Bug Garden

    Year 2 Debugging

    Track down bugs in longer robot programs by tracing each step.

    • Ages 6–8
    • 3 quests
    • Beginner → Getting stronger → Challenge

    Year 2 debugging uses longer programs on bigger grids, so children need to trace carefully, one step at a time, to find where the robot goes wrong.

    What your child will learn

    • Trace programs of four to six steps
    • Find the step where a program goes wrong
    • Name the arrow that would fix it

    Trace, don’t guess

    The best debugging strategy is to follow the program exactly, step by step, and compare where the robot is with where it should be. The first place they differ is where the bug is.

    Example questions

    Here are a few questions like the ones in the first quest. Can you solve them?

    1. 1. The robot should reach the star, but one step has a bug. Which step is wrong?

      • Step 1
      • Step 2
      • Step 3
      • Step 4
      Show answer

      Answer: Step 1. Step 1 should be ↑ instead of ↓. Fix that one arrow and the robot reaches the star!

    2. 2. The robot should reach the star, but one step has a bug. Which step is wrong?

      • Step 1
      • Step 2
      • Step 3
      Show answer

      Answer: Step 2. Step 2 should be ← instead of ↑. Fix that one arrow and the robot reaches the star!

    3. 3. The robot should reach the star, but one step has a bug. Which step is wrong?

      • Step 1
      • Step 2
      • Step 3
      Show answer

      Answer: Step 2. Step 2 should be → instead of ↓. Fix that one arrow and the robot reaches the star!

    4. 4. Match each problem to its bug.

      • the robot goes the wrong way
      • the program stops too early
      • things happen in a strange order
      • a step is missing
      • a wrong direction
      • steps are swapped
      Show answer

      Answer: the program stops too early → a step is missing · the robot goes the wrong way → a wrong direction · things happen in a strange order → steps are swapped. Spotting the kind of bug helps you fix it.

    Tips for grown-ups

    • Encourage finger-tracing on the screen for every step.
    • Praise careful checking more than speed.