An approach to implementing dynamic adaptation in C++
DEAS '05 Proceedings of the 2005 workshop on Design and evolution of autonomic application software
Hi-index | 0.00 |
A profiler can provide valuable information to a developer to facilitate program optimization, debugging or testing. In this paper, we describe the use of the Decorator pattern for non-intrusive profiling of object-oriented applications. We provide a formal specification of the Decorator pattern, and show that the pattern can be used as a program transformation without altering the external, observable behavior of the system. We refer to such a transformation as a correctness preserving transformation, or CPT. As a CPT, the Decorator pattern can be used to non-intrusively profile object-oriented applications and we illustrate this application with an invariant validator for enforcement of Design by Contract, and for profiling memory. We provide a case study to compare the cost trade-offs of validating invariants at different points in a program.