arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2101.01430cs.SE
收藏

为什么开发人员重构Source Code:基于挖掘的研究

Why Developers Refactor Source Code: A Mining-based Study

Jevgenija Pantiuchina, Fiorella Zampetti, Simone Scalabrino, Valentina Piantadosi, Rocco Oliveto, Gabriele Bavota, Massimiliano Di Penta

摘要:

重构的目的是在不修改代码外部行为的情况下改进代码的非函数属性。以前的研究通过调查开发人员来调查重构背后的动机。为了概括和补充他们的研究结果,我们提出了一个大规模的研究,定量和定性地调查为什么开发人员在开源项目中执行重构。首先,我们挖掘了150个系统历史上执行的287,813次重构操作。使用这个数据集,我们研究了重构操作和过程之间的相互作用(例如,先前的改变/修复)和产品(例如,质量度量)度量。然后,我们手动分析了551个合并的拉取请求,这些合并的拉取请求实现了重构操作,并对所实现的重构背后的动机进行了分类(例如,删除代码重复)。我们的研究结果导致(i)定量证据的关系存在于某些过程/产品指标和重构操作和(ii)一个详细的分类,概括和补充现有的文献中的动机,推动开发人员重构源代码。

英文摘要:

Refactoring aims at improving code non-functional attributes without modifying its external behavior. Previous studies investigated the motivations behind refactoring by surveying developers. With the aim of generalizing and complementing their findings, we present a large-scale study quantitatively and qualitatively investigating why developers perform refactoring in open source projects. First, we mine 287,813 refactoring operations performed in the history of 150 systems. Using this dataset, we investigate the interplay between refactoring operations and process (e.g., previous changes/fixes) and product (e.g., quality metrics) metrics. Then, we manually analyze 551 merged pull requests implementing refactoring operations and classify the motivations behind the implemented refactorings (e.g., removal of code duplication). Our results led to (i) quantitative evidence of the relationship existing between certain process/product metrics and refactoring operations and (ii) a detailed taxonomy, generalizing and complementing the ones existing in the literature, of motivations pushing developers to refactor source code.

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

↑