Skip to content
Research track

Design pattern recovery

Recovering GoF design patterns and their variants from the source code of legacy applications in Java, C# and C/C++.

Introduction

Feature‑type based pattern recognition

The recovery of design pattern knowledge from legacy applications can enrich the fields of program comprehension, maintenance, refactoring, restructuring and re‑engineering — provided the patterns are extracted accurately from the source code. Many approaches are used for the recognition of patterns, but they still lack accuracy, flexibility, customisation and effectiveness, and the evaluation of different design pattern recovery approaches remains debatable due to the unavailability of standard benchmark systems.

Multiple searching techniques based on customisable feature types and pattern definitions are used in this approach to recognise patterns from source code in multiple languages (Java, C#, C/C++). Feature types allow switching between the appropriate searching techniques — SQL, regular expressions, a source code parser and annotations — using static and dynamic parameters. The approach is validated by applying a prototyping tool to different open‑source legacy applications. The extracted results are comprehensible and can be reused for other applications.


Case studies

Results of pattern recovery

Seven open‑source systems were analysed with the prototype tool. Each report lists the patterns recovered from that system.

# Case study Patterns recovered
1JUnit 3.7View results (PDF, 10 KB)
2JHotDraw 5.1View results (PDF, 28 KB)
3QuickUML 2001View results (PDF, 14 KB)
4JRefactory 2.6.24Report not published
5Apache Ant 1.6.2View results (PDF, 15 KB)
6GALib++ 2.4View results (PDF, 8 KB)
7Libg++ 2.7.2View results (PDF, 7 KB)

Catalogue

Variants of the GoF design patterns

With the increasing application of design patterns and their variants in the development of software, the accurate recovery of patterns from existing applications has remained an active research area. Variation in the standard patterns hampers the accuracy of pattern recovery techniques and tools. We present an exhaustive study of the different structural and implementation variants of the creational and structural design patterns. The resulting catalogue of patterns and their variants serves as a knowledge base for the design pattern research community, and may be used to specify the GoF patterns and their variants. We evaluated state‑of‑the‑art tools on the variants of the Singleton design pattern and found disparity in the results of the different tools. Critical analysis and observations are presented on the basis of the whole study and of our experience.

Creational patterns

Structural patterns

Behavioural patterns

User interface web design patterns