Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

Towards accurate recommendations of merge conflicts resolution strategies

Published: 01 December 2023 Publication History

Abstract

Context:

in software engineering, developers working concurrently on a project frequently need to merge changes in the source code. The manual resolution of merge conflicts is a laborious and time-consuming task. Some studies have investigated the nature of merge conflicts and proposed methods to predict, mitigate, and resolve conflicts. However, the automatic resolution of conflicts is still an open problem.

Objective:

in this paper, we design and evaluate MESTRE (MErge STrategy REcommender), a conflict resolution strategy recommender that predicts the merge resolution strategy among version 1, version 2, concatenation of version 1 and 2, concatenation of version 2 and 1, combination of lines from version 1 and 2, and manually writing new code. For the first four strategies, MESTRE is able to not only recommend the strategy but also automatically resolve the conflict.

Methods:

we collected data from 20 open-source projects with more than 1000 merge conflicts each. Using this data, we trained and evaluated a separate classifier for each project to predict the conflict resolution strategy for a conflicting chunk.

Results:

MESTRE achieved an overall average accuracy of 80.8% among all projects. It represents a normalized improvement of 54.8% over the majority class baseline. Furthermore, since MESTRE can provide the exact conflict resolution for the most frequent conflict resolution strategies, it could automatically resolve 70.5% of the conflicts. We also found that attributes related to the conflicting chunk notably impact the classification accuracy more than those related to the merge and the file.

Conclusion:

This paper makes the following contributions: (1) MESTRE, a tool to predict merge conflict resolutions based on attributes of a Git repository; (2) an analysis of the relevance of attributes to the prediction of resolution strategies; and (3) an ablation study to find the contribution of each group of attributes to MESTRE’s performance.

References

[1]
S. Phillips, J. Sillito, R. Walker, Branching and merging: An investigation into current version control practices, in: Proceedings - International Conference on Software Engineering, 2011, pp. 9–15.
[2]
Nelson N., Brindescu C., McKee S., Sarma A., Dig D., The life-cycle of merge conflicts: Processes, barriers, and strategies, Empir. Softw. Eng. 24 (5) (2019) 2863–2906.
[3]
Costa C., Figueiredo J., Ghiotto G., Murta L., Characterizing the problem of developers’ assignment for merging branches, Int. J. Softw. Eng. Knowl. Eng. 24 (10) (2014) 1489–1508.
[4]
Y. Brun, R. Holmes, M. Ernst, D. Notkin, Proactive detection of collaboration conflicts, in: SIGSOFT/FSE 2011 - Proceedings of the 19th ACM SIGSOFT Symposium on Foundations of Software Engineering, 2011, pp. 168–178.
[5]
B. Kasi, A. Sarma, Cassandra: Proactive conflict minimization through optimized task scheduling, in: Proceedings - International Conference on Software Engineering, 2013, pp. 732–741.
[6]
Zhu F., He F., Conflict resolution for structured merge via version space algebra, Proc. ACM Program. Lang. 2 (OOPSLA) (2018).
[7]
X. Xing, K. Maruyama, Automatic software merging using automated program repair, in: IBF 2019 - 2019 IEEE 1st International Workshop on Intelligent Bug Fixing, 2019, pp. 11–16.
[8]
P. Fraternali, S. Herrera Gonzalez, M. Tariq, Almost rerere: An approach for automating conflict resolution from similar resolved conflicts, in: Web Engineering, Vol. 12128 LNCS, ICWE 2020, 2020, pp. 228–243.
[9]
C. Sung, S. Lahiri, M. Kaufman, P. Choudhury, C. Wang, Towards understanding and fixing upstream merge induced conflicts in divergent forks: An industrial case study, in: Proceedings - International Conference on Software Engineering, 2020, pp. 172–181.
[10]
R. Pan, V. Le, N. Nagappan, S. Gulwani, S. Lahiri, M. Kaufman, Can program synthesis be used to learn merge conflict resolutions? An empirical analysis, in: Proceedings - International Conference on Software Engineering, 2021, pp. 785–796.
[11]
B. Shen, W. Zhang, A. Yu, Y. Shi, H. Zhao, Z. Jin, SoManyConflicts: Resolve many merge conflicts interactively and systematically, in: Proceedings - 2021 36th IEEE/ACM International Conference on Automated Software Engineering, ASE 2021, 2021, pp. 1291–1295.
[12]
Dias K., Borba P., Barreto M., Understanding predictive factors for merge conflicts, Inf. Softw. Technol. 121 (2020).
[13]
Leßenich O., Siegmund J., Apel S., Kästner C., Hunsen C., Indicators for merge conflicts in the wild: Survey and empirical study, Autom. Softw. Eng. 25 (2) (2018) 279–313.
[14]
J. Menezes, B. Trindade, J. Pimentel, T. Moura, A. Plastino, L. Murta, C. Costa, What causes merge conflicts?, in: ACM International Conference Proceeding Series, 2020, pp. 203–212.
[15]
M. Owhadi-Kareshk, S. Nadi, J. Rubin, Predicting merge conflicts in collaborative software development, in: International Symposium on Empirical Software Engineering and Measurement, Vol. 2019-Septemer, 2019.
[16]
P. Accioly, P. Borba, L. Silva, G. Cavalcanti, Analyzing conflict predictors in open-source Java projects, in: Proceedings - International Conference on Software Engineering, 2018, pp. 576–586.
[17]
Kareshk M.O., Predicting Textual Merge Conflicts, (Master’s thesis) University of Alberta, 2020.
[18]
Ziegler T., GITCoP: A Machine Learning Based Approach to Predicting Merge Conflicts from Repository Metadata, (Master’s thesis) University of Passau, 2017.
[19]
P. Dewan, R. Hegde, Semi-synchronous conflict detection and resolution in asynchronous software development, in: ECSCW 2007 - Proceedings of the 10th European Conference on Computer Supported Cooperative Work, 2007, pp. 159–178.
[20]
J. Biehl, M. Czerwinski, G. Smith, G. Robertson, FASTDash: A visual dashboard for fostering awareness in software teams, in: Conference on Human Factors in Computing Systems - Proceedings, 2007, pp. 1313–1322.
[21]
M. Guimarães, A. Silva, Improving early detection of software merge conflicts, in: Proceedings - International Conference on Software Engineering, 2012, pp. 342–352.
[22]
Sarma A., Redmiles D., Van Der Hoek A., Palantír: Early detection of development conflicts arising from parallel code changes, IEEE Trans. Softw. Eng. 38 (4) (2012) 889–908.
[23]
S. Apel, J. Liebig, B. Brandl, C. Lengauer, C. Kästner, Semistructured merge: Rethinking merge in revision control systems, in: SIGSOFT/FSE 2011 - Proceedings of the 19th ACM SIGSOFT Symposium on Foundations of Software Engineering, 2011, pp. 190–200.
[24]
S. Apel, O. Leßenich, C. Lengauer, Structured merge with auto-tuning: Balancing precision and performance, in: 2012 27th IEEE/ACM International Conference on Automated Software Engineering, ASE 2012 - Proceedings, 2012, pp. 120–129.
[25]
G. Cavalcanti, P. Accioly, P. Borba, Assessing semistructured merge in version control systems: A replicated experiment, in: International Symposium on Empirical Software Engineering and Measurement, Vol. 2015-November, 2015, pp. 267–276.
[26]
Cavalcanti G., Borba P., Accioly P., Evaluating and improving semistructured merge, Proc. ACM Program. Lang. 1 (OOPSLA) (2017).
[27]
Ghiotto G., Murta L., Barros M., Van Der Hoek A., On the nature of merge conflicts: A study of 2731 open source Java projects hosted by GitHub, IEEE Trans. Softw. Eng. 46 (8) (2020) 892–915.
[28]
Dinella E., Mytkowicz T., Svyatkovskiy A., Bird C., Naik M., Lahiri S., DeepMerge: Learning to merge programs, IEEE Trans. Softw. Eng. (2022) 1–16.
[29]
Svyatkovskiy A., Fakhoury S., Ghorbani N., Mytkowicz T., Dinella E., Bird C., Jang J., Sundaresan N., Lahiri S.K., Program merge conflict resolution via neural transformers, in: Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, in: ESEC/FSE 2022, Association for Computing Machinery, New York, NY, USA, 2022, pp. 822–833.
[30]
C. Costa, J. Figueiredo, L. Murta, A. Sarma, TIPMerge: Recommending experts for integrating changes across branches, in: Proceedings of the ACM SIGSOFT Symposium on the Foundations of Software Engineering, Vol. 13-18-November-2016, 2016, pp. 523–534.
[31]
Costa C., Figueiredo J., Pimentel J., Sarma A., Murta L., Recommending participants for collaborative merge sessions, IEEE Trans. Softw. Eng. 47 (6) (2021) 1198–1210.
[32]
Mccabe T., A complexity measure, IEEE Trans. Softw. Eng. SE-2 (4) (1976) 308–320.
[33]
Brindescu C., Ahmed I., Jensen C., Sarma A., An empirical investigation into merge conflicts and their effect on software quality, Empir. Softw. Eng. 25 (1) (2020) 562–590.
[34]
Vale G., Schmid A., Santos A., de Almeida E., Apel S., On the relation between Github communication activity and merge conflicts, Empir. Softw. Eng. 25 (1) (2020) 402–433.
[35]
M. Cataldo, J. Herbsleb, Factors leading to integration failures in global feature-oriented development: An empirical analysis, in: Proceedings - International Conference on Software Engineering, 2011, pp. 161–170.
[36]
T. Zimmermann, Mining workspace updates in CVS, in: Proceedings - ICSE 2007 Workshops: Fourth International Workshop on Mining Software Repositories, MSR 2007, 2007.
[37]
Pedregosa F., Varoquaux G., Gramfort A., Michel V., Thirion B., Grisel O., Blondel M., Prettenhofer P., Weiss R., Dubourg V., Vanderplas J., Passos A., Cournapeau D., Brucher M., Perrot M., Duchesnay É., Scikit-learn: Machine learning in Python, J. Mach. Learn. Res. 12 (2011) 2825–2830.
[38]
T. Chen, C. Guestrin, XGBoost: A scalable tree boosting system, in: Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Vol. 13-17-August-2016, 2016, pp. 785–794.
[39]
G. Pappa, A. Freitas, Automatically evolving rule induction algorithms, in: Machine Learning: ECML 2006, Vol. 4212 LNAI, 2006, pp. 341–352.
[40]
Mantovani R., Horvath T., Cerri R., Vanschoren J., De Carvalho A., Hyper-parameter tuning of a decision tree induction algorithm, in: Proceedings - 2016 5th Brazilian Conference on Intelligent Systems, BRACIS 2016, 2017, pp. 37–42.
[41]
Han J., Pei J., Tong H., Data Mining: Concepts and Techniques, Morgan kaufmann, 2022.
[42]
C. Bird, P. Rigby, E. Barr, D. Hamilton, D. German, P. Devanbu, The promises and perils of mining git, in: Proceedings of the 2009 6th IEEE International Working Conference on Mining Software Repositories, MSR 2009, 2009, pp. 1–10.
[43]
McKee S., Nelson N., Sarma A., Dig D., Software practitioner perspectives on merge conflicts and resolutions, in: 2017 IEEE International Conference on Software Maintenance and Evolution, ICSME, IEEE, 2017, pp. 467–478.
[44]
Accioly P., Borba P., Cavalcanti G., Understanding semi-structured merge conflict characteristics in open-source Java projects, Empir. Softw. Eng. 23 (4) (2018) 2051–2085.
[45]
Nishimura Y., Maruyama K., Supporting merge conflict resolution by using fine-grained code change history, in: 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering, Vol. 1, SANER, IEEE, 2016, pp. 661–664.
[46]
J. Zhang, T. Mytkowicz, M. Kaufman, R. Piskac, S. Lahiri, Using pre-trained language models to resolve textual and semantic merge conflicts (experience paper), in: ISSTA 2022 - Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis, 2022, pp. 77–88.
[47]
U. Alon, O. Levy, S. Brody, E. Yahav, Code2Seq: Generating sequences from structured representations of code, in: 7th International Conference on Learning Representations, ICLR 2019, 2019.
[48]
Alon U., Zilberstein M., Levy O., Yahav E., Code2vec: Learning distributed representations of code, Proc. ACM Program. Lang. 3 (POPL) (2019).
[49]
H. Campos Junior, G. De Menezes, M. Barros, A. Van Der Hoek, L. Murta, Towards merge conflict resolution by combining existing lines of code, in: ACM International Conference Proceeding Series, 2022, pp. 425–434.

Cited By

View all
  • (2024)Understanding the Impact of Branch Edit Features for the Automatic Prediction of Merge Conflict ResolutionsProceedings of the 32nd IEEE/ACM International Conference on Program Comprehension10.1145/3643916.3644433(149-160)Online publication date: 15-Apr-2024

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Information and Software Technology
Information and Software Technology  Volume 164, Issue C
Dec 2023
366 pages

Publisher

Butterworth-Heinemann

United States

Publication History

Published: 01 December 2023

Author Tags

  1. Merge
  2. Conflict
  3. Resolution
  4. Recommendation
  5. Data mining
  6. Machine learning

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Understanding the Impact of Branch Edit Features for the Automatic Prediction of Merge Conflict ResolutionsProceedings of the 32nd IEEE/ACM International Conference on Program Comprehension10.1145/3643916.3644433(149-160)Online publication date: 15-Apr-2024

View Options

View options

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media