Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can fix the bugs that I find in a program.

      Key learning points

      1. A program can be tested against a design.
      2. A piece of code can be matched to an outcome.
      3. A bug is an error in the coding of the program.
      4. Debugging is finding and fixing these errors in a program.

      Keywords

      • Bug - an error or mistake in code that stops it from working properly or as expected

      • Debug - finding and fixing errors in a program

      Common misconception

      Only new programmers will have bugs in their programs.

      Every programmer will need to correct errors and debug their code. Part of the process of programming is correcting mistakes made as you go along. Regluarly test your program does what it needs to as you go along.

      Teacher tip

      You will need to be familiar with the term �debug� and the process of �debugging�. A bug is an error in the design or the coding of the program, and the process of debugging is finding and fixing these errors. Pupils benefit from knowing that teachers will produce programs that have bugs as well.

      Equipment

      Pupils will need access to a device with block-based programming software. Examples in this lesson use Scratch https://oak.link/scratch

      Licence

      This content is © Oak National Academy Limited (2026), licensed on Open Government Licence version 3.0
      except where otherwise stated. See Oak's terms & conditions
      (Collection 2).

      Lesson video

      Loading...

      Prior knowledge starter quiz

      6 Questions

      Q1.
      Which input device can be used to control a program?

      monitor
      printer
      speaker
      Correct answer: keyboard

      Q2.
      Match the terms with their definitions.

      Correct Answer:algorithm,a precise set of ordered steps
      Correct Answer:extension,adds new features to a project
      Correct Answer:event,an input that triggers commands

      Q3.
      What is a sprite in Scratch?

      a block of code
      a drink
      Correct answer: a graphic object controlled by a program
      a type of extension

      Q4.
      Why might you adjust the size of a sprite?

      Correct answer: to fit it with the background
      to make it invisible
      to stop it from moving
      to delete it

      Q5.
      What does the ‘duplicate’ command do in Scratch?

      Correct answer: copies an exact part of a coding project
      deletes a sprite
      changes the pen size
      moves a sprite

      Q6.
      What does the pen extension in Scratch allow you to do?

      move a sprite
      add sound effects
      Correct answer: draw lines
      change the background

      6 Questions

      Q1.
      Match the terms with their definitions.

      Correct Answer:testing,checking if a program works as intended
      Correct Answer:design,a plan that outlines how a program should function
      Correct Answer:code,instructions written for a computer to run

      Q2.
      What is a bug in programming?

      a type of software
      Correct answer: an error in the coding of a program
      a feature of a program
      a sprite in Scratch

      Q3.
      What is debugging?

      writing a new program
      adding new features to a program
      Correct answer: finding and fixing errors in a program
      testing a program without fixing errors

      Q4.
      Why is testing a program important?

      Correct answer: to find bugs and ensure it works properly
      to add new features
      to make it look better
      to delete unnecessary code

      Q5.
      Arrange the five steps for debugging in the correct order.

      1 - review the task
      2 - test the project
      3 - identify the bug
      4 - fix the bug
      5 - test the bug fix

      Q6.
      What does debugging help with?

      improving the program’s appearance
      Correct answer: ensuring the program works
      adding new features
      changing the program’s design

      To help you plan your 3 computing lesson on: Debugging movement, download all teaching resources for free and adapt to suit your pupils' needs...