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

变化粒度对重构检测的影响

Impact of Change Granularity in Refactoring Detection

Lei Chen, Shinpei Hayashi

摘要:

检测提交历史中的重构对于提高代码评审中代码更改的理解以及为软件演化的实证研究提供有价值的信息至关重要。已经提出了几种技术来在单个提交的粒度级别上准确地检测重构。然而,由于代码复杂性或其他实际开发问题,重构可能会在多个提交上执行,这就是为什么试图在单次提交粒度下检测重构是不够的。我们观察到,一些重构只能在较粗的粒度上被检测到,也就是说,更改分布在多个提交中。在这里,这种类型的重构被称为粗粒度重构(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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑