Mini Minds Hub · Free printable
Debug the Sandwich Robot: Free Printable Worksheet for Year 4
In short: Free printable Debug the Sandwich Robot for Year 4 (ages 8 to 9). Ollie the Otter counts the steps. Circle each bug, say why, then fix it.
- ForYear 4
- StageKey Stage 2
- CostFree
- FormatPrintable PDF
Debug the Sandwich Robot asks Year 4 children (ages 8 to 9) to find the bug in each of four step by step programs, say why it is a bug, then rewrite it. Ollie the Otter counts the steps along the way. It suits children who are ready to explain their thinking in writing. It takes about 20 minutes.
Before anyone writes, read one program aloud and act it out as the robot, doing exactly what each step says and nothing more. The usual slip is fixing a step because it sounds odd, without saying what the robot would actually do. Ask, "What does the robot do here?" and let the answer lead to the bug.
What is on the sheet
Children work through four programs, labelled A to D, that tell a sandwich robot what to do. In Program A, two steps are in the wrong order, so children rewrite them correctly. In Programs B, C and D, one step is buggy, so children rewrite it correctly. For each program they circle the bug, explain why it is a bug, then fix it. Each numbered item has space for writing.
- Program A: rewrite the two steps in the correct order.
- Program B: rewrite the buggy step correctly.
- Program C: rewrite the buggy step correctly.
- Program D: rewrite the buggy step correctly.
Worked example: a shoe robot
A robot puts on a shoe. Its program says: 1. Tie the laces. 2. Put on the sock. 3. Put on the shoe.
This example uses a different robot and a different task from the four programs on the sheet. It shows how to find, explain and fix an order bug.
Method 1: act it out- Read step 1 and do exactly what it says. Try to tie laces on a shoe that is not on a foot.
- Notice that the robot gets stuck. Circle step 1 as the bug.
- Say why: the laces cannot be tied before the shoe is on.
- For each step, ask, "What must already have happened?"
- Tying the laces needs the shoe to be on. Putting on the shoe needs the sock to be on.
- Put the steps in an order where every step has what it needs.
What is a bug, and why do programmers debug?
A program is a list of instructions that a computer follows in order. A computer cannot guess what you meant. It does exactly what each step says, even when that makes no sense to a person. This is why a sandwich robot is a useful picture. If a step is missing, out of order or unclear, the robot gets it wrong in a way that is clear to see.
A bug is a mistake in a program. Debugging means finding the bug, working out why it causes a problem, and fixing it. Programmers do this all the time, and finding a bug is a normal part of the work. Asking children to explain a bug before they fix it builds the habit of reasoning, not guessing.
Things to know about programs
- A program is a set of instructions for a computer to follow.
- Computers follow instructions exactly. They do not guess what you meant.
- The order of the steps in a program matters.
- Debugging means finding and fixing mistakes in a program.
- Programmers test their programs to check that they work.
Skills and curriculum link
- Spotting bugs
- Explaining errors
- Rewriting steps
- Following steps in order
- Testing a fix
Ideas for the grown up
- Be the robotRead each step aloud and do only what it says. Children often spot the bug when they watch the robot get stuck.
- Ask for the whyBefore children rewrite a step, ask them to say what goes wrong. The reason matters as much as the fix.
- Keep first goesIf a child crosses out an answer and tries again, leave it on the page. It shows their thinking.
- Test the fixAfter a rewrite, read the whole program again from the top. Check that every step now works.
Key words
- ProgramA list of instructions that a computer or robot follows in order.
- InstructionOne step that tells a robot or computer what to do.
- SequenceThe order in which steps happen.
- BugA mistake in a program that stops it working as it should.
- DebugTo find a bug, work out why it is a problem and fix it.
- ConditionA yes or no check that decides which step a program does next.
How to use it
- Print both pages. Page 1 is for the child. Keep page 2 for the grown up.
- Read the four programs together first. Act out the first one as the robot, one step at a time.
- Children work down the numbered items. They find and explain each bug before they rewrite it. This takes about 20 minutes.
- Check against the notes and answers on page 2. Ask, "How did you know that was the bug?"
- Come back to it another day. Repeating a familiar activity builds confidence.
Help, stretch and game ideas
If it feels too hard
Act out each program with a partner as the robot, doing one step at a time and nothing extra. Stop when something cannot happen. A crossed out first go is useful information, so leave it on the page. Start with Program A, which has two steps to put in order.
To stretch confident children
Say aloud how you would test Program C with a yes answer and a no answer, to show your fix works. Then write a short program of your own with one deliberate bug, and swap it with a partner to find and fix.
Make it a game
Read a program aloud while a partner acts it out like a robot. Stop them at the bug and say why it is a bug. Swap roles for the next program. Score a point each time you stop at the right step and give a clear reason.
Mistakes to watch for
Watch forA child rewrites the whole program when only one step is buggy.
Try thisAsk which step makes the robot go wrong. Circle that step first, then rewrite only that one.
Watch forA child fixes a step but cannot say why it was a bug.
Try thisAct the original step out as the robot and ask, "What happens here?" Then let them put the reason in their own words.
Watch forA child circles a step that sounds odd but works.
Try thisFollow it literally, as the robot would. If the robot can do it and the result makes sense, it is not the bug. Look again.
Talk about it
- What would the robot do if it followed this step exactly?
- How did you know which step was the bug?
- Why does the order of the steps matter?
- What did you change, and why does your fix work?
- Could a person fill in a missing step that a robot cannot? Why?
- How could you test that your fixed program works?
Take it off the page
Robot morning
Write a short program for getting dressed. Ask a family member to follow it exactly, like a robot, and note where it goes wrong.
Draw a robot recipe
Draw four pictures in order to show a robot a simple task, such as packing a school bag. Swap with someone to check the order.
Bug hunt
Write a short program for a task at home with one bug hidden in it. Challenge someone to find it and say why it is a bug.
Who it is for
Parents
Sit beside your child for the first program and let them lead. Act it out together as the robot. About 20 minutes is plenty. If they get stuck, ask what the robot would do at that step.
Teachers
Use it as a starter, a plenary, an early finisher task or a table activity. It needs no preparation beyond printing. Page 2 gives support and stretch ideas for mixed groups, and the answers.
Home educators
Print it as part of a wider computing plan. It sits well beside everyday sequencing talk, such as recipes or routines. Print it again for brothers and sisters, or to revisit the skill a few weeks later.
Where this fits
Before this sheet, children follow and give instructions in order, such as directions for a game or the steps of a routine. They learn that a robot or computer needs each step to be clear and in the right order.
The sheet itself practises finding, explaining and fixing bugs in four programs, and Program C brings in a yes or no choice, as the stretch idea shows. After this, children can write longer programs of their own that use choices and repeated steps, then test and debug them, on paper or on a screen.
Keep practising
If this sheet went well, find more in our Year 4 computing worksheets guide, or try Loop the Pattern, Build the Ultimate Machine, A Message's Big Journey or Loop the Treasure Trail next.
Questions parents and teachers ask
- What age is Debug the Sandwich Robot for?
It is written for Year 4 (ages 8 to 9), in Key Stage 2. Older children can use it as quick practice, and the stretch idea on page 2 gives them more to think about.
- How long does it take?
About 20 minutes. Read the four programs together first, then let children work down the numbered items. If time is short, do Program A and one other program, and return to the rest another day.
- What will children practise?
They practise finding, explaining and fixing bugs in step by step programs. For each one they circle the bug, say why it is a bug, then rewrite the step or steps correctly.
- What if it feels too hard?
Act out each program with a partner as the robot, one step at a time. Doing exactly what the step says usually shows where it goes wrong. Leave any crossed out first go on the page, because it is useful information.
- Do children need a computer?
No. It is a screen free activity that needs only paper and a pencil. The robot is on the page, and children can act out the steps with a partner instead.
- Can teachers use it in class?
Yes. It works as a starter, a plenary, an early finisher task, homework or a table activity. It needs no preparation beyond printing, and page 2 has help, a stretch idea and answers.
- Which page do children use?
Children use page 1. Page 2 is for the grown up and has notes on how to use the sheet, help for children who find it hard, a stretch idea and the answers. Black and white printing works well.
Preview the full PDF
More worksheets like this
Learn it through play: toys and games from Jaques
Made by Jaques of London, making games for families since 1795. A printable supports classroom learning and does not replace a teacher.



