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

      Programming project: iteration II

      Lesson details

      Learning outcome

      I can develop a program and apply testing techniques to ensure that it works correctly.

      Key learning points

      1. Completing an implementation ensures that all intended functionality is present.
      2. Testing checks that code behaves correctly and meets requirements.

      Keywords

      • Test plan - a document that sets out the tests that will be carried out during testing

      • Test data - the input values used to check whether a program works correctly during testing and to see how it behaves in different situations

      Common misconception

      I finished the code and it runs, so I don’t need to test it.

      Just because a program runs doesn’t mean it works correctly in all situations. Testing helps find hidden errors, especially with unusual or unexpected inputs that you might not think of.

      Teacher tip

      Introduce normal, boundary, and erroneous test data with real examples. Ask learners to predict outcomes before running tests.

      Equipment

      Pupils will need access to a device that can edit and run Python programs. Examples in this lesson use the RPF Code Editor https://oak.link/python-editor

      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.
      What does 'robust' mean in programming?

      a program that runs quickly
      a program that has no loops
      a program that skips errors
      Correct answer: a program that handles unexpected inputs without crashing

      Q2.
      What is exception handling used for?

      Correct answer: to catch and manage errors so that the program doesn't crash
      to make the program faster
      to delete errors automatically
      to skip testing

      Q3.
      What is decomposition in programming?

      writing all the code at once
      ignoring smaller tasks
      Correct answer: breaking down a problem into smaller parts
      testing the program

      Q4.
      What is a pre-condition loop?

      Correct answer: a loop that checks its condition at the start
      a loop that checks its condition at the end
      a loop that skips the condition
      a loop that runs only once

      Q5.
      Correctly order these tasks in program development:

      1 - Plan the program.
      2 - Write the code.
      3 - Test the program.
      4 - Debug the code.

      Q6.
      What ensures that a program catches errors and manages them to prevent crashes?

      Correct Answer: exception handling

      6 Questions

      Q1.
      Why is it important to test a program after completing the code?

      Correct answer: to ensure that it works correctly in all situations
      to make it run faster
      to delete unnecessary parts
      to skip debugging

      Q2.
      What does a test plan help you do?

      write the program code
      debug the program
      skip unnecessary tests
      Correct answer: organise the tests to be carried out

      Q3.
      Match the terms to their definitions:

      Correct Answer:test plan,a document that outlines the tests to be carried out

      a document that outlines the tests to be carried out

      Correct Answer:test data,input values used during testing

      input values used during testing

      Correct Answer:normal test data,typical or expected inputs

      typical or expected inputs

      Correct Answer:boundary test data,inputs at the limits of acceptable values

      inputs at the limits of acceptable values

      Correct Answer:erroneous test data,invalid or unexpected inputs

      invalid or unexpected inputs

      Q4.
      Enter a valid example of normal data for a program that accepts numbers between 1 and 3 (inclusive).

      Correct Answer: 1, 2, 3

      Q5.
      Enter a valid example of boundary data for a program that accepts numbers between 1 and 10 (inclusive).

      Correct Answer: 1, 10

      Q6.
      Why is it important to test a program even if it runs?

      to make the program run faster
      to delete unnecessary parts of the program
      Correct answer: to ensure that it works correctly in all situations
      to skip debugging

      To help you plan your 10 computer science lesson on: Programming project: iteration II, download all teaching resources for free and adapt to suit your pupils' needs...