Search papers, labs, and topics across Lattice.
This study investigates the impact of commit granularity on refactoring detection by formalizing and measuring multi-commit "coarse-grained refactorings" (CGRs) and single-commit "ephemeral refactorings" (EPRs) across 32 open-source Java repositories. Evaluating granularity is critical because state-of-the-art mining tools operate predominantly on single commits, introducing systematic bias into software evolution analyses and training data curation. The analysis reveals that structural transformations (e.g., class splitting/merging and inheritance shifts) predominantly span multiple commits with only 20% flagged in commit messages, whereas localized variable-level edits dominate ephemeral patterns.
Single-commit detectors systematically miss major architectural refactorings—like class splits and inheritance restructuring—because developers spread complex structural edits across multiple commits without documenting them.
Detecting refactorings in commit history is essential to improve comprehension to code changes on code reviews, and to provide valuable information for empirical studies on software evolution. Techniques have been proposed to accurately detect refactorings on the granularity of a single commit. However, refactorings can be made over multiple commits because of their complexity or other practical development problems, which cause detecting on only the granularity of a single commit not enough. We observe that some refactorings can only be detected in coarser granularity, i.e., changes conducted over multiple commits, or in the granularity of a single commit but not in coarse-grained. We call these types of refactorings as coarse-grained refactorings (CGRs) and ephemeral refactorings (EPRs). We investigated the features and causes of CGRs and EPRs through an empirical study of 32 open-source Java projects and found that both commonly occur during development. In addition, we found that refactoring types related to splitting or merging classes and packages, as well as those involving modifications to the inheritance structure, tend to be CGRs, and types targeting small objects such as variables and attributes, and refactorings with context-sensitive detection criteria tend to be EPRs. The causes of CGRs and EPRs are analyzed and categorized, and the relationships between the commit messages of CGRs and themselves are also assessed. We found that about 20% of commit messages explicitly suggest the existence of CGRs. We suggest that CGRs and EPRs be valued in refactoring research and that detectors be extended to identify CGRs.