Title :
Generating design pattern detectors from pattern specifications
Author :
Heuzeroth, Dirk ; Mandel, Stefan ; Löwe, Welf
Author_Institution :
Univ. Karlsruhe, Germany
Abstract :
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.
Keywords :
Java; PROLOG; formal specification; object-oriented programming; program diagnostics; software architecture; specification languages; Java; Prolog; abstract syntax trees; composite patterns; decorator patterns; design pattern detector generation; design pattern specifications; dynamic analysis; execution monitoring; legacy code; observer patterns; state sequences; static analysis; Algorithm design and analysis; Computer architecture; Concrete; Detectors; Heuristic algorithms; Java; Pattern analysis; Performance analysis; Protocols; Software systems;
Conference_Titel :
Automated Software Engineering, 2003. Proceedings. 18th IEEE International Conference on
Print_ISBN :
0-7695-2035-9
DOI :
10.1109/ASE.2003.1240313