Merge conflicts are very common in collaborative software development, which is supported mainly by the use of branches that can be potentially merged. In this context, several studies have proposed mechanisms to avoid conflicts whenever possible and some identified factors that lead to conflicts. In this article, we report on an investigation of factors that can lead to conflicts or that can somehow reduce the chances of conflict from the developers’ perspective. To do so, based on related work, we conducted two empirical studies with Brazilian software developers to both understand and analyze factors that affect merge conflicts. Firstly, we conducted survey research with 109 software developers to understand how they use branches, the occurrence of conflicts and the resolution process, and factors that can lead to or avoid conflicts. Results showed that the use of branches is very common and mostly has the purpose of creating a new feature or fixing a bug. According to the participants, in most projects, developers have the autonomy to create new branches and sometimes conflicts happen. The main factors that can lead to conflicts are “the time a branch is isolated” and “lack of communication”. On the other hand, the factors cited as good practices to avoid conflicts were “improve team communication” and “less branching duration”. Secondly, we conducted a field study based on interviews with 15 software developers to analyze those factors to understand better what leads to or avoids conflicts in a merge. Finally, this work allowed us to conclude that communication with the team, checking code updates, shorter branch duration, and management are important for software developers, especially when they think about what increases and decreases merge conflicts.
Read full abstract