Developer Reading Behavior While Summarizing Java Methods: Size and Context Matters

An eye-tracking study of 18 developers reading and summarizing Java methods is presented. The developers provide a written summary for methods assigned to them. In total, 63 methods are used from five different systems. Previous studies on this topic use only short methods presented in isolation usually as images. In contrast, this work presents the study in the Eclipse IDE allowing access to all the source code in the system. The developer can navigate via scrolling and switching files while writing the summary. New eye-tracking infrastructure allows for this improvement in the study environment. Data collected includes eye gazes on source code, written summaries, and time to complete each summary. Unlike prior work that concluded developers focus on the signature the most, these results indicate that they tend to focus on the method body more than the signature. Moreover, both experts and novices tend to revisit control flow terms rather than reading them for a long period. They also spend a significant amount of gaze time and have higher gaze visits when they read call terms. Experts tend to revisit the body of the method significantly more frequently than its signature as the size of the method increases. Moreover, experts tend to write their summaries from source code lines that they read the most.

[1]  Collin McMillan,et al.  An empirical study of the textual similarity between source code and source code summaries , 2016, Empirical Software Engineering.

[2]  Andrew Begel,et al.  Eye movements in code review , 2018, EMIP@ETRA.

[3]  Brad A. Myers,et al.  An Exploratory Study of How Developers Seek, Relate, and Collect Relevant Information during Software Maintenance Tasks , 2006, IEEE Transactions on Software Engineering.

[4]  Lori L. Pollock,et al.  Automatic generation of natural language summaries for Java classes , 2013, 2013 21st International Conference on Program Comprehension (ICPC).

[5]  Yann-Gaël Guéhéneuc,et al.  A systematic literature review on the usage of eye-tracking in software engineering , 2015, Inf. Softw. Technol..

[6]  Thomas Fritz,et al.  Tracing software developers' eyes and interactions for change tasks , 2015, ESEC/SIGSOFT FSE.

[7]  Pontus Olsson,et al.  Real-time and Offline Filters for Eye Tracking , 2007 .

[8]  Markku Tukiainen,et al.  An eye-tracking methodology for characterizing program comprehension processes , 2006, ETRA.

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

[10]  Jonathan I. Maletic,et al.  iTrace: eye tracking infrastructure for development environments , 2018, ETRA.

[11]  Jeffrey C. Carver,et al.  Evaluating source code summarization techniques: Replication and expansion , 2013, 2013 21st International Conference on Program Comprehension (ICPC).

[12]  Collin McMillan,et al.  An Empirical Study on the Patterns of Eye Movement during Summarization Tasks , 2015, 2015 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM).

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

[14]  Thomas Fritz,et al.  Eye gaze and interaction contexts for change tasks - Observations and potential , 2017, J. Syst. Softw..

[15]  Bonita Sharif,et al.  iTrace: enabling eye tracking on software artifacts within the IDE to support software engineering tasks , 2015, ESEC/SIGSOFT FSE.

[16]  Danial Hooshyar,et al.  Mining biometric data to predict programmer expertise and task difficulty , 2017, Cluster Computing.

[17]  Andrew Begel,et al.  Eye Movements in Code Reading: Relaxing the Linear Order , 2015, 2015 IEEE 23rd International Conference on Program Comprehension.

[18]  Thomas D. LaToza,et al.  Maintaining mental models: a study of developer work habits , 2006, ICSE.

[19]  Emerson R. Murphy-Hill,et al.  Do Developers Read Compiler Error Messages? , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[20]  S. Siegel,et al.  Nonparametric Statistics for the Behavioral Sciences , 2022, The SAGE Encyclopedia of Research Design.

[21]  Emily Hill,et al.  Towards automatically generating summary comments for Java methods , 2010, ASE.

[22]  Jonathan I. Maletic,et al.  Lightweight Transformation and Fact Extraction with the srcML Toolkit , 2011, 2011 IEEE 11th International Working Conference on Source Code Analysis and Manipulation.

[23]  Andrew Begel,et al.  Cognitive Perspectives on the Role of Naming in Computer Programs , 2006, PPIG.

[24]  Yann-Gaël Guéhéneuc,et al.  Eye-Tracking Metrics in Software Engineering , 2015, 2015 Asia-Pacific Software Engineering Conference (APSEC).

[25]  Akito Monden,et al.  Analyzing individual performance of source code review using reviewers' eye movement , 2006, ETRA.

[26]  Abbas Heydarnoori,et al.  CrowdSummarizer: Automated Generation of Code Summaries for Java Programs through Crowdsourcing , 2017, IEEE Software.

[27]  Bonita Sharif,et al.  Eye movements in software traceability link recovery , 2017, Empirical Software Engineering.

[28]  Jonathan I. Maletic,et al.  Automatic identification of class stereotypes , 2010, 2010 IEEE International Conference on Software Maintenance.

[29]  H. Abdi The Kendall Rank Correlation Coefficient , 2007 .

[30]  Collin McMillan,et al.  Automatic documentation generation via source code summarization of method context , 2014, ICPC 2014.

[31]  Jonathan I. Maletic,et al.  An eye-tracking study on the role of scan time in finding source code defects , 2012, ETRA.

[32]  Jonathan I. Maletic,et al.  The Evaluation of an Approach for Automatic Generated Documentation , 2017, 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[33]  Jonathan I. Maletic,et al.  Reverse Engineering Method Stereotypes , 2006, 2006 22nd IEEE International Conference on Software Maintenance.

[34]  Xiaoran Wang,et al.  Developing a model of loop actions by mining loop characteristics from a large code corpus , 2015, 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[35]  Xiaoran Wang,et al.  Automatically generating natural language descriptions for object-related statement sequences , 2017, 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[36]  Nicolas Anquetil,et al.  A study of the documentation essential to software maintenance , 2005, SIGDOC '05.

[37]  Andrian Marcus,et al.  On the Use of Automated Text Summarization Techniques for Summarizing Source Code , 2010, 2010 17th Working Conference on Reverse Engineering.

[38]  Philip S. Yu,et al.  Improving Automatic Source Code Summarization via Deep Reinforcement Learning , 2018, 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE).

[39]  Jonathan I. Maletic,et al.  Using stereotypes in the automatic generation of natural language summaries for C++ methods , 2015, 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[40]  Peter C.-H. Cheng,et al.  A Survey on the Usage of Eye-Tracking in Computer Programming , 2018, ACM Comput. Surv..

[41]  Harald C. Gall,et al.  Do Code and Comments Co-Evolve? On the Relation between Source Code and Comment Changes , 2007, 14th Working Conference on Reverse Engineering (WCRE 2007).

[42]  Lori L. Pollock,et al.  Generating Parameter Comments and Integrating with Method Summaries , 2011, 2011 IEEE 19th International Conference on Program Comprehension.

[43]  Markku Tukiainen,et al.  Temporal eye-tracking data: evolution of debugging strategies with multiple representations , 2008, ETRA.

[44]  Collin McMillan,et al.  Improving automated source code summarization via an eye-tracking study of programmers , 2014, ICSE.

[45]  Collin McMillan,et al.  An Eye-Tracking Study of Java Programmers and Application to Source Code Summarization , 2015, IEEE Transactions on Software Engineering.

[46]  Lori L. Pollock,et al.  Automatically detecting and describing high level actions within methods , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[47]  Dror G. Feitelson,et al.  How programmers read regular code: a controlled experiment using eye tracking , 2015, Empirical Software Engineering.