Why Developers Refactor Source Code: A Mining-based Study

Jevgenija Pantiuchina, Fiorella Zampetti, Simone Scalabrino, Valentina Piantadosi, Rocco Oliveto +2 more
1/5/2021
cs.SE

Official code: replication-package/why-refactoring (3 stars, R, last commit 2020-08-31).

Abstract

Refactoring aims at improving code non-functional attributes without modifying its external behavior. Previous studies investigated the motivations behind refactoring by surveying developers.

Show full abstract

With the aim of generalizing and complementing their findings, we present a large-scale study quantitatively and qualitatively investigating why developers perform refactoring in open source projects. First, we mine 287,813 refactoring operations performed in the history of 150 systems. Using this dataset, we investigate the interplay between refactoring operations and process (e.g., previous changes/fixes) and product (e.g., quality metrics) metrics. Then, we manually analyze 551 merged pull requests implementing refactoring operations and classify the motivations behind the implemented refactorings (e.g., removal of code duplication). Our results led to (i) quantitative evidence of the relationship existing between certain process/product metrics and refactoring operations and (ii) a detailed taxonomy, generalizing and complementing the ones existing in the literature, of motivations pushing developers to refactor source code.

View on arXivView PDF

Code Implementations(1)

Why Developers Refactor Code?

33RAug 20, 20196 years ago

Similar Papers

Cite this paper

@article{pantiuchina2021developers,
  title  = {Why Developers Refactor Source Code: A Mining-based Study},
  author = {Jevgenija Pantiuchina and Fiorella Zampetti and Simone Scalabrino and Valentina Piantadosi and Rocco Oliveto and Gabriele Bavota and Massimiliano Di Penta},
  year   = {2021},
  eprint = {2101.01430},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2101.01430}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2101.01430.svg)](https://codeofpaper.com/paper/2101.01430)

Discussion