skip to main content
research-article
Open Access

IntelliMerge: a refactoring-aware software merging technique

Published:10 October 2019Publication History
Skip Abstract Section

Abstract

In modern software development, developers rely on version control systems like Git to collaborate in the branch-based development workflow. One downside of this workflow is the conflicts occurred when merging contributions from different developers: these conflicts are tedious and error-prone to be correctly resolved, reducing the efficiency of collaboration and introducing potential bugs. The situation becomes even worse, with the popularity of refactorings in software development and evolution, because current merging tools (usually based on the text or tree structures of source code) are unaware of refactorings. In this paper, we present IntelliMerge, a graph-based refactoring-aware merging algorithm for Java programs. We explicitly enhance this algorithm's ability in detecting and resolving refactoring-related conflicts. Through the evaluation on 1,070 merge scenarios from 10 popular open-source Java projects, we show that IntelliMerge reduces the number of merge conflicts by 58.90% comparing with GitMerge (the prevalent unstructured merging tool) and 11.84% comparing with jFSTMerge (the state-of-the-art semi-structured merging tool) without sacrificing the auto-merging precision (88.48%) and recall (90.22%). Besides, the evaluation of performance shows that IntelliMerge takes 539 milliseconds to process one merge scenario on the median, which indicates its feasibility in real-world applications.

References

  1. Iftekhar Ahmed, Caius Brindescu, Umme Ayda Mannan, Carlos Jensen, and Anita Sarma. 2017. An empirical examination of the relationship between code smells and merge conflicts. In 2017 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM). IEEE, 58–67.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Everton LG Alves, Myoungkyu Song, and Miryung Kim. 2014. RefDistiller: a refactoring aware code review tool for inspecting manual refactoring edits. In Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, 751–754.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Sven Apel, Olaf Leßenich, and Christian Lengauer. 2012. Structured merge with auto-tuning: balancing precision and performance. In Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering. ACM, 120–129.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Sven Apel, Jörg Liebig, Benjamin Brandl, Christian Lengauer, and Christian Kästner. 2011. Semistructured merge: rethinking merge in revision control systems. In Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering. ACM, 190–200.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Christian Bartelt. 2008. Consistence preserving model merge in collaborative development processes. In Proceedings of the 2008 international workshop on Comparison and versioning of software models. ACM, 13–18.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. David Binkley, Susan Horwitz, and Thomas Reps. 1995. Program integration for languages with procedure calls. ACM Transactions on Software Engineering and Methodology (TOSEM) 4, 1 (1995), 3–35.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Christian Bird and Thomas Zimmermann. 2012. Assessing the value of branches with what-if analysis. In Proceedings of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering. ACM, 45.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Caius Brindescu. 2018. How do developers resolve merge conflicts? an investigation into the processes, tools, and improvements. In Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. ACM, 952–955.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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. ACM, 168–178.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jim Buckley, Tom Mens, Matthias Zenger, Awais Rashid, and Günter Kniesel. 2005. Towards a taxonomy of software change. Journal of Software Maintenance and Evolution: Research and Practice 17, 5 (2005), 309–332.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Jim Buffenbarger. 1993. Syntactic software merging. In Software Configuration Management. Springer, 153–172.Google ScholarGoogle Scholar
  12. Guilherme Cavalcanti, Paulo Borba, and Paola Accioly. 2017. Evaluating and improving semistructured merge. Proceedings of the ACM on Programming Languages 1, OOPSLA (2017), 59.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Eunjong Choi, Kenji Fujiwara, Norihiro Yoshida, and Shinpei Hayashi. 2018. A survey of refactoring detection techniques based on change history analysis. arXiv preprint arXiv:1808.02320 (2018).Google ScholarGoogle Scholar
  14. Danny Dig, Kashif, Tien N Nguyen, and Ralph Johnson. 2006a. Refactoring-aware software merging and configuration management. Acm Sigsoft Software Engineering Notes 31, 6 (2006), 1–2.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Danny Dig, Kashif Manzoor, Ralph Johnson, and Tien N. Nguyen. 2007. Refactoring-Aware Configuration Management for Object-Oriented Programs. In International Conference on Software Engineering.Google ScholarGoogle Scholar
  16. Danny Dig, Kashif Manzoor, Ralph E Johnson, and Tien N Nguyen. 2008. Effective software merging in the presence of object-oriented refactorings. IEEE Transactions on Software Engineering 34, 3 (2008), 321–335.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Danny Dig, Tien N Nguyen, Kashif Manzoor, and Ralph Johnson. 2006b. MolhadoRef: a refactoring-aware software configuration management tool. In Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications. ACM, 732–733.Google ScholarGoogle Scholar
  18. Hongfei Fan, Jiayao Gao, Hongming Zhu, Qin Liu, Yang Shi, and Chengzheng Sun. 2017a. Balancing Conflict Prevention and Concurrent Work in Real-Time Collaborative Programming. In Proceedings of the 12th Chinese Conference on Computer Supported Cooperative Work and Social Computing. ACM, 217–220.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Hongfei Fan and Chengzheng Sun. 2012. Dependency-based automatic locking for semantic conflict prevention in real-time collaborative programming. In Proceedings of the 27th Annual ACM Symposium on Applied Computing. ACM, 737–742.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Hongfei Fan, Hongming Zhu, Qin Liu, Yang Shi, and Chengzheng Sun. 2017b. Shared-locking for semantic conflict prevention in real-time collaborative programming. In 2017 IEEE 21st International Conference on Computer Supported Cooperative Work in Design (CSCWD). IEEE, 174–179.Google ScholarGoogle ScholarCross RefCross Ref
  21. Martin Fowler. 2002. Refactoring: Improving the Design of Existing Code. In Xp Universe First Agile Universe Conference on Extreme Programming Agile Methods-xp/agile Universe.Google ScholarGoogle ScholarCross RefCross Ref
  22. Judith E Grass. 1992. Cdiff: A syntax directed differencer for C++ programs. In C++ Conference, Portland, Oregon, 1992. 181–193.Google ScholarGoogle Scholar
  23. Mário Luís Guimarães and António Rito Silva. 2012. Improving early detection of software merge conflicts. In Proceedings of the 34th International Conference on Software Engineering. IEEE Press, 342–352.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Daniel Jackson, David A Ladd, et al. 1994. Semantic Diff: A Tool for Summarizing the Effects of Modifications.. In ICSM, Vol. 94. 243–252.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Bakhtiar Khan Kasi and Anita Sarma. 2013. Cassandra: Proactive conflict minimization through optimized task scheduling. In Proceedings of the 2013 International Conference on Software Engineering. IEEE Press, 732–741.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Miryung Kim, Matthew Gee, Alex Loh, and Napol Rachatasumrit. 2010. Ref-Finder: a refactoring reconstruction tool based on logic query templates. In Proceedings of the eighteenth ACM SIGSOFT international symposium on Foundations of software engineering. ACM, 371–372.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Dimitrios S Kolovos, Richard F Paige, and Fiona AC Polack. 2006. Merging models with the epsilon merging language (EML). In International Conference on Model Driven Engineering Languages and Systems. Springer, 215–229.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Hoai Le Nguyen and Claudia-Lavinia Ignat. 2018. An Analysis of Merge Conflicts and Resolutions in Git-based Open Source Projects. Computer Supported Cooperative Work (CSCW) 27, 3-6 (2018), 741–765.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Olaf Leßenich, Sven Apel, and Christian Lengauer. 2015. Balancing precision and performance in structured merge. Automated Software Engineering 22, 3 (2015), 367–397.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tancred Lindholm. 2004. A three-way merge for XML documents. In Proceedings of the 2004 ACM symposium on Document engineering. ACM, 1–10.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Ernst Lippe and Norbert Van Oosterom. 1992. Operation-based merging. In ACM SIGSOFT Software Engineering Notes, Vol. 17. ACM, 78–87.Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Mehran Mahmoudi, Sarah Nadi, and Nikolaos Tsantalis. 2019. Are Refactorings to Blame? An Empirical Study of Refactorings in Merge Conflicts. In 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, 151–162.Google ScholarGoogle Scholar
  33. Akhil Mehra, John Grundy, and John Hosking. 2005. A generic approach to supporting diagram differencing and merging for collaborative design. In Proceedings of the 20th IEEE/ACM international Conference on Automated software engineering. ACM, 204–213.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Gleiph Ghiotto Lima Menezes, Leonardo Gresta Paulino Murta, Marcio Oliveira Barros, and Andre Van Der Hoek. 2018. On the Nature of Merge Conflicts: a Study of 2,731 Open Source Java Projects Hosted by GitHub. IEEE Transactions on Software Engineering (2018).Google ScholarGoogle Scholar
  35. Tom Mens. 1999. Conditional graph rewriting as a domain-independent formalism for software evolution. In International Workshop on Applications of Graph Transformations with Industrial Relevance. Springer, 127–143.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. T. Mens. 2002. A state-of-the-art survey on software merging. IEEE Transactions on Software Engineering 28, 5 (2002), 449–462.Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Tom Mens and Tom Tourwé. 2004. A survey of software refactoring. IEEE Transactions on software engineering 30, 2 (2004), 126–139.Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Stas Negara, Nicholas Chen, Mohsen Vakilian, Ralph E Johnson, and Danny Dig. 2013. A comparative study of manual and automated refactorings. In European Conference on Object-Oriented Programming. Springer, 552–576.Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Nan Niu, Steve Easterbrook, and Mehrdad Sabetzadeh. 2005. A category-theoretic approach to syntactic software merging. In 21st IEEE International Conference on Software Maintenance (ICSM’05). IEEE, 197–206.Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Felix Schwägerl, Sabrina Uhrig, and Bernhard Westfechtel. 2015. A graph-based algorithm for three-way merging of ordered collections in EMF models. Science of Computer Programming 113 (2015), 51–81.Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Sergio Segura, David Benavides, Antonio Ruiz-Cortés, and Pablo Trinidad. 2007. Automated merging of feature models using graph transformations. In International Summer School on Generative and Transformational Techniques in Software Engineering. Springer, 489–505.Google ScholarGoogle Scholar
  42. Danilo Silva, Nikolaos Tsantalis, and Marco Tulio Valente. 2016. Why we refactor? confessions of github contributors. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, 858–870.Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Danilo Silva and Marco Tulio Valente. 2017. RefDiff: detecting refactorings in version histories. In Proceedings of the 14th International Conference on Mining Software Repositories. IEEE Press, 269–279.Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Friedrich Steimann and Nils Kurowsky. 2019. Transactional Editing: Giving ACID to Programmers. In Proceedings of the 12th ACM SIGPLAN International Conference on Software Language Engineering. ACM.Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Nikolaos Tsantalis, Matin Mansouri, Laleh M Eshkevari, Davood Mazinanian, and Danny Dig. 2018. Accurate and efficient refactoring detection in commit history. In Proceedings of the 40th International Conference on Software Engineering. ACM, 483–494.Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Chuck Walrad and Darrel Strom. 2002. The importance of branching models in SCM. Computer 35, 9 (2002), 31–38.Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Bernhard Westfechtel. 1991. Structure-oriented merging of revisions of software documents. In Software Configuration Management Workshop: Proceedings of the 3 rd international workshop on Software configuration management, Vol. 12. 68–79.Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Fengmin Zhu and Fei He. 2018. Conflict resolution for structured merge via version space algebra. Proceedings of the ACM on Programming Languages 2, OOPSLA (2018), 166.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. IntelliMerge: a refactoring-aware software merging technique

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image Proceedings of the ACM on Programming Languages
      Proceedings of the ACM on Programming Languages  Volume 3, Issue OOPSLA
      October 2019
      2077 pages
      EISSN:2475-1421
      DOI:10.1145/3366395
      Issue’s Table of Contents

      Copyright © 2019 Owner/Author

      This work is licensed under a Creative Commons Attribution-NoDerivs International 4.0 License.

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 10 October 2019
      Published in pacmpl Volume 3, Issue OOPSLA

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader