Skip to content

rangeetpan/MergeConflict

Repository files navigation

This project contains the code and data for the paper Can Program Synthesis be Used to Learn Merge Conflict Resolutions? An Empirical Analysis, appeared in International Conference on Software Engineering (ICSE'21) . This work has been done by Rangeet Pan, Vu Le, Nachiappan Nagappan, Sumit Gulwani, Shuvendu Lahiri, and Mike Kaufman.

Abstract In this paper, we study the problem of textual merge conflicts from the perspective of Microsoft Edge, a large, highly collaborative fork off the main Chromium branch with significant merge conflicts. Broadly, this study is divided into two sections. First, we empirically evaluate textual merge conflicts in Microsoft Edge and classify them based on the type of files, location of conflicts in a file, and the size of conflicts. We found that ~28% of the merge conflicts are 1-2 line changes, and many resolutions have frequent patterns. Second, driven by these findings, we explore Program Synthesis (for the first time) to learn patterns and resolve structural merge conflicts. We propose a novel domain-specific language (DSL) that captures many of the repetitive merge conflict resolution patterns and learn resolution strategies as programs in this DSL from example resolutions. We found that the learned strategies can resolve 11.4% of the conflicts (~41% of 1-2 line changes) that arise in the C++ files with 93.2% accuracy.

Set Up and Run

  1. Install .NET Core 3.1 SDK (https://www.microsoft.com/net/download/)

  2. Clone this repository:

    git clone https://github.com/Microsoft/prose.git
    
  3. Build the solution

    cd prose\DslSamples\MergeConflictsResolution
    dotnet build
    
  4. Run the tool

    .\MergeConflictsResolutionConsole\bin\Debug\netcoreapp3.1\MergeConflictsResolutionConsole.exe
    

Build and Run Using Visual Studio

  1. Open the project solution MergeConflictsResolution.sln in Visual Studio.

  2. Build -> Build Solution.

  3. Right click MergeConflictsResolutionConsole project (in Solution Explorer) -> Set as Startup Project.

  4. Debug -> Start Debugging.

Understanding the Synthesizer

The synthesizer has the following main components:

Contact Us:

Rangeet Pan (rangeet@iastate.edu)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published