Tutorpip← About this lessonOpen the sheet →Download PDF
Ages 8+ · Coding · Finding bugs
Why did it break?
What went wrong• pour before the cup is down• no pour step• pour typed five timesThe kind of bug• a mixed-up order• a missing step• a number that is off
Three days, three kinds of bug.
The big ideaA bug is a mistake in the steps: a mixed-up order, a gap or a number.

How it works

A bug is a mistake in the steps. A robot does exactly what the steps say, so the bug is never in the robot.

There are three kinds: the steps are in a mixed-up order, a step is missing, or a number is off.

To find a bug, check the order, the gaps and the numbers.

Steps can always be fixed, so you always know where to look.

1pour the juice2put the cup down3hand it over
Day one: pour comes before the cup is down.

Example 1: A mixed-up order

  1. Maya's steps say: pour the juice, put the cup down, hand it over.
  2. Bo pours first, and there is no cup yet, so the juice runs across the table.
  3. The steps were in a mixed-up order.
1pour the juice2put the cup down3hand it over
Pour comes first.

Example 2: A missing step

  1. Maya swaps the cards, and now the steps are: put the cup down, hand it over.
  2. Bo hands over an empty cup, because nobody wrote a pour step.
  3. A robot cannot do a step nobody wrote.

Example 3: A number that is off

  1. Maya types the pour five times instead of once.
  2. Bo pours, and pours, and pours, until the cup overflows.
  3. The number of pours is off.
1put the cup down2pour the juice3pour the juice4pour the juice5pour the juice6pour the juice7hand it over
Five pours instead of one.

Example 4: Fixing it

  1. Put the cup down, pour the juice once, and hand it over.
  2. On the last day every cup comes out full.
  3. Each bug was a mistake in the steps, and each was fixed.

Words to know

bug
A mistake in the steps.
mixed-up order
The steps are in the wrong order.
missing step
A step nobody wrote.
number off
A step that happens too many or too few times.

Watch out

Try it

  1. Shoes go on before socks. Which kind of bug is it?
  2. A door opens but never shuts. Which kind of bug is it?
  3. A dance spins thirty times, not three. Which kind of bug is it?
  4. Is the bug in Bo, or in the steps?
Answers: 1. A mixed-up order · 2. A missing step · 3. A number that is off · 4. In the steps
Try at homeAsk a grown-up to write three steps for something easy, like making a sandwich. Swap two steps, or leave one out, or change a number. Read them out and say which kind of bug you made: a mixed-up order, a missing step, or a number that is off. Then fix it together.
For grown-upsPlay the Mission: write three steps for something easy, like making a sandwich. Your child swaps two steps, leaves one out, or changes a number, reads them out, and says which kind of bug they made. Then fix it together.
Open these notes on screenScan the code, or go to tutorpip.com.