Module 7: Contracts
In this module we will look at Bertrand Meyer's Design-by-Contract approach to specifying the interface of operations/methods, and compare it with defensive programming. We will explore how to specify contracts on class operations through the use of preconditions and preconditions.Lecture material
- Contracts :: Powerpoint :: PDF
Tutorial
The exercises from the Self-Study module can be worked through in class.Self-study modules
This module shows you how to tighten up your object design with the use of design-by contract.
- Contracts :: pdf
Resources
- Bertrand Meyer: Applying "Design by Contract, in Computer (IEEE), vol. 25, no. 10, October 1992, pages 40-51.
- Building bug-free O-O software: An introduction to Design by Contract.
http://archive.eiffel.com/doc/manuals/technology/contract/ - Design by contract, Wikipedia
http://en.wikipedia.org/wiki/Design_by_contract - Defensive programming, Wikipedia
http://en.wikipedia.org/wiki/Defensive_programming