Computing · Years 3-4
Bell.Study
Debugging programs
Finding and fixing errors (bugs) in code. Debugging is an important skill for any programmer
- 1
What is a 'bug' in a program? A) An error in the code B) A small insect C) A part of the screen D) A type of computer
Answer: - 2
True or false? Debugging means finding and fixing errors in a program. A) True B) False
Answer: - 3
Complete the sentence. An error in a program is called a ___.
Answer: - 4
What is a bug in a program? A) An error or mistake in the code B) An insect on your screen C) A type of computer D) A new feature
Answer: - 5
Which of these is a common kind of bug? A) Putting the steps in the wrong order B) Closing the computer C) Choosing a colourful background D) Naming the program well
Answer: - 6
Your program should print 'Hello' but it prints 'Helo'. What kind of bug is this? A) A typo (spelling mistake) B) A missing step C) A computer breaking D) A power cut
Answer: - 7
Put these debugging steps in the order a programmer might use them. Put these in order: Run the program, Spot what goes wrong, Find the part of the code with the bug, Fix the bug, Test the program again
Answer: - 8
A program should repeat a sound 5 times but it only plays once. What might be the bug? A) There is no loop, or the loop runs 1 time instead of 5 B) The speakers are too loud C) The screen is too bright D) The mouse is broken
Answer: - 9
Match the bug to a way to fix it. Match each item on the left to one on the right. Left: Steps in wrong order, Missing step, Typo in a word, Loop runs wrong number of times Right: Reorder the steps, Add the missing step, Correct the spelling, Change the loop count
Answer: - 10
Where does the word 'bug' come from in computing? A) A real moth was found in an early computer in 1947 B) It was invented in the year 2000 C) It came from a science fiction film D) It is from a children's TV show
Answer:
Answer key
Debugging programs · for parents and teachers
- 1
An error in the code
A bug is an error or mistake in a program that stops it working correctly.
- 2
True
True. Debugging is the process of finding and fixing bugs (errors) in code.
- 3
bug
An error in a program is called a bug. Removing bugs is called debugging.
- 4
An error or mistake in the code
A bug is an error in code. Debugging means finding and fixing bugs.
- 5
Putting the steps in the wrong order
Putting steps in the wrong order is a common bug. Sequence matters in programs.
- 6
A typo (spelling mistake)
'Helo' is missing an 'l'. A typo is a spelling mistake that can be a bug.
- 7
Run the program, Spot what goes wrong, Find the part of the code with the bug, Fix the bug, Test the program again
Programmers test, spot bugs, find them in the code, fix them, then test again.
- 8
There is no loop, or the loop runs 1 time instead of 5
If a sound should play 5 times but only plays once, the loop is missing or set to the wrong number.
- 9
Steps in wrong order → Reorder the steps; Missing step → Add the missing step; Typo in a word → Correct the spelling; Loop runs wrong number of times → Change the loop count
Each kind of bug has a sensible fix. Knowing the type of bug helps you fix it faster.
- 10
A real moth was found in an early computer in 1947
In 1947, a real moth was found inside an early computer, and the term 'bug' for an error stuck.