journal article·2022-08-30Open access

Research on Design Pattern Detection Method Based on UML Model with Extended Image Information and Deep Learning

Lei Wang, Tian Song, Hui-Na Song, Shuai Zhang

Applied Sciences· Volume 12· Issue 17

Abstract

Detecting relevant design patterns from system design or source code helps software developers and maintainers understand the ideas behind the design of large-scale, highly complicated software systems, thereby improving the quality of software systems. Currently, design pattern detection based on machine learning has become a hot research direction. Scholars have proposed many design pattern detection methods based on machine learning. However, most of the existing literature only reports the utilization of traditional machine learning algorithms such as KNN, decision trees, ANN, SVM, etc., which require manual feature extraction and feature selection. It is very difficult to find suitable and effective features for the detection of design patterns. In the previous research, we have initially explored a design pattern detection method based on graph theory and ANN. Based on the research work done, we speculate that if we can realize the end-to-end design pattern detection from system design or source code to design pattern with the help of the powerful automatic feature extraction and other advantages of deep learning, the detection effect can be further improved. This paper intends to first explore a UML model that extends image information, called colored UML, so as to transform the design pattern detection problem into an image classification problem; on this basis, the positive and negative sample sets and the system to be recognized are all expressed in the form of colored UML models, the convolutional neural network VGGNet is used to train the data set to extract features, and the extracted features are trained by the SVM for binary classification to judge the pattern instances. Experiments were carried out on three open-source projects. We used three non-machine learning design pattern detection methods and five design pattern detection methods based on traditional machine learning algorithms, as well as the method in this paper. In general, the method proposed in this paper achieved higher precision and recall, and for different programs and their patterns, the precision and recall were stable at more than 85% in most cases. The experimental results demonstrate that this paper can achieve a better effect in recognizing design patterns. The research is, therefore, of both theoretical significance and application value.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Software Engineering Research · Graph Theory and Algorithms · Data Visualization and Analytics

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

School of Computer Science & Technology, Beijing Institute of Technology, Beijing 100081, China

College of Mathematics and Computer Science, Yan’an University, Yan’an 716000, China

Shaanxi Key Laboratory of Intelligent Processing for Big Energy Data, Yan’an 716000, China

Funding

National Natural Science Foundation of China (NSFC) · Scientific Research Plan Projects of Shaanxi Education Department · PhD Scientific Research Startup Foundation of Yan’an University · Open Fund Project of Shaanxi Key Laboratory of Intelligent Processing for Big Energy Data

References (56)

Show source-provided references
1. Naghdipour, A., Hasheminejad, S., and Keyvanpour, M.R. (2021, January 3–4). DPSA: A Brief Review for Design Pattern Selection Approaches. Proceedings of the 2021 26th International Computer Conference: Computer Society of Iran (CSICC), Tehran, Iran.10.1109/CSICC52343.2021.9420629 ↗
2. Ohstuki, M., and Kakeshita, T. (2021, January 23–25). Generating Relationship between Design Pattern and Source Code. Proceedings of the 13th International Conference on Computer Supported Education, Prague, Czech Republic.10.5220/0010472502880293 ↗
3. Gamma, E., Helm, R., Johnson, R., and Vlissides, J. (1995). Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley.
4. Design pattern detection approaches: A systematic review of the literature10.1007/s10462-020-09834-5 ↗
5. Krämer, C., and Prechelt, L. (1996, January 11–10). Design recovery by automated search for structural design patterns in object-oriented software. Proceedings of the Working Conference on Reverse Engineering, Monterey, CA, USA.
6. Luitel, G., Stephan, M., and Inclezan, D. (2016, January 16–17). Model level design pattern instance detection using answer set programming. Proceedings of the International Workshop on Modeling in Software Engineering, Austin, TX, USA.10.1145/2896982.2896991 ↗
7. Design pattern detection using similarity scoring10.1109/TSE.2006.112 ↗
8. Efficiently detecting structural design pattern instances based on ordered sequences10.1016/j.jss.2018.04.015 ↗
9. Design pattern detection based on the graph theory10.1016/j.knosys.2017.01.007 ↗
10. MDetection a design pattern through merge static and dynamic analysis using altova and lambdes tools
11. Zhang, P., Yu, D., and Wang, J. (2017, January 4–8). A Degree-Driven Approach to Design Pattern Mining Based on Graph Matching. Proceedings of the 2017 24th Asia-Pacific Software Engineering Conference (APSEC), Nanjing, China.10.1109/APSEC.2017.24 ↗
12. A rule-based procedure for automatic recognition of design patterns in UML diagrams10.1002/spe.2336 ↗
13. Al-Obeidallah, M., Petridis, M., and Kapetanakis, S. (2017, January 19–23). MLDA: A Multiple Levels Detection Approach for Design Patterns Recovery. Proceedings of the International Conference on Compute and Data Analysis, Lakeland, Florida.10.1145/3093241.3093244 ↗
14. Shi, N., and Olsson, R.A. (2006, January 18–22). Reverse Engineering of Design Patterns from Java Source Code. Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering (ASE 2006), Tokyo, Japan.10.1109/ASE.2006.57 ↗
15. Panich, A., and Vatanawood, W. (2016, January 26–29). Detection of design patterns from class diagram and sequence diagrams using ontology. Proceedings of the IEEE/ACIS International Conference on Computer & Information Science, Okayama, Japan.10.1109/ICIS.2016.7550771 ↗
16. Design Pattern Detection using Genetic Algorithm for Sub-graph Isomorphism to Enhance Software Reusability
17. Bernardi, M.L., Cimitile, M., de Ruvo, G.D., di Lucca, G.A., and Santone, A. (2015, January 20–22). Model checking to improve precision of design pattern instances identification in OO systems. Proceedings of the International Joint Conference on Software Technologies, Lisbon, France.10.5220/0005520500530063 ↗
18. Pattern detection and design rationale traceability: An integrated approach to software design quality10.1049/iet-sen.2017.5017 ↗
19. Al-Obeidallah, M.G., Petridis, M., and Kapetanakis, S. (2017, January 7–9). A Structural Rule-Based Approach for Design Patterns Recovery. Proceedings of the International Conference on Software Engineering Research, Management and Applications, London, UK.10.1007/978-3-319-61388-8_7 ↗
20. Multistage relaxing detection method for variants of design pattern
21. Chan, E.P. (2017). Artificial Intelligence Techniques, John Wiley & Sons, Ltd.
22. Wang, L. (2019). Design Pattern Detection Based on Similarity Scoring, FSM and Machine Learning. [Ph.D. Thesis, China University of Mining and Technology (Beijing)].
23. Wang, L. (2020). Automatic Design Pattern Detection—Principles, Methods and Tools, Hans Publishing House.
24. Wang, L., Wang, W.-F., Song, H.-N., and Zhang, S. (2022). Design Pattern Detection Based on Similarity Scoring and Secondary Subsystems. Comput. Eng., online.
25. Dong, J., Sun, Y., and Zhao, Y. (2018, January 13–15). Compound record clustering algorithm for design pattern detection by decision tree learning. Proceedings of the 2008 IEEE International Conference on Information Reuse and Integration, Las Vegas, NV, USA.
26. On applying machine learning techniques for design pattern detection10.1016/j.jss.2015.01.037 ↗
27. Research on Design Pattern Mining Based on Machine Learning
28. Source code and design conformance, design pattern detection from source code by classification approach10.1016/j.asoc.2014.10.027 ↗
29. Chaturvedi, S., Chaturvedi, A., Tiwari, A., and Agarwal, S. (2018, January 29–31). Design Pattern Detection using Machine Learning Techniques. Proceedings of the 2018 7th International Conference on Reliability, Infocom Technologies and Optimization (Trends and Future Directions) (ICRITO), Noida, India.10.1109/ICRITO.2018.8748282 ↗
30. Alhusain, S., Coupland, S., John, R., and Kavanagh, M. (2013, January 9–11). Towards machine learning based design pattern recognition. Proceedings of the The 13th Annual UK Workshop on Computational Intelligence, Guildford, UK.10.1109/UKCI.2013.6651312 ↗
31. Uchiyama, S., Kubo, A., Washizaki, H., and Fukazawa, Y. (2011, January 1–4). Design Pattern Detection using Software Metrics and Machine Learning. Proceedings of the First International Workshop on Model-Driven Software Migration, Oldenburg, Germany.
32. Detecting design patterns in object-oriented program source code by using metrics and machine learning10.4236/jsea.2014.712086 ↗
33. GEML: A grammar-based evolutionary machine learning approach for design-pattern detection10.1016/j.jss.2021.110919 ↗
34. Thaller, H., Linsbauer, L., and Egyed, A. (2019, January 24–27). Feature Maps: A Comprehensible Software Representation for Design Pattern Detection. Proceedings of the 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER), Hangzhou, China.10.1109/SANER.2019.8667978 ↗
35. Software Metrics and tree-based machine learning algorithms for distinguishing and detecting similar structure design patterns10.1007/s42452-019-1815-3 ↗
36. Design Pattern Detection Approach Based on Stacked Generalization
37. Deep learning10.1038/nature14539 ↗
38. A Survey on Deep Learning: Algorithms, Techniques, and Applications
39. Three-Dimensional Reconstruction of Dilute Bubbly Flow Field with Light-Field Images Based on Deep Learning Method10.1109/JSEN.2021.3065374 ↗
40. Exploring prognostic indicators in the pathological images of hepatocellular carcinoma based on deep learning10.1136/gutjnl-2020-320930 ↗
41. A mobile augmented reality application for supporting real-time skin lesion analysis based on deep learning10.1007/s11554-021-01109-8 ↗
42. Weibo Text Sentiment Analysis Based on BERT and Deep Learning10.3390/app112210774 ↗
43. Machine translation using deep learning for universal networking language based on their structure10.1007/s13042-021-01317-5 ↗
44. Yang, S., Wang, Y., and Chu, X. (2002). A Survey of Deep Learning Techniques for Neural Machine Translation. arXiv.
45. Cui, H., Zhao, Y., and Dong, W. (2021). Research on life prediction method of rolling bearing based on deep learning and voice interaction technology. Int. J. Speech Technol., online.10.1007/s10772-021-09873-5 ↗
46. A Group Decision Optimization Analogy based Deep Learning architecture for multiclass pathology classification in a voice signal10.1109/JSEN.2021.3049277 ↗
47. Toward an Automatic Quality Assessment of Voice-Based Telemedicine Consultations: A Deep Learning Approach10.3390/s21093279 ↗
48. Source Code Defect Detection Based on Deep Learning
49. Guéhéneuc, Y.-G. (2007, January 4–8). P-MARt: Pattern-like Micro Architecture Repository. Proceedings of the lst EuroPLoP Focus Group on Pattern Repositories, Irsee, Germany.
50. Fontana, F.A., Caracciolo, A., and Zanoni, M. (2012, January 27–30). DPB: A benchmark for design pattern detection tools. Proceedings of the Proc. of the 16th European Conf. on Software Maintenance and Reengineering (CSMR), Szeged, Hungary.10.1109/CSMR.2012.32 ↗
51. Building and mining a repository of design pattern instances: Practical and research benefits10.1016/j.entcom.2012.10.002 ↗
52. Feature-Based Software Design Pattern Detection10.1016/j.jss.2021.111179 ↗
53. Simonyan, K., and Zisserman, A. (2015, January 7–9). Very Deep Convolutional Networks for Large-Scale Image Recognition. Proceedings of the International Conference on Learning Representations, San Diego, CA, USA.
54. Bi, R., Sun, G.-F., Zhou, X.-Y., and Liu, W.-W. (2020). Hands-On Deep Learning from Scratch, Tsinghua University Press.
55. Liu, X.-L., Yang, Q.-H., Hu, X.-G., Yu, D.-H., and Bai, H.-J. (2020). Deep Learning by PaddlePaddle, Machinery Industry Press.
56. PSSP with dynamic weighted kernel fusion based on SVM-PHGS10.1016/j.knosys.2011.11.002 ↗