Enforce Inform Ignore Assume - Gradual Adoption of Contracts In Production Code
summary
C++ contract checks are introduced as macros (BDE/BSLS_ASSERT style) that move through four concrete modes: Ignore (annotations compile but never run), Inform (telemetry logs violations with exponential backoff), Enforce (violation handler aborts or can throw to fail fast), and Assume (treat predicates as optimizer hints). Workflow shows inserting cheap and _safe expensive checks, running test drivers and production telemetry, fixing reported bugs, then enabling enforcement or optimizer assumptions once the system is clean.
AI-written summary · about
chapters (34)
- 0:00Introduction
- 0:45Agenda
- 1:27What is a contract
- 3:05Examples of contracts
- 4:12Undefined behavior
- 5:16Contract no language
- 5:41Contract no Java
- 6:38Preconditions
- 9:10Postconditions
- 9:58Invariants
- 11:10Error Reporting
- 14:01Guarantees
- 16:47Changing Promises
- 18:54Finding a Contract
- 20:28Contract Terminology
- 21:22Wide vs Narrow Contracts
- 23:16Survey Results
- 28:04Example
- 31:21Post Conditions
- 33:45Operating Throws
- 35:47Simple Function
- 36:41Bug in Implementation
- 38:27Changing the Contract
- 40:52Is Another Wide Contract Better
- 42:07Plug
- 42:32Contract Tech
- 43:29Test Drivers vs Unit Tests
- 45:34C vs C Standard
- 46:47Key Issues
- 47:40Expensive Checks
- 48:54Customization
- 49:34Contract
- 51:02The Workflow
- 53:08Simple First Step
related talks
01h 17mFunction Contracts in Practice using C++
01h 30mContracts, Safety, and the Art of Cat Herding
58mAvoid Misuse of Contracts!
01h 05m“Contract Programming in C++(20) (part 2 of 2)”
01h 31mContracts for C++
01h 22mContracts, Safety and Correctness in C++
56mContracts for Dependable C++
01h 12mContract use: Past, Present, and Future
