Empirical study of the relationship between design patterns and code smells.
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. Althou...
Main Authors: | , , |
---|---|
Format: | Article |
Language: | English |
Published: |
Public Library of Science (PLoS)
2020-01-01
|
Series: | PLoS ONE |
Online Access: | https://doi.org/10.1371/journal.pone.0231731 |
id |
doaj-3465e14a4294497ab2046b9b18f93c5d |
---|---|
record_format |
Article |
spelling |
doaj-3465e14a4294497ab2046b9b18f93c5d2021-03-03T21:47:59ZengPublic Library of Science (PLoS)PLoS ONE1932-62032020-01-01154e023173110.1371/journal.pone.0231731Empirical study of the relationship between design patterns and code smells.Mahmoud AlfadelKhalid AljasserMohammad AlshayebSoftware 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.https://doi.org/10.1371/journal.pone.0231731 |
collection |
DOAJ |
language |
English |
format |
Article |
sources |
DOAJ |
author |
Mahmoud Alfadel Khalid Aljasser Mohammad Alshayeb |
spellingShingle |
Mahmoud Alfadel Khalid Aljasser Mohammad Alshayeb Empirical study of the relationship between design patterns and code smells. PLoS ONE |
author_facet |
Mahmoud Alfadel Khalid Aljasser Mohammad Alshayeb |
author_sort |
Mahmoud Alfadel |
title |
Empirical study of the relationship between design patterns and code smells. |
title_short |
Empirical study of the relationship between design patterns and code smells. |
title_full |
Empirical study of the relationship between design patterns and code smells. |
title_fullStr |
Empirical study of the relationship between design patterns and code smells. |
title_full_unstemmed |
Empirical study of the relationship between design patterns and code smells. |
title_sort |
empirical study of the relationship between design patterns and code smells. |
publisher |
Public Library of Science (PLoS) |
series |
PLoS ONE |
issn |
1932-6203 |
publishDate |
2020-01-01 |
description |
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. |
url |
https://doi.org/10.1371/journal.pone.0231731 |
work_keys_str_mv |
AT mahmoudalfadel empiricalstudyoftherelationshipbetweendesignpatternsandcodesmells AT khalidaljasser empiricalstudyoftherelationshipbetweendesignpatternsandcodesmells AT mohammadalshayeb empiricalstudyoftherelationshipbetweendesignpatternsandcodesmells |
_version_ |
1714815010741420032 |