DeepMerge:学习合并程序
DeepMerge: Learning to Merge Programs
摘要:
在协作软件开发中,程序合并是集成来自多个程序员的更改的机制。现代版本控制系统中的合并算法会在更改与文本发生冲突时报告冲突。合并冲突需要人工干预,并且经常会使现代持续集成管道停止。之前的工作发现,尽管成本很高,但大多数解决方案都涉及重新排列文本而不编写任何新代码。受此启发,我们提出了第一个数据驱动的方法来解决合并冲突的机器学习模型。我们在工具DeepMerge中实现了我们的方法,该工具使用了(i)合并输入的编辑感知嵌入和(ii)指针网络的变体的新颖组合,以从输入片段构建分辨率。我们还提出了一种算法,以本地化手动决议的解决方案的文件,并利用它来策划地面实况数据集,包括8,719个非平凡的决议在JavaScript程序。我们的评估表明,在一个测试集上,DeepMerge可以预测37%的非平凡合并的正确解决方案,而最先进的半结构化合并技术只能预测4%。此外,在最多3行的合并子集(占总数据集的24%)上,DeepMerge可以以78%的准确率预测正确的分辨率。
英文摘要:
In collaborative software development, program merging is the mechanism to integrate changes from multiple programmers. Merge algorithms in modern version control systems report a conflict when changes interfere textually. Merge conflicts require manual intervention and frequently stall modern continuous integration pipelines. Prior work found that, although costly, a large majority of resolutions involve re-arranging text without writing any new code. Inspired by this observation we propose the first data-driven approach to resolve merge conflicts with a machine learning model. We realize our approach in a tool DeepMerge that uses a novel combination of (i) an edit-aware embedding of merge inputs and (ii) a variation of pointer networks, to construct resolutions from input segments. We also propose an algorithm to localize manual resolutions in a resolved file and employ it to curate a ground-truth dataset comprising 8,719 non-trivial resolutions in JavaScript programs. Our evaluation shows that, on a held out test set, DeepMerge can predict correct resolutions for 37% of non-trivial merges, compared to only 4% by a state-of-the-art semistructured merge technique. Furthermore, on the subset of merges with upto 3 lines (comprising 24% of the total dataset), DeepMerge can predict correct resolutions with 78% accuracy.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。