What influences dwell time during source code reading?: analysis of element type and frequency as factors

While knowledge about reading behavior in natural-language text is abundant, little is known about the visual attention distribution when reading source code of computer programs. Yet, this knowledge is important for teaching programming skills as well as designing IDEs and programming languages. We conducted a study in which 15 programmers with various expertise read short source codes and recorded their eye movements. In order to study attention distribution on code elements, we introduced the following procedure: First we (pre)-processed the eye movement data using log-transformation. Taking into account the word lengths, we then analyzed the time spent on different lexical elements. It shows that most attention is oriented towards understanding of identifiers, operators, keywords and literals, relatively little reading time is spent on separators. We further inspected the attention on keywords and provide a description of the gaze on these primary building blocks for any formal language. The analysis indicates that approaches from research on natural-language text reading can be applied to source code as well, however not without review.

[1]  Jean Scholtz,et al.  Characteristics of the Mental Representations of Novice and Expert Programmers: An Empirical Study , 1993, Int. J. Man Mach. Stud..

[2]  Jean Scholtz,et al.  The Roles Beacons Play in Comprehension for Novice and Expert Programmers , 2002, PPIG.

[3]  Akito Monden,et al.  Exploiting Eye Movements for Evaluating Reviewer's Performance in Software Review , 2007, IEICE Trans. Fundam. Electron. Commun. Comput. Sci..

[4]  Roman Bednarik,et al.  Expertise-dependent visual attention strategies develop over time during debugging with multiple code representations , 2012, Int. J. Hum. Comput. Stud..

[5]  Dawn J. Lawrie,et al.  The impact of identifier style on effort and comprehension , 2012, Empirical Software Engineering.

[6]  Gerald M. Weinberg,et al.  Goals and Performance in Computer Programming , 1974 .

[7]  Teresa Busjahn,et al.  The use of code reading in teaching programming , 2013, Koli Calling '13.

[8]  K. Rayner,et al.  Lexical complexity and fixation times in reading: Effects of word frequency, verb complexity, and lexical ambiguity , 1986, Memory & cognition.

[9]  Anneliese Amschler Andrews,et al.  A Coding Scheme to Support Systematic Analysis of Software Comprehension , 1999, IEEE Trans. Software Eng..

[10]  K. Rayner Eye movements in reading and information processing: 20 years of research. , 1998, Psychological bulletin.

[11]  Andreas Busjahn,et al.  Analysis of code reading to gain more insight in program comprehension , 2011, Koli Calling.

[12]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[13]  Martha E. Crosby,et al.  How do we read algorithms? A case study , 1990, Computer.

[14]  Kenneth Holmqvist,et al.  Eye tracking: a comprehensive guide to methods and measures , 2011 .