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 条
  • [1] Building empirical knowledge on the relationship between code smells and design patterns: An exploratory study
    Santos, Jose Amancio M.
    Antunes Petronilo, Gadiel Xavier
    [J]. JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2022, 34 (09)
  • [2] The relationship between design patterns and code smells: An exploratory study
    Walter, Bartosz
    Alkhaeir, Tarek
    [J]. INFORMATION AND SOFTWARE TECHNOLOGY, 2016, 74 : 127 - 142
  • [3] The Effect of Code Smells on the Relationship Between Design Patterns and Defects
    Alkhaeir, Tarek
    Walter, Bartosz
    [J]. IEEE ACCESS, 2021, 9 (09): : 3360 - 3373
  • [4] An Empirical Examination of the Relationship Between Code Smells and Merge Conflicts
    Ahmed, Iftekhar
    Brindescu, Caius
    Mannan, Umme Ayda
    Jensen, Carlos
    Sarma, Anita
    [J]. 11TH ACM/IEEE INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT (ESEM 2017), 2017, : 58 - 67
  • [5] An empirical investigation of the relationship between pattern grime and code smells
    Alharbi, Maha
    Alshayeb, Mohammad
    [J]. JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2024, 36 (09)
  • [6] An empirical investigation on the relationship between design and architecture smells
    Sharma, Tushar
    Singh, Paramvir
    Spinellis, Diomidis
    [J]. EMPIRICAL SOFTWARE ENGINEERING, 2020, 25 (05) : 4020 - 4068
  • [7] An empirical investigation on the relationship between design and architecture smells
    Tushar Sharma
    Paramvir Singh
    Diomidis Spinellis
    [J]. Empirical Software Engineering, 2020, 25 : 4020 - 4068
  • [8] The Relationship Between Code Smells and Traceable Patterns - Are They Measuring the Same Thing?
    Codabux, Zadia
    Sultana, Kazi Zakia
    Williams, Byron J.
    [J]. INTERNATIONAL JOURNAL OF SOFTWARE ENGINEERING AND KNOWLEDGE ENGINEERING, 2017, 27 (9-10) : 1529 - 1547
  • [9] Are architectural smells independent from code smells? An empirical study
    Fontana, Francesca Arcelli
    Lenarduzzi, Valentina
    Roveda, Riccardo
    Taibi, Davide
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2019, 154 : 139 - 156
  • [10] Empirical Study on Code Smells in iOS Applications
    Rahkema, Kristiina
    Pfahl, Dietmar
    [J]. 2020 IEEE/ACM 7TH INTERNATIONAL CONFERENCE ON MOBILE SOFTWARE ENGINEERING AND SYSTEMS, MOBILESOFT, 2020, : 61 - 65