Making specifications complete through models

  • Authors:
  • Bernd Schoeller;Tobias Widmer;Bertrand Meyer

  • Affiliations:
  • ETH Zurich, Switzerland;IBM Research, Zurich, Switzerland;ETH Zurich, Switzerland

  • Venue:
  • Proceedings of the 2004 international conference on Architecting Systems with Trustworthy Components
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Good components need precise contracts. In the practice of Design by ContractTM, applications and libraries typically express, in their postconditions and class invariants, only a subset of the relevant properties. We present: An approach to making these contract elements complete without extending the assertion language, by relying on “model classes” directly deduced from mathematical concepts. An actual “Mathematical Model Library” (MML) built for that purpose A method for using MML to express complete contracts through abstraction functions, and an associated theory of specification soundness. As a direct application of these ideas, a new version of a widely used data structure and algorithms library equipped with complete contracts through MML. All the software is available for download. The approach retains the pragmatism of the Design by Contract method, suitable for ordinary applications and understandable to ordinary programmers, while potentially achieving the benefits of much heavier formal specifications. The article concludes with a discussion of applications to testing and program proving, and of remaining issues.