Model-driven detection of Design Patterns

Tracing source code elements of an existing Object Oriented software system to the components of a Design Pattern is a key step in program comprehension or re-engineering. It helps, mainly for legacy systems, to discover the main design decisions and trade-offs that are often not documented. In this paper an approach is presented to automatically detect Design Patterns in existing Object Oriented systems by tracing system's source code components to the roles they play in the Patterns. Design Patterns are modelled by high level structural Properties (e.g. inheritance, dependency, invocation, delegation, type nesting and membership relationships) that are checked, by source code parsing, against the system structure and components. The approach allows to detect also Pattern variants, defined by overriding the Pattern structural properties. The approach was applied to some open-source systems to validate it. Results on the detected patterns, discovered variants and on the overall quality of the approach are provided and discussed.

[1]  Jim Welsh,et al.  Towards pattern-based design recovery , 2002, ICSE '02.

[2]  Michele Risi,et al.  Design pattern recovery through visual language parsing and source code analysis , 2009, J. Syst. Softw..

[3]  Yann-Gaël Guéhéneuc,et al.  DeMIMA: A Multilayered Approach for Design Pattern Identification , 2008, IEEE Transactions on Software Engineering.

[4]  Alexander Chatzigeorgiou,et al.  Design Pattern Detection Using Similarity Scoring , 2006, IEEE Transactions on Software Engineering.

[5]  Yann-Gaël Guéhéneuc,et al.  Fingerprinting design patterns , 2004, 11th Working Conference on Reverse Engineering.

[6]  Sang Uk Lee,et al.  Attributed relational graph matching based on the nested assignment structure , 2010, Pattern Recognit..

[7]  P. David Stotts,et al.  SPQR: flexible automated design pattern extraction from source code , 2003, 18th IEEE International Conference on Automated Software Engineering, 2003. Proceedings..

[8]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .