Understanding Predictive Factors for Merge Conflicts

Conflicts occur even when merging modular contributions


Only Merge Scenarios with Conflitcts
Sample Non modular contributions (%) Modular contributions (%)
Ruby sample 57.3 42.7
Python sample 70.8 29.2

Likelihood of conflict occurrence significantly increases when contributions to be merged are not modular


Ruby Sample (Model I) - Odds Ratios from Regression Assessing Merge Conflicts Factors
Factor Metric Model I Model II Model III Model IV Model V Model VI Model VII
Changes to a common slice 6.13 *** 4.28 *** 3.80 *** 5.18 *** 4.28 *** 3.78 *** 5.11 ***
Number of commits 3.55 *** 3.53 ***
Number of developers 1.17 *** 1.56 *** 1.15 *** 1.51 ***
Number of changed files 3.27 *** 3.24 ***
Number of changed lines 0.99 0.99
Duration 1.04 *** 1.09 ***
Conclusion delay 1.01 1.01 1.01
Deviance Explained 10.9% 17.5% 19.0% 14.3% 17.5% 19.0% 14.5%
*** p < 0.001 ** p < 0.01 * p < 0.05
Python Sample (Model I) - Odds Ratios from Regression Assessing Merge Conflicts Factors
Factor Metric Model I Model II Model III Model IV Model V Model VI Model VII
Changes to a common slice 4.39 *** 2.82 *** 3.13 *** 3.60 *** 2.83 *** 3.11 *** 3.52 ***
Number of commits 2.16 *** 2.17 ***
Number of developers 1.36 *** 1.45 *** 1.36 *** 1.44 ***
Number of changed files 2.40 *** 2.17 ***
Number of changed lines 1.64 *** 1.49 ***
Duration 1.18 *** 1.23 ***
Conclusion delay 0.98 0.87 *** 0.85 ***
Deviance Explained 7.1% 14.4% 13.5% 11.6% 14.4% 14.3% 12.7%
*** p < 0.001 ** p < 0.01 * p < 0.05

Contribution non modularity does not predict the extent of merge damage


Ruby Sample - Changes to a common slice does not correlate strongly with
Conflict Metric cor * p-value
Number of merge conflicts 0.07 < 2.2e-16
Number of files with merge conflicts 0.13 < 2.2e-16

Python Sample - Changes to a common slice does not correlate strongly with
Conflict Metric cor * p-value
Number of merge conflicts 0.06 7.532e-12
Number of files with merge conflicts 0.09 < 2.2e-16
* We compute the point-biserial correlation coefficient since changes to a common slice is a dichotomous variable.

Conflicts in non modular scenarios often occur in model, view, and controller files


Only conflicting scenarios with non modular contributions % contain at least one slice file (model, view or controller) with at least one conflict
Ruby sample 62.8%
Python sample 76.9%

Most contributions involve changes to more than one MVC module


MVC modules affected by contributions % Ruby Sample % Python Sample
Mixed1 65.3 57.9
Config 2 23.6 22.5
App3 4.0 8.8
View4 3.3 4.0
Model5 2.1 3.8
Controller6 1.6 2.9
Total 100.0 100.0
1 - contributions affect more than one MVC module
2 - contains only configuration files such as routes, database schema, logs, Rakefile, Gemfile, etc
3 - contains only global reusable files such as CSS files, templates, static pages, and Javascript files
4 - contains only view files
5 - contains only model files
6 - contains only controller files