Advertisement

Innovations in Systems and Software Engineering

, Volume 3, Issue 4, pp 303–318 | Cite as

Effective identifier names for comprehension and memory

  • Dawn Lawrie
  • Christopher Morrell
  • Henry Feild
  • David Binkley
Original Paper

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.

Keywords

Program comprehension Software quality Quality assessment 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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, TorontoGoogle Scholar
  2. 2.
    Butler G, Grogono P, Shinghal R, Tjandra I (1995) Retrieving information from data flow diagrams. In: Working conference on reverse engineering, NovemberGoogle Scholar
  3. 3.
    Caprile B, Tonella P (1999) Nomen est omen: analyzing the language of function identifiers. In: Working Conference on Reverse Engineering, Altanta, Georgia, USA, OctoberGoogle Scholar
  4. 4.
    Caprile B, Tonella P (2000) Restructuring program identifier names. In: ICSMGoogle Scholar
  5. 5.
    Cowan N (2001) The magical number 4 in short-term memory: a reconsideration of mental storage capacity. Behav Brain Sci 24(1)Google Scholar
  6. 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 2005Google Scholar
  7. 7.
    Jones D (2004) Memory for a short sequence of assignment statements. C Vu 16(6)Google Scholar
  8. 8.
    Knuth D (2003) Selected papers on computer languages. Center for the Study of Language and Information (CSLI Lecture Notes, vol 139). Stanford, CaliforniaGoogle Scholar
  9. 9.
    Landis, JR, Koch, GG (1977) The measurement of observer agreement for categorical data. Biometrics 33(1)Google Scholar
  10. 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)Google Scholar
  11. 11.
    Mitchell T (1997). Machine learning. WCB McGraw-Hill, New York zbMATHGoogle Scholar
  12. 12.
    Morrell, C, Pearson, J, Brant, L, (1997) Linear transformation of linear mixed effects models. Am Stat 51(4)Google Scholar
  13. 13.
    De Palma P (2001) Why women avoid computer science. Commun ACM 44(6)Google Scholar
  14. 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, MayGoogle Scholar
  15. 15.
    Saiedan H and Mc Clanahan LM (1996). Frameworks for quality software process: SEI capability maturity model. Softw Qual J 5(1): 1 CrossRefGoogle Scholar
  16. 16.
    Silberman S (2001) The geek syndrome. Wired 9(12)Google Scholar
  17. 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)Google Scholar
  18. 18.
    Sneed H (1996) Object-oriented cobol recycling. In: 3rd Working Conference on Reverse Engineering. IEEE Computer Society, St. LouisGoogle Scholar
  19. 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)Google Scholar
  20. 20.
    Verbeke G and Molenberghs G (2001). Linear mixed models for longitudinal data. Springer, New York Google Scholar

Copyright information

© Springer-Verlag London Limited 2007

Authors and Affiliations

  • Dawn Lawrie
    • 1
  • Christopher Morrell
    • 2
  • Henry Feild
    • 1
  • David Binkley
    • 1
  1. 1.Computer Science DepartmentLoyola CollegeBaltimoreUSA
  2. 2.Mathematical Sciences DepartmentLoyola CollegeBaltimoreUSA

Personalised recommendations