New
New
Lesson 6 of 9
  • Year 11
  • AQA

Refining code for a programming project

I can identify and make improvements to refine code.

Lesson 6 of 9
New
New
  • Year 11
  • AQA

Refining code for a programming project

I can identify and make improvements to refine code.

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. Reviewing code means checking how well it works, how readable it is and whether it meets the functional requirements.
  2. Improving code may involve simplifying logic, breaking large sections of code into subroutines or correcting any errors.
  3. Code should be readable and maintainable, so that others can understand and work with it easily.

Keywords

  • Modularity - breaking software into independent, self-contained units or modules

Common misconception

A function and a procedure are the same.

A function is different from a procedure because it returns a value or values to the main program.


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

This lesson assumes pupils have already developed a part-completed solution. If required, you can provide them with a sample solution at oak.link/stream-scheduler.
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.
Which statement best describes a functional requirement?

The program should look appealing.
Correct answer: The program must allow users to print documents.
The program should run quickly.
The program must use a specific brand of computer.

Q2.
What is the main purpose of validation in a program?

to improve the appearance of data
to increase the speed of processing
to change the data format
Correct answer: to check that data meets certain standards

Q3.
What is a key feature of a list as a data structure?

It can only store numbers.
It is always a fixed size.
Correct answer: It can contain items of different data types.
It cannot be changed after creation.

Q4.
Put these steps in the correct order for processing data in a program:

1 - data is input
2 - data is validated
3 - data is processed
4 - data is output

Q5.
Match each term to its correct description:

Correct Answer:functional requirement,specifies what a system must do

specifies what a system must do

Correct Answer:validation,ensures data meets criteria before use

ensures data meets criteria before use

Correct Answer:list,stores multiple items and can change size

stores multiple items and can change size

Q6.
What is an output in a program?

the data entered by a user
the calculation the program performs
Correct answer: the result shown on screen
the process of sorting data

Assessment exit quiz

Download quiz pdf

6 Questions

Q1.
What is the main reason for reviewing code?

Correct answer: to check readability, functionality and requirements
to make the code longer
to add more comments
to change the programming language

Q2.
What word describes code that is organised into independent sections, making it easier to understand and maintain?

Correct Answer: modular

Q3.
Which of these is an example of improving code?

making variable names shorter
adding unnecessary lines
removing all comments
Correct answer: breaking down large code into subroutines

Q4.
What Python statement allows you to use functions that generate unpredictable numbers, such as for picking a value from a list at random?

Correct Answer: import random

Q5.
Match each example to the correct concept:

Correct Answer:modularity,breaking code into subroutines

breaking code into subroutines

Correct Answer:function,a block of code that gives back a result

a block of code that gives back a result

Correct Answer:code review,looking for errors and improvements

looking for errors and improvements

Q6.
Which statement correctly explains the difference between a function and a procedure in programming?

both return a value to the main program
only a procedure can take parameters
Correct answer: only a function returns a value to the main program
both are used only for displaying information