arrow
Return

Why Developers Refactor Source Code: A Mining-based Study

delete2020-09-26
delete34
delete
OA
AI
J
Jevgenija Pantiuchina *
F
Fiorella Zampetti
S
Simone Scalabrino
V
Valentina Piantadosi
Rocco Oliveto cover
Rocco Oliveto (Rocco Oliveto)
Gabriele Bavota cover
Gabriele Bavota (Gabriele Bavota)
Massimiliano Di Penta cover
Massimiliano Di Penta (Massimiliano Di Penta)
DOI:10.1145/3408302delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Refactoring aims at improving code non-functional attributes without modifying its external behavior. Previous studies investigated the motivations behind refactoring by surveying developers. 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.
Keywords:
Refactoring
empirical software engineering
Why Do Developers Reject Refactorings in Open-Source Projects?
err2021-12-24
err4
PREAI
errPantiuchina, Jevgenija; Lin, Bin; Zampetti, Fiorella; Di Penta, Massimiliano; Lanza, Michele; Bavota, Gabriele
errShare
errSave
Test code refactoring unveiled: where and how does it affect test code quality and effectiveness?
err2024-11-16
err0
PREAI
errMartins, Luana; Pontillo, Valeria; Costa, Heitor; Ferrucci, Filomena; Palomba, Fabio; Machado, Ivan
errShare
errSave
Data augmentation of Python code refactoring datasets based on LLMs
err2026-06-18
err0
errOAAI
errVasilica-Andreea Moldovan; Rareş Pătcaş; Simona Motogna
errShare
errSave
An empirical study to improve software security through the application of code refactoring
err2018-04-01
err43
PREAI
errMumtaz, Haris; Alshayeb, Mohammad; Mahmood, Sajjad; Niazi, Mahmood
errShare
errSave
Evaluating refactorings for spreadsheet models
err2016-08-01
err4
errOAAI
errCunha, Jacome; Fernandes, Joao Paulo; Martins, Pedro; Mendes, Jorge; Pereira, Rui; Saraiva, Joao
errShare
errSave
Impermanent identifiers: Enhanced source code comprehension and refactoring
err2024-10-01
err1
errOAAI
errGuerra, Eduardo Martins; Ivo, Andre A. S.; Pereira, Fernando O.; Robbes, Romain; Janes, Andrea; Silveira, Fabio Fagundes
errShare
errSave
Multi-Criteria Code Refactoring Using Search-Based Software Engineering: An Industrial Case Study
err2016-06-30
err107
PREAI
errOuni, Ali; Kessentini, Marouane; Sahraoui, Houari; Inoue, Katsuro; Deb, Kalyanmoy
errShare
errSave

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.4K
Citations:
4.5K

Organization

U
universita della svizzera italiana
Scholars:
134
Papers: 64
Citations: 2.1K
U
university of sannio
Scholars:
128
Papers: 55
Citations: 1.4K
U
University of Molise
Scholars:
142
Papers: 65
Citations: 1.3K
researcher View more organizations
Cited Papers

Cited Papers

How changes affect software entropy: an empirical study
err2012-07-14
err49
PREAI
errCanfora, Gerardo; Cerulo, Luigi; Cimitile, Marta; Di Penta, Massimiliano
errShare
errSave
Urinary Cytokines During Intravesical Bacillus Calmetteguerin Therapy for Superficial Bladder Cancer
err1996-02-01
err0
PREAI
errTheo M. de Reijke; Elizabeth C. de Boer; Karl Heinz Kurth; Denis H. J. Schamhart
errShare
errSave
Identification of Move Method Refactoring Opportunities
err2009-05-01
err274
PREAI
errTsantalis, Nikolaos; Chatzigeorgiou, Alexander
errShare
errSave
Inferring Functional Linkages between Proteins from Evolutionary Scenarios
err2006-06-01
err0
PREAI
errYun Zhou; Rui Wang; Li Li; Xuefeng Xia; Zhirong Sun
errShare
errSave
errShare
errSave
How We Refactor, and How We Know It
err2012-01-01
err327
PREAI
errMurphy-Hill, Emerson; Parnin, Chris; Black, Andrew P.
errShare
errSave
Acute Urinary Retention Associated with Prostatic Carcinoma
err1989-06-01
err0
PREAI
errJudd W. Moul; Rodney Davis; John A. Vaccaro; Stephen A. Sihelnik; William D. Belville; David G. McLeod
errShare
errSave
Using structural and semantic measures to improve software modularization
err2012-09-14
err56
PREAI
errBavota, Gabriele; De Lucia, Andrea; Marcus, Andrian; Oliveto, Rocco
errShare
errSave
researcher View more