School preview · Teacher-led courses are in preview · Registration is open · Payments and live video are awaiting connection
← Coding Projects

Beginner · Other / specialist pathway · Coding

Find, explain and fix a bug

Find a bug by comparing expected and actual behaviour.

Original Kidemy beginner self-study unit · Learn the idea, try the practical activity and review your written answers. Review your project with a guardian or teacher using the criteria below. Teacher-led course approval and booking are separate.

Learn the idea

A bug is a mistake that causes a program to behave differently from its intended rules. State what should happen, test what does happen and trace the steps to find the first difference. Change one relevant thing, then test again, including another input.

Worked example

Expected: show a message three times. Actual plan: repeat 4 times, show the message. The repeat count is the first mismatch; changing it to 3 fixes this particular bug.

  1. Write the expected result before changing the program.
  2. Trace or run a small example.
  3. Retest the change so a guessed fix is not mistaken for a working one.

Your written practice

Show your working on paper and enter your answer here. If it does not match, compare the model and try again.

Show model answer and explanation

3

The expected behaviour specifies three.

Show model answer and explanation

3

The changed count matches the intended rule.

Show model answer and explanation

retest

The changed program must be checked.

Write in your own words. A guardian or teacher should review this response.

Show model answer and explanation

The operation is subtraction instead of addition. Use 4 + 3, which gives 7.

Check the expected operation and the verified new result.

Write in your own words. A guardian or teacher should review this response.

Show model answer and explanation

Choosing garden opens no scene. I expected the garden scene with a next button.

Check the action, actual result and expected result.

Fix and prove

Ask a partner to put one mistake in a paper algorithm. Find it, explain it and test the correction with two cases.

Review with a guardian or teacher

Keep your work on paper or in a local file. This page does not upload it or automatically grade the project.

Teacher-led lessons, schedules and prices for this outline are upcoming. You can use any starter practice above now without booking.

Your next step

Solo practice works without an account. Sign in to save a practice record to your learner profile.

Keep practising

Exact lesson links and related activities are labelled separately. Return-to-course links retain your selected learning path.

Browse all games and books →