Naming Practices in Java Projects: An Empirical Study - Gresta, Remo; Durelli, Vinicius; Cirilo, Elder (Anais do Simpósio Brasileiro de Qualidade de Software (SBQS), 2021)
Investigating the properties of identifier names and their role in software systems have been central to software engineering. Research in naming identifiers shows that informative names are crucial to improving the readability and maintainability of programs: essentially, intention-revealing names make code easier to understand and act as a basic form of documentation. Poorly named identifiers tend to hurt the comprehensibility and maintainability of software systems. However, most computer science curricula emphasize programming concepts and language syntax over naming guidelines and conventions. Consequently, programmers lack knowledge about naming practices. We carried out a study to explore the naming practices of Java programmers. We analyzed 1,421,607 identifier names (i.e., attributes, parameters, and variables names) from 40 open-source Java projects and categorized these names into eight naming practices. We examined the occurrence and prevalence of the categories across projects, and our results also highlight in which contexts identifiers following each naming practice tend to appear more regularly. The results can be helpful to enhance programmers’ awareness and contribute to improving educational materials and code review methods.