Design by Contract (DbC) trata la relación entre un method y su llamador como un acuerdo formal, definido por tres cosas: preconditions (lo que el llamador debe garantizar), postconditions (lo que el method garantiza a cambio), e invariants (lo que permanece verdadero para el objeto en todo momento).
Las tres obligaciones
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
