arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2609.07482cs.SE

重构检测中变更粒度影响的实证研究

An Empirical Study on the Impact of Change Granularity in Refactoring Detection

Lei Chen, Shinpei Hayashi

首次发表
浏览论文内容

中文总结 AI 辅助

通过实证研究32个Java项目,发现跨提交的粗粒度重构和短暂重构普遍存在,并分析了其特征、成因及提交消息关联,建议扩展检测器以识别粗粒度重构。

中文摘要 AI 辅助

在提交历史中检测重构对于提高代码审查中对代码变更的理解,以及为软件演化的实证研究提供有价值的信息至关重要。已有技术能够在单个提交的粒度上准确检测重构。然而,由于重构的复杂性或其他实际开发问题,重构可能跨越多个提交完成,这导致仅在单个提交粒度上进行检测是不够的。我们观察到,某些重构只能在更粗的粒度(即跨多个提交的变更)下被检测到,或者只能在单个提交粒度下检测到而在粗粒度下无法检测。我们将这些类型的重构分别称为粗粒度重构(CGRs)和短暂重构(EPRs)。我们通过对32个开源Java项目的实证研究,调查了CGRs和EPRs的特征和成因,发现这两类重构在开发过程中都普遍发生。此外,我们发现与拆分或合并类和包相关的重构类型,以及涉及继承结构修改的重构类型,往往属于CGRs;而针对变量和属性等小对象的重构类型,以及具有上下文敏感检测标准的重构,往往属于EPRs。我们对CGRs和EPRs的成因进行了分析和分类,并评估了CGRs的提交消息与其自身之间的关系。我们发现约20%的提交消息明确暗示了CGRs的存在。我们建议在重构研究中重视CGRs和EPRs,并扩展检测器以识别CGRs。

英文摘要

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.

发表机构

  • School of Computing, Institute of Science Tokyo(东京科学大学计算学院)

机构由 AI 辅助整理,请以论文原文为准。

补充信息

↑