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

Spork:带保留的Java的结构化合并

Spork: Structured Merge for Java with Formatting Preservation

Simon Larsén, Jean-Rémy Falleri, Benoit Baudry, Martin Monperrus

摘要:

现代软件开发的高度并行的工作流程使得源代码的合并成为开发人员的常见活动。实践的状态是基于行的合并,这是普遍使用的“git合并”。然而,基于行的合并是一种通用技术,适用于任何无法利用源代码的结构化特性的文本,这使得合并冲突经常发生。作为一种补救措施,研究人员提出了结构化合并工具,这些工具通常对抽象语法树而不是原始文本进行操作。结构化合并极大地减少了合并冲突的发生,但也有一些重要的限制,主要的限制是倾向于改变合并代码的格式,并且容易产生过多的运行时间。在本文中,我们提出了SPORK,一个新的结构化的JAVA合并工具。SPORK是独一无二的,因为它比同类的最先进的工具在更大程度上保留格式。SPORK总体上也比现有技术更快,特别是在实践中显着减少了最坏情况下的运行时间。我们通过回放从119个开源项目中收集的1740个真实世界的文件合并来展示这些属性,并通过深入的案例研究进一步展示了SPORK与最先进技术之间的几个关键差异。

英文摘要:

The highly parallel workflows of modern software development have made merging of source code a common activity for developers. The state of the practice is based on line-based merge, which is ubiquitously used with "git merge". Line-based merge is however a generalized technique for any text that cannot leverage the structured nature of source code, making merge conflicts a common occurrence. As a remedy, research has proposed structured merge tools, which typically operate on abstract syntax trees instead of raw text. Structured merging greatly reduces the prevalence of merge conflicts but suffers from important limitations, the main ones being a tendency to alter the formatting of the merged code and being prone to excessive running times. In this paper, we present SPORK, a novel structured merge tool for JAVA. SPORK is unique as it preserves formatting to a significantly greater degree than comparable state-of-the-art tools. SPORK is also overall faster than the state of the art, in particular significantly reducing worst-case running times in practice. We demonstrate these properties by replaying 1740 real-world file merges collected from 119 open-source projects, and further demonstrate several key differences between SPORK and the state of the art with in-depth case studies.

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

↑