A use case diagram is a UML diagram that represents the user’s interaction with the system and shows the relationship between the user and different use cases in which the user is involved.
When we talk about the use cases we are talking about the scenarios.
What is included in a use case?
Now, we will go through some common sections that are present in any traditional use case. They are:
- Use case id that shows a unique id to identify the use case
- Use case name to name a use case
- Use case description that describes all about the use case in an elaborated way.
- Precondition that explains the conditions that have to be met to proceed with the use case
- Postcondition that explains the outcome when a use case is successfully completed
- Actors that show whoever is involved in the use case
- The main flow that explains the actual flow in the use cases and the interactions between the actor and the use case
- An alternate flow that explains the flow other than the main flow but with the same result as of the main flow
- An exceptional flow that explains the flow by which the use case goal cannot be achieved
How to write effective use cases?
- Use case should be written in a way that in each step they show an action
- Always keep the steps to be short as possible and write them in a way that is easily understood. Also, don’t make it too short.
- Try to avoid if statements as they create ambiguity in the use case.
- Don’t go for the UI while writing the use case and try to avoid adding UI in every step
- While writing use cases one can encounter the business rules and keeping those rules in mind, one should be writing the use cases.
- It should be simple and understandable.
- It should have a very high level of understanding of the process.
- It must standalone.
- It should not describe the design.