UseCaseDescriptions EXCELLENT
UseCaseDescriptions EXCELLENT
Close Registration
Find use cases Brief description: This use case allows a Registrar to
close the registration process. Courses that do not have
enough students are cancelled. The Billing System is
notified for each student in each course that is not
cancelled, so the student can be billed.
Important Note:
Find use cases Use case writing is an
iterative process
Outline a
use case
Detail a
use case
Process of writing use cases
Find actors
Name and briefly
describe the actors
Find use cases that you have found
Outline a
use case
Detail a
use case
Actors and the system boundary
• Determine what the system boundary is
• Everything beyond the boundary that
interacts with the system is an instance
of an actor System boundary?
Is the Accounts
Receivable
System an actor
or part of the
system?
Financial
Analyst ?
Order Entry System ?
Accounts
Receivable Financial
System Analyst
Actors and roles
• An actor represents a role that a human,
hardware device, or another system can play
in relation to the system.
Find actors
• Who or what uses the system?
• Who or what gets information from this
system?
• Who or what provides information to
the system?
• Where in the company is the system
used?
• Who or what supports and maintains
the system?
• What other systems use this system?
Name the actor
• Actor names should
clearly convey the
actor’s role Student
Course Catalog
System
Describe the actor
Name Student
Brief description A person who
signs up for a
course
Register for courses
Relationships with Student
use cases
Review
Log in
User
CRUD Use Cases
• A CRUD use case is a Create, Read,
Update, or Delete use case
• Remove CRUD use cases if they are data-
management use cases that do not
provide results that are of value to actors
Create a schedule
Delete a schedule
Name the use case
• A use case name should:
– Be unique, intuitive, and self-
explanatory
– Define clearly and unambiguously Register for
the observable result of value courses
gained from the use case
– Be from the perspective of the actor
that triggers the use case Select a
– Describe the behavior that the use course to teach
case supports
– Start with a verb and use a simple
verb-noun combination
GOAL 1
Actor GOAL 2
Find use cases (cont.)
Actor 2 Actor 3
Each communicates-association is a whole dialog
Student logs on to system
System approves logon
Student requests course
information
Register for
Student Courses Course
Catalog
System
Billing System
Close
Registration
Detail a
use case
Outline each use case
An outline captures use case steps in short
sentences, organized sequentially
Use Case Name
Brief Description
Basic Flow
1. First step
Structure
Number 2. Second step the basic
and name 3. Third step
flow into
Alternative Flows
the steps 1. Alternative flow 1 steps
2. Alternative flow 2
3. Alternative flow 3 Identify
alternative
flows
Why outline use cases?
DRAFT
Use-Case Size
Is it more than
one use case?
? ?
Outlining helps find alternative flows
Use Case
?
Flows of events (basic and alternative)
• Basic flow
– What event starts the use case?
– How does the use case end?
– How does the use case repeat some behavior?
• Alternative flows
– Are there optional situations in the use case?
– What odd cases might happen?
– What variants might happen?
– What may go wrong?
– What may not happen?
– What kinds of resources can be blocked?
Step-by-step outline: Register for Courses
Basic Flow
1. Student logs on.
2. Student chooses to create a schedule.
3. Student obtains course information.
4. Student selects courses.
5. Student submits schedule. What are other
6. System displays completed schedule . alternatives?
Alternative Flows
A1. Unidentified student.
A2. Quit.
A3. Cannot enroll.
A4. Course Catalog System unavailable.
Can we allow students to register if the Course
Catalog is unavailable?
A5. Course registration closed.
What is a use-case scenario?
An instance of a use case
An ordered set of flows from the start of a use
case to one of its end points
Flow
Scenario
Note: This diagram illustrates only some of the
possible scenarios based on the flows.
Why capture use-case
scenarios?
• Help you identify, in concrete terms,
what a system will do when a use
case is performed
• Make excellent test cases
• Help with project planning
• Useful for analysis and design
How to capture use-case scenarios
• Capture scenarios in the Use-Case
Specification in their own section
• Give each scenario a name
• List the name of each flow in the
scenario
–Place the flows in sequence
• Example:
Use Case: Register for Courses
Scenario: Quit before registering
Flows: Basic Flow, Quit
Outline: Register for Courses
Basic Flow of Events
1. Student logs on.
2. Student chooses to create a schedule.
3. Student obtains course information.
4. Student selects courses.
5. Student submits schedule.
6. System displays completed schedule.
Alternative Flows
A1. Unidentified student.
A2. Quit.
A3. Cannot enroll.
A4. Course Catalog System unavailable. What are other
A5. Course registration closed. scenarios?
…
Scenarios
1. Register for courses: Basic Flow
2. Unidentified Student: Basic Flow, Unidentified Student
3. Quit before registering: Basic Flow, Quit
…
Checkpoints for use cases
Detail a
use case
Detail a use case
You found actors and use cases, then outlined the
use cases. Next, you add detail.
<Use-Case
<Use-CaseName>
Name>
1.
1.Brief
BriefDescription
Description
2.
2.Basic
BasicFlow
Flowof
ofEvents
Events
3.
3.Alternative
AlternativeFlows
Flows
4.
4.Subflows
Subflows
5.
5.Key
KeyScenario
Scenario
6. Add Detail
6.Preconditions
Preconditions
7.
7.Postconditions
Postconditions
8.
8.Extension
ExtensionPoints
Points
9.
9.Special
SpecialRequirements
Requirements
10.
10.Additional
AdditionalInformation
Information
Use case style
1. Student Logs On
Alternative
Flows Subflow
Example subflow
Preconditions
• Describe the state that the system must be in
before the use case can start
– Simple statements that define the state of the
system, expressed as conditions that must be
true
– Should never refer to other use cases that need to
be performed prior to this use case
– Should be stated clearly and should be easily
verifiable
• Optional: Use only if needed for clarification
• Example
Register for Courses use case
Precondition:
– The list of course offerings for the semester has
been created and is available to the Course
Registration System
– Student has logged into the Course
Registration System
Postconditions
• Describe the state of the system at the end of
the use case
– Use when the system state is a precondition to
another use case, or when the possible use case
outcomes are not obvious to use case readers
– Should never refer to other, subsequent use cases
– Should be stated clearly and should be easily
verifiable
• Optional: Use only if needed for clarification
• Example:
Register for Courses use case
Postcondition: At the end of this
use case either the student has been
enrolled in courses, or registering was
unsuccessful and no changes have been made to
the student schedules or course enrollments
Sequence use cases with pre and postconditions
Guideline:
If the business rule is specific to the use case, put it in the use case.
If it is general to the application, put it in a business rules document,
Supplementary Specification, or domain model.
RUP style summary
• Basic flow RUP Use-Case Specification
Template
– Steps are numbered
and named
– Steps do not reference
alternative flows
– Shows the main actor
succeeding in that
actor’s main goal
• Alternative flows
– Have names
– May have steps
Use case checkpoints
The actor interactions and exchanged
information is clear
The communication sequence between actor
and use case conforms to the user's
expectations
How and when the use case's flow of events
starts and ends is clear
The subflow in a use case is modeled
accurately
The basic flow achieves an observable result
for one or more actors
Review
Glossary
What terms need defining?
Implementation
Visualize the glossary with a domain model
0..* 0..*
0..1 1
Part-time Student Full-time Student Professor Course
How do you deal with the user
interface?
• Leave the user interface out of the use case
– Use cases are independent of the user interface
– Describe user interfaces with
• User-experience models or prototypes
• User interface specifications
CRUD use
cases
How do you handle repetitive
behavior?
Register for Courses
Simple, repetitive
behavior can be
captured within
the basic flow.
How do you handle repetitive behavior?
Basic Flow
(cont.)
1. Log On. Register for Courses
…
2. Create Schedule.
1.2. The system displays the functions available to the student. These
functions are Create A Schedule, Modify a Schedule and Delete a Schedule.
The student selects ‘Create a Schedule’.
3. Perform Subflow Select Courses
Repetitive flow of 4. Submit Schedule
events can be …
Alternative Flows
captured using a 1. Modify Schedule.
subflow. 1.1 In the Create Schedule step of the Basic Flow, if the student already has a
schedule that has been saved; the system retrieves and displays the
Student’s current schedule (e.g., the schedule for the current semester) and
allows him/her to use it as a starting point.
1.2 Perform Subflow Select Courses.
1.3 The use case resumes at the Submit Schedule step of the Basic Flow.
…
Subflows
1. Select Courses.
1.1 The system retrieves a list of available course offerings from the
Course Catalog System and displays the list to the student.
1.2 The Student selects up to 4 primary course offerings and 2 alternative
course offerings from the list of available offerings.
1.3 The student can add and delete courses as desired until choosing to
submit the schedule.
How to handle steps that are not
sequential?
Create Requirement
Developers will assume
that steps are sequential
unless you specify
otherwise.
How do you handle conditional?
Option 1: Use inline conditional behavior (if
statements) in the basic flow
Pros Basic Flow Register for Courses
Familiar to 1. Log On.
programmers …
Easier to handle 2. Create Schedule.
The student chooses to create a schedule. The system
small variations in retrieves a list of available course offerings from the Course
flows Catalog System and displays the list to the student.
Cons
Can be hard to If the student has an existing schedule and chooses to
modify a schedule, the system retrieves and displays the
follow student’s current schedule (e.g., the schedule for the
Harder to identify current semester) and allows him/her to use it as a starting
scenarios point.
Harder to implement If the student has an existing schedule and chooses to
and test delete it, the system retrieves and displays the Student
current schedule. The system prompts the Student to verify
the deletion. The Student verifies the deletion. The system
How would you deletes the schedule.
remove the ifs? …
How do you handle conditional
behavior?
Option 2: Use alternative flows
• Pros Basic Flow Register for Courses
– Can be used anywhere there is 1. Log On.
conditional behavior
– Clearer
…
– Easier to read 2. Create Schedule.
– Easier to define scenarios The system displays the functions available to the student. These
• Cons functions are Create A Schedule, Modify a Schedule and Delete a
– More alternative flows Schedule. The student selects ‘Create a Schedule’.
– Increased complexity in
maintaining cross-references 3. Select Courses
…
Alternative Flows
1. Modify Schedule.
In the Create Schedule step of the Basic Flow, if the student has an
existing, the system retrieves and displays the student’s current
schedule (e.g., the schedule for the current semester) and allows
him/her to use it as a starting point. The use case resumes at the
Basic Flow Select Courses.
2. Delete a Schedule
In the Create Schedule step of the Basic Flow, if the student has an
existing schedule and chooses to delete it, the system retrieves
and displays the student current schedule. . The system prompts
the Student to verify the deletion. The student verifies the
deletion. The system deletes the schedule. The use case ends
Review
– ISO S upportability
Testability
Extensibility
Configurability
Serviceability
Adaptability Installability
Maintainability Localizability
Compatibility Robustness
Example: Nonfunctional
Requirements
• Example:
– The system must provide price quotes
that are no more than 15 minutes
delayed.
Actor(s)
Pre-condition The User is logged into the System and has
appropriate privilege to perform the operation,
and the Item exists in the System.
Post-condition The value(s) of the attribute(s) of the Item
have been updated.
Trigger User indicates the desire to update the Item.
Normal Scenario
1.
2. Contributor/System Administrator selects
option to upload additional data to an entry
3. Contributor/System Administrator selects on
which entry to upload additional data
4. Contributor/System Administrator revises
newly added data
5. Contributor/System Administrator saves
additional data to entry
6. Contributor/System Administrator signs out of
system
Normal Scenario
1. User requests initiation of update, specifying
the Item whose attributes are to be modified.
2. System displays current values of attributes
that can be modified.
3. User selects attribute to modify, enters value,
and submits update request.
4. System confirms update and displays updated
attribute.
Extensions
1.1 Contributor/System Administrator does not
have a login account:
1.1.a – Contributor/System Administrator
creates account to login into the system