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

基于操作的重构感知合并:一个实证评估

Operation-based Refactoring-aware Merging: An Empirical Evaluation

Max Ellis, Sarah Nadi, Danny Dig

摘要:

在版本控制系统中处理合并冲突对于软件开发人员来说是一项具有挑战性的任务。解决合并冲突是一个耗时且容易出错的过程,会分散开发人员对重要任务的注意力。最近的工作表明,重构经常涉及合并冲突,并且与重构相关的冲突往往更大,使它们更难解决。在文献中,有两种重构感知的合并技术声称可以自动解决重构相关的冲突;然而,这两种技术从未进行过实证比较。在本文中,我们提出了RefMerge,一个复兴的基于Java的设计和实现的第一种技术,这是一个基于操作的重构感知合并算法。我们将RefMerge与Git和最先进的基于图形的重构感知合并工具IntelliMerge进行比较,这些工具来自20个开源项目的2,001个合并场景,其中包含与重构相关的冲突。我们发现,RefMerge解决或减少了497(25%)合并方案中的冲突,而增加冲突,只有214(11%)的情况下。另一方面,我们发现IntelliMerge解决或减少了478(24%)合并方案中的冲突,但增加了597(30%)合并方案中的冲突。此外,我们还对三种合并算法之间的差异进行了定性分析,并提供了每个工具的优点和缺点的见解。我们发现,虽然IntelliMerge在排序和格式冲突方面做得很好,但它在类级别的重构和具有几个重构的场景中挣扎。另一方面,RefMerge对合并场景中的重构数量有弹性,但我们发现RefMerge在反转与移动相关的重构时会引入冲突。

英文摘要:

Dealing with merge conflicts in version control systems is a challenging task for software developers. Resolving merge conflicts is a time-consuming and error-prone process, which distracts developers from important tasks. Recent work shows that refactorings are often involved in merge conflicts and that refactoring-related conflicts tend to be larger, making them harder to resolve. In the literature, there are two refactoring-aware merging techniques that claim to automatically resolve refactoring-related conflicts; however, these two techniques have never been empirically compared. In this paper, we present RefMerge, a rejuvenated Java-based design and implementation of the first technique, which is an operation-based refactoring-aware merging algorithm. We compare RefMerge to Git and the state-of-the-art graph-based refactoring-aware merging tool, IntelliMerge, on 2,001 merge scenarios with refactoring-related conflicts from 20 open-source projects. We find that RefMerge resolves or reduces conflicts in 497 (25%) merge scenarios while increasing conflicting LOC in only 214 (11%) scenarios. On the other hand, we find that IntelliMerge resolves or reduces conflicts in 478 (24%) merge scenarios but increases conflicting LOC in 597 (30%) merge scenarios. We additionally conduct a qualitative analysis of the differences between the three merging algorithms and provide insights of the strengths and weaknesses of each tool. We find that while IntelliMerge does well with ordering and formatting conflicts, it struggles with class-level refactorings and scenarios with several refactorings. On the other hand, RefMerge is resilient to the number of refactorings in a merge scenario, but we find that RefMerge introduces conflicts when inverting move-related refactorings.

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

↑