Debugging Method Names

  • Einar W. Høst
  • Bjarte M. Østvold
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5653)


Meaningful method names are crucial for the readability and maintainability of software. Existing naming conventions focus on syntactic details, leaving programmers with little or no support in assuring meaningful names. In this paper, we show that naming conventions can go much further: we can mechanically check whether or not a method name and implementation are likely to be good matches for each other. The vast amount of software written in Java defines an implicit convention for pairing names and implementations. We exploit this to extract rules for method names, which are used to identify “naming bugs” in well-known Java applications. We also present an approach for automatic suggestion of more suitable names in the presence of mismatch between name and implementation.


Java Programmer Semantic Distance Rule Violation Java Application Candidate Phrase 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bajracharya, S.K., Ngo, T.C., Linstead, E., Dou, Y., Rigor, P., Baldi, P., Lopes, C.V.: Sourcerer: a search engine for open source code supporting structure-based search. In: Tarr, P.L., Cook, W.R. (eds.) OOPSLA Companion, pp. 681–682. ACM Press, New York (2006)Google Scholar
  2. 2.
    Beck, K.: Implementation Patterns. Addison-Wesley Professional, Reading (2007)Google Scholar
  3. 3.
    Bloch, J.: Effective Java. Prentice-Hall, Englewood Cliffs (2008)Google Scholar
  4. 4.
    Caprile, B., Tonella, P.: Nomen est omen: Analyzing the language of function identifiers. In: Proceedings of the Sixth Working Conference on Reverse Engineering (WCRE 1999), Atlanta, Georgia, USA, 6-8 October 1999, pp. 112–122. IEEE Computer Society Press, Los Alamitos (1999)Google Scholar
  5. 5.
    Collar, E., Valerdi, R.: Role of software readability on software development cost. In: Proceedings of the 21st Forum on COCOMO and Software Cost Modeling, Herndon, VA (October 2006)Google Scholar
  6. 6.
    Deißenböck, F., Pizka, M.: Concise and consistent naming. In: Proceedings of the 13th IEEE International Workshop on Program Comprehension (IWPC 2005), pp. 97–106. IEEE Computer Society Press, Los Alamitos (2005)CrossRefGoogle Scholar
  7. 7.
    Eierman, M.A., Dishaw, M.T.: The process of software maintenance: a comparison of object-oriented and third-generation development languages. Journal of Software Maintenance and Evolution: Research and Practice 19(1), 33–47 (2007)CrossRefGoogle Scholar
  8. 8.
    Fellbaum, C.: WordNet: An Electronic Lexical Database. MIT Press, Cambridge (1998)zbMATHGoogle Scholar
  9. 9.
    Frege, G.: On sense and reference. In: Geach, P., Black, M. (eds.) Translations from the Philosophical Writings of Gottlob Frege, pp. 56–78. Blackwell, Malden (1952)Google Scholar
  10. 10.
    Gil, J., Maman, I.: Micro patterns in Java code. In: Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2005), San Diego, CA, USA, October 16-20, 2005, pp. 97–116. ACM Press, New York (2005)CrossRefGoogle Scholar
  11. 11.
    Høst, E.W., Østvold, B.M.: The programmer’s lexicon, volume I: The verbs. In: Proceedings of the Seventh IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2007), Washington, DC, USA, pp. 193–202. IEEE Computer Society, Los Alamitos (2007)CrossRefGoogle Scholar
  12. 12.
    Høst, E.W., Østvold, B.M.: The Java programmer’s phrase book. In: Proceedings of the 1st International Conference on Software Language Engineering (SLE 2008), Springer, Heidelberg (2008)Google Scholar
  13. 13.
    Lawrie, D., Feild, H., Binkley, D.: Quantifying identifier quality: An analysis of trends. Journal of Empirical Software Engineering 12(4), 359–388 (2007)CrossRefGoogle Scholar
  14. 14.
    Lawrie, D., Morrell, C., Feild, H., Binkley, D.: What’s in a name? A study of identifiers. In: Proceedings of the 14th International Conference on Program Comprehension (ICPC 2006), Athens, Greece, 14-16 June 2006, pp. 3–12. IEEE Computer Society Press, Los Alamitos (2006)CrossRefGoogle Scholar
  15. 15.
    Liblit, B., Begel, A., Sweeser, E.: Cognitive perspectives on the role of naming in computer programs. In: Proceedings of the 18th Annual Psychology of Programming Workshop, Sussex, United Kingdom, September 2006, Psychology of Programming Interest Group (2006)Google Scholar
  16. 16.
    Ma, H., Amor, R., Tempero, E.D.: Indexing the Java API using source code. In: Australian Software Engineering Conference, pp. 451–460. IEEE Computer Society Press, Los Alamitos (2008)Google Scholar
  17. 17.
    Manning, C.D., Schuetze, H.: Foundations of Statistical Natural Language Processing. MIT Press, Cambridge (1999)Google Scholar
  18. 18.
    Martin, R.C.: Clean Code. Prentice-Hall, Englewood Cliffs (2008)Google Scholar
  19. 19.
    McConnell, S.: Code Complete: A Practical Handbook of Software Construction, 2nd edn. Microsoft Press (2004)Google Scholar
  20. 20.
    Pollock, L.L., Vijay-Shanker, K., Shepherd, D., Hill, E., Fry, Z.P., Maloor, K.: Introducing natural language program analysis. In: Proceedings of the 7th ACM Workshop on Program Analysis for Software Tools and Engineering (PASTE 2007), San Diego, California, USA, 2007, June 13-14, 2007, pp. 15–16. ACM, New York (2007)Google Scholar
  21. 21.
    Reiss, S.P.: Finding unusual code. In: Proceedings of the 23rd IEEE International Conference on Software Maintenance (ICSM 2007), pp. 34–43. IEEE Computer Society Press, Los Alamitos (2007)Google Scholar
  22. 22.
    Shepherd, D., Fry, Z.P., Hill, E., Pollock, L., Vijay-Shanker, K.: Using natural language program analysis to locate and understand action-oriented concerns. In: Proceedings of the 6th international conference on Aspect-oriented software development (AOSD 2007), pp. 212–224. ACM Press, New York (2007)CrossRefGoogle Scholar
  23. 23.
    Shepherd, D., Pollock, L.L., Vijay-Shanker, K.: Towards supporting on-demand virtual remodularization using program graphs. In: Proceedings of the 5th International Conference on Aspect-Oriented Software Development (AOSD 2006), pp. 3–14. ACM Press, New York (2006)CrossRefGoogle Scholar
  24. 24.
    Singer, J., Kirkham, C.: Exploiting the correspondence between micro patterns and class names. In: Proceedings of the Eight IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2008), pp. 67–76. IEEE Computer Society Press, Los Alamitos (2008)CrossRefGoogle Scholar
  25. 25.
    Surowiecki, J.: The Wisdom of Crowds. Anchor (2005)Google Scholar
  26. 26.
    Witten, I.H., Frank, E.: Data Mining: Practical Machine Learning Tools and Techniques, 2nd edn. Morgan Kaufmann, San Francisco (2005)zbMATHGoogle Scholar
  27. 27.
    Wittgenstein, L.: Philosophical Investigations. Prentice-Hall, Englewood Cliffs (1973)zbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Einar W. Høst
    • 1
  • Bjarte M. Østvold
    • 1
  1. 1.Norwegian Computing CenterNorway

Personalised recommendations