Generating design pattern detectors from pattern specifications

We present our approach to support program understanding by a tool that generates static and dynamic analysis algorithms from design pattern specifications to detect design patterns in legacy code. We therefore specify the static and dynamic aspects of patterns as predicates, and represent legacy code by predicates that encode its attributed abstract syntax trees. Given these representations, the static analysis is performed on the legacy code representation as a query derived from the specification of the static pattern aspects. It provides us with pattern candidates in the legacy code. The dynamic specification represents state sequences expected when using a pattern. We monitor the execution of the candidates and check their conformance to this expectation. We demonstrate our approach and evaluate our tool by detecting instances of the observer, composite and decorator patterns in Java code using Prolog to define predicates and queries.

[1]  Mary Shaw,et al.  An Introduction to Software Architecture , 1993, Advances in Software Engineering and Knowledge Engineering.

[2]  Kyle G. Brown,et al.  Design reverse-engineering and automated design-pattern detection in Smalltalk , 1996 .

[3]  Lutz Prechelt,et al.  Functionality versus Practicality: Employing Existing Tools for Recovering Structural Design Patterns , 1998, J. Univers. Comput. Sci..

[4]  Leslie Lamport,et al.  The temporal logic of actions , 1994, TOPL.

[5]  Welf Löwe,et al.  Understanding Architecture through Structure and Behavior Visualization , 2003 .

[6]  Rudolf K. Keller,et al.  Pattern-based reverse-engineering of design components , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[7]  Welf Löwe,et al.  Automatic design pattern detection , 2003, 11th IEEE International Workshop on Program Comprehension, 2003..

[8]  Andreas Ludwig,et al.  Aspect-Oriented Configuration and Adaptation of Component Communication , 2001, GCSE.

[9]  Oliver Ciupke,et al.  Automatic detection of design problems in object-oriented reengineering , 1999, Proceedings of Technology of Object-Oriented Languages and Systems - TOOLS 30 (Cat. No.PR00278).

[10]  Dirk Heuzeroth,et al.  COMBINING STATIC AND DYNAMIC ANALYSES TO DETECT INTERACTION PATTERNS , 2002 .

[11]  Tommi Mikkonen,et al.  Formalizing design patterns , 1998, Proceedings of the 20th International Conference on Software Engineering.

[12]  Rick Kazman,et al.  Software architectural transformation , 1999, Sixth Working Conference on Reverse Engineering (Cat. No.PR00303).

[13]  Dirk Heuzeroth Software-Visualization-From Theory to Practice , 2003 .