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, DPD_F 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. DPD_F creates a semantic representation of Java source code using the code features and the call graph, and applies the \textit{Word2Vec} algorithm on the semantic representation to construct the word-space geometric model of the Java source code. DPD$_F$ 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 DPD_F with two existing design pattern detection techniques namely FeatureMaps & MARPLE-DPD. Empirical results demonstrate that our approach outperforms the state-of-the-art approaches by approximately 35% and 15% respectively in terms of Precision. The run-time performance also supports the practical applicability of our classifier.
翻译:软件设计模式是软件设计和架构中常见问题的标准解决方案。 了解特定模块执行设计模式是设计理解的捷径。 人工探测设计模式是一项耗时且具有挑战性的任务, 因此研究人员已经建议了自动设计模式探测技术。 然而, 这些技术显示某些设计模式的性能较低。 在此工作中, 我们引入了设计模式探测方法, DPD_ F, 通过使用机器学习分类器的代码功能来自动培训设计模式探测器, 从而改善当前状态的性能。 DPD_ F 创建了爪哇源代码的语义表达法, 使用代码特征和呼叫图, 并应用语义表达法的算法来构建爪哇源代码的字体空间地理测量模型。 DPD$_ F$, 然后建立一个在标签数据集上受过培训的机器学习分类, 并用超过80%的精度和超过79 ⁇ 的重新校正。 此外, 我们将DPD_FD_ F与两种现有的设计模式探测技术进行了比较, 即, 功能地图和 MARPLE- DP- DA. 15 Arrestim a protime the pre- pre- pre- pre- pricisalal Protium proglemental press palalal as procustrutal ex pal procument thes pres 15 a pres proutals ex ex ex ex 。