1 BasicUseCases
1 BasicUseCases
Model Namespace
Element
Classifier Generalizable
Element Constraint
name
isRoot visibility
isSpecification Body
SWE 215
1
Introduction
Use Case: “... a typical interaction between a
user and a computer system”, Booch
– Here, “user” is anything that needs or invokes the functionality
of the system
– “Computer system” is the system being modeled
Use cases capture and document the user-
visible functionality of a system (functional
requirements)
Use cases capture how the system will benefit
the user
Each use case represents a discrete goal for
the user
2
Coming up: Example Use Case Diagram
Example Use Case Diagram
3
Coming up: Use Case Diagrams
Use Case Diagrams
Use Case Diagrams provide a visual way to
document user goals and explore possible
functionality
Three primary modeling components:
– Actors – Relationships between
– Use Cases use cases
Record class grades Review Transcripts
Teacher
Authorized Student
Staff Worker
4
Coming up: Actors
User Goals
User Goals are statements that represent
what the users need to accomplish,
independent of specific software features
Examples of user goals for a Student
Records Management System
– Ensure that a student’s records reflects courses
taken and grades received in those courses
– Allow only authorized faculty and staff to update
student records
– Ensure that students can obtain copies of their own
(and only their) records in a timely manner
5
Actors
Actors are people or external systems that
need to interact with our system
Finding Actors
6
Coming up: Relationships Between Actors
Actors
An actor can be a role that a user plays with
respect to the system
A single person may play different roles
A single actor may perform many use cases
A use case may be performed by many actors
Show external systems as actors only when
they are the ones who need a use case
7
End of presentation
Relationships Between Actors
Actors can be related by
generalization/specialization
Actors are classifiers (not individual users)
Student
s..
io u
obv
ery ip it
n v sk
Graduate
he se
Student
s w rwi
t hi the
Do o
8
Coming up: Use Case Relationships
Use Case Relationships
Includes
Extends
Generalization
9
Coming up: Use-Case Relationships
Use-Case Relationships
Includes Dependency: Defines how one
use case can invoke behavior defined by
another use case
<<includes>>
10
Coming up: Use-Case Relationships
Use-Case Relationships
Extends dependency: defines a use-case
that is a variation of another, usually for
handling an abnormal situation
<<extends>>
11
Coming up: Use-Case Relations
Use-Case Relations
Generalization: Defines one use case as a generalization
of another. Replaces generic functionality with alternate
implementation
12
Coming up: Documenting Use Cases
Documenting Use Cases
List Actors What is system response
to external event? What
is the user’s goal?
List External Determine
Events expected behavior
Name behaviors as
use cases
Add relations
Document use case
(includes, extends,
(basic flow,
generalization)
alternate, exception)
13
Coming up: Benefits of Use Cases
Benefits of Use Cases
Use cases diagrams capture user-visible functions
Show Actors
outside
boundary
Use extend,
include, Typically one
generalization/spe
cialization where diagram for
appropriate your project
15
Coming up: Use cases for CS421
is sufficient
Questions
Who might be interested in reviewing or using use
case diagrams?
When in the development life cycle should we employ
use cases?
What do use cases have to do with object-orientation?
What level of use-case granularity is best?
How many use cases are enough?
Can other modeling activities help in discovering use
cases?
When in the development life cycle do we stop
referring to or refining the use cases?
What should the text description of use case contain?
16
Coming up:
In Class Exercise
Let’s create a use case diagram for
– iPod
– Television set
– Elevator
– ATM
– Online Scrabble game
– Word Processor
17
Coming up: Use cases for CS421