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 条
  • [1] When Are Smells Indicators of Architectural Refactoring Opportunities? A Study of 50 Software Projects
    Sousa, Leonardo
    Oizumi, Willian
    Garcia, Alessandro
    Oliveira, Anderson
    Cedrim, Diego
    Lucena, Carlos
    2020 IEEE/ACM 28TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION, ICPC, 2020, : 354 - 365
  • [2] 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
  • [3] 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
  • [4] 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
  • [5] Ensemble Deep Network for Secured Refactoring Framework by Predicting Code-Bad Smells in Software Projects
    Pandiyavathi, T.
    Sivakumar, B.
    Journal of Software: Evolution and Process, 2025, 37 (02)
  • [6] Facilitating Software Refactoring with Appropriate Resolution Order of Bad Smells
    Liu, Hui
    Yang, Limei
    Niu, Zhendong
    Ma, Zhiyi
    Shao, Weizhong
    7TH JOINT MEETING OF THE EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND THE ACM SIGSOFT SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2009, : 265 - 268
  • [7] A survey on UML model smells detection techniques for software refactoring
    Mumtaz, Haris
    Alshayeb, Mohammad
    Mahmood, Sajjad
    Niazi, Mahmood
    JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2019, 31 (03)
  • [8] 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
  • [9] A Catalogue of Model Smells and Refactoring Operations for Object-Oriented Software
    Sidhu, Brahmaleen K.
    Singh, Kawaljeet
    Sharma, Neeraj
    PROCEEDINGS OF THE 2018 SECOND INTERNATIONAL CONFERENCE ON INVENTIVE COMMUNICATION AND COMPUTATIONAL TECHNOLOGIES (ICICCT), 2018, : 313 - 319
  • [10] 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