The Effect of Code Smells on the Relationship Between Design Patterns and Defects

被引:7
|
作者
Alkhaeir, Tarek [1 ]
Walter, Bartosz [1 ]
机构
[1] Poznan Univ Tech, Fac Comp & Telecommun, PL-60965 Poznan, Poland
来源
IEEE ACCESS | 2021年 / 9卷 / 09期
关键词
Code smells; design patterns; defect proneness;
D O I
10.1109/ACCESS.2020.3047870
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
The relationship between design patterns and defects was investigated in the literature, but with mixed results. While the majority of studies found the presence of patterns to be positively correlated with defects, other works reported the opposite conclusions. This may suggest that contextual factors affect this relationship. In this study we analyze the role of code smells as a confounding variable in the relationship between design patterns and defects in Java classes. To investigate this, we applied statistical tests to capture the difference in the impact on defects between pattern classes with/without code smells in 10 Java systems from the PROMISE dataset, with respect to 13 design patterns and 10 code smells. The presence of code smells in patterns appears to be a valid factor affecting defect-proneness. Pattern classes with smells attract more defects than non-smelly pattern classes, and in most systems smelly design patterns are positively correlated with the presence of defects, while non-smelly patterns tend to have no impact, or a slightly negative impact on the presence of defects. As a result, the presence of code smells in design pattern classes appears to be a contextual factor affecting the defect-proneness of the subject code.
引用
收藏
页码:3360 / 3373
页数:14
相关论文
共 50 条
  • [1] Empirical study of the relationship between design patterns and code smells
    Alfadel, Mahmoud
    Aljasser, Khalid
    Alshayeb, Mohammad
    [J]. PLOS ONE, 2020, 15 (04):
  • [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] 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)
  • [4] 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
  • [5] Revisiting the Relationship Between Code Smells and Refactoring
    Yoshida, Norihiro
    Saika, Tsubasa
    Choi, Eunjong
    Ouni, Ali
    Inoue, Katsuro
    [J]. 2016 IEEE 24TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC), 2016,
  • [6] A Systematic Literature Mapping on the Relationship Between Design Patterns and Bad Smells
    Sousa, Bruno L.
    Bigonha, Mariza A. S.
    Ferreira, Kecia A. M.
    [J]. 33RD ANNUAL ACM SYMPOSIUM ON APPLIED COMPUTING, 2018, : 1528 - 1535
  • [7] 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
  • [8] 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)
  • [9] A blessing in disguise? Assessing the Relationship between Code Smells and Sustainability
    Catolino, Gemma
    [J]. 2020 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2020), 2020, : 779 - 780
  • [10] Code Smells, Micro Patterns and their Relations
    Fontana, Francesca Arcelli
    Zanoni, Marco
    Walter, Bartosz
    Martenka, Pawel
    [J]. ERCIM NEWS, 2012, (88): : 33 - 33