Skip to main content

Advertisement

Log in

Effective identifier names for comprehension and memory

  • Original Paper
  • Published:
Innovations in Systems and Software Engineering Aims and scope Submit manuscript

Abstract

Readers of programs have two main sources of domain information: identifier names and comments. When functions are uncommented, as many are, comprehension is almost exclusively dependent on the identifier names. Assuming that writers of programs want to create quality identifiers (e.g., identifiers that include relevant domain knowledge), one must ask how should they go about it. For example, do the initials of a concept name provide enough information to represent the concept? If not, and a longer identifier is needed, is an abbreviation satisfactory or does the concept need to be captured in an identifier that includes full words? What is the effect of longer identifiers on limited short term memory capacity? Results from a study designed to investigate these questions are reported. The study involved over 100 programmers who were asked to describe 12 different functions and then recall identifiers that appeared in each function. The functions used three different levels of identifiers: single letters, abbreviations, and full words. Responses allow the extent of comprehension associated with the different levels to be studied along with their impact on memory. The functions used in the study include standard computer science textbook algorithms and functions extracted from production code. The results show that full-word identifiers lead to the best comprehension; however, in many cases, there is no statistical difference between using full words and abbreviations. When considered in the light of limited human short-term memory, well-chosen abbreviations may be preferable in some situations since identifiers with fewer syllables are easier to remember.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Anquetil N, Lethbridge T (1998) Assessing the relevance of identifier names in a legacy software system. In: Proceedings of the 1998 conference of the Centre for Advanced Studies on Collaborative Research, Toronto

  2. Butler G, Grogono P, Shinghal R, Tjandra I (1995) Retrieving information from data flow diagrams. In: Working conference on reverse engineering, November

  3. Caprile B, Tonella P (1999) Nomen est omen: analyzing the language of function identifiers. In: Working Conference on Reverse Engineering, Altanta, Georgia, USA, October

  4. Caprile B, Tonella P (2000) Restructuring program identifier names. In: ICSM

  5. Cowan N (2001) The magical number 4 in short-term memory: a reconsideration of mental storage capacity. Behav Brain Sci 24(1)

  6. Deißenböck F., Pizka M (2005) Concise and consistent naming. In: Proceedings of the 13th international workshop on program comprehension (IWPC 2005). IEEE Computer Society, St. Louis, May 2005

  7. Jones D (2004) Memory for a short sequence of assignment statements. C Vu 16(6)

  8. Knuth D (2003) Selected papers on computer languages. Center for the Study of Language and Information (CSLI Lecture Notes, vol 139). Stanford, California

  9. Landis, JR, Koch, GG (1977) The measurement of observer agreement for categorical data. Biometrics 33(1)

  10. Lawrie D, Feild H, Binkley D (2007) An empirical study of rules for well-formed identifiers. J Softw Maint Evol Res Pract 19(4)

  11. Mitchell T (1997). Machine learning. WCB McGraw-Hill, New York

    MATH  Google Scholar 

  12. Morrell, C, Pearson, J, Brant, L, (1997) Linear transformation of linear mixed effects models. Am Stat 51(4)

  13. De Palma P (2001) Why women avoid computer science. Commun ACM 44(6)

  14. Rilling J, Klemola T (2003) Identifying comprehension bottlenecks using program slicing and cognitive complexity metrics. In: Proceedings of the 11th IEEE international workshop on program comprehension, Portland, May

  15. Saiedan H and Mc Clanahan LM (1996). Frameworks for quality software process: SEI capability maturity model. Softw Qual J 5(1): 1

    Article  Google Scholar 

  16. Silberman S (2001) The geek syndrome. Wired 9(12)

  17. Sjøberg D, Hannay J, Hansen O, Kampenes V, Karahasanovic A, Liborg N, Rekdal A (1993) A survey of controlled experiments in software engineering. IEEE Trans Softw Eng 19(4)

  18. Sneed H (1996) Object-oriented cobol recycling. In: 3rd Working Conference on Reverse Engineering. IEEE Computer Society, St. Louis

  19. Takang A, Grubb P, Macredie R (1996) The effects of comments and identifier names on program comprehensibility: an experiential study. J Program Lang 4(3)

  20. Verbeke G and Molenberghs G (2001). Linear mixed models for longitudinal data. Springer, New York

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dawn Lawrie.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Lawrie, D., Morrell, C., Feild, H. et al. Effective identifier names for comprehension and memory. Innovations Syst Softw Eng 3, 303–318 (2007). https://doi.org/10.1007/s11334-007-0031-2

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11334-007-0031-2

Keywords

Navigation