Uml and Use Cases
CS 414, Software Engineering I
Mark Ardis
Rose-Hulman Institute
January 9, 2003
Outline
UML
Use cases
Sequence diagrams
Activity diagrams
How to write use cases
2
Note About Slides
Some of these slides are from a course by
Rational Software Corp.
Some of these slides are from Alastair
Cockburn
Please respect their copyrights
3
What Is the UML?
The Unified Modeling Language (UML) is a
language for
Specifying
Visualizing
Constructing
Documenting
the artifacts of a software-intensive
system
4
UML History
5
Inputs to UML
Booch
Rumbaugh
Jacobson
Meyer
Fusion
Operation descriptions,
Message numbering
Before and after
conditions
Embley
Harel
Singleton classes,
High-level view
State charts
Gamma, et.al
Wirfs-Brock
Frameworks, patterns,
notes
Shlaer - Mellor
Object Lifecycles
Odell
Classification
Responsibilities
The UML Provides
Standardized Diagrams
Use Case
Use Case
Diagrams
Activity
Diagrams
Diagrams
Scenario
Scenario
Diagrams
Sequence
Diagrams
Diagrams
Scenario
Scenario
Diagrams
Collaboration
Diagrams
Diagrams
Use Case
Use Case
Diagrams
Use Case
Diagrams
Diagrams
State
State
Diagrams
Class
Diagrams
Diagrams
Model
Deployment
Diagram
State
State
Diagrams
Object
Diagrams
Diagrams
State
State
Diagrams
State
Diagrams
Diagrams
Component
Component
Diagrams
Component
Diagrams
Diagrams
7
UML Diagrams Are Key System Artifacts
Use-Case
Diagram
Class Diagram
State Diagram
add file
Writing
add file [ numberOffile==MAX ] /
flag OFF
Openning
Use Case 1
close file
Actor A
Actor B
close file
Reading
Use Case 2
Domain
Expert
Closing
<<entity>>
Customer
name
addr
receive()
withdraw()
fetch()
send()
Use Case 3
Deployment
Diagram
UI
Class
MFC
DocumentApp
ºÐ»ê ȯ°æÀÇ Çϵå¿þ¾î¹× ³×Æ®¿÷À¸·ÎÀÇ Á¤º¸ ½Ã½ºÅÛ ¿¬°á ¸ðµ¨
- À©µµ¿ì 95 : Ŭ¶óÀ̾ðÆ®
- À©µµ¿ì NT: ÀÀ¿ë¼ -¹ö
- À¯´Ð½º ¸Ó½Å: ÀÀ¿ë ¼-¹ö ¹× µ¥ÀÌŸ ¼-¹ö, Åë½Å ¼-¹ö
- IBM ¸ÞÀÎÇÁ·¹ÀÓ: µ¥ÀÌŸ ¼-¹ö, Åë½Å ¼-¹ö
Rog ueWave
Repository
Persistence
9: sortByName ( )
DocumentList
Windows95
Window95
Windows95
g lobal
¹®¼-°ü¸®
Ŭ¶óÀ̾ðÆ®.EXE
FileManager
¹®¼-°ü¸® ¾ÖÇø´
mainWnd : MainWnd
1: Doc view request ( )
Windows
NT
L
2: fetchDoc( )
gFile : GrpFile
4: create ( )
8: fillFile ( )
user : »ç¿ëÀÚ
User Interface
Definition
fileMgr : FileMgr
3: create ( )
Package
Diagram
Document
Solaris
¹®¼-°ü¸® ¿£Áø.EXE
Alpha
UNIX
ÀÀ¿ë¼-¹ö.EXE
Windows
NT
GraphicFile
File
IBM
Mainframe
FileList
6: fillDocument ( )
µ¥ÀÌŸº£À̽º¼-¹ö
7: readFile ( )
5: readDoc ( )
document : Document
repository : Repository
Collaboration Diagram
mainWnd
user
ƯÁ ¤¹®¼-¿¡ ´ëÇÑ º¸±â¸¦
»ç¿ëÀÚ°¡ ¿äà »ÇÑ´Ù.
fileMgr :
FileMgr
document :
Document
gFile
Component
Diagram
Forward Engineering(Code Generation)
and
Reverse Engineering
repository
1: Doc view reques t ( )
Source Code edit, compile, debug, link
2: fetc hDoc ( )
3: c reate ( )
4: c reate ( )
5: readDoc ( )
È-Àϰü¸®ÀÚ´Â Àоî¿Â
¹®¼-À Ç Á ¤º¸¸¦ ÇØ´ç ¹®¼°´Ã ¼¿¡ ¼³Á ¤À » ¿äà »ÇÑ´Ù.
6: fill Doc ument ( )
7: readFile ( )
8: fill File ( )
È-¸é °´Ã¼´Â ÀоîµéÀÎ
°´Ã ¼µé¿¡ ´ëÇØ À ̸§º°·Î
Á¤·Ä À» ½Ã ÄÑ È-¸é¿¡
º¸¿©Á Ø´Ù.
9: s ortByName ( )
Sequence Diagram
Executable System
8
Rational Unified Process (RUP)
Phases
Process Workflows
Inception Elaboration
Construction
Transition
Business Modeling
Requirements
Analysis & Design
Implementation
Test
Deployment
Supporting Workflows
Configuration Mgmt
Management
Environment
Preliminary
Iteration(s)
Iter.
#1
Iter.
#2
Iter.
#n
Iter. Iter.
#n+1 #n+2
Iterations
Iter.
#m
Iter.
#m+1
9
Business Modeling Workflow
Capture a
Common
Business-Process Vocabulary
Analyst
Find Business Actors
and Use Cases
Structure the
Business Use-Case
Model
Detail a
Business Use Case
Business
Designer
Business Model
Reviewer
Review the
Business
Use-Case Model
Detail a
Business Worker
Find Business Workers
and Entities
Detail a
Business Entity
Review the
Business
Object Model
10
Requirements Workflow
Develop Elicit Stakeholder
Vision
Needs
Find Actors
and Use Cases
Capture a
Manage
Dependencies Common
Vocabulary
Detail a
Use Case
Use-Case
Specifier
User-Interface
Modeling
User-Interface
Designer
Architect
Structure the
Use-Case Model
Prioritize
Use Cases
Requirements
Reviewer
Review
Requirements
User-Interface
Prototyping
11
Analysis & Design Workflow
Architectural
Analysis
Architectural Describe
Concurrency
Design
Architect
Use-Case
Analysis
Describe
Distribution
Review the Architecture
Architecture Reviewer
SubsystemDesign
Use-Case
Design
Designer
Review the
Design
Design
Reviewer
Class
Design
Database
Designer
Database
Design
12
Outline
UML
Use cases
Sequence diagrams
Activity diagrams
How to write use cases
13
Use-Case
Name
Use Case
Model
Brief description
Flows of Events
Relationships
Activity and State
Actors
diagrams
Use-Case diagrams
Special requirements
Preconditions
Postconditions
Other diagrams
Use Cases
...
Use-Case Reports
14
Example Use-Case Diagram
Login
Registrar
Maintain Professor Information
View Report Card
Student
Register for Courses
Maintain Student Information
Course Catalog
Close Registration
Select Courses to Teach
Professor
Submit Grades
Billing System
Use-Case Flows of Events
“Happy Path”
Has one normal, basic flow
("Happy Path" or
"Sunny Day Scenario")
Several alternative flows
Regular variants
Odd cases
Exceptional flows handling error situations
16
What Are Scenarios ?
A scenario is an instance of a use case
Checkpoints: Actors
Have all the actors been identified?
Is each actor involved with at least one use case?
Is each actor really a role? Should any be merged
or split?
Do two actors play the same role in relation to a
use case?
Do the actors have intuitive and descriptive
names? Can both users and customers understand
the names?
18
Checkpoints: Use-Cases
Is each use case involved with at least one actor?
Is each use case independent of the others?
Do any use cases have very similar behaviors or
flows of events?
Do the use cases have unique, intuitive, and
explanatory names so that they cannot be mixed
up at a later stage?
Do customers and users alike understand the
names and descriptions of the use cases?
19
A First Step Towards Executables
Use Cases Analysis Design Source
Classes Classes Code
Exec
Use Case Realization
Use Case Model
Design Model
<<realizes>>
Use Case
Use Case Realization
Sequence Diagrams
Use Case
Realization
Documentation
Collaboration
Diagrams
Class Diagrams
21
Outline
UML
Use cases
Sequence diagrams
Activity diagrams
How to write use cases
22
Example: Sequence Diagram
: Student
: MainForm
: Maintain
ScheduleForm
: Registration
Controller
: CourseCatalog
System
: Schedule
1: // select maintain schedule( )
2: // open schedule form( )
3: // get course offerings( )
4: // get course offerings( )
5: // select 4 primary and 2 alternate offerings( )
6: // add courses to schedule( )
7: // create with offerings( )
23
One Interaction Diagram Not Good Enough
Basic Flow
Alternate Flow 1
Alternate Flow 2
Alternate Flow 3
Alternate Flow 4
Alternate Flow 5
Alternate Flow n
AF3
AF1
AF2
24
Outline
UML
Use cases
Sequence diagrams
Activity diagrams
How to write use cases
25
Example: Activity Diagram
Select
Course
Check
Schedule
[checks completed]
Assign to
Course
[student added
to course]
Check
Pre-requisites
[checks failed]
Resolve
Conflict
Update
Schedule
26
Outline
UML
Use cases
Sequence diagrams
Activity diagrams
How to write use cases
27
Cartoon of the Day
28
Switch to other
talk...
29
© Copyright 2026 Paperzz