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 条
  • [21] The Impact of Code Smells on Software Bugs: A Systematic Literature Review
    Cairo, Aloisio S.
    Carneiro, Glauco de F.
    Monteiro, Miguel P.
    INFORMATION, 2018, 9 (11):
  • [22] Enhancing Software Robustness by Detecting and Removing Exception Handling Smells: An Empirical Study
    Hsieh, Chin-Yun
    Chen, You-Lun
    Liao, Zhen-Jie
    JOURNAL OF INTERNET TECHNOLOGY, 2018, 19 (05): : 1603 - 1611
  • [23] Code Refactoring and its Impact on Internal and External Software Quality: An Experimental Study
    Alawairdhi, Mohammed
    INTERNATIONAL JOURNAL OF COMPUTER SCIENCE AND NETWORK SECURITY, 2019, 19 (06): : 12 - 17
  • [24] Detecting Code Smells in Software Product Lines - An Exploratory Study
    Abilio, Ramon
    Padilha, Juliana
    Figueiredo, Eduardo
    Costa, Heitor
    2015 12TH INTERNATIONAL CONFERENCE ON INFORMATION TECHNOLOGY - NEW GENERATIONS, 2015, : 433 - 438
  • [25] An Exploratory Study on the Relationship of Smells and Design Issues with Software Vulnerabilities
    Oishwee, Sahrima Jannat
    Codabux, Zadia
    Stakhanova, Natalia
    PROCEEDINGS OF THE 1ST INTERNATIONAL WORKSHOP ON MINING SOFTWARE REPOSITORIES APPLICATIONS FOR PRIVACY AND SECURITY, MSR4P&S 2022, 2022, : 16 - 20
  • [26] A large-scale empirical study of code smells in JavaScript projects
    David Johannes
    Foutse Khomh
    Giuliano Antoniol
    Software Quality Journal, 2019, 27 : 1271 - 1314
  • [27] On evaluating the impact of the refactoring of architectural problems on software quality
    Fontana, Francesca Arcelli
    Roveda, Riccardo
    Vittori, Stefano
    Metelli, Andrea
    Saldarini, Stefano
    Mazzei, Francesco
    PROCEEDINGS OF THE XP2016 SCIENTIFIC WORKSHOPS, 2016,
  • [28] Evolution patterns of software-architecture smells: An empirical study of intra- and inter-version smells
    Gnoyke, Philipp
    Schulze, Sandro
    Krueger, Jacob
    JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 217
  • [29] A large-scale empirical study of code smells in Java']JavaScript projects
    Johannes, David
    Khomh, Foutse
    Antoniol, Giuliano
    SOFTWARE QUALITY JOURNAL, 2019, 27 (03) : 1271 - 1314
  • [30] Code Refactoring for Software Reusability: An Experimental Study
    Almogahed, Abdullah
    Mandin, Hairulnizam
    Rejab, Mazidah Mat
    Alawadhi, Abdulwadood
    Barraood, Samera Obaid
    Othman, Manal
    Al-Jamili, Omar
    Almazroi, Abdulwahab Ali
    Shaharudin, Shazlyn Milleana
    2024 4TH INTERNATIONAL CONFERENCE ON EMERGING SMART TECHNOLOGIES AND APPLICATIONS, ESMARTA 2024, 2024, : 62 - 67