Design recovery by automated search for structural design patterns in object-oriented software

Christian Krämer, Lutz Prechelt

2002 · 227 citations · 5 references

DOIFull text

Open access

Concepts

TL;DR

Design patterns such as Adapter, Bridge, Composite, Decorator, and Proxy are widely used in object‑oriented software, and locating their instances in existing code can enhance maintainability. The Pat system extracts design information from C++ header files, encodes it as PROLOG facts, and uses a single query to search for all structural patterns, evaluated on libraries like zApp and LEDA. Pat successfully identifies all pattern instances under certain restrictions, achieving about 40 % precision, and its output can be easily filtered manually, making it a useful tool for design recovery.

Abstract

The object-oriented design community has recently begun to collect so-called design patterns: cliches plus hints to their recommended use in software construction. The structural design patterns Adapter, Bridge, Composite, Decorator, and Proxy represent packaged problem/context/solution/properties descriptions to common problems in object-oriented design. Localizing instances of these patterns in existing software produced without explicit use of patterns can improve the maintainability of software. In the authors' approach, called the Pat system, design information is extracted directly from C++ header files and stored in a repository. The patterns are expressed as PROLOG rules and the design information is translated into facts. A single PROLOG query is then used to search for all patterns. They examined four applications, including the popular class libraries zApp and LEDA, with Pat. With some restrictions all pattern instances are found; the precision is about 40 percent. Since manual filtering of the output is relatively easy, they consider Pat a useful tool for discovering or recovering design information.

References

5