Canonical Method Names for Java

Using Implementation Semantics to Identify Synonymous Verbs
  • Einar W. Høst
  • Bjarte M. Østvold
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6563)


Programmers rely on the conventional meanings of method names when writing programs. However, these conventional meanings are implicit and vague, leading to various forms of ambiguity. This is problematic since it hurts the readability and maintainability of programs. Java programmers would benefit greatly from a more well-defined vocabulary. Identifying synonyms in the vocabulary of verbs used in method names is a step towards this goal. By rooting the meaning of verbs in the semantics of a large number of methods taken from real-world Java applications, we find that such synonyms can readily be identified. To support our claims, we demonstrate automatic identification of synonym candidates. This could be used as a starting point for a manual canonicalisation process, where redundant verbs are eliminated from the vocabulary.


Java Programmer Probability Mass Function Method Implementation Semantic Object Abstract Language 
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.
    Abelson, H., Sussman, G.J.: Structure and Interpretation of Computer Programs. MIT Electrical Engineering and Computer Science, 2nd edn. MIT Press, Cambridge (1996)zbMATHGoogle Scholar
  2. 2.
    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
  3. 3.
    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
  4. 4.
    von Mayrhauser, A., Vans, A.M.: Program comprehension during software maintenance and evolution. Computer 28(8), 44–55 (1995)CrossRefGoogle Scholar
  5. 5.
    Lawrie, D., Morrell, C., Feild, H., Binkley, D.: Effective identifier names for comprehension and memory. ISSE 3(4), 303–318 (2007)Google Scholar
  6. 6.
    Martin, R.C.: Clean Code. Prentice-Hall, Englewood Cliffs (2008)Google Scholar
  7. 7.
    Beck, K.: Implementation Patterns. Addison-Wesley Professional, Reading (2007)Google Scholar
  8. 8.
    Høst, E.W., Østvold, B.M.: The programmer’s lexicon, volume I: The verbs. In: Proceedings of the 7th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2007), pp. 193–202. IEEE Computer Society, Los Alamitos (2007)CrossRefGoogle Scholar
  9. 9.
    Høst, E.W., Østvold, B.M.: The java programmer’s phrase book. In: Gašević, D., Lämmel, R., Van Wyk, E. (eds.) SLE 2008. LNCS, vol. 5452, pp. 322–341. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  10. 10.
    Høst, E.W., Østvold, B.M.: Debugging method names. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 294–317. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  11. 11.
    Steels, L.: The recruitment theory of language origins. In: Lyon, C., Nehaniv, C.L., Cangelosi, A. (eds.) Emergence of Language and Communication, pp. 129–151. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  12. 12.
    Cover, T.M., Thomas, J.A.: Elements of Information Theory, 2nd edn. Wiley Series in Telecommunications. Wiley, Chichester (2006)zbMATHGoogle Scholar
  13. 13.
    Gil, J., Maman, I.: Micro patterns in Java code. In: Proceedings of the 20th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2005), pp. 97–116. ACM, New York (2005)CrossRefGoogle Scholar
  14. 14.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley, Boston (1995)zbMATHGoogle Scholar
  15. 15.
    Singer, J., Brown, G., Lujan, M., Pocock, A., Yiapanis, P.: Fundamental nano-patterns to characterize and classify Java methods. In: Proceedings of the 9th Workshop on Language Descriptions, Tools and Applications (LDTA 2009), pp. 204–218 (2009)Google Scholar
  16. 16.
    Collberg, C., Myles, G., Stepp, M.: An empirical study of Java bytecode programs. Software Practice and Experience 37(6), 581–641 (2007)CrossRefGoogle Scholar
  17. 17.
    Singer, J., Kirkham, C.: Exploiting the correspondence between micro patterns and class names. In: Proceedings of the 8th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2008), pp. 67–76. IEEE Computer Society, Los Alamitos (2008)CrossRefGoogle Scholar
  18. 18.
    Pollock, L.L., Vijay-Shanker, K., Shepherd, D., Hill, E., Fry, Z.P., Maloor, K.: Introducing natural language program analysis. In: Das, M., Grossman, D. (eds.) Proceedings of the 7th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering (PASTE 2007), pp. 15–16. ACM, New York (2007)CrossRefGoogle Scholar
  19. 19.
    Shepherd, D., Pollock, L.L., Vijay-Shanker, K.: Towards supporting on-demand virtual remodularization using program graphs. In: Filman, R.E. (ed.) Proceedings of the 5th International Conference on Aspect-Oriented Software Development (AOSD 2006), pp. 3–14. ACM, New York (2006)CrossRefGoogle Scholar
  20. 20.
    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, New York (2007)CrossRefGoogle Scholar
  21. 21.
    Ma, H., Amor, R., Tempero, E.D.: Indexing the Java API using source code. In: Proceedings of the 19th Australian Software Engineering Conference (ASWEC 2008), pp. 451–460. IEEE Computer Society, Los Alamitos (2008)CrossRefGoogle Scholar
  22. 22.
    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, Los Alamitos (2005)CrossRefGoogle Scholar
  23. 23.
    Lawrie, D., Feild, H., Binkley, D.: Syntactic identifier conciseness and consistency. In: 6th IEEE International Workshop on Source Code Analysis and Manipulation (SCAM 2006), pp. 139–148. IEEE Computer Society, Los Alamitos (2006)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

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

Personalised recommendations