Dry run techniques where you step through a program listing away from a computer are very powerful pedagogically as a way to teach programming as well as other computational topics (eg Turing Machines, algorithms, etc).
Two main approaches are
- role play the execution of aspects of a program
- draw dry run tables, showing the changing values of tables with a row for each line executed by the program
Role play is good as a way to give initial understanding of new programming concepts. Dry Running short program fragments then reinforces learning and acts as a diagnostic test to help students over barrier concepts.
Role playing dry runs
This video, part of the Box Variables activity, illustrates role playing the dry run of assignments
Diagnostic Tests / Puzzle Sheets
Use these kinds of sheets of simple dry run tests as a diagnostic test to catch problems with student mental models immediately, or just use them as puzzle sheets
- Puzzle Sheet: Python Assignment Dry Run Table Puzzles [PDF] TO PRINT
- Puzzle Sheet: Python Assignment Dry Run Table Puzzles[PDF FORM] TO DO ON COMPUTER
- Solution Sheet: Python Assignment Dry Run Table Solutions [PDF]
Slides from various times I have presented this talk
- Live LockDown Lecture2020: The importance of Dry Running Programs [PDF]
- CASLondon 2020: The Importance of Dry Running Programs [pdf]
Linked Activities – for more on the above