Computer Science
Grade 1
20 min
Debugging Simple Errors
Debugging Simple Errors
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Define what a 'bug' is in a set of instructions.
Identify a step that is out of order in a sequence.
Find a missing step in a simple algorithm.
Correct an incorrect step in a list of commands.
Explain why fixing bugs is important for computers.
Use 'detective thinking' to look for clues to a problem.
Oh no! Your robot friend is trying to get dressed but put his shoes on first! 👟 What went wrong?
We will learn to be code detectives! 🕵️ We will find and fix little mistakes, called bugs. This helps our computer programs work the right way.
Real-World Applications
Fixing a toy that is built the wrong way.
Following a recipe in the correct order to bake cookies. 🍪
Putting on your socks and shoes in the right sequence.
Giving a...
2
Key Concepts & Vocabulary
TermDefinitionExample
Bug 🐞A small mistake or error in the instructions.Telling a robot to pour milk before getting a glass.
DebuggingFinding and fixing bugs. You are a bug detective!Realizing the milk needs a glass and adding that step.
SequenceThe order that things happen, one after another.First, get bread. 🍞 Second, get jelly. Third, spread jelly.
AlgorithmA list of steps to do something.The steps to brush your teeth is an algorithm.
CommandOne single instruction or step for the computer.The command 'Walk forward' tells a robot to move.
ProgramA whole set of commands for a computer to follow.All the steps to make a robot dance is a program. 🕺
3
Core Syntax & Patterns
One Step at a Time
Check each instruction one by one, from the start.
Don't skip ahead! Read the first step, see if it's right. Then read the second.
Order Matters
Steps must be in the correct sequence to work.
Putting on socks comes before putting on shoes. The order is very important.
Be a Detective 🔎
Ask: 'What should happen?' and 'What really happened?'
If the robot turned left but should have gone straight, you found a clue!
4 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
A character needs to get a key 🔑 to open a chest. The code is: 1. Walk to key. 2. Walk to chest. 3. Open chest. The character walks to the chest but can't open it. What is the bug?
A.The chest is locked too tight
B.The character walked too slowly
C.The key is the wrong shape
D.The 'pick up key' step is missing
Challenging
Your friend is sad because their code for a dancing robot has a bug. What is the KINDEST and most helpful thing to say?
A.Let's look at the steps together, we can find the bug!
B.My code worked perfectly on the first try.
C.You should just give up.
D.Your code is really bad.
Challenging
A game character should collect a coin 🪙, then jump over a wall. The code is: 1. JUMP. 2. COLLECT COIN. The character hits the wall and never gets the coin. What is the problem?
A.The wall is too high
B.The order of the steps is wrong
C.The coin is too shiny
D.The character needs to run faster
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing Free