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 条
  • [21] An empirical study of Android behavioural code smells detection
    Prestat, Dimitri
    Moha, Naouel
    Villemaire, Roger
    EMPIRICAL SOFTWARE ENGINEERING, 2022, 27 (07)
  • [22] An empirical study of Android behavioural code smells detection
    Dimitri Prestat
    Naouel Moha
    Roger Villemaire
    Empirical Software Engineering, 2022, 27
  • [23] An Empirical Study of Code Smells in Java']JavaScript Projects
    Saboury, Amir
    Musavi, Pooya
    Khomh, Foutse
    Antoniol, Giulio
    2017 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), 2017, : 294 - 305
  • [24] A taxonomy and an initial empirical study of bad smells in code
    Mäntylä, M
    Vanhanen, J
    Lassenius, C
    INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, PROCEEDINGS, 2003, : 381 - 384
  • [25] An Empirical Study of Code Smells in Transformer-based Code Generation Techniques
    Siddiq, Mohammed Latif
    Majumder, Shafayat H.
    Mim, Maisha R.
    Jajodia, Sourov
    Santos, Joanna C. S.
    2022 IEEE 22ND INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2022), 2022, : 71 - 82
  • [26] On the Effectiveness of Concern Metrics to Detect Code Smells: An Empirical Study
    Padilha, Juliana
    Pereira, Juliana
    Figueiredo, Eduardo
    Almeida, Jussara
    Garcia, Alessandro
    Sant'Anna, Claudio
    ADVANCED INFORMATION SYSTEMS ENGINEERING (CAISE 2014), 2014, 8484 : 656 - 671
  • [27] Are Existing Code Smells Relevant in Web Games? An Empirical Study
    Khanve, Vaishali
    ESEC/FSE'2019: PROCEEDINGS OF THE 2019 27TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2019, : 1241 - 1243
  • [28] Are existing code smells relevant in web games? An empirical study
    Khanve, Vaishali
    ESEC/FSE 2019 - Proceedings of the 2019 27th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering, 2019, : 1241 - 1243
  • [29] A blessing in disguise? Assessing the Relationship between Code Smells and Sustainability
    Catolino, Gemma
    2020 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2020), 2020, : 779 - 780
  • [30] Defect frequency and design patterns:: An empirical study of industrial code
    Vokác, M
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2004, 30 (12) : 904 - 917