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 条
  • [41] On the practitioners' understanding of coupling smells - A grey literature based Grounded-Theory study
    Singjai, Apitchaka
    Simhandl, Georg
    Zdun, Uwe
    INFORMATION AND SOFTWARE TECHNOLOGY, 2021, 134
  • [42] The Birth of Refactoring A Retrospective on the Nature of High-Impact Software Engineering Research
    Griswold, William G.
    Opdyke, William F.
    IEEE SOFTWARE, 2015, 32 (06) : 30 - 38
  • [43] On the impact of Performance Antipatterns in multi-objective software model refactoring optimization
    Cortellessa, Vittorio
    Di Pompeo, Daniele
    Stoico, Vincenzo
    Tucci, Michele
    2021 47TH EUROMICRO CONFERENCE ON SOFTWARE ENGINEERING AND ADVANCED APPLICATIONS (SEAA 2021), 2021, : 224 - 233
  • [44] Test Coverage and Impact Analysis for Detecting Refactoring Faults: A Study on the Extract Method Refactoring
    Alves, Everton L. G.
    Massoni, Tiago
    Machado, Patricia D. L.
    30TH ANNUAL ACM SYMPOSIUM ON APPLIED COMPUTING, VOLS I AND II, 2015, : 1534 - 1540
  • [45] How Good are Code Smells for Evaluating Software Maintainability? - Results from a Comparative Case Study
    Yamashita, Aiko
    2013 29TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), 2013, : 566 - 571
  • [46] Refactoring a legacy component for reuse in a software product line: a case study
    Kolb, R
    Muthig, D
    Patzke, T
    Yamauchi, K
    JOURNAL OF SOFTWARE MAINTENANCE AND EVOLUTION-RESEARCH AND PRACTICE, 2006, 18 (02): : 109 - 132
  • [47] Assessment of Approaches for the Analysis of Refactoring Activity on Software Repositories An Empirical Study
    Orru, Matteo
    Marchesi, Michele
    PROCEEDINGS OF THE XP2016 SCIENTIFIC WORKSHOPS, 2016,
  • [48] An empirical study to improve software security through the application of code refactoring
    Mumtaz, Haris
    Alshayeb, Mohammad
    Mahmood, Sajjad
    Niazi, Mahmood
    INFORMATION AND SOFTWARE TECHNOLOGY, 2018, 96 : 112 - 125
  • [49] The Impact of Refactoring Changes on the SZZ Algorithm: An Empirical Study
    Campos Neto, Edmilson
    da Costa, Daniel Alencar
    Kulesza, Uira
    2018 25TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2018), 2018, : 380 - 390
  • [50] An Empirical Study on the Impact of Refactoring on Quality Metrics in Android Applications
    Hamdi, Oumayma
    Ouni, Ali
    AlOmar, Eman Abdullah
    Cinneide, Mel O.
    Mkaouer, Mohamed Wiem
    2021 IEEE/ACM 8TH INTERNATIONAL CONFERENCE ON MOBILE SOFTWARE ENGINEERING AND SYSTEMS (MOBILESOFT 2021), 2021, : 28 - 39