Postconditions

The postcondition is a statement that describes the state of the system when the use case is terminated. The postcondition should be true for all the alternative flows, regardless of which one was executed and it should be false for the basic flow. The idea behind the postcondition is that if anything goes wrong during the execution of the use case, the system should be left in a condition described in the definition of the postcondition. Defining an adequate postcondition is very important as it defines the state the system should be in when the use case terminates.

As an example, in the case when weather data are provided by an on-line weather station one possible postcondition can be defined as follows:

The connection between the user's computer and the server where the weather data are located should be terminated.

The above formulation of the postcondition looks like a very trivial thing, but it is important to know the state of the system when the connection with the weather server fails. Let us suppose that the postcondition for our use case were defined as follows:

The system should continue dialing the weather server until connection is established.

According to this definition of the postcondition, the system will continue dialing the server until the connection is restored. In this case, the system will be busy for as long as the connection is not established. A system designed to persist connecting to the server no matter how long it takes may not be a good system, as the system cannot be used as long as it tries to connect to the remote server.

0 0

Post a comment