Cambridge O Level Computer Science · Syllabus 2210 · Algorithm Design and Problem-Solving
Trace Table
What is Trace Table?
A table used to record a dry run of an algorithm, with a column for each variable of interest and further columns for conditions, outputs and user prompts, and a row for each executed step, filled in by following the algorithm exactly one statement at a time rather than by predicting the final result.
This definition is part of the Algorithm Design and Problem-Solving chapter in Cambridge O Level Computer Science.
Trace Table in context
Topic 7 is about the work that happens before and around writing code. You analyse a problem (identify it, strip away what does not matter, break it into parts, and name the inputs, processes, outputs and storage), you design a solution (structure diagram, flowchart, pseudocode), you code it, and you test it with data you chose on purpose. Along the way you use a small fixed set of standard methods — linear search, bubble sort, totalling, counting, maximum, minimum, average — you protect the input with validation and verification, and you prove behaviour with trace tables and with normal, abnormal, extreme and boundary test data. Nothing in this topic requires you to be fluent in a programming language; it requires you to be exact.
A dry run is following an algorithm by hand, one executed statement at a time, exactly as a computer would. A trace table is the record of that dry run: a column for each variable of interest, plus columns for conditions, outputs and user prompts as required, and a row for each step. The whole value of the technique comes from one discipline: you write down what the algorithm does, not what you think it is supposed to do.
Common mistakes with Trace Table
- M21. “A dry run means working out what the final answer should be, and a trace table records only the final values.” Correct A dry run follows the algorithm one executed statement at a time, and a trace table records every change, every condition result, every prompt and every output along the way. Why it matters Trace-table questions almost always use a defective algorithm. Writing down the answer you expected is exactly how the fault is missed.
Questions students ask about Trace Table
What is the difference between a dry run and testing?
A dry run is done by hand, on paper, following the algorithm statement by statement — usually recorded in a trace table. Testing runs the actual program on a computer with chosen test data. A dry run finds logic faults before any code exists, which is exactly why it belongs to the design stage as well as to debugging.

