一句话:提出 sMerge,从程序行为语义出发,将合并冲突解决转化为针对性测试生成,并形式化定义了冲突问题。
协同开发中合并冲突频繁发生,而现有自动解决技术多为启发式或黑盒方法,未能触及冲突根源——冲突版本之间存在不同的程序行为。本文首先形式化定义合并冲突问题,给出冲突发生的具体条件以及选取某一版本作为解决结果的标准;在此基础上提出 sMerge,主张解决冲突的关键在于识别程序行为差异,因而可通过针对性的测试生成来完成。该方法可利用基于搜索、基于 GPT 以及人工测试等多种测试生成技术。作者在来自多个项目的冲突数据集上进行了广泛评估,结果表明 sMerge 能有效解决合并问题,并能检测出开发者提供的错误 ground truth,从而提升合并过程的可靠性。
Collaborative software development significantly enhances development productivity by enabling multiple contributors to work concurrently on different branches. Despite these advantages, such collaboration often increases the likelihood of causing conflicts. Resolving these conflicts brings huge challenges, primarily due to the necessity of comprehending the differences between conflicting versions. Researchers have explored various automatic conflict resolution techniques, including unstructured, structured, and learning-based approaches. However, these techniques are mostly heuristic-based or black-box in nature, which means they do not attempt to solve the root cause of the conflicts, i.e., the existence of different program behaviors exhibited by the conflicting versions.In this work, we propose sMerge, a novel conflict resolution approach based on the semantics of program behaviors. We first give the formal definition of the merge conflict problem as well as the specific conditions under which conflicts happen and the criteria employed to select certain version as the resolution. Based on the definition, we propose to resolve the conflicts from the perspective of program behaviors. In particular, we argue that the key to resolving conflicts is identifying different program behaviors, and thus can be solved through targeted test generation. We conduct an extensive evaluation of sMerge using a comprehensive dataset of conflicts sourced from various projects. Our results show that sMerge can effectively solve the merge problem by employing different test generation techniques, including search-based, GPT-based, and manual testing. We remark that sMerge provides a way to understand the program behavior differences through testing, which not only allows us to solve the merge problem soundly but also enables the detection of incorrect ground truths provided by developers, thereby enhancing the reliability of the merge process.CCS CONCEPTS• Software and its engineering → Collaboration in software development.
@inproceedings{Dong00ZMD024,
title = {Revisiting the Conflict-Resolving Problem from a Semantic Perspective},
author = {Jinhao Dong and Jun Sun and Yun Lin and Yedi Zhang and Murong Ma and Jin Song Dong and Dan Hao},
booktitle = {ASE},
year = {2024},
doi = {10.1145/3691620.3694993}
}