Year 3 (ages 7–8, Grade 2 in the US) · Computing · Sequences in Scratch · Lesson 3
Debugging
Finding and fixing bugs in robot routes and block programs by testing, spotting, fixing one thing and retesting.
Exam boards: this lesson matches the AQA and Pearson Edexcel GCSE computing courses. Check which course your school follows.

14-minute video lesson
Teaching, worked examples and 20 practice questions solved step by step.
Watch free for a monthWhat your child will learn
- Define bug and debugging
- Spot errors in sequences
- Fix bugs
- Retest programs
The method
- Test.
- Spot.
- Fix.
- Retest.
Key words: bug, debug, test, sequence, error, fix.
Worked examples
Worked examples from the lesson, with every step.
Question 1
Robot A1 (up) should reach A4. Code: forward 4. Bug?
- Step 1: one too many
Answer: should be forward 3
Question 2
Robot A1 (up) should reach D1. Code: turn left, forward 3. Bug?
- Step 1: wrong turn
Answer: should be turn right
Question 3
Robot A1 (up) should reach B2. Code: forward 1, forward 1. Bug?
- Step 1: missing turn
Answer: missing a turn: forward 1, turn right, forward 1