Empirical study of the relationship between design patterns and code smells

被引:6
|
作者
Alfadel, Mahmoud [1 ]
Aljasser, Khalid [2 ]
Alshayeb, Mohammad [2 ]
机构
[1] Concordia Univ, Dept Comp Sci & Software Engn, Montreal, PQ, Canada
[2] King Fahd Univ Petr & Minerals, Informat & Comp Sci Dept, Dhahran, Saudi Arabia
来源
PLOS ONE | 2020年 / 15卷 / 04期
关键词
QUALITY; IMPACT; BAD;
D O I
10.1371/journal.pone.0231731
中图分类号
O [数理科学和化学]; P [天文学、地球科学]; Q [生物科学]; N [自然科学总论];
学科分类号
07 ; 0710 ; 09 ;
摘要
Software systems are often developed in such a way that good practices in the object-oriented paradigm are not met, causing the occurrence of specific disharmonies which are sometimes called code smells. Design patterns catalogue best practices for developing object-oriented software systems. Although code smells and design patterns are widely divergent, there might be a co-occurrence relation between them. The objective of this paper is to empirically evaluate if the presence of design patterns is related to the presence of code smells at different granularity levels. We performed an empirical study using 20 design patterns and 13 code smells in ten small-size to medium-size, open source Java-based systems. We applied statistical analysis and association rules. Results confirm that classes participating in design patterns have less smell-proneness and smell frequency than classes not participating in design patterns. We also noticed that every design pattern category act in the same way in terms of smell-proneness in the subject systems. However, we observed, based on the association rules learning and the proposed validation technique, that some patterns may be associated with certain smells in some cases. For instance, Command patterns can co-occur with God Class, Blob and External Duplication smell.
引用
收藏
页数:35
相关论文
共 50 条
  • [31] 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
  • [32] Code Smells, Micro Patterns and their Relations
    Fontana, Francesca Arcelli
    Zanoni, Marco
    Walter, Bartosz
    Martenka, Pawel
    ERCIM NEWS, 2012, (88): : 33 - 33
  • [33] An Ontological Identification of Relationships between Anti-Patterns and Code Smells
    Luo, Yixin
    Hoss, Allyson
    Carver, Doris L.
    2010 IEEE AEROSPACE CONFERENCE PROCEEDINGS, 2010,
  • [34] Code smells as system-level indicators of maintainability: An empirical study
    Yamashita, Aiko
    Counsell, Steve
    JOURNAL OF SYSTEMS AND SOFTWARE, 2013, 86 (10) : 2639 - 2653
  • [35] Software Code Smells and Defects: An Empirical Investigation
    Brown, Reuben
    Greer, Des
    PROCEEDINGS OF THE 18TH INTERNATIONAL CONFERENCE ON EVALUATION OF NOVEL APPROACHES TO SOFTWARE ENGINEERING, ENASE 2023, 2023, : 570 - 580
  • [36] Design Smells in Deep Learning Programs: An Empirical Study
    Nikanjam, Amin
    Khomh, Foutse
    2021 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2021), 2021, : 332 - 342
  • [37] A large-scale empirical study of code smells in JavaScript projects
    David Johannes
    Foutse Khomh
    Giuliano Antoniol
    Software Quality Journal, 2019, 27 : 1271 - 1314
  • [38] An Empirical Study on Code Smells Co-occurrences in Android Applications
    Hamdi, Oumayma
    Ouni, Ali
    AlOmar, Eman Abdullah
    Mkaouer, Mohamed Wiem
    2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING WORKSHOPS (ASEW 2021), 2021, : 26 - 33
  • [39] The Smelly Eight: An Empirical Study on the Prevalence of Code Smells in Quantum Computing
    Chen, Qihong
    Camara, Ruben
    Campos, Jose
    Souto, Andre
    Ahmed, Iftekhar
    2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 358 - 370
  • [40] Subjective evaluation of software evolvability using code smells:: An empirical study
    Mantyla, Mika V.
    Lassenius, Casper
    EMPIRICAL SOFTWARE ENGINEERING, 2006, 11 (03) : 395 - 431