TY - JOUR
T1 - Feature-based software design pattern detection
AU - Nazar, Najam
AU - Aleti, Aldeida
AU - Zheng, Yaokun
N1 - Funding Information:
We would like to extend our gratitude to the individuals who have dedicated their time and effort in performing annotation of design patterns through the online tool. We would also like to thank all anonymous reviewers for their valuable comments. This research received no internal or external funding from any public or private agency.
Publisher Copyright:
© 2021 Elsevier Inc.
PY - 2022/3
Y1 - 2022/3
N2 - Software design patterns are standard solutions to common problems in software design and architecture. Knowing that a particular module implements a design pattern is a shortcut to design comprehension. Manually detecting design patterns is a time consuming and challenging task, therefore, researchers have proposed automatic design pattern detection techniques. However, these techniques show low performance for certain design patterns. In this work, we introduce a design pattern detection approach, DPDF that improves the performance over the state-of-the-art by using code features with machine learning classifiers to automatically train a design pattern detector. DPDF creates a semantic representation of Java source code using the code features and the call graph, and applies the Word2Vec algorithm on the semantic representation to construct the word-space geometric model of the Java source code. DPDF then builds a machine learning classifier trained on a labelled dataset and identifies software design patterns with over 80% Precision and over 79% Recall. Additionally, we have compared DPDF with two existing design pattern detection techniques namely FeatureMaps & MARPLE-DPD. Empirical results demonstrate that our approach outperforms the existing approaches by approximately 35% and 15% respectively in terms of Precision. The run-time performance also supports the practical applicability of our classifier.
AB - Software design patterns are standard solutions to common problems in software design and architecture. Knowing that a particular module implements a design pattern is a shortcut to design comprehension. Manually detecting design patterns is a time consuming and challenging task, therefore, researchers have proposed automatic design pattern detection techniques. However, these techniques show low performance for certain design patterns. In this work, we introduce a design pattern detection approach, DPDF that improves the performance over the state-of-the-art by using code features with machine learning classifiers to automatically train a design pattern detector. DPDF creates a semantic representation of Java source code using the code features and the call graph, and applies the Word2Vec algorithm on the semantic representation to construct the word-space geometric model of the Java source code. DPDF then builds a machine learning classifier trained on a labelled dataset and identifies software design patterns with over 80% Precision and over 79% Recall. Additionally, we have compared DPDF with two existing design pattern detection techniques namely FeatureMaps & MARPLE-DPD. Empirical results demonstrate that our approach outperforms the existing approaches by approximately 35% and 15% respectively in terms of Precision. The run-time performance also supports the practical applicability of our classifier.
KW - Code features
KW - Machine learning
KW - Software design patterns
KW - Word-space-model
UR - http://www.scopus.com/inward/record.url?scp=85121212481&partnerID=8YFLogxK
U2 - 10.1016/j.jss.2021.111179
DO - 10.1016/j.jss.2021.111179
M3 - Article
AN - SCOPUS:85121212481
SN - 0164-1212
VL - 185
JO - Journal of Systems and Software
JF - Journal of Systems and Software
M1 - 111179
ER -