Operation contracts

From Wikipedia, the free encyclopedia

Operation contracts are formal constraints defined over software operations. These are created during the domain-modeling phase.

Typically, an operation contract consists of 4 components:

  • Operation name: A name for the operation
  • Cross-References: List of use-cases that refer this operation
  • Preconditions: State of variables/system before this operation is invoked
  • Postconditions: State of variables/system after successful completion of the operation

Typically, the Postconditions can be of 3 kinds:

  • Instance creation
  • Attribute modification
  • Associations broken/added