Apply the following advice to create contracts:
State the postconditions in a declarative, passive past tense form (was …) to emphasize the declaration of a state change rather than a design of how it is going to be achieved. For example:
(better) A SalesLineItem was created.
(worse) Create a SalesLineItem.
Remember to establish a memory between existing objects or those newly created by defining the forming of an association. For example, it is not enough that a new SalesLineItem instance is created when the enterItem operation occurs. After the operation is complete, it should also be true that the newly created instance was associated with Sale; thus:
The SalesLineItem was associated with the Sale (association formed).
The most common problem is forgetting to include the forming of associations. Particularly when new instances are created, it is very likely that associations to several objects need be established. Don't forget!
18.223.168.2