New
New
Lesson 8 of 9
  • Year 11
  • OCR

Testing and refining a programming project

I can test a programming project using a range of methods.

Lesson 8 of 9
New
New
  • Year 11
  • OCR

Testing and refining a programming project

I can test a programming project using a range of methods.

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

These resources were created for remote use during the pandemic and are not designed for classroom teaching.

Lesson details

Key learning points

  1. Testing is the process of checking that a program works correctly and meets all its requirements.
  2. To test a program thoroughly, a range of data should be used, including normal, boundary and invalid data.
  3. A good test plan includes clear tests with predicted outcomes.
  4. If the actual results don't match the expected results, the program is checked for errors in a process called debugging.

Keywords

  • Testing - the systematic process of checking that a program works as expected

  • Debugging - the process of finding and correcting errors in program code

Common misconception

A test plan should only include data that will cause a program to not work.

A test plan should contain a range of test data, including normal, erroneous and boundary.


To help you plan your year 11 computer science lesson on: Testing and refining a programming project, download all teaching resources for free and adapt to suit your pupils' needs...

This lesson assumes pupils have created a test plan in the previous lesson. If this is not the case, the start of a sample test plan is provided in the lesson along with some starter sample code for pupils to test.
Teacher tip

Equipment

All pupils require access to devices that can edit and run Python programs. Starter code files are available to copy or use directly via the Raspberry Pi Code Editor.

Licence

This content is © Oak National Academy Limited (2025), 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

Download quiz pdf

6 Questions

Q1.
What is the main purpose of software testing?

to make the program look attractive
Correct answer: to check whether the program works correctly and meets requirements
to speed up the computer
to write more code

Q2.
Which type of testing involves checking how different sections of a program interact?

Correct Answer: integration testing, integration

Q3.
What does black box testing focus on?

the internal code structure
the appearance of the program
Correct answer: inputs and outputs, without looking at the code
the speed of the hardware

Q4.
What is the process of finding and correcting errors in code called?

Correct Answer: debugging, debug

Q5.
Why is it important to use different types of data, such as erroneous, normal and boundary data, when testing?

to make the tests more complicated
to impress your teacher
to reduce the size of the program
Correct answer: to ensure the program works correctly in all situations

Q6.
Match the type of data to its description:

Correct Answer:normal data,typical, expected input values

typical, expected input values

Correct Answer:erroneous data,input values outside allowed range

input values outside allowed range

Correct Answer:boundary data,values at the edge of allowed limits

values at the edge of allowed limits

Correct Answer:test case,a set of conditions used to check the program

a set of conditions used to check the program

Assessment exit quiz

Download quiz pdf

6 Questions

Q1.
Why is it important to use different types of data when testing?

to make the test plan longer
to slow down the program
Correct answer: to check how the program handles all possible situations
to impress your teacher

Q2.
Which statement about test plans is correct?

Correct answer: a test plan should contain normal, boundary and erroneous data
a test plan should only include data that makes the program fail
a test plan is only needed for large projects
a test plan is not useful for programmers

Q3.
What type of test input checks the extreme limits of what a program should accept?

Correct Answer: boundary data, boundary

Q4.
Match the term to its definition:

Correct Answer:testing,checking that a program works as expected

checking that a program works as expected

Correct Answer:debugging,finding and correcting errors in code

finding and correcting errors in code

Correct Answer:normal data,typical, expected input values

typical, expected input values

Correct Answer:erroneous data,input values that are invalid

input values that are invalid

Q5.
What should you do if your program’s actual results don’t match the expected results?

Correct answer: debug the program
ignore the problem
add more features
delete the test

Q6.
Arrange these steps for handling a failed test:

1 - identify the failed test
2 - examine the code for mistakes
3 - correct the error
4 - re-run the test