skip to main content
10.1145/3555228.3555229acmotherconferencesArticle/Chapter ViewAbstractPublication PagessbesConference Proceedingsconference-collections
research-article

Towards Merge Conflict Resolution by Combining Existing Lines of Code

Published: 05 October 2022 Publication History

Abstract

Software developers often need to combine their contributions. This operation is called merge. When the contributions happen at the same physical region in the source code, the merge is marked as conflicting and must be manually resolved by the developers. Existing studies explore why conflicts happen, their characteristics, and how they are resolved. In this paper, we investigate a specific subset of merge conflicts, which may be resolved using a combination of existing lines. We analyze 10,177 conflict chunks of popular projects that were resolved by combining existing lines, aiming at characterizing and finding patterns that developers frequently use to resolve them. We found that these conflicting chunks and their resolutions are usually small (they have a median of 6 LOC and 3 LOC, respectively). Moreover, 98.6% of the analyzed resolutions preserve the order of the lines in the conflicting chunks. We also found that 77.4% of the chunk resolutions do not interleave lines from different contributions more than once. These findings altogether, when used as heuristics for automatic merge resolution, could enable the reduction of the search space by 94.7%, paving the road for future search-based software engineering tools for this problem.

References

[1]
Paola Accioly, Paulo Borba, and Guilherme Cavalcanti. 2018. Understanding semi-structured merge conflict characteristics in open-source Java projects. Empirical Software Engineering 23, 4 (Aug. 2018), 2051–2085. https://doi.org/10.1007/s10664-017-9586-1
[2]
Caius Brindescu, Iftekhar Ahmed, Carlos Jensen, and Anita Sarma. 2020. An empirical investigation into merge conflicts and their effect on software quality. Empirical Software Engineering 25, 1 (Jan. 2020), 562–590. https://doi.org/10.1007/s10664-019-09735-4
[3]
Caius Brindescu, Iftekhar Ahmed, Rafael Leano, and Anita Sarma. 2020. Planning for untangling: Predicting the difficulty of merge conflicts. In 2020 IEEE/ACM 42nd International Conference on Software Engineering (ICSE). IEEE, 801–811.
[4]
Muhammad Zohaib Brohi. 2019. Software Practitioners Perspective on Merge Conflicts and Resolution. Master’s thesis. University of Passau. https://www.infosun.fim.uni-passau.de/se/theses/MuhammadZohaibMA.pdf
[5]
Yuriy Brun, Reid Holmes, Michael D Ernst, and David Notkin. 2011. Proactive detection of collaboration conflicts. In Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering. 168–178.
[6]
Catarina Costa, José JC Figueiredo, Gleiph Ghiotto, and Leonardo Murta. 2014. Characterizing the Problem of Developers’ Assignment for Merging Branches. International Journal of Software Engineering and Knowledge Engineering 24, 10(2014), 1489–1508.
[7]
Gleiph Ghiotto, Leonardo Murta, Márcio Barros, and André van der Hoek. 2020. On the Nature of Merge Conflicts: A Study of 2,731 Open Source Java Projects Hosted by GitHub. IEEE Transactions on Software Engineering 46, 8 (2020), 892–915. https://doi.org/10.1109/TSE.2018.2871083
[8]
Mark Harman, S Afshin Mansouri, and Yuanyuan Zhang. 2012. Search-based software engineering: Trends, techniques and applications. ACM Computing Surveys (CSUR) 45, 1 (2012), 1–61.
[9]
Dennis E Hinkle, William Wiersma, and Stephen G Jurs. 2003. Applied statistics for the behavioral sciences. Vol. 663. Houghton Mifflin College Division.
[10]
Bakhtiar Khan Kasi and Anita Sarma. 2013. Cassandra: Proactive conflict minimization through optimized task scheduling. In 2013 35th International Conference on Software Engineering (ICSE). IEEE, 732–741.
[11]
Nicholas Nelson, Caius Brindescu, Shane McKee, Anita Sarma, and Danny Dig. 2019. The life-cycle of merge conflicts: processes, barriers, and strategies. Empirical Software Engineering 24, 5 (Oct. 2019), 2863–2906. https://doi.org/10.1007/s10664-018-9674-x
[12]
Hoai Le Nguyen and Claudia-Lavinia Ignat. 2017. Parallelism and conflicting changes in Git version control systems. In IWCES’17 - The Fifteenth International Workshop on Collaborative Editing Systems. HAL-Inria, Portland, Oregon, United States, 1–1. https://hal.inria.fr/hal-01588482
[13]
Rangeet Pan, Vu Le, Nachiappan Nagappan, Sumit Gulwani, Shuvendu Lahiri, and Mike Kaufman. 2021. Can Program Synthesis be Used to Learn Merge Conflict Resolutions? An Empirical Analysis. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). 785–796. https://doi.org/10.1109/ICSE43902.2021.00077
[14]
Gustavo Vale, Claus Hunsen, Eduardo Figueiredo, and Sven Apel. 2021. Challenges of Resolving Merge Conflicts: A Mining and Survey Study. IEEE Transactions on Software Engineering(2021).
[15]
Ryohei Yuzuki, Hideaki Hata, and Kenichi Matsumoto. 2015. How we resolve conflict: an empirical study of method-level conflict resolution. In 2015 IEEE 1st International Workshop on Software Analytics (SWAN). IEEE, Montreal, QC, Canada, 21–24. https://doi.org/10.1109/SWAN.2015.7070484

Cited By

View all
  • (2024)How code composition strategies affect merge conflict resolution?Journal of Software Engineering Research and Development10.5753/jserd.2024.363812:1Online publication date: 31-Oct-2024
  • (2023)Towards accurate recommendations of merge conflicts resolution strategiesInformation and Software Technology10.1016/j.infsof.2023.107332164:COnline publication date: 1-Dec-2023

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
SBES '22: Proceedings of the XXXVI Brazilian Symposium on Software Engineering
October 2022
457 pages
ISBN:9781450397353
DOI:10.1145/3555228
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 05 October 2022

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Version control systems
  2. conflict resolution
  3. search-based software engineering
  4. software merge

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Funding Sources

Conference

SBES 2022
SBES 2022: XXXVI Brazilian Symposium on Software Engineering
October 5 - 7, 2022
Virtual Event, Brazil

Acceptance Rates

Overall Acceptance Rate 147 of 427 submissions, 34%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)19
  • Downloads (Last 6 weeks)1
Reflects downloads up to 15 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)How code composition strategies affect merge conflict resolution?Journal of Software Engineering Research and Development10.5753/jserd.2024.363812:1Online publication date: 31-Oct-2024
  • (2023)Towards accurate recommendations of merge conflicts resolution strategiesInformation and Software Technology10.1016/j.infsof.2023.107332164:COnline publication date: 1-Dec-2023

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media