Computer Science: Algorithms and Programming (KS1)

KS1

CO-KS12-D001

Understanding what algorithms are and how they are implemented as programs; creating and debugging simple programs; using logical reasoning to predict program behaviour.

National Curriculum context

At KS1, the computer science strand introduces pupils to the foundational concepts of algorithms and programs. An algorithm is a precise sequence of instructions for solving a problem, and understanding that algorithms must be unambiguous and correctly ordered is the first step in computational thinking. Pupils learn to create simple programs (sequences of instructions) and to debug them when they do not work as expected, developing systematic problem-solving habits. Logical reasoning - the ability to predict what a program will do from its code - is introduced as a core skill, beginning the development of the mental modelling abilities that underpin more complex programming at KS2 and beyond. These early experiences establish that computer science is a discipline that requires both creativity and rigorous logical thinking.

1

Concepts

1

Clusters

1

Prerequisites

1

With difficulty levels

AI Direct: 1

Lesson Clusters

1

Understand algorithms and debug simple programs

practice Curated

At KS1 the sole programming concept is debugging and logical reasoning — the foundational skill of reading a program, predicting its behaviour and fixing errors. A single-concept cluster correctly represents the domain's narrow but important focus.

1 concepts Cause and Effect

Teaching Suggestions (3)

Study units and activities that deliver concepts in this domain.

Algorithms Unplugged

Computing Practical Application
Pedagogical rationale

Unplugged activities (no computers) are the most effective introduction to algorithms because they make the abstract concrete. Writing step-by-step instructions for everyday tasks (making a sandwich, brushing teeth, navigating a maze) reveals the need for precision and unambiguity. Pupils discover through classmate-following exercises that computers do exactly what you say, not what you mean.

BeeBot Programming

Computing Practical Application
Pedagogical rationale

BeeBots (or similar floor robots) bridge the gap between unplugged algorithms and screen-based programming. Pupils program the robot to navigate a floor mat by pressing directional buttons (forward, back, left, right). The physical movement of the robot provides immediate, visible feedback -- did it go where you intended? Debugging means watching where it went wrong and adjusting the sequence. The tangible, spatial nature of floor robots matches KS1 developmental stage.

ScratchJr: First Animations

Computing Practical Application
Pedagogical rationale

ScratchJr provides the first experience of on-screen programming using visual blocks. Pupils create simple animations by snapping together movement and appearance blocks. The block-based interface removes the barrier of typing, allowing pupils to focus on the logic of sequencing. Creating a character that moves and speaks is inherently motivating and produces a shareable outcome.

Prerequisites

Concepts from other domains that pupils should know before this domain.

Concepts (1)

Debugging and Logical Reasoning

skill AI Direct

CO-KS12-C003

Debugging is the process of finding and fixing errors in programs. It requires logical reasoning: the ability to read code, mentally execute it step by step, identify where the actual behaviour diverges from the expected behaviour, and determine what change will fix the error. Logical reasoning about programs is also required to predict what a program will do before running it. At KS1 and KS2, developing debugging skills and the habit of logical, systematic thinking about code is as important as learning to write new code.

Teaching guidance

Model debugging strategies explicitly: read the error message (if any), read the code, trace through it step by step, check each part's contribution, hypothesise a fix, test. Give pupils deliberately buggy programs and ask them to identify and fix the errors before writing their own. Normalise bugs: frame them as a necessary part of programming rather than a sign of failure. Develop pupils' metacognitive awareness by asking them to articulate their reasoning when debugging. Use pair programming as a debugging strategy: talking through code with a partner helps identify errors.

Vocabulary: debug, error, bug, syntax error, logic error, trace, execute, predict, fix, test, check, correct, output, expected, actual, reasoning
Common misconceptions

Pupils may feel that having errors in their code means they have failed. Reframing debugging as a normal and creative part of programming is essential. Pupils may try random changes hoping something will fix a bug rather than reasoning about the cause; teaching systematic debugging strategies builds more effective habits. Some pupils struggle to 'read' code as an execution trace; explicit tracing activities develop this skill.

Difficulty levels

Entry

Identifying that a program is not working as expected and finding an obvious error by comparing the output with the intended result.

Example task

This program should make the sprite draw a square, but it draws a triangle. Look at the code — what is wrong?

Model response: The loop only repeats 3 times instead of 4. A square has 4 sides, so I need to change the repeat from 3 to 4.

Developing

Using logical reasoning to trace through a program step by step, predicting the output and identifying where it goes wrong.

Example task

Trace through this program and predict what it will output: set x to 5, repeat 3 times (set x to x + 2, say x).

Model response: Start: x = 5. First time through the loop: x becomes 5 + 2 = 7, it says 7. Second time: x becomes 7 + 2 = 9, it says 9. Third time: x becomes 9 + 2 = 11, it says 11. The program will say 7, then 9, then 11.

Expected

Systematically debugging programs by testing, identifying errors, hypothesising causes, making changes and retesting.

Example task

This game program has two bugs: the score doesn't increase when you collect a coin, and the character can walk through walls. Find and fix both bugs.

Model response: Bug 1: The score variable is being set to 1 each time instead of increased by 1. I changed 'set score to 1' to 'change score by 1'. Bug 2: The wall collision check uses 'if touching wall colour' but the wall colour in the code doesn't match the actual wall colour on the screen. I used the colour picker to get the exact colour. After fixing both, I tested by collecting three coins (score went 1, 2, 3) and walking into a wall (character stopped).

Greater Depth

Applying debugging strategies systematically, including using test data, print statements for tracing, and explaining why certain types of bugs are harder to find.

Example task

A classmate's sorting program works for most lists but gives wrong results for some. How would you systematically find the bug?

Model response: I would test with several types of input: a sorted list, a reversed list, a list with duplicates, a list with one item, and an empty list. I would add print statements inside the loop to show the state of the list after each step, so I can see where it goes wrong. I would trace the failing case step by step. Some bugs only appear with specific inputs — these are harder to find because the program seems to work most of the time.

Delivery rationale

Computing concept — inherently digital subject with strong tool support.