Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can use trace tables to test the logic of an algorithm.

      Key learning points

      1. Trace tables can be used to walkthrough and understand the logic of an algorithm.
      2. Trace tables can be used to help find logical errors in algorithms.

      Keywords

      • Trace table - a tool used to track the values of variables and the flow of execution in an algorithm or program, step by step

      • Error - a mistake or unexpected behaviour in a program that prevents it from working correctly

      • Modulo - an operation that gives you the remainder when one number is divided by another

      Common misconception

      Using trace tables guarantees correct logic and code.

      Trace tables can be subject to human error and can be impractical to use for complex algorithms.

      Teacher tip

      Initially, pupils can struggle to keep track of variable changes in trace tables. Model the completion of trace tables slowly by narrating the changes as they happen.

      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

      6 Questions

      Q1.
      What is a set of step-by-step instructions to solve a problem called?

      Correct Answer: algorithm, an algorithm, algorithms

      Q2.
      Why is it helpful to develop an algorithm’s logic before coding?

      Correct answer: It makes problem solving easier.
      It wastes time.
      It creates unnecessary steps.
      It’s only useful for flowcharts.

      Q3.
      What is a diagram that represents logic or data (or similar alternatives)?

      Correct Answer: flowchart, flow chart

      Q4.
      What does decomposition involve?

      ignoring the problem entirely
      Correct answer: breaking down problems into smaller subproblems
      writing a program directly
      creating a flowchart

      Q5.
      What is abstraction in computational thinking?

      focusing on irrelevant details
      writing a program in plain language
      ignoring the important parts of a problem
      Correct answer: focusing on the important parts and ignoring irrelevant details

      Q6.
      What is a way to express an algorithm in plain language (or similar alternatives)?

      Correct Answer: pseudocode, pseudo code

      6 Questions

      Q1.
      Match the terms with their definitions.

      Correct Answer:trace table,a tool to track variable values and execution flow

      a tool to track variable values and execution flow

      Correct Answer:error,a mistake in a program that prevents it from working correctly

      a mistake in a program that prevents it from working correctly

      Correct Answer:modulo,an operation that gives the remainder when dividing two numbers

      an operation that gives the remainder when dividing two numbers

      Correct Answer:human error,mistakes made by people when creating trace tables

      mistakes made by people when creating trace tables

      Correct Answer:execution,the process of running an algorithm or program

      the process of running an algorithm or program

      Q2.
      What is a trace table used for?

      to draw flowcharts
      to write pseudocode
      Correct answer: to track variable values in a program
      to translate algorithms into code

      Q3.
      What is a common limitation of trace tables?

      they are always correct
      Correct answer: they can be subject to human error
      they only work for pseudocode
      they cannot track variable values

      Q4.
      What is the result of 10%3?

      Correct Answer: 1, one

      Q5.
      Arrange these steps into the correct order for creating a trace table.

      1 - Write the algorithm.
      2 - Identify the variables in the algorithm.
      3 - Track the values of variables step by step.
      4 - Analyse the results to find errors.

      Q6.
      Why might trace tables be impractical for complex algorithms?

      they are too simple to use
      they cannot track variables
      they only work for pseudocode
      Correct answer: they can become too large and difficult to manage

      To help you plan your 10 computer science lesson on: Tracing algorithms, download all teaching resources for free and adapt to suit your pupils' needs...