Eye-movement indices of reading while debugging Python source code

Jack Dempsey, Anna Tsiola, Nigel Bosch, Kiel Christianson, Mallory Stites

Research output: Contribution to journalArticlepeer-review

Abstract

Unlike text reading, the eye-movement behaviours associated with reading Python, a computer programming language, are largely understudied through a psycholinguistic lens. A general understanding of the eye movements involved in reading while troubleshooting Python, and how these behaviours compare to proofreading text, is critical for developing educational interventions and interactive tools for helping programmers debug their code. These data may also highlight to what extent humans use their underlying text reading ability when reading source code. The current work provides a profile of global reading behaviours associated with reading Python source code for debugging purposes. To this end, we recorded experienced programmers’ eye movements while they determined whether 21 different Python functions would produce the desired output, an incorrect output, or an error message. Some reading behaviours seem to mirror those found in text reading (e.g. effects of stimulus complexity), while others may be specific to reading code. Results suggest that semantic errors that produce undesired outputs in programming source code may influence early stages of processing, likely due to the largely top-down strategy employed by experienced programmers when reading source code. The findings are framed to invigorate discussion and further exploration into psycholinguistic analysis of human source code reading.

Original languageEnglish (US)
Pages (from-to)89-107
Number of pages19
JournalJournal of Cognitive Psychology
Volume37
Issue number2
DOIs
StatePublished - 2025

Keywords

  • Eye-tracking
  • debugging
  • programming languages
  • python
  • reading

ASJC Scopus subject areas

  • Experimental and Cognitive Psychology
  • Arts and Humanities (miscellaneous)

Fingerprint

Dive into the research topics of 'Eye-movement indices of reading while debugging Python source code'. Together they form a unique fingerprint.

Cite this