Abstract
Knowledge and understanding about system design are very important for the development and maintenance of any software system due to certain deadlines and frequent changes in requirements and environment. However, it is a very difficult task to analyse design automatically. Design patterns give standard solutions to common design problems. It is very helpful to find existence of such patterns in the source code. It will reduce effort and time required in understanding and thus in the maintenance activity. In this paper we propose a tool DPDT for detecting design patterns from system software. We use graph matching process to find exact instances of design patterns mapped to system software. In graph matching structural aspects are considered. After that static facts of software systems and design patterns are used to reduce the number of false positives. We evaluate our result on two well-known open source software: JHotDraw and JUnit and compared the result of DPDT with existing tools (Sempatrec, DPF, SSA, DeMIMA, and Depatos) of design patterns detection. It is found that for proxy design patterns our tool out performs the all other tools. Further, for few design patterns it is giving moderate results while other tools did not consider those design patterns.
Similar content being viewed by others
Data availability
Yes.
Code availability
Yes.
References
Gamma E (1995) Design patterns: elements of reusable object-oriented software. Pearson Education India
Vassallo C, Panichella S, Palomba F et al (2020) How developers engage with static analysis tools in different contexts. Empir Software Eng 25:1419–1457. https://doi.org/10.1007/s10664-019-09750-5
Al-Obeidallah MG, Petridis M, Kapetanakis S (2016) A survey on design pattern detection approaches. Int J Softw Eng (IJSE) 7(3):41–59
Dong J, Zhao Y, Peng T (2007) Architecture and design pattern discovery techniques-a review. In Software Engineering Research and Practice 621–627
Rasool G, Streitfdert D (2011) A survey on design pattern recovery techniques. Int J Computer Sci Issues (IJCSI) 8(6):251
Kramer C, Prechelt L (1996) Design recovery by automated search for structural design patterns in object-oriented software. Proceedings of WCRE '96: 4rd Working Conference on Reverse Engineering, Monterey, CA, USA: 208–215, Doi: https://doi.org/10.1109/WCRE.1996.558905
Seemann J, von Gudenberg JW (1998) Pattern-based design recovery of Java software. ACM SIGSOFT Softw Eng Notes 23(6):10–16
Blondel VD, Gajardo A, Heymans M, Senellart P, Dooren VP (2004) A measure of similarity between graph vertices: applications to synonym extraction and web searching. SIAM Rev 46(4):647–666
Tsantalis N, Chatzigeorgiou A, Stephanides G, Halkidis ST (2006) Design pattern detection using similarity scoring. IEEE Trans Softw Eng 32(11):896–909
Dong J, Sun Y, Zhao, Y (2008) Design pattern detection by template matching. In Proceedings of the 2008 ACM symposium on Applied computing: 765–769
Dong J, Lad DS, Zhao Y (2007) DP-Miner: Design pattern discovery using matrix. In 14th Annual IEEE International Conference and Workshops on the Engineering of Computer-Based Systems (ECBS'07) (pp. 371–380). IEEE
Singh J, Gupta M (2019) Design pattern detection using dpdetect algorithm. Int J Innov Technol Exploring Eng (IJITEE) 8(7)
Wenzel S, Kelter U (2006) Model-driven design pattern detection using difference calculation. In Workshop on Pattern Detection for Reverse Engineering
Bernardi ML, Cimitile M, Di Lucca G (2014) Design pattern detection using a DSL-driven graph matching approach. J Softw: Evol Process 26(12):1233–1266
Gupta M (2011) Design pattern mining using greedy algorithm for multilabeled graphs. Int J Inf Commun Technol, Indersci 3(4):314–323
Pande A, Gupta M (2010) Design pattern detection using graph matching. Int J Computer Eng Inf Technol 15(20):59–64
Rao RS, Gupta M (2013) Design pattern detection by greedy algorithm using inexact graph matching. Int J Eng Res Technol 2(10):3658–3664
Gupta M, Pande A (2011) Design patterns mining using subgraph isomorphism: relational view. Int J Softw Eng Its Appl 5(2):47–56
Antoniol G, Fiutem R, Cristoforetti L (1998) Design pattern recovery in object-oriented software. Proceedings. 6th International Workshop on Program Comprehension. IWPC'98 (Cat. No.98TB100242), Ischia, Italy, 1998 153-160, Doi: https://doi.org/10.1109/WPC.1998.693342
Keller RK, Schauer R, Robitaille S, Pagé P (1999) Pattern-based reverse-engineering of design components. In Proceedings of the 21st international conference on Software engineering: 226–235
Lee H, Youn H, Lee, E (2007) Automatic detection of design pattern for reverse engineering. 5th ACIS International Conference on Software Engineering Research, Management & Applications (SERA 2007), Busan, Korea (South), 2007: 577–583, doi: https://doi.org/10.1109/SERA.2007.58
Rasool G, Philippow I, Mäder P (2010) Design pattern recovery based on annotations. Adv Eng Softw 41(4):519–526
Stencel K. Wegrzynowicz P (2008) Detection of diverse design pattern variants. APSEC '08: Proceedings of the 2008 15th Asia-Pacific Software Engineering ConferenceDecember 2008: 25–32. https://doi.org/10.1109/APSEC.2008.67
Vokác M (2006) An efficient tool for recovering Design Patterns from C++ Code. J Object Technol 5(1):139–157
Ferenc R, Beszedes A, Fulop L, Lele J (2005) Design pattern mining enhanced by machine learning. In 21st IEEE International Conference on Software Maintenance (ICSM'05): 295–304
Uchiyama S, Kubo A, Washizaki H, Fukazawa Y (2014) Detecting design patterns in object-oriented program source code by using metrics and machine learning. J Softw Eng Appl 7(12):983
Wang W. Tzerpos V (2005) Design pattern detection in Eiffel systems. 12th Working Conference on Reverse Engineering (WCRE'05), Pittsburgh, PA, USA, 2005: 10–174, doi: https://doi.org/10.1109/WCRE.2005.14
Mhawish MY, Gupta M (2020) Software metrics and tree-based machine learning algorithms for distinguishing and detecting similar structure design patterns. SN Appl Sci 2(1):11. https://doi.org/10.1007/s42452-019-1815-3
Shi N, Olsson R A (2006) Reverse engineering of design patterns from java source code. 21st IEEE/ACM International Conference on Automated Software Engineering (ASE'06), Tokyo, Japan, 2006: 123–134. doi: https://doi.org/10.1109/ASE.2006.57
Alnusair A, Zhao T, Yan G (2014) Rule-based detection of design patterns in program code. Int J Softw Tools Technol Transfer 16(3):315–334
Brown K (1996) Design reverse-engineering and automated design-pattern detection in Smalltalk. North Carolina State University at Raleigh, USA
Gupta M, Pande A, Tripathi AK (2011) Design pattern detection using SOP expressions for graphs. ACM SIGSOFT Softw Eng Notes 36(1):01–05
Barbudo R, Ramirez A, Servant F, Romero J (2021) GEML: a grammar-based evolutionary machine learning approach for design-pattern detection. J Syst Softw 175:110919
Liu C (2021) A general framework to detect design patterns by combining static and dynamic analysis techniques. Int J Softw Eng Knowl Eng 31(01):21–54
Lucia. A.D., Deufemia, V., Gravino, C., Risi, M., (2018) Detecting the Behavior of Design Patterns through Model Checking and Dynamic Analysis, ACM Transactions on Software Engineering and Methodology, Volume 26, Issue 4, Article No. 13, pp1-41, https://doi.org/10.1145/3176643
Cosmats Institute of Information Technology http://research.citi.lahaore.edu.pk/Groups/SERC/DesignPattern.aspx [January1, 2014]
Guéhéneuc Y G (2007) P-mart: Pattern-like micro architecture repository. Proceedings of the 1st EuroPLoP Focus Group on pattern repositories, 1–3
Yu D, Zhang P, Yang J, Chen Z, Liu C, Chen J (2018) Efficiently detecting structural design pattern instances based on ordered sequences. J Syst Softw 142:35–56
Guéhéneuc YG, Antoniol G (2008) Demima: a multilayered approach for design pattern identification. IEEE Trans Software Eng 34(5):667–684
Khwaja S, Alshayeb (2016) Survey on software design pattern specification languages, ACM Computer Survey 49(1). Doi: https://doi.org/10.1145/2926966
Author information
Authors and Affiliations
Contributions
JS: Methodology, Software, writing-original draft preparation, validation, visualization, formal analysis MG: Conceptualization, supervision, writing-reviewing and editing; SRC, GB: writing-reviewing and editing.
Corresponding author
Ethics declarations
Conflict of interest
There is no conflict among authors.
Human or animal rights
This article does not contain any studies with human or animal subjects performed by any of the authors.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Singh, J., Chowdhuri, S.R., Bethany, G. et al. Detecting design patterns: a hybrid approach based on graph matching and static analysis. Inf Technol Manag 23, 139–150 (2022). https://doi.org/10.1007/s10799-021-00339-3
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10799-021-00339-3