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

8Citations
Citations of this article
29Readers
Mendeley users who have this article in their library.

This article is free to access.

Abstract

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.

Cite

CITATION STYLE

APA

Alkhaeir, T., & Walter, B. (2021). The Effect of Code Smells on the Relationship between Design Patterns and Defects. IEEE Access, 9, 3360–3373. https://doi.org/10.1109/ACCESS.2020.3047870

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free