Abstract

Detecting design pattern instances from source codes can assist the understanding of the systems. This paper presents an approach to the detection of design patterns based on graph isomorphism. We introduce two kinds of graphs, among which one represents the system design and the other describes the design patterns to be recovered. In order to detect instances of design patterns, we first identify in system graph all the candidate classes that correspond to the pattern classes. Afterwards we select some of candidate classes to form the sub-graphs of system graph, which are then checked isomorphic to the pattern graph or not. Those isomorphic sub-graphs are regarded to be corresponding to instances of the design patterns. The detection of decorator pattern is given as the example to show the effectiveness of the approach.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.