Design by Contract (DbC) tratta la relazione tra un metodo e il suo chiamante come un accordo formale, definito da tre elementi: precondizioni (cosa il chiamante deve garantire), postcondizioni (cosa il metodo garantisce in cambio), e invarianti (cosa rimane vero per l'oggetto in ogni momento).
Le tre obbligazioni
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
