Abstract

Design patterns are reusable solutions that can be applied to solve specific problems in software design. Such patterns can be misapplied, though, and give rise to code smells, i.e., fragments in the code that indicate possible design flaws. In this study, we aim to understand how often code smells co-occur with design patterns, as well as to determine the most common co-occurrences. To this end, we identified instances of code smells and design patterns in methods of 25 open source Java projects, by using automated detection tools. We also manually inspected fragments of the projects' source code to gather insight on the relationship between specific pairs of smells and patterns. Among other findings, we found that methods that are part of the Adapter pattern are more likely to contain code smells, especially the Feature Envy smell, although it can be argued that the detection of this smell in this context is a false positive.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.