|Lesson 5||Use case description, part 1|
|Objective||Describe each Use Case with a Textual Narrative.|
Describe each Use Case with a Textual Narrative
Scope Use Case - Description
Most diagrams require some kind of textual narrative to help interpret the diagram properly.
The use case diagram uses a narrative for each use case. The narrative consists of three basic elements:
- Triggering event
- Main flow of events
- Exceptional flow of events
Use cases are discrete units of work. They have a beginning and an end. The narrative must identify the triggering event that initiates the use case. The event could be a point in time (for example, month's end), a condition in the system (for example, account is overdrawn), or a request by an actor (for example, selecting an option).
Main flow of events
The main flow of events describes the way that you would expect the use case to work if nothing ever went wrong. Leave exceptions out of this description to keep the focus on the reason the use case exists, and to keep focus away from error handling.
Exceptional flow of events
Once the main flow of events is fully understood, review the flow and identify what could go wrong. Look for validations that could fail and interruptions that could occur before the use case has a chance to finish. Create a separate description for each exceptional flow of events.
Example of a basic use case template
Here is an example of a basic use case template:
|Use Case Name:||Verb and Noun that expresses the goal of the use case, for example. "Deposit Funds."
|Initiation (Triggering event) :|| This use case starts when ... Identify how the use case knows when it is time to try to accomplish its goal.
|Main flow of events:
||Describe the successful dialog between the actor and the use case
|Exceptional flow of events:
||Describe a dialog that does not achieve the stated goal of the use case, for example, an exception
Most teams will want to add audit details like a change log, author, and other information for managing the narratives over time.
In the Slide Show below, the use case template is used to create a narrative for the use case Deposit Funds.
- Identify the triggering event for the use case
- Describe the dialog between the actor and the use case without any errors or exceptions
- Describe a dialog that includes one of the possible exceptions
- Continue to add exception flows until all exceptions have been documented. (There are more possible exceptions, but we will conclude here)
Write-Use Case Description - Exercise