Contracts and Assertions
- slide 28 : 32
Design by Contract
Design by Contract
TM
(DBC) represents the idea of designing and specifying programs by means of assertions
Use of contracts in the phases and activities of software development
Design:
A pragmatic approach to program specification
Documentation:
Adds very important information to interface documentation of the classes
Implementation:
Guides and constrains the actual programming
Verification:
The program can be checked against the specification every time it is executed
Test:
Preconditions limit the testing work
The check of postconditions and class invariants do part of the testing work
End use:
Trigger exception handling if assertions are violated