Software Design by Contract Pattern
Jump to navigation
Jump to search
A Software Design by Contract Pattern is a software design pattern based on code contracts (formal, precise and verifiable interface specifications for software components).
- Context:
- …
- Counter-Example(s):
- See: Formal Methods, Component-Based Software Engineering, Abstract Data Type, Precondition, Postcondition, Invariant (Computer Science), Conceptual Metaphor.
References
2014
- (Wikipedia, 2014) ⇒ http://en.wikipedia.org/wiki/Design_by_contract Retrieved:2014-11-5.
- Design by contract (DbC), also known as contract programming, programming by contract and design-by-contract programming, is an approach for designing software. It prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants. These specifications are referred to as "contracts", in accordance with a conceptual metaphor with the conditions and obligations of business contracts.
2013
- http://research.microsoft.com/en-us/projects/contracts/
- Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs. The contracts take the form of preconditions, postconditions, and object invariants. Contracts act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification, and documentation generation.
Code Contracts bring the advantages of design-by-contract programming to all .NET programming languages. The benefits of writing contracts are:
- Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs. The contracts take the form of preconditions, postconditions, and object invariants. Contracts act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification, and documentation generation.