A use case is a written description of how users will perform tasks on your website. It outlines, from a user’s point of view, a system’s behavior as it responds to a request. Each use case is represented as a sequence of simple steps, beginning with a user’s goal and ending when that goal is fulfilled.
Benefits of Use Cases
Use cases add value because they help explain how the system should behave and in the process, they also help brainstorm what could go wrong. They provide a list of goals and this list can be used to establish the cost and complexity of the system. Project teams can then negotiate which functions become
and are built.
|What Use Cases Include||What Use Cases Do NOT Include|
Elements of a Use Case
Depending on how in depth and complex you want or need to get, use cases describe a combination of the following elements:
- Actor – anyone or anything that performs a behavior (who is using the system)
- Stakeholder – someone or something with vested interests in the behavior of the system under discussion (SUD)
- Primary Actor – stakeholder who initiates an interaction with the system to achieve a goal
- Preconditions – what must be true or happen before and after the use case runs.
- Triggers – this is the event that causes the use case to be initiated.
- Main success scenarios [Basic Flow] – use case in which nothing goes wrong.
- Alternative paths [Alternative Flow] – these paths are a variation on the main theme. These exceptions are what happen when things go wrong at the system level.
How To Write a Use Case
Write the steps in a use case in an easy-to-understand narrative. Kenworthy (1997) outlines the following steps:
- Identify who is going to be using the website.
- Pick one of those users.
- Define what that user wants to do on the site. Each thing the use does on the site becomes a use case.
- For each use case, decide on the normal course of events when that user is using the site.
- Describe the basic course in the description for the use case. Describe it in terms of what the user does and what the system does in response that the user should be aware of.
- When the basic course is described, consider alternate courses of events and add those to “extend” the use case.
- Look for commonalities among the use cases. Extract these and note them as common course use cases.
- Repeat the steps 2 through 7 for all other users.
Example Use Cases
Below, are examples of three use cases with increasing levels of complexity. For our purposes we have defined them as Simple, Middleweight and Heavyweight use case for doing the laundry. In each of these types of uses cases you will see that:
- A housekeeper does laundry on a Wednesday
- She washes each load.
- She dries each load.
- She folds certain items.
- She irons some items.
- She throws away certain items.
Simple Laundry Use Case
|Use Case 1||Do laundry|
|Basic Flow||On Wednesdays, the housekeeper reports to the laundry room. She sorts the laundry that is there. Then she washes each load. She dries each load. She folds the items that need folding. She irons and hangs the items that are wrinkled. She throws away any laundry item that is irrevocably shrunken, soiled or scorched.|
Middleweight Laundry Use Case
|Use Case 1||Do laundry|
|On Wednesdays, the housekeeper reports to the laundry room. She sorts the laundry that is there. Then she washes each load. She dries each load. She folds the items that need folding. She throws away any laundry item that is irrevocably shrunken, soiled or scorched.|
|Alternative Flow 1||If she notices that something is wrinkled, she irons it and then hangs it on a hanger.|
|Alternative Flow 2||If she notices that something is still dirty, she rewashes it.|
|Alternative Flow 3||If she notices that something shrank, she throws it out.|
Heavyweight Laundry Use Case
|Use Case 1||Housekeeper does laundry|
|Use Case Overview||It is Wednesday and there is laundry in the laundry room. The housekeeper sorts it, then proceeds to launder each load. She folds the dry laundry as she removes it from the dryer. She irons those items that need ironing.|
|Trigger||Dirty laundry is transported to the laundry room on Wednesday.|
|Precondition 1||It is Wednesday|
|Precondition 2||There is laundry in the laundry room.|
Bạn đang xem: Use Cases
Basic Flow: Do Laundry
|Description||This scenario describes the situation where only sorting, washing and folding are required. This is the main success scenario.|
|1||Housekeeper sorts laundry items.|
|2||Housekeeper washes each load.|
|3||Housekeeper dries each load.|
|4||Housekeeper verifies that laundry item does not need ironing, is clean and not shrunken.|
|5||Housekeeper verifies that laundry item is foldable.|
|6||Housekeeper folds laundry item|
|7||Housekeeper does this until there are no more laundry items to fold|
|Termination outcome||Laundry is clean and folded|
Xem thêm: Crom(II) oxit là oxit
Alternative Flow 4A: Laundry item needs ironing.
|Description||This scenario describes the situation where one or more items need ironing before or in lieu of folding|
|4A1||Housekeeper verifies that the laundry item needs ironing and is clean and not shrunken|
|4A2||Housekeeper irons the laundry item|
|4A3||Housekeeper puts laundry item on a hanger|
|Termination outcome||Laundry that needs ironing is ironed and hung up.|
Alternative flow 4B: Laundry item is dirty.
|Description||This scenario describes the situation where the laundry item did not get clean the first time through the wash.|
|4B1||Housekeeper verifies that the laundry item is not clean.|
|4B2||Housekeeper rewashes the laundry item|
|Termination outcome||Dirty laundry is rewashed.|
Alternative flow 4C: Laundry item shrank.
|Description||This scenario describes the situation where the laundry item shrank.|
|4C1||Housekeeper verifies that the laundry item shrank|
|4C2||Housekeeper disposes of laundry item.|
|Termination outcome||Laundry item no longer exists.|
Alternative flow 5A: Laundry item needs hanger.
|Description||This scenario describes the situation where the laundry item needs to be hung instead of folded.|
|5A1||Housekeeper verifies that laundry item needs hanging.|
|5A2||Housekeeper puts laundry item on a hanger.|
|Termination outcome||Laundry that needs hanging is hung up.|
Post conditions: All laundry clean and folded or hung up.
- Laundry can only be done on Wednesdays.
- All ironed laundry items get hung on hangers
- Any laundry item that is irrevocably soiled, shrunken, scorched, etc. , gets thrown out.
Chuyên mục: Kiến thức