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.
翻译:合作软件开发是现代软件开发生命周期不可分割的一部分,对于大规模软件项目的成功至关重要。当多个开发者在同一代码线上同时进行修改时,可能会发生合并冲突。这种冲突将拉动请求和连续整合管道拖延数小时至数日,严重损害开发者的生产力。为了解决这一问题,我们引入了基于象征性三向差异的新颖神经程序合并框架和变压器编码模型。通过利用合并冲突解决方案的有限性质,我们重新配置生成解决方案序列的任务,作为一套原始合并模式的分类任务,从真实世界合并中提取出来的原始合并模式,可能会发生合并冲突。我们的模型在合并解决方案合成中实现了63%至68%的准确度,使现有半结构化的绩效得到近3x的改进,在神经程序合并工具中实现了2x的改进。最后,我们证明MergeBERT与Java、JavaScript、TyScript和C#程序化语言的源代码文档合作相当灵活。为了测量MergeBERErality的实用性使用,我们从一个大版本的准确性组合,我们进行一项用户研究,我们将在最大版本的版本中为IMEREB 25号决议的评估,我们将建议用于评估。