The term was coined by Bertrand Meyer in connection with his design of the Eiffel programming language and first described in various articles starting in 1986 and the two successive editions (1988, 1997) of his book Object-Oriented Software Construction. Where this assumption is considered too risky (as in multi-channel or distributed computing), the inverse approach is taken, meaning that the server component tests that all relevant preconditions hold true (before, or while, processing the client component's request) and replies with a suitable error message if not. The DbC approach assumes all client components that invoke an operation on a server component will meet the preconditions specified as required for that operation. These specifications are referred to as "contracts", in accordance with a conceptual metaphor with the conditions and obligations of business contracts. 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. ![]() ![]() Design by contract ( DbC), also known as contract programming, programming by contract and design-by-contract programming, is an approach for designing software.
0 Comments
Leave a Reply. |