New
New
Year 5

Writing and testing algorithms

I can create a physical project that includes selection.

New
New
Year 5

Writing and testing algorithms

I can create a physical project that includes selection.

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. An algorithm can describe what a physical model will do.
  2. Selection can be used to produce an intended outcome.
  3. Programs are improved through debugging.

Keywords

  • Algorithm - a precise sequence of steps that can be followed to do a task

  • Repetition - part of a program where one or more commands are run multiple times in a loop

  • Debug - finding and fixing errors in a program

Common misconception

You should write all the code before testing.

Test small parts frequently to catch errors early. It is easier to fix a few errors at a time than all of them at once.


To help you plan your year 5 computing lesson on: Writing and testing algorithms, download all teaching resources for free and adapt to suit your pupils' needs...

This lesson may require more time than is available, as it involves physical model building. You should consider how the activities can be linked into Design and Technology provision within your school. Children may work in pairs or groups to create the model.
Teacher tip

Equipment

Crumble microcontroller, crocodile clips, battery pack, Sparkle LED, motor, push button switch, a selection of materials and equipment suitable for making models such as card, scissors, tape etc.

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...

6 Questions

Q1.
What is selection in programming?
a loop that repeats commands indefinitely
a way to store information
Correct answer: a part of a program where if a condition is met, a set of commands is run
a condition that always evaluates to True
Q2.
What is a condition in programming?
Correct answer: a statement that can be True or False
a loop that repeats commands
a command that always runs
a way to stop a program
Q3.
What does repetition mean in programming?
Correct answer: running commands multiple times in a loop
stopping the program when a condition is met
storing information for future use
running all commands in order once
Q4.
Is a Sparkle an input device, an output device or neither?
Correct Answer: output, output device, an output device
Q5.
What is the process of finding and fixing errors in a program called?
Correct Answer: debug, debugging
Q6.
Arrange the steps for creating a coding project:
1 - create a detailed drawing or plan
2 - write an algorithm for the project
3 - translate the algorithm into code
4 - test and debug the code

6 Questions

Q1.
What is an algorithm?
a loop that repeats commands indefinitely
a condition that is always True
a tool used to store data
Correct answer: a precise sequence of steps to complete a task
Q2.
What does debugging mean?
writing new code
repeating commands in a loop
Correct answer: finding and fixing errors in a program
storing data in a program
Q3.
Why is it important to test small parts of code frequently?
to make the program run faster
to avoid writing algorithms
Correct answer: to catch errors early and fix them
to reduce the need for repetition
Q4.
Why is an algorithm important in programming?
Correct answer: it helps plan the steps needed to complete a task
it repeats commands in a loop
it stores information in the program
it stops the program from running
Q5.
Arrange the steps for debugging a program:
1 - identify the error
2 - find the part of the code causing the error
3 - fix the error in the code
4 - test the program to ensure the error is fixed
Q6.
Match the key words and definitions.
Correct Answer:algorithm,a precise sequence of steps that can be followed to do a task

a precise sequence of steps that can be followed to do a task

Correct Answer:repetition,a program where one or more commands are run multiple times in a loop

a program where one or more commands are run multiple times in a loop

Correct Answer:debug,finding and fixing errors in a program

finding and fixing errors in a program