UML Sequence Diagrams
14. How to Create a Contract
Apply the following advice from Liu, to create a contract for a system operation
1. Identify the system operations from the system sequence diagram.
2. For each system operation, construct a contract.
3. Start by writing the Responsibilities section, informally describing the purpose of the operation.
4. Then complete the Post-conditions section, declaratively describing the state changes that occur to objects in the conceptual model.
5. To describe the post-conditions, use the following categories:
- Instances creation and deletion.
- Attributes modification.
- Associations formed and broken.