arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2109.00084cs.SEcs.CL
收藏

基于神经Transformers的程序合并冲突消解

Program Merge Conflict Resolution via Neural Transformers

Microsoft(微软);Washington State University(华盛顿州立大学);UC Irvine(加州大学欧文分校);Microsoft Research(微软研究院);University of Pennsylvania(宾夕法尼亚大学)

Alexey Svyatkovskiy, Sarah Fakhoury, Negar Ghorbani, Todd Mytkowicz, Elizabeth Dinella, Christian Bird, Jinu Jang, Neel Sundaresan, Shuvendu Lahiri

摘要:

协作软件开发是现代软件开发生存周期的一个组成部分,是大型软件项目成功的关键。当多个开发人员对同一行代码进行并发更改时,可能会发生合并冲突。这种冲突会使拉取请求和持续集成管道延迟数小时到数天,严重影响开发人员的生产力。为了解决这个问题,我们介绍了MergeBERT,一种新的神经程序合并框架的基础上令牌级的三路差分和一个Transformer编码器模型。通过利用合并冲突解决方案的限制性,我们重新制定的任务,生成的决议序列作为一个分类任务,从现实世界的合并提交数据中提取的一组原始合并模式。我们的模型在合并分辨率合成方面实现了63-68%的准确率,与现有的半结构化工具相比,性能提高了近3倍,与神经程序合并工具相比,性能提高了2倍。最后,我们证明了MergeBERT足够灵活,可以处理Java、JavaScript、TypeScript和C#程序设计语言中的源代码文件。为了衡量MergeBERT的实际使用,我们进行了一项用户研究,以评估MergeBERT的建议与25名开发人员从大型OSS项目的122个现实世界中遇到的冲突。结果表明,在实践中,MergeBERT决议将被接受在一个更高的速度比估计的精度和准确性的自动度量。此外,我们使用参与者的反馈来确定未来改进MergeBERT的途径。

英文摘要:

Collaborative software development is an integral part of the modern software development life cycle, essential to the success of large-scale software projects. When multiple developers make concurrent changes around the same lines of code, a merge conflict may occur. Such conflicts stall pull requests and continuous integration pipelines for hours to several days, seriously hurting developer productivity. To address this problem, we introduce MergeBERT, a novel neural program merge framework based on token-level three-way differencing and a transformer encoder model. By exploiting the restricted nature of merge conflict resolutions, we reformulate the task of generating the resolution sequence as a classification task over a set of primitive merge patterns extracted from real-world merge commit data. Our model achieves 63-68% accuracy for merge resolution synthesis, yielding nearly a 3x performance improvement over existing semi-structured, and 2x improvement over neural program merge tools. Finally, we demonstrate that MergeBERT is sufficiently flexible to work with source code files in Java, JavaScript, TypeScript, and C# programming languages. To measure the practical use of MergeBERT, we conduct a user study to evaluate MergeBERT suggestions with 25 developers from large OSS projects on 122 real-world conflicts they encountered. Results suggest that in practice, MergeBERT resolutions would be accepted at a higher rate than estimated by automatic metrics for precision and accuracy. Additionally, we use participant feedback to identify future avenues for improvement of MergeBERT.

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

↑