1
Bugs and debugging
Computing 1: Topic 1.4, pp. 49–59
GoalSay what a bug is and that debugging means finding and fixing it.
New words
bug · an error in code or in a programdebug · find a bug and fix it
Explanation
A bug is an error in a program. A bug makes the program work in the wrong way. To debug is to find the bug and fix it. Then run the program again to check. We look at the cards to find it.
Worked examples
Tom’s robot should go to the flower, but it stops too soon. There is a bug. Tom finds it, fixes it, and runs the program again.
A bug is not a real insect in your computer. It is a mistake in the code. Every programmer finds bugs. Finding them is part of the job.
Long ago, people found a real moth stuck inside a big computer. It stopped the computer from working. People joked that they had found a bug. Today ‘bug’ means any error in a program.
Class activity
Bug hunt: a partner writes four command cards for a route but secretly puts in one bug, for example one forward too many. You walk the route on a floor grid. Does it reach the goal? Find the bug. Say: ‘I found the bug. I fixed it.’
Practice
1
What is a bug in a program?
An error that makes the program work the wrong way.
2
What does it mean to debug?
To find a bug and fix it.
3
After you fix a bug, what do you do?
Run the program again to check it.
4
Is a bug always a real insect?
No. In computing it is a mistake in the code.