Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M8897

Design by Contract

Design by Contract
SystemsHigh supportSystems Theory
Included
account_tree

Version 1.0.0 · Updated 2026-07-28

CORE DEFINITION

Design by Contract (DbC) is a method for designing computer software. This method requires software designers to define formal, precise, and verifiable interfaces for software components, thus adding preconditions, postconditions, and invariants to traditional abstract data types. The term 'contract' used in this method's name is a metaphor, as it is somewhat analogous to a commercial contract. Because 'Design by Contract' is a registered trademark of Eiffel Software, many developers use the terms 'Programming by Contract', 'Contract Programming', or 'Contract-First development' to refer to this method. Microsoft also adopts this design approach, calling it 'Code Contracts'.

SCAFFOLDING EFFECT

psychology

Reduce cognitive load

Design by Contract (DbC) is a method for designing computer software. This method requires software designers to define formal, precise, and verifiable interfaces for software components, thus adding preconditions, postconditions, and invariants to traditional abstract data types. The term 'contract' used in this method's name is a metaphor, as it is somewhat analogous to a commercial contract.

anchor

Anchor fast decisions

A software design method proposed by Bertrand Meyer: it treats interactions between modules as contracts—preconditions, postconditions, and class invariants. The mechanism uses formal agreements to constrain the caller and the callee, and reports an error when a contract is violated.

MINIMUM ACTION

In progress 0/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more

Source support: Explicit

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E5%A5%91%E7%BA%A6%E5%BC%8F%E8%AE%BE%E8%AE%A1ZH · Explicit
    verified

RELATED MODELS