[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ 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 2018 Publication 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.
[2]
Alan D. Baddeley. 2000. The episodic buffer: A new component of working memory? Trends in Cognitive Sciences 4, 11 (2000), 417--423.
[3]
Alan D. Baddeley. 2007. Working memory, thought, and action. Vol. 45. OUP Oxford.
[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.
[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.
[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.
[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.
[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.
[9]
Ruven Brooks. 1983. Towards a theory of the comprehension of computer programs. International Journal of Man-Machine Studies 18, 6 (1983), 543--554.
[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.
[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.
[12]
Jacob Cohen. 1988. Statistical power analysis for the behavioral sciences. Hilsdale. (1988).
[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.
[14]
Florian Deissenboeck and Markus Pizka. 2006. Concise and consistent naming. Software Quality Journal 14, 3 (2006), 261--282.
[15]
Eric Evans and Rafał Szpoton. 2015. Domain-driven design. Helion.
[16]
Richard K. Fjeldstad. 1983. Application program maintenance study: Report to our respondents. Proceedings GUIDE 48, 1983 (1983).
[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.
[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.
[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.
[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.
[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.
[22]
Robert C. Martin. 2009. Clean code: a handbook of agile software craftsmanship. Pearson Education.
[23]
Phillip Anthony Relf. 2004. Achieving software quality through source code readability. Quality Contract Manufacturing LLC (2004).
[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.
[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.
[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.

Cited By

View all
  • (2025)Toward a theory on programmer’s block inspired by writer’s blockEmpirical Software Engineering10.1007/s10664-024-10542-930:1Online publication date: 1-Feb-2025
  • (2024)A Quantitative Investigation of Trends in Confusing Variable Pairs Through Commits: Do Confusing Variable Pairs Survive?Proceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering10.1145/3661167.3661228(90-99)Online publication date: 18-Jun-2024
  • (2024)Promoting Deliberate Naming Practices in Programming Education: A Set of Interactive Educational ActivitiesProceedings of the 2024 on ACM Virtual Global Computing Education Conference V. 110.1145/3649165.3690115(235-241)Online publication date: 5-Dec-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 28 May 2018

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Java developers
  2. identifier names
  3. program comprehension
  4. software quality

Qualifiers

  • Research-article

Funding Sources

Conference

ICSE '18
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)78
  • Downloads (Last 6 weeks)20
Reflects downloads up to 13 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2025)Toward a theory on programmer’s block inspired by writer’s blockEmpirical Software Engineering10.1007/s10664-024-10542-930:1Online publication date: 1-Feb-2025
  • (2024)A Quantitative Investigation of Trends in Confusing Variable Pairs Through Commits: Do Confusing Variable Pairs Survive?Proceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering10.1145/3661167.3661228(90-99)Online publication date: 18-Jun-2024
  • (2024)Promoting Deliberate Naming Practices in Programming Education: A Set of Interactive Educational ActivitiesProceedings of the 2024 on ACM Virtual Global Computing Education Conference V. 110.1145/3649165.3690115(235-241)Online publication date: 5-Dec-2024
  • (2024)Variables and Variable Naming in Popular Programming Textbooks for Children and NovicesProceedings of the 2024 on ACM Virtual Global Computing Education Conference V. 110.1145/3649165.3690112(242-248)Online publication date: 5-Dec-2024
  • (2024)Teachers' Beliefs and Practices on the Naming of Variables in Introductory Python Programming CoursesProceedings of the 46th International Conference on Software Engineering: Software Engineering Education and Training10.1145/3639474.3640069(368-379)Online publication date: 14-Apr-2024
  • (2024)Using Program Comprehension Models to Teach ComprehensibilityProceedings of the 26th Australasian Computing Education Conference10.1145/3636243.3636244(1-10)Online publication date: 29-Jan-2024
  • (2024)Generating Function Names to Improve Comprehension of Synthesized Programs2024 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC)10.1109/VL/HCC60511.2024.00035(248-259)Online publication date: 2-Sep-2024
  • (2024)Deep learning based identification of inconsistent method names: How far are we?Empirical Software Engineering10.1007/s10664-024-10592-z30:1Online publication date: 25-Nov-2024
  • (2024)An intelligent java method name recommendation framework via two-phase neural networksEmpirical Software Engineering10.1007/s10664-024-10574-130:1Online publication date: 8-Nov-2024
  • (2024)An eye tracking study assessing source code readability rules for program comprehensionEmpirical Software Engineering10.1007/s10664-024-10532-x29:6Online publication date: 5-Oct-2024
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media