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

论软件合并的正确性

On the Correctness of Software Merge

National Institute of Advanced Industrial Science and Technology(产业技术综合研究所);Chiba Institute of Technology(千叶工业大学)

Akira Mori, Masatomo Hashimoto

AI总结:

研究软件合并正确性,提出基于句法标准的新结构合并工具,要求结果可解析且通用,经大规模实验对比现有工具,发现新工具无错误结果,揭示结构合并优缺点,为开发可靠合并工具奠定基础。

摘要:

三方合并工具在现代软件开发中起着关键作用,开发者通过“拉取请求”将分支合并到主分支。传统上合并任务定义直观,结果常未经审查就被接受。本文提出一种新的结构合并工具,基于句法标准评估合并结果,要求结果可解析且通用。通过范畴论中推出的概念精确定义此要求。在大规模实验中,发现现有工具存在错误结果,而新工具无。进一步比较揭示了结构合并的优缺点,强调了明确正确性标准的重要性,期望此标准为开发更可靠的合并工具奠定基础。

英文摘要:

Three-way merge tools play crucial roles in modern software development, where a developer forks a branch to make local modifications and requests it to be merged into the main branch via a "pull request." Despite its importance, the task has traditionally been defined in an intuitive manner, and the results of merge tools are often accepted without scrutiny. In this paper, we present a new structural merge tool in comparison with existing tools based on the syntactic criteria we propose for evaluating the merge results. We require the merge result to be both parsable and universal. Being parsable means that the result is syntactically valid according to the grammar of the programming language. Being universal means that the result incorporates all and only the edit operations occurring in each branch while ensuring that edits common to both branches are applied only once. This requirement can be precisely defined using the notion of pushouts in category theory. In a large-scale experiment involving 43,774 file merge scenarios from 76 open-source Java projects, we found a number of incorrect results reported by existing tools such as the Git companion merge tool, whereas our tool reports none. We further compared d3j's results with 2,582 developer-resolved merges and with 2,459 merge scenarios involving 21 refactoring types. These experiments revealed both the strengths and current limitations of structural merge, and underscore the importance of clear correctness criteria. We expect that the proposed criterion will provide a foundation for developing more reliable and principled merge tools.

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

↑