Investigating naming convention adherence in Java references

Naming conventions can help the readability and comprehension of code, and thus the onboarding of new developers. Conventions also provide cues that help developers and tools extract information from identifier names to support software maintenance. Tools exist to automatically check naming conventions but they are often limited to simple checks, e.g. regarding typography. The adherence to more elaborate conventions, such as the use of noun and verbal phrases in names, is not checked. We present Nominal, a naming convention checking library for Java that allows the declarative specification of conventions regarding typography and the use of abbreviations and phrases. To test Nominal, and to investigate the extent to which developers follow conventions, we extract 3.5 million reference - field, formal argument and local variable - name declarations from 60 FLOSS projects and determine their adherence to two well-known Java naming convention guidelines that give developers scope to choose a variety of forms of name, and sometimes offer conflicting advice. We found developers largely follow naming conventions, but adherence to specific conventions varies widely.

[1]  Robert D. Macredie,et al.  The effects of comments and identifier names on program comprehensibility: an experimental investigation , 1996, J. Program. Lang..

[2]  Emily Hill,et al.  AMAP: automatically mining abbreviation expansions in programs to enhance software maintenance tools , 2008, MSR '08.

[3]  Emily Hill,et al.  Mining source code to automatically split identifiers for software analysis , 2009, 2009 6th IEEE International Working Conference on Mining Software Repositories.

[4]  Yijun Yu,et al.  A Survey of the Forms of Java Reference Names , 2015, 2015 IEEE 23rd International Conference on Program Comprehension.

[5]  Paolo Tonella,et al.  Natural Language Parsing of Program Element Names for Concept Extraction , 2010, 2010 IEEE 18th International Conference on Program Comprehension.

[6]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[7]  Scott W. Ambler,et al.  The Elements of Java Style , 2000 .

[8]  Lori Pollock,et al.  Integrating natural language and program structure information to improve software search and exploration , 2010 .

[9]  Andrew Begel,et al.  Cognitive Perspectives on the Role of Naming in Computer Programs , 2006, PPIG.

[10]  David W. Binkley,et al.  Improving identifier informativeness using part of speech information , 2011, MSR '11.

[11]  Phillip A. Relf,et al.  Tool assisted identifier naming for improved software readability: an empirical study , 2005, 2005 International Symposium on Empirical Software Engineering, 2005..

[12]  Guy L. Steele,et al.  The Java Language Specification, Java SE 8 Edition , 2013 .

[13]  Yijun Yu,et al.  Mining java class naming conventions , 2011, 2011 27th IEEE International Conference on Software Maintenance (ICSM).

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

[15]  Yijun Yu,et al.  Improving the Tokenisation of Identifier Names , 2011, ECOOP.

[16]  Scott W. Ambler,et al.  The Elements of Java™ Style: Index , 2000 .

[17]  Dan Klein,et al.  Accurate Unlexicalized Parsing , 2003, ACL.

[18]  Einar W. Høst,et al.  The Java Programmer's Phrase Book , 2009, SLE.

[19]  Charles A. Sutton,et al.  Learning natural coding conventions , 2014, SIGSOFT FSE.

[20]  Yijun Yu,et al.  INVocD: Identifier name vocabulary dataset , 2013, 2013 10th Working Conference on Mining Software Repositories (MSR).