Hero background

Debugging Algorithms

Technology • 60 • 14 students • Created with AI following Aligned with New Zealand Curriculum

Download now

Free PDF · we'll email you a copy

Technology
60
14 students
29 July 2026

Teaching Instructions

This is lesson 4 of 4 in the unit "Exploring Computational Thinking". Lesson Title: Debugging and Problem Solving - Fix the Broken Algorithm Lesson Description: WALT: Identify and fix errors in algorithms through systematic debugging processes. Students will receive intentionally flawed algorithms from previous lessons (robot navigation, paper airplanes, or recipes) and work in small groups to identify problems, test solutions, and create improved versions. They will learn debugging strategies like checking each step individually, testing with real materials, and asking 'what if' questions. The lesson culminates in students presenting their debugging process and improved algorithms to the class. Success Criteria: Identify at least 2-3 errors in a given algorithm; explain why each error causes problems; create and test an improved version; share debugging strategies used. Differentiation: Provide algorithms with varying complexity levels; use color-coding to highlight different types of errors (missing steps, unclear instructions, wrong order). Extension: Advanced learners create their own flawed algorithms for classmates to debug, or develop a 'debugging checklist' for the class to use. Dyslexia-Friendly: Use visual error-spotting techniques with highlighting and symbols; allow verbal explanations of debugging process rather than written reports.

Overview

WALT: Identify and fix errors in algorithms through systematic debugging processes. Class: Year 3 and Year 4 Duration: 60 minutes Class Size: 14 students Unit: Exploring Computational Thinking (Lesson 4 of 4)

This lesson deepens students’ understanding of algorithms and computational thinking by focusing on debugging—finding and fixing errors in algorithms. Using familiar contexts from earlier lessons, such as robot navigation, paper airplane instructions, or cooking recipes, students work collaboratively to identify errors, test solutions, and refine their algorithms. The lesson fosters reflective thinking and iterative problem solving, embodying key competencies of the New Zealand Curriculum Refresh.


Curriculum Links

Technology Learning Area – Nature of Technology:

  • "Technological practice": Develops students’ ability to follow and modify algorithms.
  • "Technological outcomes": Students develop knowledge about computational thinking and problem-solving.

Key Competencies:

  • Thinking: Students actively solve problems, use creative thinking to debug.
  • Relating to Others: Collaborative debugging encourages dialogue and sharing ideas.
  • Managing Self: Persistence and reflection in improving algorithms.

Achievement Objectives Reference (New Zealand Curriculum Refresh):

  • Develop and follow simple algorithms, including testing, debugging, and refining these (Years 3–4).
  • Investigate and use computational thinking processes such as decomposition, pattern recognition, abstraction, and debugging.

Success Criteria

  • Identify at least 2–3 errors in a provided algorithm.
  • Explain why each error causes problems.
  • Create and test an improved algorithm version.
  • Articulate the debugging strategies employed during problem-solving.

Differentiation

  • Provide algorithm sheets with varying error complexity to match student readiness.
  • Use colour-coding on the algorithms to highlight types of errors: missing steps, unclear instructions, wrong step order.
  • Support verbal or pictorial explanations for students who find writing challenging (dyslexia-friendly).
  • Encourage more advanced learners to create their own flawed algorithms for peers to debug or develop a class ‘debugging checklist’.

Resources

  • Slides: One slide deck to guide through the lesson, showing examples, instructions, debugging strategies, and reflection prompts.
  • Worksheet: One worksheet containing flawed algorithms for small groups to debug, space for notes, and extension tasks.
  • Real materials (robot models, paper airplanes, recipe cards) to test algorithms physically.

Lesson Structure

Introduction (10 minutes)

  • Hook: Show a ‘broken’ robot navigation algorithm that leads to funny or unexpected outcomes. Prompt students to guess what went wrong.
  • Open with the introduction slides featuring the learning intention and success criteria.
  • Activate prior knowledge by briefly revisiting algorithms explored in previous lessons (robot paths, paper airplane folding, simple recipes).
  • Discuss what debugging means in computing and everyday life. Highlight that all good problem solvers find and fix errors to improve outcomes.

Exploration & Group Activity (25 minutes)

  • Organise students into small groups of 3 or 4.
  • Distribute the debugging worksheet with flawed algorithms of varying challenge (color-coded).
  • Each group will:
  1. Read and ‘act out’ or physically test their assigned flawed algorithm step-by-step, using materials if applicable.
  2. Use systematic debugging strategies taught:
  • Checking each step individually.
  • Testing real materials aligned with the algorithm.
  • Asking 'what if?' questions to explore consequences of changes.
  1. Identify at least 2-3 errors and discuss why these cause problems.
  2. Rewrite an improved, corrected algorithm that fixes these errors.
  3. Test the new algorithm and note improvements.

Sharing & Reflection (20 minutes)

  • Groups present their debugging process and improved algorithms to the class, explaining:
  • The errors found and why they mattered.
  • How they fixed the algorithm.
  • The debugging techniques used.
  • Teachers facilitate discussion highlighting common error types and debugging approaches.
  • Encourage students to share which strategies were most helpful, reinforcing metacognition.
  • Introduce the extension challenge: advanced learners create their own flawed algorithm for others to debug or help develop a class debugging checklist, promoting leadership and deeper thinking.

Plenary (5 minutes)

  • Recap success criteria and reflect on how debugging links to other learning and everyday life problem solving.
  • Collect the worksheets for assessment or follow-up.
  • Set a simple ‘debug at home’ challenge: find a daily instruction or recipe with errors and think about how to fix it.

Teaching Notes

  • Use clear, accessible language and visuals to support students with dyslexia or language barriers.
  • Emphasise that mistakes are positive and essential parts of learning and creating.
  • Use gestures, highlighting, and symbols on worksheets to support visual learners.
  • Monitor group progress and scaffold with prompting questions like "What happens if we skip this step?" or "Is this instruction clear?"
  • Encourage peer support within groups for collaborative learning.

Create Your Own AI Lesson Plan

Join thousands of teachers using Kuraplan AI to create personalized lesson plans that align with Aligned with New Zealand Curriculum in minutes, not hours.

AI-powered lesson creation
Curriculum-aligned content
Ready in minutes

Created with Kuraplan AI

Generated using gpt-4.1-mini-2025-04-14

🌟 Trusted by 1000+ Schools

Join educators across New Zealand