Application invariants: Design by Contract augmented with deployment correctness logic

  • Authors:
  • Anthony Savidis

  • Affiliations:
  • Institute of Computer Science, Foundation for Research and Technology—Hellas, Heraklion, Crete, GR-71110, Greece

  • Venue:
  • Software—Practice & Experience
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Design by Contract is a method for the development of robust object-oriented software, introducing class invariants as conditions corresponding to the design axioms that should be satisfied by every valid instance of a class. Additionally, the method states formally the way client programs should correctly utilize supplier classes, so that the composition of correct programs may be accomplished. However, the contextual correctness of supplier instances within client programs, only reflected in the client-specific semantics for supplier-class deployment, cannot be expressed through Design by Contract. For instance, supplier instances satisfying the supplier class invariant may not constitute plausible supplier instances in the context of a particular client program. In this context, we introduce application invariants as an extension to Design by Contract, for hosting the contextual-correctness logic for supplier instances, as conditionally defined by client programs. This allows stronger validation of supplier instances, through the dynamic encapsulation of client-specific acceptance filtering, enabling more intensive defect detection. Application invariants are implemented in the context of client classes as methods utilizing correctness condition expressions, are dynamically hosted within supplier instances, while always called by supplier instances when the basic supplier-class invariant test is performed. Copyright © 2005 John Wiley & Sons, Ltd.