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

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 fact...

Descripción completa

Guardado en:
Detalles Bibliográficos
Autores principales: Tarek Alkhaeir, Bartosz Walter
Formato: article
Lenguaje:EN
Publicado: IEEE 2021
Materias:
Acceso en línea:https://doaj.org/article/4dbc4c69d60041d0a3a3f0c84b3689a3
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
id oai:doaj.org-article:4dbc4c69d60041d0a3a3f0c84b3689a3
record_format dspace
spelling oai:doaj.org-article:4dbc4c69d60041d0a3a3f0c84b3689a32021-11-23T00:00:56ZThe Effect of Code Smells on the Relationship Between Design Patterns and Defects2169-353610.1109/ACCESS.2020.3047870https://doaj.org/article/4dbc4c69d60041d0a3a3f0c84b3689a32021-01-01T00:00:00Zhttps://ieeexplore.ieee.org/document/9309303/https://doaj.org/toc/2169-3536The 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.Tarek AlkhaeirBartosz WalterIEEEarticleCode smellsdesign patternsdefect pronenessElectrical engineering. Electronics. Nuclear engineeringTK1-9971ENIEEE Access, Vol 9, Pp 3360-3373 (2021)
institution DOAJ
collection DOAJ
language EN
topic Code smells
design patterns
defect proneness
Electrical engineering. Electronics. Nuclear engineering
TK1-9971
spellingShingle Code smells
design patterns
defect proneness
Electrical engineering. Electronics. Nuclear engineering
TK1-9971
Tarek Alkhaeir
Bartosz Walter
The Effect of Code Smells on the Relationship Between Design Patterns and Defects
description 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.
format article
author Tarek Alkhaeir
Bartosz Walter
author_facet Tarek Alkhaeir
Bartosz Walter
author_sort Tarek Alkhaeir
title The Effect of Code Smells on the Relationship Between Design Patterns and Defects
title_short The Effect of Code Smells on the Relationship Between Design Patterns and Defects
title_full The Effect of Code Smells on the Relationship Between Design Patterns and Defects
title_fullStr The Effect of Code Smells on the Relationship Between Design Patterns and Defects
title_full_unstemmed The Effect of Code Smells on the Relationship Between Design Patterns and Defects
title_sort effect of code smells on the relationship between design patterns and defects
publisher IEEE
publishDate 2021
url https://doaj.org/article/4dbc4c69d60041d0a3a3f0c84b3689a3
work_keys_str_mv AT tarekalkhaeir theeffectofcodesmellsontherelationshipbetweendesignpatternsanddefects
AT bartoszwalter theeffectofcodesmellsontherelationshipbetweendesignpatternsanddefects
AT tarekalkhaeir effectofcodesmellsontherelationshipbetweendesignpatternsanddefects
AT bartoszwalter effectofcodesmellsontherelationshipbetweendesignpatternsanddefects
_version_ 1718417373849976832