Design by Contract (DbC) tratează relația dintre o metodă și apelantul acesteia ca un acord formal, definit de trei lucruri: preconditions (ce trebuie să garanteze apelantul), postconditions (ce garantează metoda la rândul ei), și invariants (ce rămâne adevărat pentru obiect în orice moment).
Cele trei obligații
PRECONDITION → caller's duty: inputs/state the method requires to run correctly
POSTCONDITION → method's duty: what it promises on return (if precondition held)
INVARIANT → always-true property of the object, before and after every method
