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

被引:56
|
作者
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
来源
ESEC/FSE 2017: PROCEEDINGS OF THE 2017 11TH JOINT MEETING ON FOUNDATIONS OF SOFTWARE ENGINEERING | 2017年
关键词
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 条
  • [1] Does refactoring improve software structural quality? A longitudinal study of 25 projects
    Cedrim, Diego
    Sousa, Leonardo
    Garcia, Alessandro
    Gheyi, Rohit
    THIRTIETH BRAZILIAN SYMPOSIUM ON SOFTWARE ENGINEERING (SBES 2016), 2016, : 73 - 82
  • [2] A longitudinal study of the impact of refactoring in android applications
    Hamdi, Oumayma
    Ouni, Ali
    Cinneide, Mel O.
    Mkaouer, Mohamed Wiem
    INFORMATION AND SOFTWARE TECHNOLOGY, 2021, 140
  • [3] Refactoring Community Smells: An Empirical Study on the Software Practitioners of Bangladesh
    Tahsin, Noshin
    Sakib, Kazi
    2022 29TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE, APSEC, 2022, : 422 - 426
  • [4] A systematic literature review: Refactoring for disclosing code smells in object oriented software
    Singh, Satwinder
    Kaur, Sharanpreet
    AIN SHAMS ENGINEERING JOURNAL, 2018, 9 (04) : 2129 - 2151
  • [5] Identification, Impact, and Refactoring of Smells in Pipe-Like Web Mashups
    Stolee, Kathryn T.
    Elbaum, Sebastian
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2013, 39 (12) : 1654 - 1679
  • [6] 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 - +
  • [7] Analyzing the Impact of Refactoring on Bad Smells
    Tavares, Cleiton
    Bigonha, Mariza
    Figueiredo, Eduardo
    34TH BRAZILIAN SYMPOSIUM ON SOFTWARE ENGINEERING, SBES 2020, 2020, : 97 - 101
  • [8] A Systematic Literature Survey of Software Metrics, Code Smells and Refactoring Techniques
    Agnihotri, Mansi
    Chug, Anuradha
    JOURNAL OF INFORMATION PROCESSING SYSTEMS, 2020, 16 (04): : 915 - 934
  • [9] Composite refactoring: Representations, characteristics and effects on software projects
    Bibiano, Ana Carla
    Uchoa, Anderson
    Assuncao, Wesley K. G.
    Tenorio, Daniel
    Colanzi, Thelma E.
    Vergilio, Silvia Regina
    Garcia, Alessandro
    INFORMATION AND SOFTWARE TECHNOLOGY, 2023, 156
  • [10] Impact on energy consumption of design patterns, code smells and refactoring techniques: A systematic mapping study
    Poy, Olivia
    Angeles Moraga, Ma
    Garcia, Felix
    Calero, Coral
    JOURNAL OF SYSTEMS AND SOFTWARE, 2025, 222