UML Use Case Diagrams
UML Use Case Diagrams
Jeroen Keiren
• “More than 900 people who ran post offices were prosecuted after
faulty computer software made it look like money was missing from
their branches.”
• Issues with integrity, consistency, etc. E.g. when cancelling transfer lack of
transactions lead to transfer recorded in one system not in another.
• Explanation on YouTube by Computerphile
https://youtu.be/hBJm9ZYqL10?si=UjJ3EW8VY3qUXLT7
• The system shall provide the means for the resource provider to
see on which project this resource is working.
• In order to obtain a CERN car sticker the person must have a valid CERN
ID.
• The opening of the software shall take less than 3-4 seconds under
normal working conditions.
796 pages
OMG Document Number: formal/2017-12-05
IDate:
do not expect you December
to learn2017UML specification by heart, but
please consult it
Normative Reference:
in case of doubt.
http://www.omg.org/spec/UML/2.5.1
Diagram
Structure Behavior
Diagram Diagram
Class Package Profile Object Activity State Machine Interaction Use Case
Diagram Diagram Diagram Diagram Diagram Diagram Diagram Diagram
Diagram
Structure Behavior
Diagram Diagram
Class Package Profile Object Activity State Machine Interaction Use Case
Diagram Diagram Diagram Diagram Diagram Diagram Diagram Diagram
Diagram
Structure Behavior
Diagram Diagram
Class Package Profile Object Activity State Machine Interaction Use Case
Diagram Diagram Diagram Diagram Diagram Diagram Diagram Diagram
[CC0]
Use case
• Fundamental concept of many object-oriented development methods
• System
(what is being described?)
• Student administration system
• Actors
(who interacts with the system?)
• Professor
• Use cases
(what can the actors do?)
• Query student data
• Issue certificate
18 2IX20 Use case diagrams
Use Case
22
7 2IX20 Use case diagrams
Actors
Non-human Human
Secondary Secondary
Passive Active
Structured approach
• Name
• Short description
• Precondition: prerequisite for successful execution
• Postcondition: system state after successful execution
• Error situations: errors relevant to the problem domain
• System state on the occurrence of an error
• Actors that communicate with the use case
• Trigger: events which initiate/start the use case
• Standard process: individual steps to be taken
• Alternative processes: deviations from the standard process
• Actors are connected with use cases via solid lines (associations)
• Every actor must communicate (be associated) with at least one use
case
• An association is always binary
• Multiplicities may be specified
The behavior of one use case (included use case) is integrated in the
behavior of another use case (base use case)
Student Administration
Reserve
lecture hall
«extend»
Announce
lecture
«extend»
Announce Professor
exam
• Extension points:
• define at which point the behavior is
integrated
• written directly within the use case
• Multiple extension points can be
specified
• Conditions define under which
circumstances the behavior is
integrated
Actors:
• Customer
• Supplier
• Collector (in this case, Collector = Supplier)
Use cases:
• Buy product
• Restock machine
• Collect money
Vending machine
Buy product
Restock machine
«includes» Supplier
Customer
Collect money
Actors are not part of the system, hence, they are positioned outside the
system boundaries!
Many small use cases that have the same objective may be grouped to
form one use case
ü
51 2IX20 Use case diagrams: pitfalls and best practices
Best Practices: Typical Errors To Avoid (5/5)
The various steps are part of the use cases, not separate use cases
themselves! à NO functional decomposition
ü
52 2IX20 Use case diagrams: pitfalls and best practices
Summary
54 2IX20 Lecture 2
Notation Elements (2/2)
Name Notation Description
55 2IX20 Lecture 2
Next steps
Read
• Chapter 4 reader
Do
• Exercises 4.1-4.12
• Extra exercise: create a use case diagram for a social media app
• Weekly test 1
• Assignment 1: finish requirements, start on use case diagram