Skip to content
Computing · Year 3

Active learning ideas

Finding and Fixing Bugs (Debugging)

Active debugging builds both technical skill and a growth mindset. Students learn that errors are normal and fixable through careful observation and incremental testing. Hands-on activities like Pair Debug Challenge and Bug Hunt Stations make problem-solving visible, so pupils see debugging as a puzzle to solve, not a failure to avoid.

National Curriculum Attainment TargetsKS2: Computing - ProgrammingKS2: Computing - Debugging
20–45 minPairs → Whole Class4 activities

Activity 01

Mystery Object30 min · Pairs

Pair Debug Challenge: Sprite Maze

Provide buggy code for a sprite to navigate a maze. Pairs predict what will happen, run the code, note the exact failure point, and fix one block at a time. They swap with another pair to test fixes and explain changes.

Justify why 'failing' is a vital part of the programming process.

Facilitation TipDuring Pair Debug Challenge, circulate and ask each pair to explain one bug they found and how they fixed it before moving to the next maze.

What to look forProvide students with a simple sprite program containing one obvious bug (e.g., a sprite moving left instead of right). Ask them to run the code, identify the incorrect block, and explain what change they would make to fix it.

UnderstandAnalyzeEvaluateSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 02

Mystery Object45 min · Small Groups

Bug Hunt Stations: Code Cards

Set up stations with printed code snippets on cards showing common errors like wrong sequences or loops. Small groups test each on devices, circle the bug, and rewrite correctly. Rotate stations and share one fix per group.

Analyze strategies to isolate a single block of code causing a bug.

Facilitation TipAt Bug Hunt Stations, provide colored stickers so students can mark code blocks they tested and mark the ones still in question.

What to look forPose the question: 'Imagine your sprite is stuck in a loop, repeating the same action forever. What are three steps you could take to figure out which part of your code is causing the problem?' Facilitate a class discussion, encouraging students to share their strategies.

UnderstandAnalyzeEvaluateSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 03

Mystery Object20 min · Whole Class

Whole Class Debug Demo: Live Prediction

Project a buggy sprite program. Class predicts behaviour, you run it to reveal the bug, then vote on fixes. Implement student ideas live, discuss why each works or fails, and log strategies on a shared board.

Evaluate different approaches to staying calm when code does not work as expected.

Facilitation TipIn Whole Class Debug Demo, pause after each prediction and ask two students to share their expected outcome before running the code to surface misconceptions early.

What to look forGive each student a card with the statement: 'When my code doesn't work, I feel...'. Ask them to complete the sentence and then write one strategy they can use to help them stay calm and keep trying to fix the bug.

UnderstandAnalyzeEvaluateSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 04

Mystery Object25 min · Individual

Individual Test Log: Personal Program

Students create a simple sprite dance, introduce a deliberate bug, then log tests: prediction, outcome, change made. They repeat until fixed, reflecting on patterns in their errors.

Justify why 'failing' is a vital part of the programming process.

Facilitation TipIn Individual Test Log, model how to write a concise prediction line like ‘Sprite will move 10 steps right’ before testing, so students see the value of clear expectations.

What to look forProvide students with a simple sprite program containing one obvious bug (e.g., a sprite moving left instead of right). Ask them to run the code, identify the incorrect block, and explain what change they would make to fix it.

UnderstandAnalyzeEvaluateSelf-ManagementSocial Awareness
Generate Complete Lesson

A few notes on teaching this unit

Teach debugging as a routine, not a reaction. Model your own thinking aloud when bugs appear, showing how you predict, test, and adjust. Avoid fixing student code for them; instead, ask guiding questions like ‘What did you expect to happen?’ and ‘Where could the first mistake be?’ Research shows that students who verbalize their process before running code catch more errors and build stronger debugging habits.

By the end of these activities, students will confidently test code step by step, predict outcomes, and isolate bugs with calm persistence. They will move from random guesses to systematic fixes, using tools like prediction logs and code cards to guide their work.


Watch Out for These Misconceptions

  • During Pair Debug Challenge, watch for students who erase entire code or restart without testing each block first.

    Pause the activity and remind pairs to use the step-by-step run feature to test one block at a time, marking each as working or not before making any changes.

  • During Bug Hunt Stations, watch for students who change code randomly until something works.

    Ask students to write a prediction for each card before testing, then circle the exact block that caused the mismatch between prediction and outcome.

  • During Whole Class Debug Demo, watch for students who blame the computer or the software for the bug.

    Point to the code on the board and ask the class to read it aloud together, emphasizing that the computer did exactly what the instructions said, so the error must be in the human-written code.


Methods used in this brief