Testing algorithms with trace tables
A trace table tests an algorithm on paper before it becomes a program. You play the computer: carry out each step in order and write down every value a variable takes. This dry run (or desk check) shows whether the algorithm gives the right output, and Paper 1 asks for that output almost every year.
By the end of this page you can
- Set up a trace table with the right columns
- Trace assignments, IF statements and loops
- Fill in a trace table row by row
- Work out an algorithm’s output
Goals tick themselves off as you try the activities below.

Photo: ArnoldReinhold, CC BY-SA 4.0, via Wikimedia Commons. Cropped, student’s name blurred, resized, JPEG q72.
Before computers were close at hand, every program was checked line by line on paper. Exams still ask you to.
How often it shows up in past papers
Paper 1 counts come from our past-paper bank of CSEC Information Technology Paper 1s. The last-5 row shows how often it came up in the five most recent papers.
Inside this topic
- How to traceLocked
- Build a tracegameLocked
- Key termsLocked
- Test yourselfmarkedLocked
- Practise for real · 1 past questionLocked