ABSTRACT
Reading and understanding source code is a major task in software development. Code comprehension depends on the quality of code, which is impacted by code structure and identifier naming. In this paper we empirically investigated whether longer but more descriptive identifier names improve code comprehension compared to short names, as they represent useful information in more detail. In a web-based study 88 Java developers were asked to locate a semantic defect in source code snippets. With descriptive identifier names, developers spent more time in the lines of code before the actual defect occurred and changed their reading direction less often, finding the semantic defect about 14% faster than with shorter but less descriptive identifier names. These effects disappeared when developers searched for a syntax error, i.e., when no in-depth understanding of the code was required. Interestingly, the style of identifier names had a clear impact on program comprehension for more experienced developers but not for less experienced developers.
- Hirohisa Aman, Sousuke Amasaki, Tomoyuki Yokogawa, and Minoru Kawahara. 2016. Local variables with compound names and comments as signs of fault-prone Java methods. In Joint Proceedings of the 4th International Workshop on Quantitative Approaches to Software Quality and 1st International Workshop on Technical Debt Analytics. 4--11.Google Scholar
- Alan D. Baddeley. 2000. The episodic buffer: A new component of working memory? Trends in Cognitive Sciences 4, 11 (2000), 417--423.Google ScholarCross Ref
- Alan D. Baddeley. 2007. Working memory, thought, and action. Vol. 45. OUP Oxford.Google Scholar
- Alan D. Baddeley, Robert Logie, Ian Nimmo-Smith, and Neil Brereton. 1985. Components of fluent reading. Journal of Memory and Language 24, 1 (1985), 119--131.Google ScholarCross Ref
- Alan D. Baddeley, Neil Thomson, and Mary Buchanan. 1975. Word length and the structure of short-term memory. Journal of Verbal Learning and Verbal Behavior 14, 6 (1975), 575--589.Google ScholarCross Ref
- Dave Binkley, Marcia Davis, Dawn Lawrie, Jonathan I. Maletic, Christopher Morrell, and Bonita Sharif. 2013. The impact of identifier style on effort and comprehension. Empirical Software Engineering 18, 2 (2013), 219--276. Google ScholarDigital Library
- Dave Binkley, Marcia Davis, Dawn Lawrie, and Christopher Morrell. 2009. To camelCase or under_score. In 17th International Conference on Program Comprehension (ICPC '09). IEEE, 158--167.Google ScholarCross Ref
- Dave Binkley, Dawn Lawrie, Steve Maex, and Christopher Morrell. 2009. Identifier length and limited programmer memory. Science of Computer Programming 74, 7 (2009), 430--445. Google ScholarDigital Library
- Ruven Brooks. 1983. Towards a theory of the comprehension of computer programs. International Journal of Man-Machine Studies 18, 6 (1983), 543--554.Google ScholarCross Ref
- Simon Butler, Michel Wermelinger, Yijun Yu, and Helen Sharp. 2009. Relating identifier naming flaws and code quality: An empirical study. In 16th Working Conference on Reverse Engineering (WCRE '09). IEEE, 31--35. Google ScholarDigital Library
- Simon Butler, Michel Wermelinger, Yijun Yu, and Helen Sharp. 2010. Exploring the influence of identifier names on code quality: An empirical study. In 14th European Conference on Software Maintenance and Reengineering (CSMR '10). IEEE, 156--165. Google ScholarDigital Library
- Jacob Cohen. 1988. Statistical power analysis for the behavioral sciences. Hilsdale. (1988).Google Scholar
- Meredyth Daneman and Patricia A. Carpenter. 1980. Individual differences in working memory and reading. Journal of Verbal Learning and Verbal Behavior 19, 4 (1980), 450--466.Google ScholarCross Ref
- Florian Deissenboeck and Markus Pizka. 2006. Concise and consistent naming. Software Quality Journal 14, 3 (2006), 261--282. Google ScholarDigital Library
- Eric Evans and Rafał Szpoton. 2015. Domain-driven design. Helion.Google Scholar
- Richard K. Fjeldstad. 1983. Application program maintenance study: Report to our respondents. Proceedings GUIDE 48, 1983 (1983).Google Scholar
- Johannes C. N. Hofmeister, Janet Siegmund, and Daniel V. Holt. 2017. Shorter identifier names take longer to comprehend. In 24th International Conference on Software Analysis, Evolution, and Reengineering (SANER '17). IEEE, 217--227.Google Scholar
- Anthony R. Jansen, Alan F. Blackwell, and Kim Marriott. 2003. A tool for tracking visual attention: The Restricted Focus Viewer. Behavior Research Methods 35, 1 (2003), 57--69.Google Scholar
- Dawn Lawrie, Christopher Morrell, Henry Feild, and David Binkley. 2006. What's in a name? A study of identifiers. In 14th International Conference on Program Comprehension (ICPC '06). IEEE, 3--12. Google ScholarDigital Library
- Dawn Lawrie, Christopher Morrell, Henry Feild, and David Binkley. 2007. Effective identifier names for comprehension and memory. Innovations in Systems and Software Engineering 3, 4 (2007), 303--318.Google ScholarCross Ref
- Ben Liblit, Andrew Begel, and Eve Sweetser. 2006. Cognitive perspectives on the role of naming in computer programs. In Proceedings of the 18th Annual Psychology of Programming Workshop.Google Scholar
- Robert C. Martin. 2009. Clean code: a handbook of agile software craftsmanship. Pearson Education. Google ScholarDigital Library
- Phillip Anthony Relf. 2004. Achieving software quality through source code readability. Quality Contract Manufacturing LLC (2004). Google ScholarDigital Library
- Teresa M. Shaft and Iris Vessey. 1995. The relevance of application domain knowledge: The case of computer program comprehension. Information Systems Research 6, 3 (1995), 286--299. Google ScholarDigital Library
- Bonita Sharif and Jonathan I. Maletic. 2010. An eye-tracking study on camelCase and under_score identifier styles. In 18th International Conference OnProgram Comprehension (ICPC '10). IEEE, 196--205. Google ScholarDigital Library
- Ben Shneiderman and Richard Mayer. 1979. Syntactic/semantic interactions in programmer behavior: A model and experimental results. International Journal of Computer & Information Sciences 8, 3 (1979), 219--238.Google ScholarCross Ref
Index Terms
- Descriptive compound identifier names improve source code comprehension
Recommendations
Shorter identifier names take longer to comprehend
Developers spend the majority of their time reading code, a process in which identifier names play a key role. Although many identifier naming styles exist, they often lack an empirical basis and it is not clear whether short or long identifier names ...
Studying abbreviated vs. full-word identifier names when dealing with faults: an external replication
ESEM '14: Proceedings of the 8th ACM/IEEE International Symposium on Empirical Software Engineering and MeasurementContext: abbreviated and full-word identifier names in dealing with faults in source code. Goal: investigating whether the use of abbreviated identifier names affects the ability of novice professional software developers in identifying and fixing ...
A Survey of the Forms of Java Reference Names
ICPC '15: Proceedings of the 2015 IEEE 23rd International Conference on Program ComprehensionThe readability of identifiers is a major factor of program comprehension and an aim of naming convention guidelines. Due to their semantic content, identifiers are also used in feature and bug location, among other software maintenance tasks. Looking ...
Comments