How code composition strategies affect merge conflict resolution?
DOI:
https://doi.org/10.5753/jserd.2024.3638Keywords:
Version control systems, software merge, conflict resolution, search-based software engineeringAbstract
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. This paper investigates a 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 frequently addressed by developers 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 72.7% of the chunk resolutions do not interleave lines from different contributions more than once. Finally, developers prefer to resolve conflicts containing only Import statements using lines from the local version of the conflict. When used as heuristics for automatic merge resolution, these findings could reduce the search space by 94.7%, paving the road for future search-based software engineering tools for this problem.
Downloads
References
Accioly, P., Borba, P., and Cavalcanti, G. (2018). Understanding semi-structured merge conflict characteristics in open-source Java projects. Empirical Software Engineering, 23(4):2051–2085.
Altman, D. and Bland, J. (2005). Statistics notes: Standard deviations and standard errors. British Medical Journal, 331(7521):903–903.
Appleton, B., Berczuk, S., Cabrera, R., and Orenstein, R. (1998). Streamed lines: Branching patterns for parallel software development. In Proceedings of PloP, volume 98, page 14.
Brindescu, C., Ahmed, I., Jensen, C., and Sarma, A. (2020a). An empirical investigation into merge conflicts and their effect on software quality. Empirical Software Engineering, 25(1):562–590.
Brindescu, C., Ahmed, I., Leano, R., and Sarma, A. (2020b). Planning for untangling: Predicting the difficulty of merge conflicts. In 2020 IEEE/ACM 42nd International Conference on Software Engineering (ICSE), pages 801–811. IEEE.
Brohi, M. Z. (2019). Software Practitioners Perspective on Merge Conflicts and Resolution. Master’s thesis, University of Passau.
Campos Junior, H. d. S., de Menezes, G. G. L., Barros, M. d. O., van der Hoek, A., and Murta, L. G. P. (2022). Towards merge conflict resolution by combining existing lines of code. In Proceedings of the XXXVI Brazilian Symposium on Software Engineering, pages 425–434.
Cavalcanti, G., Borba, P., and Accioly, P. (2017). Evaluating and improving semistructured merge. Proceedings of the ACM on Programming Languages, 1(OOPSLA):1–27.
Costa, C., Figueiredo, J. J., Ghiotto, G., and Murta, L. (2014). Characterizing the problem of developers’ assignment for merging branches. International Journal of Software Engineering and Knowledge Engineering, 24(10):1489–1508.
Dinella, E., Mytkowicz, T., Svyatkovskiy, A., Bird, C., Naik, M., and Lahiri, S. (2022). Deepmerge: Learning to merge programs. IEEE Transactions on Software Engineering, 49(4):1599–1614.
Dong, J., Zhu, Q., Sun, Z., Lou, Y., and Hao, D. (2023). Merge conflict resolution: Classification or generation? In 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 1652–1663. IEEE.
Fraternali, P., Herrera Gonzalez, S. L., and Tariq, M. M. (2020). Almost rerere: An approach for automating conflict resolution from similar resolved conflicts. In Web Engineering: 20th International Conference, ICWE 2020, Helsinki, Finland, June 9–12, 2020, Proceedings 20, pages 228–243. Springer.
Ghiotto, G., Murta, L., Barros, M., and van der Hoek, A. (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):892–915.
Harman, M., Mansouri, S. A., and Zhang, Y. (2012). Search-based software engineering: Trends, techniques and applications. ACM Computing Surveys (CSUR), 45(1):1–61.
Hinkle, D. E., Wiersma, W., and Jurs, S. G. (2003). Applied statistics for the behavioral sciences, volume 663. Houghton Mifflin College Division.
Israel, G. D. (1992). Determining sample size. Technical report, University of Florida.
Kasi, B. K. and Sarma, A. (2013). Cassandra: Proactive conflict minimization through optimized task scheduling. In 2013 35th International Conference on Software Engineering (ICSE), pages 732–741. IEEE.
Mens, T. (2002). A state-of-the-art survey on software merging. IEEE transactions on software engineering, 28(5):449–462.
Nelson, N., Brindescu, C., McKee, S., Sarma, A., and Dig, D. (2019). The life-cycle of merge conflicts: processes, barriers, and strategies. Empirical Software Engineering, 24(5):2863–2906.
Nguyen, H. L. and Ignat, C.-L. (2017). Parallelism and conflicting changes in Git version control systems. In IWCES’17 - The Fifteenth International Workshop on Collaborative Editing Systems, pages 1–1, Portland, Oregon, United States. HAL-Inria.
Pan, R., Le, V., Nagappan, N., Gulwani, S., Lahiri, S., and Kaufman, M. (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), pages 785–796.
Seibt, G., Heck, F., Cavalcanti, G., Borba, P., and Apel, S. (2021). Leveraging structure in software merge: An empirical study. IEEE Transactions on Software Engineering, 48(11):4590–4610.
Svyatkovskiy, A., Fakhoury, S., Ghorbani, N., Mytkowicz, T., Dinella, E., Bird, C., Jang, J., Sundaresan, N., and Lahiri, S. K. (2022). 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, pages 822–833.
Vale, G., Hunsen, C., Figueiredo, E., and Apel, S. (2021). Challenges of resolving merge conflicts: A mining and survey study. IEEE Transactions on Software Engineering.
Xing, X. and Maruyama, K. (2019). Automatic software merging using automated program repair. In 2019 IEEE 1st International Workshop on Intelligent Bug Fixing (IBF), pages 11–16. IEEE.
Yuzuki, R., Hata, H., and Matsumoto, K. (2015). How we resolve conflict: an empirical study of method-level conflict resolution. In 2015 IEEE 1st International Workshop on Software Analytics (SWAN), pages 21–24, Montreal, QC, Canada. IEEE.
Zhang, J., Mytkowicz, T., Kaufman, M., Piskac, R., and Lahiri, S. K. (2022). Using pre-trained language models to resolve textual and semantic merge conflicts (experience paper). In Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis, pages 77–88.
Zhu, F. and He, F. (2018). Conflict resolution for structured merge via version space algebra. Proceedings of the ACM on Programming Languages, 2(OOPSLA):1–25.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2024 Heleno de Souza Campos Junior, Gleiph Ghiotto L. de Menezes, Márcio de Oliveira Barros, André van der Hoek, Leonardo Gresta Paulino Murta
This work is licensed under a Creative Commons Attribution 4.0 International License.