Indicators for Merge Conflicts in the Wild:
Survey and Empirical Study

Abstract

With modern version-control systems, while the creation of new branches and forks is easy and fast, merging is often time-consuming. Especially, when dealing with many branches or forks, a prediction of merge costs based on proper indicators would be desirable to help developers recognize problematic merging scenarios before potential conflicts become too severe in the evolution of a software project.

We analyze the predictive power of several indicators, such as the number, size, or scattering degree of commits in each branch, derived either from the version-control system or directly from the source code. Based on a survey of 41 developers, we expect 7 indicators being feasible to predict the number of merge conflicts. We test our hypotheses in a study of 155 open-source projects including 32,579 merge scenarios and comprising 50 million lines of code.

A notable (“negative”) result is that none of 7 indicators suggested by the developer survey has a predictive power concerning the frequency of merge conflicts. We discuss this and other findings as well as perspectives thereof.

Hypotheses and Results

Hypothesis H1

Active, diverted branches are more likely to result in conflicts than inactive branches that remain close to each other.
Scatter plot: number of commits / number of conflicts
Rejected Number of commits do not correlate with the number of merge conflicts.

Hypothesis H2

Many commits within a small time span are more likely to produce conflicts than the same number of commits over longer time spans.
Scatter plot: commits last week / number of conflicts
Rejected Commit density does not correlate with the number of conflicts.

Hypothesis H3

The more files are changed by both branches, the more likely a conflict occurs.
Scatter plot: files changed by both branches / number of conflicts
Rejected The number of files changed in both branches does not correlate with the number of conflicts.

Hypothesis H4

Larger changes that modify more lines of code are more likely to cause conflicts than smaller changes.
Scatter plot: change size / number of conflicts
Rejected Large changes are not more likely to lead to conflicts than smaller changes.

Hypothesis H5

More code fragmentation of the committed changes results in more conflicts than lesser code fragmentation.
Scatter plot: number of chunks / number of conflicts
Rejected Fragmentation of changes is not more likely to result in conflicts.

Hypothesis H6

Scattered changes (across classes or methods) are more likely to spawn conflicts than cohesive changes.
Scatter plot: scattering over classes / number of conflicts
Scatter plot: scattering over methods / number of conflicts
Rejected Scattered changes across classes or methods are not related to the number of conflicts.

Hypothesis H7

Changes above the level of class declarations (which are typically inserted and maintained automatically) are more likely to lead to merge conflicts than changes inside class declarations (introduced by human developers).
Scatter plot: rate of changes above class level / number of conflicts
Scatter plot: rate of changes in classes / number of conflicts
Rejected Granularity of changes (above or within class declarations) has no influence on merge conflicts.

Downloads

Sample Systems

ProjectDomainMerge ScenariosLines of Code
OsmandNavigation App971151715
intellij-communityIDE8803623963
robolectricTesting framework85973816
rundeckJob Scheduler80292373
wro4jOptimizer80151421
SpoutGame Engine766113909
dropwizardLibrary73826591
FBReaderJE-book Reader73876033
rstudioIDE680165967
OpenTripPlannerTrip Planner678109731
lanternProxy67129729
druidAnalysis Tool627160297
okhttpWeb browser59846039
BuildCraftGame56074034
EssentialsGame50942837
andlyticsAnalysis Tool49047326
MozStumblerWifi Scanner47324283
groovy-coreProgramming Language447224265
fitnesseTesting Framework44570697
KunderaLibrary442336686
ActivitiBusiness Process Management Platform436245414
tachyonDistributed Storage System43381906
senseiDistributed Database42129548
Algorithm-ImplementationsAlgorithm Library3993429
hectorDatabase Client35937814
phoenixJDBC Driver358126638
antlr4Parser Generator35074398
nokogiriParser32917176
Equivalent-Exchange-3Game32217920
voldemortDistributed Storage System317200192
junitTesting Framework31032629
elephant-birdLibrary30726274
k-9Mail Client29371959
gocdContinuous Integration Management287320592
BroadleafCommerceeCommerce Framework284218253
nutzWeb Application Framework27933094
gitblitGit Server27392323
metricsAnalysis Tool27219025
picassoLibrary27110689
generator-jhipsterWeb Application Framework2705811
dynmapGame Extension2515177
stormRealtime Computation System24958118
testngTesting Framework24964868
daggerDependency Injector24511560
mcMMOGame Extension24233485
hectorDatabase Client23331703
syncanyFilesharing Application22454330
servoLibrary22329512
atmosphereWeb Application Framework21451952
gherkinParser20958236
google-go-lang-idea-pluginIDE Plugin20753285
processingDSL197115155
blueprintsProperty Graph Model Interface19736390
java-driverLibrary19650321
async-http-clientLibrary19441856
commonsLibrary19367526
Rajawali3D Engine19336111
torqueboxApplication Server1891668
mctMonitoring Platform186174184
jedisDatabase Client18223805
gephiGraph Visualization Platform177182724
commafeedRSS Reader1779386
ArduinoElectronics Prototyping Platform17628928
twitter4jTwitter Library17542855
spring-socialService Provider Framework16816002
gwt-bootstrapWeb Interface Library16829772
dynjsProgramming Language16446455
titanGraph Database15898624
spring-rooApplication Development Framework158126158
cucumber-jvmTesting Framework15825860
jzmqMessaging Library1536105
astyanaxDatabase Client15268657
HystrixInterface Monitoring Library15040596
nettyNetwork Application Framework150228418
graylog2-serverLogfile Analyzer14990921
eurekaLoad Balancer14419011
SimianArmyCloud Computing Tool Suite14323087
curatorZookeeper Library1393209
logbackLogging Framework13081658
jackson-databindData-binding Library126115373
javaee7-samplesSamples12433349
titanium\_modulesModules12364750
robospiceAndroid Library12219573
TextSecureInstant Messenger11958415
vrapperEclipse Plugin11335414
reactorApplication Development Framework11252238
ActionBarSherlockAndroid Library11136333
robotiumTesting Framework1108362
ListViewAnimationsAndroid Library1088952
mongo-java-driverDatabase Driver10894234
jmxtransJMX Query Tool10810451
lucene-solrSearch Engine107884947
ConversationsInstant Messenger10622921
spoonTesting Framework1046160
AndEngineGame Engine10252912
jphpCompiler10079048
jeromqMessaging Library9930331
hiveData Warehouse Software99844898
b3log-soloBlog Software9826595
exhibitorZookeeper Supervision System9819323
mustache.javaTemplates978867
sikuliGUI Automation Software9343242
rootbeer1GPU Compiler9133452
lombokLanguage Extension8957164
StickyListHeadersAndroid Library87934
webbitWeb Server858084
flywayDatabase Migration Tool8528536
erjangVirtual Machine8360047
rexsterGraph Server7926573
twitter-text-javaText Processing Library79731
spring-integration-samplesSamples7815898
jsonJSON Implementation754031
ghostdriverNetwork Library743849
ImageLoaderImage Loader74889
datafuData Processing Library7427801
autoSource Code Generator746913
mongo-hadoopHadoop Connector7211118
AntennaPodPodcast Manager7039236
ps3mediaserverMedia Server7045399
UpdateCheckerUpdate Manager701153
HoloEverywhereAndroid Theme6959837
OpenRefineData Processing Tool6561725
hbcHTTP Client Library646709
HikariCPJDBC Library6211345
yuicompressorSource Code Compression606894
ShowcaseViewGUI App592204
jdbiDatabase Library5927552
ShowcaseViewGUI App582204
droidpartsAndroid Framework5613696
CroutonAndroid Library562373
scribe-javaAuthentication Library566319
elasticsearch-river-mongodbDatabase Library558908
weinreDebugger542587
elephantdbDistributed Database5417868
sms-backup-plusBackup Software529796
todo.txt-touchTasklist Manager5251774
dsploitExploit Framework5219388
twitter4jTwitter Library5150173
java-deeplearningeLearning Platform5050001
bonecpDatabase Library4826235
fastjsonJSON Processor4770544
SlidingMenuAndroid Library474238
databusAnalysis Tool47181925
jitsiInstant Messenger46565986
closure-compilerCompiler45293908
eclipse-themesEclipse Plugin457833
photo-picker-plusPhoto App452600
mockitoMocking Framework4580171
elasticsearchSearch Engine43546503
WorldEditGame Editor4274199
aws-sdk-javaSDK371511531
ambroseMonitoring Platform366123
spring-bootApplication Development Framework13136990
cgeoGeocaching App553156
liferay-portalWeb Platform12573254

Contact

HTML5 Valid Valide CSS!