Towards Predicting Merge Conflicts in Software Development Environments
Marina Bianca Trif, Radu Răzvan Slăvescu · 2021
Software development is nowadays a collaborative process. Although there exist version control systems such as Git, that help with the challenges that collaborative work poses, the process still has some issues, one of them are merge conflicts. When two or more developers need to combine the contents of different branches, merge conflicts might appear if the same lines of code have been changed in parallel. The process of deciding which version is to be kept requires human assistance and is time-consuming as well as error-prone. In order to mitigate the risk, a possible solution is finding conflicts before they appear by using Machine Learning (ML) / Deep Learning (DL) based predictors. We aim to explore which of these approaches would fit best to the task. To this end, we trained various classifiers using datasets composed of Git-related features regarding open source repositories. We studied over 30 thousand merge scenarios and over 30 different candidate features. Our classifiers’ values for precision and recall range between 0.68 and 0.78, with remarkably high values for ROC AUC. Cascading a Random Forest classifier with a deep neural network one offered the best results for the task at hand. The results indicate that conflict prediction is indeed attainable using machine learning, which could be an important step towards better synchronization in software development.