Identifier Renaming

Contextualizing Rename Decisions using Refactorings and Commit Messages

Identifier names are the atoms of comprehension; weak identifier names decrease productivity by increasing the chance that developers make mistakes and increasing the time taken to understand chunks of code. Therefore, it is important to support developers in naming, and renaming, identifiers. In this paper, we study how terms in an identifier are changed during the application of rename refactorings and contextualize these changes using co-occurring refactorings and commit messages. The goal of this work is to understand how different development activities affect the type of changes applied to names during a rename. The results of this study can help researchers understand more about developers' naming habits and allow stronger support for assisting developers in determining when to rename and what words to use.

This study has been accepted for publication at The 19th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM 2019)

Download Preprint
Presentation Slides

An Empirical Investigation of How and Why Developers Rename Identifiers

Renaming is vital to software maintenance and evolution. Developers rename entities when their original names no longer fit their behavioral role within the program. This may happen if the entity's original name was of poor quality or if the system has evolved such that the original name needs to be updated to reflect some of this evolution. In the end, the reason for the rename ultimately falls under increasing understandability and comprehension. Because comprehension is so important, and identifiers are the primary way developers comprehend code, it is critical to understand empirically how and why identifier names evolve. Armed with an understanding of these two facets of identifier evolution, researchers will be able to train algorithms to recognize, recommend, or even automatically generate high-quality identifier names. We present an empirical study of how method, class and package identifier names evolve to better understand the motives of their evolution. The empirical validation involves a set of 524,113 rename refactorings, performed on 3,795 Java systems. In a nutshell, our findings demonstrate that most rename refactorings narrow the meaning of the identifiers for which they are applied. Further, we analyze commit messages to contextualize these renames.

This study has been accepted for publication at The 2nd International Workshop on Refactoring (IWoR 2018)

Download Preprint | Download From ACM Digital Library