A Characterization Study of Merge Conflicts in Java Projects

TR Number

Date

2022

Journal Title

Journal ISSN

Volume Title

Publisher

ACM

Abstract

In collaborative software development, programmers create branches to add features and fix bugs, and merge branches to integrate edits. When edits from different branches textually overlap (i.e., textual conflicts) or lead to compilation and runtime errors (i.e., build and test conflicts), it is challenging for developers to remove conflicts. Prior work proposed tools to detect and solve conflicts. However, many questions are not fully investigated, such as what types of conflicts exist in practice and how developers or tools handle them. For this paper, we used automated textual merge, compilation, and testing to reveal 3 types of conflicts in 208 open-source repositories: textual conflicts, build conflicts (i.e., conflicts causing build errors), and test conflicts (i.e., conflicts triggering test failures). We manually inspected 538 conflicts and their resolutions to characterize merge conflicts. Our analysis revealed three phenomena. First, higher-order conflicts (i.e., build and test conflicts) are harder to handle, while existing tools mainly focus on textual conflicts. Second, developers resolved most higher-order conflicts by applying similar edits to multiple program locations. Third, developers resolved 64% of true textual conflicts by keeping complete edits from either a left or right branch. Our work will shed light on future research of software merge.

Description

Keywords

Citation