Operation-Based Refactoring-Aware Merging: An Empirical Evaluation

Operation-Based Refactoring-Aware Merging: An Empirical Evaluation
复制标题

DOI:
10.1109/tse.2022.3228851
复制
发表时间:
2021-12
影响因子:
7.4
通讯作者:
Max Ellis;Sarah Nadi;Danny Dig
Max Ellis;Sarah Nadi;Danny Dig
中科院分区:
计算机科学1区
文献类型:
--
作者:
Max Ellis;Sarah Nadi;Danny Dig

文献摘要

相似文献

在版本控制系统中处理合并冲突对于软件开发人员来说是一项具有挑战性的任务。解决合并冲突是一个耗时且容易出错的过程,它分散了开发人员的注意力。最近的工作表明,重构经常涉及合并冲突,而与重构相关的冲突往往更大,因此很难解决。在文献中,有两种重构感知的合并技术声称自动解决与重构相关的冲突。但是,这两种技术从未经过经验比较。在本文中,我们介绍了Refmerge,这是一种基于Java的重新启用和第一种技术的实现,这是一种基于操作的重构感知算法。我们将Refmerge与Git和最先进的基于图形的合并工具Intellimerge在2,001个合并方案上进行了比较,并从20个开源项目中进行了与重构相关的冲突。我们发现,Refmerge在497(25%)合并方案中解决或减少了冲突,同时仅在214(11%)方案中增加了冲突的LOC。另一方面,我们发现Intellimerge解决或减少了478(24%)合并方案的冲突,但增加了597(30%)合并方案的LOC冲突。我们还对三种合并算法之间的差异进行了定性分析,并提供了每个工具的优势和劣势的见解。我们发现,尽管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.