Design by Contract
Kind: principle
Layer: Contracts Core
Aliases: DbC
Record: architecture:design-by-contract
Severity: recommended
Scope: API, function, class, service
Canonical: Ontology
A design rule that every operation states the preconditions it needs, the postconditions it guarantees and the invariants it keeps.
Listed in Architecture principles, after PACELC Theorem and before Explicit Contracts.
Requires
Reinforces
Enables
Conflicts with
In tension with
Tensions
Contracts
Violated by
Refactored by
Severity
Category
Linked from
- Template families
- A seat is a contract
- Stating an invariant
- From intent to predicate
- Contracts / Interfaces / Compatibility
- Correctness / Determinism / Verification
- SOLID / Object-Oriented Design
- Error Handling / Resilience
- Contracts / Interfaces / Compatibility
- Correctness / Determinism / Verification
- Error Handling / Resilience
- Architecture
- Context verification
- Severity levels
- The resolutions