Research Article
Exploiting design patterns to automate validation of class invariants
Article first published online: 6 OCT 2005
DOI: 10.1002/stvr.327
Copyright © 2005 John Wiley & Sons, Ltd.
Additional Information
How to Cite
Malloy, B. A. and Power, J. F. (2006), Exploiting design patterns to automate validation of class invariants. Software Testing, Verification and Reliability, 16: 71–95. doi: 10.1002/stvr.327
Publication History
- Issue published online: 11 MAY 2006
- Article first published online: 6 OCT 2005
- Manuscript Accepted: 8 MAR 2005
- Manuscript Received: 28 MAY 2004
- Abstract
- References
- Cited By
Keywords:
- class invariants;
- validation;
- design patterns;
- Object Constraint Language
Abstract
In this paper, techniques are presented that exploit two design patterns, the Visitor pattern and the Decorator pattern, to validate invariants about the data attributes in a C++ class automatically. To investigate the pragmatics involved in using the two patterns, a study of an existing, well-tested application, keystone, a parser and front-end for the C++ language, is presented. Results from the study indicate that these two patterns provide flexibility in terms of the frequency and level of granularity of validation of the class invariants, which are expressed in the Object Constraint Language (OCL). The quantitative results measure the impact of these approaches and the additional faults uncovered through validation of the case study. Copyright © 2005 John Wiley & Sons, Ltd.

1099-1689/asset/olbannerleft.jpg?v=1&s=f177ca3aecdb1afaf18649c31eb98c6a5a2ba179)
1099-1689/asset/olbannerright.jpg?v=1&s=c31cdb59b8e8855ed28bf83573e9f1693e3f9a0e)
1099-1689/asset/cover.gif?v=1&s=f770cbd14e5dbc2249e9f62de4d9f5779efcc8b7)