论文标题

变化粒度在重构检测中的影响

Impact of Change Granularity in Refactoring Detection

论文作者

Chen, Lei, Hayashi, Shinpei

论文摘要

在提交历史记录中检测重构对于提高代码审查中代码变更的理解和为软件演化提供了有价值的信息至关重要。已经提出了几种技术来在单个提交的粒度水平上准确检测重生。但是,由于代码复杂性或其他实际开发问题,可以在多个提交中进行重构,这就是为什么试图在单一命令粒度下检测重构的原因不足。我们观察到,只能在较粗糙的粒度上检测到一些重构,即,散布在多个提交中的变化。本文中,这种类型的重构称为粗粒重构(CGR)。我们比较了19个开源存储库的不同粒度粒度粒度检测到的重构。结果表明CGR是常见的,并且随着粒度变得更粗糙,它们的频率会增加。此外,我们发现与移动相关的重构往往是最常见的CGR。我们还分析了CGR的原因,并建议CGR在重构研究中很有价值。

Detecting refactorings in commit history is essential to improve the comprehension of code changes in code reviews and to provide valuable information for empirical studies on software evolution. Several techniques have been proposed to detect refactorings accurately at the granularity level of a single commit. However, refactorings may be performed over multiple commits because of code complexity or other real development problems, which is why attempting to detect refactorings at single-commit granularity is insufficient. We observe that some refactorings can be detected only at coarser granularity, that is, changes spread across multiple commits. Herein, this type of refactoring is referred to as coarse-grained refactoring (CGR). We compared the refactorings detected on different granularities of commits from 19 open-source repositories. The results show that CGRs are common, and their frequency increases as the granularity becomes coarser. In addition, we found that Move-related refactorings tended to be the most frequent CGRs. We also analyzed the causes of CGR and suggested that CGRs will be valuable in refactoring research.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源