Page 21 : 32
Object-oriented Programming in C#
Contracts and Assertions
* Correctness
Software Qualities
Correctness
Specifications
* Specification with preconditions and postconditions
Logical expressions
Examples of preconditions and postconditions
An Assertion Language
* Responsibilities and Contracts
Questions Related to Responsibility
Division of Responsibilities
The highly responsible program
Responsibility division by pre and postconditions
Contracts
Everyday Contracts
Contracts: Obligations and Benefits
Obligations and Benefits in Sqrt
* Class Invariants
General aspects of contracts
Everyday invariants
An example of a class invariant
* Inheritance is Subcontracting
Inheritance and Contracts
Subcontracting
Class invariants in the triangle class hierarchy
Assertions in Abstract classes
* Design by Contract
Design by Contract
DBC and Programming Languages
Code Contracts in C# 4.0
* Loop Invariants
Loop Invariants
An example of a class invariant
The class invariant of a circular lists expresses that the list is circular whenever it is non-empty
Circular list with a class invariant.
A circular list with pre and postconditions