Hands-On Science Lab

Glossary โ€บ Coding โ€บ Bug

Bug

A mistake in a program that makes it do the wrong thing.

For kids

If your robot walks off the edge of the map, there's a bug. Finding and fixing it is called debugging.

For grown-ups

Bugs can be logic errors (wrong steps), syntax errors (wrong grammar for the language) or edge cases (situations nobody planned for). Debugging is systematic: find where expected and actual behaviour first diverge.

Try it in one minute

Write a five-step program for walking to the door. Have someone follow it and find the bug.

Common mix-up

Bugs aren't failures. Every programmer writes them; good programmers find them.

See it in an activity