Design by Contract (Question 8) formalizes each operation's obligations as an explicit precondition/postcondition/class-invariant triad (Question 10) between a supplier and its clients.
Benefits. Contracts document each operation's real behaviour precisely and unambiguously (far more precisely than prose comments), and in languages with runtime assertion support they can be MACHINE-CHECKED. They sharply localize fault assignment when something goes wrong (caller's fault if a precondition failed; supplier's fault if a postcondition or invariant failed despite a satisfied precondition), which speeds debugging. They also justify omitting redundant defensive checks inside the supplier (Question 8) — if the precondition already guarantees a non-empty stack, pop() need not re-check emptiness defensively, since a violated precondition is by definition the caller's bug, not a case the supplier must recover from gracefully.
Challenges. Writing and maintaining contracts alongside the code is extra effort, and runtime assertion checking has a real performance cost, often leading teams to strip it from production builds — removing exactly the safety net most useful for catching real violations. Many mainstream languages (historically Java, C++) lack first-class contract syntax, requiring library or annotation workarounds (assert, JML) rather than a language-enforced mechanism. Stating precise, correct contracts for complex, stateful, or concurrent operations (e.g., invariants spanning multiple collaborating objects) can become nearly as hard as writing the implementation itself, and a wrong contract only formalizes a wrong assumption rather than catching it — DbC complements testing, it does not replace it.