Forward and Reverse Engineering
To forward engineer a use case diagram:
- Identify the objects that interact with the system
- Try to identify the various roles that each external object may play
- Make up an actor to represent each distinct interaction role
- For each use case in the diagram, identify its flow of events and its exceptional flow of events
- Generate a test script for each flow using the flow's preconditions, taking into account the tests initial and post condition state as its success criteria
- Generate test scaffolding to show each actor that interacts with the use case wherever necessary
- Actors are either simulated or replaced by a real-world equivalent when they push information to the element or are acted upon by the element
- Use tools to run these tests whenever needed to release the element to which the use case diagram is assigned
To reverse engineer a use case diagram:
- Analyze each actor that interacts with the system
- For each actor, study how the actor interacts with the system, changes the state of the system, or responds to some event
- Detect the flow of events in the executable system corresponding to each other
- Primary flows must be dealt with first. Later alternative paths should be considered
- Cluster related flows by declaring a corresponding use case
- Consider modeling variants using extend relationships, and common flows by applying include relationships
- Represent these actors and use cases in a use case diagram, and establish their relationships
- The executable and the atomic computations are known as the action states. This is because they are the states of the system that represent the execution of an action