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

协同软件开发中合并冲突的预测

Predicting Merge Conflicts in Collaborative Software Development

University of Alberta(阿尔伯塔大学);University of British Columbia(不列颠哥伦比亚大学)

Moein Owhadi-Kareshk, Sarah Nadi, Julia Rubin

摘要:

背景在协作软件开发过程中,开发人员经常使用分支来添加功能或修复错误。当合并来自两个分支的更改时,如果更改不一致,则可能发生冲突。开发人员需要在完成合并之前解决这些冲突,这是一个容易出错且耗时的过程。合并冲突的早期检测是处理此问题的方法之一,它警告开发人员在冲突变得庞大和复杂之前解决冲突。现有技术通过在后台连续地拉取和合并分支的所有组合来实现这一点,以在冲突发生时立即通知开发人员,这是计算上昂贵的过程。降低此成本的一种潜在方法是使用基于机器学习的冲突预测器,该预测器过滤掉不太可能具有冲突的合并场景,即安全合并场景。目标。在本文中,我们评估冲突预测是否可行。法我们设计了一个分类器预测合并冲突,基于9个轻量级的Git功能集。为了评估我们的预测器,我们对来自7种程序设计语言的744个GitHub存储库的267,657个合并场景进行了大规模研究。结果我们的研究结果表明,我们实现了高f1分数,从0.95到0.97不同的程序设计语言,预测安全合并的情况下。对于冲突的合并场景,f1分数在0.57和0.68之间。结论.预测合并冲突在实践中是可行的,特别是在预测安全合并场景作为推测性合并的预过滤步骤的上下文中。

英文摘要:

Background. During collaborative software development, developers often use branches to add features or fix bugs. When merging changes from two branches, conflicts may occur if the changes are inconsistent. Developers need to resolve these conflicts before completing the merge, which is an error-prone and time-consuming process. Early detection of merge conflicts, which warns developers about resolving conflicts before they become large and complicated, is among the ways of dealing with this problem. Existing techniques do this by continuously pulling and merging all combinations of branches in the background to notify developers as soon as a conflict occurs, which is a computationally expensive process. One potential way for reducing this cost is to use a machine-learning based conflict predictor that filters out the merge scenarios that are not likely to have conflicts, ie safe merge scenarios. Aims. In this paper, we assess if conflict prediction is feasible. Method. We design a classifier for predicting merge conflicts, based on 9 light-weight Git feature sets. To evaluate our predictor, we perform a large-scale study on 267, 657 merge scenarios from 744 GitHub repositories in seven programming languages. Results. Our results show that we achieve high f1-scores, varying from 0.95 to 0.97 for different programming languages, when predicting safe merge scenarios. The f1-score is between 0.57 and 0.68 for the conflicting merge scenarios. Conclusions. Predicting merge conflicts is feasible in practice, especially in the context of predicting safe merge scenarios as a pre-filtering step for speculative merging.

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

↑