Naming Practices in Java Projects: An Empirical Study

  • Remo Gresta UFSJ
  • Vinicius Durelli UFSJ
  • Elder Cirilo UFSJ

Resumo


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.
Palavras-chave: naming identifiers, program comprehension, mining software repositories, empirical software engineering
Publicado
08/11/2021
GRESTA, Remo; DURELLI, Vinicius; CIRILO, Elder. Naming Practices in Java Projects: An Empirical Study. In: SIMPÓSIO BRASILEIRO DE QUALIDADE DE SOFTWARE (SBQS), 20. , 2021, Evento Online. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2021 . p. 91-100.