▶ TrainingGet Pro
All tools & lessonsAll toolsAllGet the appApp
Learning departments Music, Math, Cookery, Programming and Art are open – explore →

Block coding lesson 4: Finding and fixing bugs

US version. US grades and US spelling. · UK version of this lesson

A bug is a mistake in a program. Debugging means finding it and fixing it. A complete 30-minute block coding lesson (Grades K–2), from Unit 2: Bugs and walls. Myrtle the Turtle runs right here in your browser – nothing to install.

Time
30 minutes + 10 min homework
Grade
Grades K–2 (ages 5–8)
You need
A computer or tablet, squared paper and a pencil
Graded
Instantly, with explanations

For parents: how to use this lesson

You don't need to know anything about coding. The lesson explains each step on screen, the way Mr Babbage, our Head of Computing, likes it: watch Myrtle first, then have a go. Programs are made from blocks – no typing – and every answer is graded straight away.

  1. Before the screen: Write a "buggy" route on paper for a grown-up and ask them to find your bug.
  2. Press Start the lesson below and watch the worked examples together. Press Run and say what each block does before Myrtle does it.
  3. Let your child do the practice on their own. When Myrtle goes the wrong way, that's a clue, not a failure – press Run again and watch which block it is on.
  4. Finish with the talk question: “How did you find the bug?”
  5. Later that day or the next day: the homework (10 minutes), then a practice test.

Watch out for

  • Starting the whole program again from nothing. Most bugs are one wrong block. Find where it first goes wrong.
  • Thinking a bug means you are bad at coding. Every programmer makes bugs. Finding them is part of the job.

Miss Lovelace's tip for home: ask your child to be Myrtle. Read out the blocks and let them walk it on the floor. If they can act it out, they understand it.

What your child will learn

Learning goal: find the block that makes a program go wrong.

Success looks like

  • I can find the block that makes a program go wrong.
  • I can fix a bug by changing one block.
  • I can test again after a fix.

Key words

bug · debug · test · fix

The big ideas (for the adult)

A bug is a mistake in a program. Debugging means finding it and fixing it.

Run the program and watch: the bug is usually at the first moment Myrtle does something we did not expect.

A worked example

move forward 2
turn left
move forward 4
turn right
move forward 1

Press Start the lesson to watch the turtle run it.

The lesson, step by step

30 minutes in 5 parts
PartTimeHow it is checked
Starter4 minGraded by Classfern
Teach7 minWatch, talk and try
Worked example and try it6 minGraded by Classfern
Practice9 minGraded by Classfern
Wrap up4 minGraded by Classfern + self-check

The lesson

It runs here on the page. No sign-up and no names – progress is kept only in this browser. Each visit picks a new mix of questions.

Homework

10 minutes: 4 questions – work out what Myrtle does, then build or fix a program – and a short reflection. New questions every time, all graded instantly. Away from the screen: write a "buggy" route on paper for a grown-up and ask them to find your bug.

Practice tests

All computer science practice tests · All 18 block coding lessons

Curriculum

CSTA K–12 Computer Science Standards (2017), grades K–2: 1A-AP-14 – Find and fix errors in algorithms or programs with sequences and simple loops; 1A-AP-15 – Use correct terms to describe steps and choices during iterative development.

The standard codes are CSTA's; the descriptions are our own words.

Our lessons, blocks and questions are our own. They are not written or endorsed by any government department, testing agency or exam board.