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

代码重构是否影响合并工作量?

Do code refactorings influence the merge effort?

Andre Oliveira, Vania Neves, Alexandre Plastino, Ana Carla Bibiano, Alessandro Garcia, Leonardo Murta

AI总结:

本研究通过关联规则挖掘分析40,248次合并提交,发现代码重构会增加合并工作量,且重构越多、并行重构时工作量越大,提示改进合并与重构推荐工具。

摘要:

在协作式软件开发中,多个贡献者经常并行修改源代码,以实现新功能、修复缺陷、重构现有代码及进行其他更改。这些同时发生的更改需要合并到同一版本的源代码中。然而,合并操作可能失败,需要开发人员介入以解决冲突。文献研究表明,所有合并尝试中有10%至20%会导致冲突,这些冲突需要开发人员手动干预才能完成合并过程。在本文中,我们关注一种特定类型的更改,它影响源代码的结构并有可能增加合并工作量:代码重构。我们分析了重构的发生与合并工作量之间的关系。为此,我们应用了一种称为关联规则提取的数据挖掘技术,以发现行为模式,从而分析重构对合并工作量的影响。我们的实验从28个流行的开源项目中发生的40,248次合并提交中提取了关联规则。结果表明:(i)重构的发生增加了产生合并工作量的可能性;(ii)重构次数越多,产生工作量的可能性越大;(iii)重构次数越多,工作量越大;以及(iv)并行重构进一步增加了产生工作量的可能性及其强度。获得的结果可能暗示开发团队实施重构方式的改变。此外,它们还可以指出改进支持代码合并和推荐重构的工具的可能途径,同时考虑重构次数和合并工作量属性。

英文摘要:

In collaborative software development, multiple contributors frequently change the source code in parallel to implement new features, fix bugs, refactor existing code, and make other changes. These simultaneous changes need to be merged into the same version of the source code. However, the merge operation can fail, and developer intervention is required to resolve the conflicts. Studies in the literature show that 10 to 20 percent of all merge attempts result in conflicts, which require the manual developer's intervention to complete the process. In this paper, we concern about a specific type of change that affects the structure of the source code and has the potential to increase the merge effort: code refactorings. We analyze the relationship between the occurrence of refactorings and the merge effort. To do so, we applied a data mining technique called association rule extraction to find patterns of behavior that allow us to analyze the influence of refactorings on the merge effort. Our experiments extracted association rules from 40,248 merge commits that occurred in 28 popular open-source projects. The results indicate that: (i) the occurrence of refactorings increases the chances of having merge effort; (ii) the more refactorings, the greater the chances of effort; (iii) the more refactorings, the greater the effort; and (iv) parallel refactorings increase even more the chances of having effort, as well as the intensity of it. The results obtained may suggest behavioral changes in the way refactorings are implemented by developer teams. In addition, they can indicate possible ways to improve tools that support code merging and those that recommend refactorings, considering the number of refactorings and merge effort attributes.

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

↑