Towards a Naming Quality Model

Sander Meester, S. Bouwmeester, Ana Oprescu, Magiel Bruntink · UvA-DARE (University of Amsterdam) · 2019

Having highly maintainable software decreases the time spent on development. Although various research efforts show that the names of identifiers play a large role in the readability and maintainability of code, code quality assessments often do not take these names into account. Although developers can usually quickly assess the quality of a name, the abstract nature of names makes a fully automated assessment difficult. This research investigates the creation of a general naming quality model. Our proposed model assesses: a) the syntactic quality of Java method names, b) how well a method body matches its name semantically. We assess this using 1) a set of guidelines from literature, 2) a machine learning algorithm trained on AST representations of method bodies. Initial results show that the combination of a rule-based approach and a deep learning model can correctly indicate what names need attention. By inspecting the names flagged as a violation by both approaches we found that the combination of syntactic and semantic information yields better results than either of them by themselves. Further validation experiments on a Github commit dataset show that the model can distinguish between good and bad names, but still has room for improvement.

Read the paper · More papers on PaperTik