Understanding the Impact of Refactoring on Smells: A Longitudinal Study of 23 Software Projects

被引:54
|
作者
Cedrim, Diego [1 ]
Garcia, Alessandro [1 ]
Mongiovi, Melina [2 ]
Gheyi, Rohit [2 ]
Sousa, Leonardo [1 ]
de Mello, Rafael [1 ]
Fonseca, Baldoino [3 ]
Ribeiro, Marcio [3 ]
Chavez, Alexander [1 ]
机构
[1] Pontificia Univ Catolica Rio de Janeiro, Rio de Janeiro, Brazil
[2] Univ Fed Campina Grande, Campina Grande, Brazil
[3] Univ Fed Alagoas, Maceio, Brazil
关键词
Refactoring; Code Smells; Structural Quality; CODE SMELLS; MAINTENANCE PROBLEMS;
D O I
10.1145/3106237.3106259
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code smells in a program represent indications of structural quality problems, which can be addressed by software refactoring. However, refactoring intends to achieve different goals in practice, and its application may not reduce smelly structures. Developers may neglect or end up creating new code smells through refactoring. Unfortunately, little has been reported about the beneficial and harmful effects of refactoring on code smells. This paper reports a longitudinal study intended to address this gap. We analyze how often commonly-used refactoring types affect the density of 13 types of code smells along the version histories of 23 projects. Our findings are based on the analysis of 16,566 refactorings distributed in 10 different types. Even though 79.4% of the refactorings touched smelly elements, 57% did not reduce their occurrences. Surprisingly, only 9.7% of refactorings removed smells, while 33.3% induced the introduction of new ones. More than 95% of such refactoring-induced smells were not removed in successive commits, which suggest refactorings tend to more frequently introduce long-living smells instead of eliminating existing ones. We also characterized and quantified typical refactoring-smell patterns, and observed that harmful patterns are frequent, including: (i) approximately 30% of the Move Method and Pull Up Method refactorings induced the emergence of God Class, and (ii) the Extract Superclass refactoring creates the smell Speculative Generality in 68% of the cases.
引用
收藏
页码:465 / 475
页数:11
相关论文
共 50 条
  • [21] Understanding the effect of batch refactoring on software quality
    Agnihotri, Mansi
    Chug, Anuradha
    International Journal of System Assurance Engineering and Management, 15 (06): : 2328 - 2336
  • [22] Impact of Metrics based Refactoring on the Software Quality: a Case Study
    Shrivastava, Suprika Vasudeva
    Shrivastava, Vishal
    2008 IEEE REGION 10 CONFERENCE: TENCON 2008, VOLS 1-4, 2008, : 439 - +
  • [23] An Ontology-Based Approach to Reduce the Negative Impact of Code Smells in Software Development Projects
    Castellano, Ivian L.
    Aguilar, Gilberto Fernando Castro
    Silega, Nemury
    Kamal, Tahir
    Al-Gaashani, Mehdhar S. A. M.
    Samee, Nagwan Abdel
    Alabdulhafith, Maali
    IEEE ACCESS, 2023, 11 : 100146 - 100153
  • [24] A Quantitative Study on Characteristics and Effect of Batch Refactoring on Code Smells
    Bibiano, Ana Carla
    Fernandes, Eduardo
    Oliveira, Daniel
    Garcia, Alessandro
    Kalinowski, Marcos
    Fonseca, Baldoino
    Oliveira, Roberto
    Oliveira, Anderson
    Cedrim, Diego
    2019 13TH ACM/IEEE INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT (ESEM 2019), 2019, : 31 - 41
  • [25] Learning to detect community smells in open source software projects
    Almarimi, Nuri
    Ouni, Ali
    Mkaouer, Mohamed Wiem
    KNOWLEDGE-BASED SYSTEMS, 2020, 204
  • [26] An Exploratory Study of the Impact of Code Smells on Software Change-proneness
    Khomh, Foutse
    Di Penta, Massimiliano
    Gueheneuc, Yann-Gael
    16TH WORKING CONFERENCE ON REVERSE ENGINEERING (WCRE 2009), 2009, : 75 - +
  • [28] URegM: a unified prediction model of resource consumption for refactoring software smells in open source cloud
    Imran, Asif
    Kosar, Tevfik
    PROCEEDINGS OF 2022 THE 3RD EUROPEAN SYMPOSIUM ON SOFTWARE ENGINEERING, ESSE 2022, 2022, : 56 - 62
  • [29] Understanding metric-based detectable smells in Python']Python software: A comparative study
    Chen Zhifei
    Chen Lin
    Ma Wanwangying
    Zhou Xiaoyu
    Zhou Yuming
    Xu Baowen
    INFORMATION AND SOFTWARE TECHNOLOGY, 2018, 94 : 14 - 29
  • [30] Analysis of Code Refactoring Impact on Software Quality
    Kaur, Amandeep
    Kaur, Manpreet
    4TH INTERNATIONAL CONFERENCE ON ADVANCEMENTS IN ENGINEERING & TECHNOLOGY (ICAET-2016), 2016, 57