AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Spot the bug

Week 9 · Unit 1 · 1.4 · 3 lessons
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.

bug!find itfix itrun again
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.
programmerbug
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.
mothcomputer
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?
2
What does it mean to debug?
debug
3
After you fix a bug, what do you do?
4
Is a bug always a real insect?