Revise Computingrevisecomputing.co.uk
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates
At a glanceFeaturesStudentsPricingHow it worksFree GCSE notesExam dates

Knowledge organisers / Testing

Dry run tracing

All topicsPractise exam questions
Knowledge organiser

Testing

301.13c

Step through manually.

What you need to know

A dry run means stepping through code line by line on paper, recording variable values in a trace table. This helps find logic errors without running the program.

Key points

  • Create columns for each variable
  • Add a row for each line that changes a value
  • Include the output column for print statements
  • Follow loops iteration by iteration

Code examples

Dry run this code
python
x = 1
for i in range(3):
    x = x * 2
print(x)
# Trace: x=1 → x=2 → x=4 → x=8
# Output: 8