Litcius/Paper detail

DeepMerge: Learning to Merge Programs

Elizabeth Dinella, Todd Mytkowicz, A. Svyatkovskiy, Christian Bird, Mayur Naik, Shuvendu K. Lahiri

2022IEEE Transactions on Software Engineering32 citationsDOI

Abstract

In collaborative software development, program merging is <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">the</i> mechanism to integrate changes from multiple programmers. Merge algorithms in modern version control systems report a conflict when changes interfere textually. Merge conflicts require manual intervention and frequently stall modern continuous integration pipelines. Prior work found that, although costly, a large majority of resolutions involve re-arranging text without writing any new code. Inspired by this observation we propose the <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">first data-driven approach</i> to resolve merge conflicts with a machine learning model. We realize our approach in a tool <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">DeepMerge</small> that uses a novel combination of (i) an edit-aware embedding of merge inputs and (ii) a variation of pointer networks, to construct resolutions from input segments. We also propose an algorithm to localize manual resolutions in a resolved file and employ it to curate a ground-truth dataset comprising 8,719 non-trivial resolutions in JavaScript programs. Our evaluation shows that, on a held out test set, <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">DeepMerge</small> can predict correct resolutions for 37% of non-trivial merges, compared to only 4% by a state-of-the-art semistructured merge technique. Furthermore, on the subset of merges with upto 3 lines (comprising 24% of the total dataset), <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">DeepMerge</small> can predict correct resolutions with 78% accuracy.

Topics & Concepts

Computer scienceMerge (version control)Artificial intelligencePointer (user interface)Programming languageInformation retrievalMachine learningTheoretical computer scienceSoftware Engineering ResearchSoftware Testing and Debugging TechniquesAdvanced Malware Detection Techniques