Year 2 (ages 6–7, Grade 1 in the US) · Computing · Programming a floor robot · Lesson 3
Debugging programs
Finding and fixing bugs in floor-robot programs by running, watching, changing one step and testing again.
Exam boards: this lesson matches the AQA and Pearson Edexcel GCSE computing courses. Check which course your school follows.

13-minute video lesson
Teaching, worked examples and 20 practice questions solved step by step.
Watch free for a monthWhat your child will learn
- Know what a bug is
- Find the wrong step
- Fix a program
- Test again
The method
- Run it and watch.
- Find the first wrong step.
- Fix just that step.
- Test it again.
Key words: bug, debug, test, program, predict, robot.
Worked examples
Worked examples from the lesson, with every step.
Question 1
Goal: A1 to A4. Program: forward 2. Fix it.
- Step 1: one too few? count
Answer: forward 3
Question 2
Goal: A1 to D1. Program: turn right, forward 2. Fix it.
- Step 1: count squares
Answer: turn right, forward 3
Question 3
Goal: B1 to B5. Program: forward 5. Fix it.
- Step 1: count squares
Answer: forward 4