{'fraction_non_alphanumeric': 0.013363028953229399, 'fraction_numerical': 0.0, 'mean_word_length': 4.953642384105961, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Detection of design pattern instances based on graph isomorphism

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.