This is a quick summary of how to write use cases.
- The name should start with a strong verb.
- A use case is a set of scenarios. A scenario is a list of steps.
- Each step should state what the user does and/or what the system responds.
- The steps must not mention how the system does something.
Keep the steps essential or logical -- no colors, clicks, typing!
- Each step needs to be analysed in detail before it becomes code.
- Keep It Simple: use the simplest format you need.
- Refine interesting use cases first.
- Make sure you store use cases so that they are easily found, edited, and used.
- Put use cases on a project web site.
- Keep track of different versions.
- Writing use cases is a team sport.
- Focus on a particular user (give them a name) in each use case and each step.
- Don't get bogged down in all the special ways it can go wrong until you've finished the main success story.
- Also see Rules below.
The minimum documentation is a well chosen name. It should
start with a verb and indicate the type of user, and what they achieve:
Enrol student in class.
This is better than nothing... and the start for
drafting more complete descriptions of the use case.
There is a lot to be said for labelling use cases with a short identifier.
(UC1): Enrol student in class.
Name + Terse one paragraph description of who does what to get what.
Notice that we just add the description to the name+label:
(UC1): Enrol student in class.
The student logs in to the enrolment system and requests a list of sections
of a class. They then select one class to enrol in and the system records
this enrolment. The student is provided with confirmation that they
have been enrolled.
Name
(Main Success Scenario): Brief one paragraph description.
(Alternate scenario 1): if ...., one paragraph
(Alternate scenario 2): if ...., one paragraph
. . . . . . . . . ( end of section Casual Format) <<Contents | End>>
Notice that the scenarios are labelled for later cross reference and discussion.
Example
(UC1): Enrol student in class.
(UC1main): The student logs in to the enrolment system and requests a list of sections
of a class. They then select one class to enrol in and the system records
this enrolment. The student is provided with confirmation that they
have been enrolled.
(UC1a): The class is full and the system proposes an alternative.
(UC1b): The student cancels the enrollment after confirmation.
(UC1aa): The class is full and there is no alternativ,e the system suggests talking
to an advisor.
Notice that the scenarios are labelled for later cross reference and discussion.
. . . . . . . . . ( end of section Casual Format) <<Contents | End>>
This differs from a casual format in that the scenarios are numbered lists of
steps.
Name
(Main Success Scenario): list of steps.
(Steps letter): if ...., list of steps.
(Steps letter): if ...., list of steps.
Example
(UC): Enrol student in class.
(UC):
- The student logs in to the enrolment system and requests a list of sections
of a class.
- The student selects one class to enrol in and the system records
this enrolment.
- The student is provided with confirmation that they have been enrolled.
- They can select more classes.
- The student logs out.
(UC2a): The class is full and the system proposes an alternative.
(UC3b): The student cancels the enrollment after confirmation.
(UC2aa): The class is full and there is no alternative, the system suggests talking
to an advisor.
. . . . . . . . . ( end of section Less Casual Format) <<Contents | End>>
Use this only for the really valuable and interesting use cases.
Here are the headings for a fully dressed use case
Start with a verb, numbering optional
The System Under Design or Context
Enterpise goal, User-goal, or subfunction
Name the actor who uses the system under design to achieve some goal.
State what special and interesting things must be true for this particular case to work.
List the interesting things that are true after a scenario is completed.
- step_number: actor does something or system responds
(step numbers letter): condition
- actor does something/system does something
. . . . . . . . . ( end of section Extensions) <<Contents | End>>
- desired quality or technological limitation
- step number: possible change in technology or data format
- Question
- Topic to research
Here is a Tabular Format
Table
|
---|
Name
| Start with a verb, numbering optional
|
Scope
| The System under Design
|
Level
| User-goal or subfunction
|
Primary Actor
| Asks the SUD to deliver service to meet goals
|
Stakeholders and Interests
| (stakeholder1): what they want.
|
Preconditions
| State what special and interesting things must be true for this particular case to work.
|
Postconditions
| List the interesting things that are true after a scenario is completed
|
Main Success Scenario
| actor does something or system responds
|
Extensions
| (steps letter): condition steps
|
Special Requirements
| desired qualities or technological limitations
|
Variations in Technology and Data
| step number: possible change in technology or data format
|
Frequency of Occurrence
| How often
|
Miscellaneous
| Open issues to research
|
(Close Table)
[ fullydressed.txt ]
[ fullydressed.html ]
. . . . . . . . . ( end of section Fully Dressed) <<Contents | End>>
Source:
Rules
[YueBriandLabiche13]
- Each event is a sentence with either the system or an actor as the subject.
- Describe a sequence of events.
- No interations between actors.
- One action per sentence.
- Use active voice not passive.
- Clearly show who is sender and who reciever.
- Use Declarative sentences.
- Use words consistently.
- Don't use modal verbs like "might".
- Avoid adverbs.
- Use simple sententences: one sobject + one predicate.
- Don't use negative adjectives and adverbs.
- No pronouns.
- Don't use participle phrases as an adverbial phrase.
- Use "The system" consistently to refer to the system under design.
- You can INCLUDE another use case.
- You can indicate an EXTENDED BY use case.
- You should indicate where an alternative sequence flows from.
- Use IF-THEN-ELSE-END IF, and ELSEIF
- Use MEANWHILE ___
- Use VALIDATE THAT ___
- Use DO-UNTIL
- Use ABORT
- Use RESUME_STEP ___
- Each basic flow and alternative flow should have its own postcondition
** Controversial **
. . . . . . . . . ( end of section Rules for scenarios) <<Contents | End>>
Use a dumb editor!
[Cockburn02b]
(Alistair Cockburn's article).
[ http://www.accompa.com/product-management-blog/2009/10/08/use-case-template-example-requirements-management-basics/ ]
(shorter fully dressed form).
[ url?sa=t&source=web&cd=4&ved=0CC0QFjAD&url=http%3A%2F%2Fninova.itu.edu.tr%2Fen%2Fcourses%2Finstitute-of-informatics%2F156%2Fbbl-502%2Fekkaynaklar%3Fg99523&rct=j&q=fully%20dressed%20use%20case%20example&ei=a5ztTMnuKMGVnwfi_sD9CA&usg=AFQjCNHEWXzGLEj3rDMNrNzzGQw_p3VPAQ&cad=rja ]
(Larman's UC1: Process Sale in PDF).
[ Use_case ]
(Wikipedia).