A Multiple Phases Approach for Design Patterns Recovery Based on Structural and Method Signature Features

A Multiple Phases Approach for Design Patterns Recovery Based on Structural and Method Signature Features

Mohammed Ghazi Al-Obeidallah (Department of Computing, University of Brighton, Brighton, UK), Miltos Petridis (Department of Computing, Middlesex University, London, UK) and Stelios Kapetanakis (Department of Computing, University of Brighton, Brighton, UK)
Copyright: © 2018 |Pages: 17
DOI: 10.4018/IJSI.2018070103

Abstract

Design patterns describe both structure, behavior of classes and their relationships. They can improve software documentation, speed up the development process and enable large-scale reuse of software architectures. This article presents a multiple levels detection approach (MLDA) to recover design pattern instances from Java source code. MLDA is able to recover design pattern instances based on a generated class level representation of a subject system. Specifically, MLDA presents what is the so-called Structural Search Model (SSM) which incrementally builds the structure of each design pattern based on the generated source code model. Moreover, MLDA uses a rule-based approach to match the method signatures of the candidate design instances to that of the subject system. As the experiment results illustrate, MLDA is able to recover 23 design patterns with reasonable detection accuracy.
Article Preview

2. Recovering Design Pattern Instances

The Multiple Levels Detection Approach (MLDA) is a research prototype, which has been developed to recover the instances of design patterns from Java source code. MLDA involves three main levels: a parsing level, a searching level and method signatures matching level. The architecture of MLDA appears in Figure 1.

The parsing level aims to recover the source code information and produce a source code model. Moreover, MLDA aims to recover the five key relationships, which may occur between classes and objects inside any object-oriented program. These relationships are Inheritance, Aggregation, Association, Dependency and Realization. On the other hand, the searching level of MLDA aims to examine the source code model that has been developed during the parsing level and tries to match it with the GoF’s catalog.

Specifically, MLDA introduces a Structural Search Model (SSM), which involves a searching algorithm for each design pattern. MLDA works on the principle of building the patterns incrementally based on the connecting relationships. The third level of MLDA is the method signatures matching level. The method signatures of the subject system are represented as a set of facts. On the other hand, the required method signatures of the candidate design instances are represented as a set of rules. CLIPS (C Language Integrated Production System) (Clipsrules.net, 2017), an expert system tool, has been used to match the generated facts and rules. It must be noticed that MLDA uses the standard codes presented by GoF (Gamma et al., 1995).

Figure 1.

The architecture of MLDA

Complete Article List

Search this Journal:
Reset
Open Access Articles: Forthcoming
Volume 8: 4 Issues (2020): Forthcoming, Available for Pre-Order
Volume 7: 4 Issues (2019): 2 Released, 2 Forthcoming
Volume 6: 4 Issues (2018)
Volume 5: 4 Issues (2017)
Volume 4: 4 Issues (2016)
Volume 3: 4 Issues (2015)
Volume 2: 4 Issues (2014)
Volume 1: 4 Issues (2013)
View Complete Journal Contents Listing