Dry run of an algorithm
Working through an algorithm by hand, line by line, using chosen test data as inputs and recording each step in a trace table, to see what it does and find logic errors without running it.
Understanding Dry run of an algorithm in IGCSE Computer Science Paper 2
What it does: During a dry run you do not type at a keyboard. You choose a test value such as 7 and treat it as the value entered by INPUT. Dry running with Total 10 and Count 2 gives 20 instead of 5, which shows the logic error: the line should use / not *. A dry run is done by hand, without a computer. You follow each line in order to see what the algorithm does. A trace table records each step. Each variable has its own column, and there is an OUTPUT column for anything displayed. Dry runs help you spot logic errors, where the algorithm runs but gives the wrong result. They do not change how fast a program runs.
Common mistakes: A FOR loop needs the keyword TO between the start and end values, so you cannot dry run this line. UNTIL belongs to REPEAT ... UNTIL. It should be FOR Count ← 1 TO 3. When you dry run with a test value such as 35, the algorithm must take that value as input. OUTPUT Temp never stores a value in Temp, so the IF has nothing to test. It should be INPUT Temp.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 71–82) and word search (Modules 71–92).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
dry runFill in the Blanks
Spot the Error
Student with a class code? Join your class →