Are Refactorings to Blame? An Empirical Study of Refactorings in Merge Conflicts

Mehran Mahmoudi, Sarah Nadi, Nikolaos Tsantalis

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

With the rise of distributed software development, branching has become a popular approach that facilitates collaboration between software developers. One of the biggest challenges that developers face when using multiple development branches is dealing with merge conflicts. Conflicts occur when inconsistent changes happen to the code. Resolving these conflicts can be a cumbersome task as it requires prior knowledge about the changes in each of the development branches. A type of change that could potentially lead to complex conflicts is code refactoring. Previous studies have proposed techniques for facilitating conflict resolution in the presence of refactorings. However, the magnitude of the impact that refactorings have on merge conflicts has never been empirically evaluated. In this paper, we perform an empirical study on almost 3,000 well-engineered open-source Java software repositories and investigate the relation between merge conflicts and 15 popular refactoring types. Our results show that refactoring operations are involved in 22% of merge conflicts, which is remarkable taking into account that we investigated a relatively small subset of all possible refactoring types. Furthermore, certain refactoring types, such as EXTRACT METHOD, tend to be more problematic for merge conflicts. Our results also suggest that conflicts that involve refactored code are usually more complex, compared to conflicts with no refactoring changes.

Original languageEnglish (US)
Title of host publicationSANER 2019 - Proceedings of the 2019 IEEE 26th International Conference on Software Analysis, Evolution, and Reengineering
EditorsEmad Shihab, David Lo, Xinyu Wang
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages151-162
Number of pages12
ISBN (Electronic)9781728105918
DOIs
StatePublished - Mar 15 2019
Event26th IEEE International Conference on Software Analysis, Evolution, and Reengineering, SANER 2019 - Hangzhou, China
Duration: Feb 24 2019Feb 27 2019

Publication series

NameSANER 2019 - Proceedings of the 2019 IEEE 26th International Conference on Software Analysis, Evolution, and Reengineering

Conference

Conference26th IEEE International Conference on Software Analysis, Evolution, and Reengineering, SANER 2019
Country/TerritoryChina
CityHangzhou
Period2/24/192/27/19

Keywords

  • git
  • merge conflict
  • refactoring
  • software evolution

ASJC Scopus subject areas

  • Computer Science Applications
  • Software
  • Computational Theory and Mathematics

Fingerprint

Dive into the research topics of 'Are Refactorings to Blame? An Empirical Study of Refactorings in Merge Conflicts'. Together they form a unique fingerprint.

Cite this