An approach for evaluating and suggesting method names using n-gram models

Method names are important for the software development process. It has been shown by some studies that the quality of method names affects software comprehension. In response, some approaches that evaluate comprehensibility of method names have been proposed. However, the effectiveness of existing approaches is limited because they focus on part of names. To deal with the limitation, we propose a novel approach for evaluating comprehensibility of method names and suggesting comprehensible method names using n-gram models. We implemented a prototype tool and conducted two experiments as a case study. Our experiments show that our approach can correctly evaluate 75% method names and successfully suggest 92% actual third words of method names.

[1]  David Binkley,et al.  An empirical study of rules for well-formed identifiers: Research Articles , 2007 .

[2]  Yann-Gaël Guéhéneuc,et al.  A New Family of Software Anti-patterns: Linguistic Anti-patterns , 2013, 2013 17th European Conference on Software Maintenance and Reengineering.

[3]  Christian Roth,et al.  Recommending rename refactorings , 2010, RSSE '10.

[4]  David W. Binkley,et al.  An empirical study of rules for well-formed identifiers , 2007, J. Softw. Maintenance Res. Pract..

[5]  David W. Binkley,et al.  Effective identifier names for comprehension and memory , 2007, Innovations in Systems and Software Engineering.

[6]  Adrian Kuhn,et al.  Automatic labeling of software components and their evolution using log-likelihood ratio of word frequencies in source code , 2009, 2009 6th IEEE International Working Conference on Mining Software Repositories.

[7]  Einar W. Høst,et al.  Debugging Method Names , 2009, ECOOP.

[8]  David W. Binkley,et al.  What’s in a Name? A Study of Identifiers , 2006, 14th IEEE International Conference on Program Comprehension (ICPC'06).

[9]  Paolo Tonella,et al.  Automated Identifier Completion and Replacement , 2013, 2013 17th European Conference on Software Maintenance and Reengineering.

[10]  Norman Wilde,et al.  The role of concepts in program comprehension , 2002, Proceedings 10th International Workshop on Program Comprehension.

[11]  Jihong Guan,et al.  Properly and Automatically Naming Java Methods: A Machine Learning Based Approach , 2012, ADMA.

[12]  Einar W. Høst,et al.  The Programmer's Lexicon, Volume I: The Verbs , 2007 .

[13]  Hinrich Schütze,et al.  Book Reviews: Foundations of Statistical Natural Language Processing , 1999, CL.

[14]  Andrew M. Kuhn,et al.  Code Complete , 2005, Technometrics.

[15]  Adrian Kuhn On recommending meaningful names in source and UML , 2010, RSSE '10.

[16]  Einar W. Høst,et al.  The Programmer's Lexicon, Volume I: The Verbs , 2007, Seventh IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2007).

[17]  Markus Pizka,et al.  Concise and consistent naming , 2005, 13th International Workshop on Program Comprehension (IWPC'05).