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.

Full Text
Published version (Free)

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