skip to main content
10.1145/3196321.3196332acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Descriptive compound identifier names improve source code comprehension

Published:28 May 2018Publication History

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.

References

  1. 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 ScholarGoogle Scholar
  2. Alan D. Baddeley. 2000. The episodic buffer: A new component of working memory? Trends in Cognitive Sciences 4, 11 (2000), 417--423.Google ScholarGoogle ScholarCross RefCross Ref
  3. Alan D. Baddeley. 2007. Working memory, thought, and action. Vol. 45. OUP Oxford.Google ScholarGoogle Scholar
  4. 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 ScholarGoogle ScholarCross RefCross Ref
  5. 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 ScholarGoogle ScholarCross RefCross Ref
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarCross RefCross Ref
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. Ruven Brooks. 1983. Towards a theory of the comprehension of computer programs. International Journal of Man-Machine Studies 18, 6 (1983), 543--554.Google ScholarGoogle ScholarCross RefCross Ref
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. Jacob Cohen. 1988. Statistical power analysis for the behavioral sciences. Hilsdale. (1988).Google ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. Florian Deissenboeck and Markus Pizka. 2006. Concise and consistent naming. Software Quality Journal 14, 3 (2006), 261--282. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Eric Evans and Rafał Szpoton. 2015. Domain-driven design. Helion.Google ScholarGoogle Scholar
  16. Richard K. Fjeldstad. 1983. Application program maintenance study: Report to our respondents. Proceedings GUIDE 48, 1983 (1983).Google ScholarGoogle Scholar
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle Scholar
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarCross RefCross Ref
  21. 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 ScholarGoogle Scholar
  22. Robert C. Martin. 2009. Clean code: a handbook of agile software craftsmanship. Pearson Education. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Phillip Anthony Relf. 2004. Achieving software quality through source code readability. Quality Contract Manufacturing LLC (2004). Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Descriptive compound identifier names improve source code comprehension

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            ICPC '18: Proceedings of the 26th Conference on Program Comprehension
            May 2018
            423 pages
            ISBN:9781450357142
            DOI:10.1145/3196321

            Copyright © 2018 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 28 May 2018

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Upcoming Conference

            ICSE 2025

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader