Eye-tracking analysis of source code reading on a line-by-line basis
Tanya Beelders · 2022
Code reading differs from natural language reading in that it is often not a linear reading process. As such, novices may not have already acquired all the skills necessary to read code in an optimal and efficient way. This study illustrates that novices read method signatures with less processing than code lines in the method body. Furthermore, they transition between all lines of code, rarely recognizing that some lines are irrelevant to the current line being read. An informal comparison with experts shows that experts are skilled at disregarding irrelevant lines to the current line being read. Furthermore, when reading a loop, novices will continuously read each line contained in the loop while experts will avoid re-reading simpler lines in successive iterations of the loop, rather concentrating on lines that contain higher computational complexity. This paper therefore shows additional differences between novices and experts and identifies some novel idiosyncrasies of novice code readers that should be taken into account during teaching.