Writing and testing algorithms
I can create a physical project that includes selection.
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
- An algorithm can describe what a physical model will do.
- Selection can be used to produce an intended outcome.
- Programs are improved through debugging.
Keywords
Algorithm - a precise set of ordered steps which can be followed by a human or a computer 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...
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.
The starter quiz will activate and check your pupils' prior knowledge, with versions available both with and without answers in PDF format.
We use learning cycles to break down learning into key concepts or ideas linked to the learning outcome. Each learning cycle features explanations with checks for understanding and practice tasks with feedback. All of this is found in our slide decks, ready for you to download and edit. The practice tasks are also available as printable worksheets and some lessons have additional materials with extra material you might need for teaching the lesson.
The assessment exit quiz will test your pupils' understanding of the key learning points.
Our video is a tool for planning, showing how other teachers might teach the lesson, offering helpful tips, modelled explanations and inspiration for your own delivery in the classroom. Plus, you can set it as homework or revision for pupils and keep their learning on track by sharing an online pupil version of this lesson.
Explore more key stage 2 computing lessons from the Exploring selection in physical computing unit, dive into the full primary computing curriculum, or learn more about lesson planning.
Equipment
Pupils will need model making materials, a microcontroller, crocodile clips, battery packs, Sparkle LEDs, push button switches and motors. Examples in this lesson use Crumble https://oak.link/crumble
Licence
Prior knowledge starter quiz
6 Questions
Q1.What is selection in programming?
Q2.What is a condition in programming?
Q3.What does repetition mean in programming?
Q4.Is a Sparkle an input device, an output device or neither?
Q5.What is the process of finding and fixing errors in a program called?
Q6.Arrange the steps for creating a coding project:
Assessment exit quiz
6 Questions
Q1.What is an algorithm?
Q2.What does debugging mean?
Q3.Why is it important to test small parts of code frequently?
Q4.Why is an algorithm important in programming?
Q5.Arrange the steps for debugging a program:
Q6.Match the key words and definitions.
a precise sequence of steps that can be followed to do a task
a program where one or more commands are run multiple times in a loop
finding and fixing errors in a program