UML SIG – UML Lecture Series Requirements Modeling UML SIG UML Lecture Series UML SIG Requirements Modeling (Use Case Diagram + Use Case Description) UML Lecture Series Requirements Modeling (Use Case Diagram + Use Case Description)
Jun 29, 2015
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
UML Lecture Series
UML SIG
Requirements Modeling (Use Case Diagram +
Use Case Description)
UML Lecture Series
Requirements Modeling (Use Case Diagram +
Use Case Description)
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Session Objectives
At the end of this lecture You will be able to :
1. Draw a use case diagram to depict functional
requirements of a system.
2. Expose typical mistakes by students.
3. Write use case description for a use case.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
• use case• use case diagram• functional requirements• non-functional requirements• actor• include• extend• use case specification/definition/description• flow of events• alternate flow of events / alternate pathway• exception flow of events / exception pathway• basic flow of events / happy pathway• non-functional requirements / shadow use cases
Keywords used in this lecture
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Thoughts to Ponder …
To my knowledge, no other software engineering language construct as significant as use cases has
been adopted so quickly and so widely among practitioners. I believe this is because use cases play
a role in so many different aspects of software engineering.
Ivar JacobsonFounding Father of UML and Creator of Use Case Diagram
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Functional vs. Non-Functional
Requirements
Functional
Non-Functional
Functional requirement are user ‘visible’ features and aretypically initiated by stakeholders of the system – generate report, login, etc.
Non-functional requirements are ‘non-visible’ features and but required for a effective running of an application – security, backup, etc.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Session Objectives
At the end of this lecture You will be able to :
1. Draw a use case diagram to depict functional
requirements of a system.
2. Expose typical mistakes by students.
3. Write use case description for a use case.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Use Case Diagram
Definition:A diagram that shows a set of use cases and actors and their relationships.
Use cases represent system functionality, the requirements of the system from the user’s perspective.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Notations
use case A description of a set of sequences of actions, including variants, that system performs that yields an observable value to an actor. actorThe people or systems that provide or receive information from the system; they are among the stakeholders of a system.includeSpecifies that the source use case explicitly incorporates the behaviour of another use case at a location specified by the sourceextend Specifies that the target use case extends the behaviour of the source.
<<include>>
<<extend>>
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Actors
Actors
Could be human beings, other systems, timers and clocks or hardware devices.
Actors that stimulate the system and are the initiators of events are called primary actors (active)Actors that only receive stimuli from the system are called secondary actors (passive)
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Actors
Actors
Who/what will be interested in the system?
Who/what will want to change the data in the system?
Who/what will want to interface with the system?
Who/what will want information from the system?
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Use Case Diagram– Guidelines & Caution
1. Use cases should ideally begin with a verb – i.e generate report. Use cases should NOT be open ended – i.e Register
(instead should be named as Register New User)
2. Avoid showing communication between actors.
3. Actors should be named as singular. i.e student and NOT students. NO names should be used – i.e John, Sam, etc.
4. Do NOT show behaviour in a use case diagram; instead only depict only system functionality.
5. Use case diagram does not show sequence – unlike DFDs.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Example – Include and Extend
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
The use of include and extend is discouraged simply becausethey add unnecessary complexity to a Use Case diagram.
Since the primary purpose of use cases is to show usercentred functionality, the precedence of use cases takeslittle importance.
Include and Extend
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Quiz 1
Customer Service Clerk
Maintain Relationships
Order Clerk
Process Orders
CustomerMaintain Orders
SupplierMaintain Inventory
Packaging ClerkShip Product
Bill ing Clerk
Generate Invoice
Accounting System
Manager
Time
Decision Support
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Quiz 2
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Granularity of Use Cases
Add referenc
e
Remove reference
Search for reference
User
List references
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Granularity of Use Cases
Manage Reference
User
Generally, a use case should embody sufficient levels of granularity without which the use case may not be rendered as useful.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Session Objectives
At the end of this lecture You will be able to :
1. Draw a use case diagram to depict functional
requirements of a system.
2. Expose typical mistakes by students.
3. Write use case description for a use case.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Mistake 1
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Mistake 2
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Mistake 3
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Mistake 4
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Mistake 5
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG Inventory System
In order to generate an invoice a clerk must log in. If a clerk is a first time user, one must have themselves registered. There should be an option for a user to register oneself within the login page. Any user can use the system to view products online.The option of login is also provided when a user views products online.
Discussion Exercise
Draw a use case diagram for the scenario below:
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Exercise - Solution
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Session Objectives
At the end of this lecture You will be able to :
1. Draw a use case diagram to depict functional
requirements of a system.
2. Expose typical mistakes by students.
3. Write use case description for a use case.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Use Case Specification
Maintain Relationships
Customer Service Clerk
Process Orders
Order Clerk
Maintain OrdersCustomer
Maintain Inventory Supplier
Ship ProductPackaging
Clerk
Billing Clerk
Accounting System
Generate Invoice
ManagerDecision Support
Time
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Use Case Specification
Maintain Relationships
Customer Service Clerk
Process Orders
Order Clerk
Maintain OrdersCustomer
Maintain Inventory Supplier
Ship ProductPackaging
Clerk
Billing Clerk
Accounting System
Generate Invoice
ManagerDecision Support
Time
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Use Case Specification
Use case specification is synonymous to use case description
and use case definition and can used interchangeably.
Use case specification defines information that pertains to a
particular use case which is important in understanding the
purpose behind the use case.
Use case specification is written for every use case.
A use case specification has one or more flow of events or
pathways association with it.
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Flow of Events / Pathways
A flow of events or pathway is a textual description embodying
sequence of events with regards to the use case and is part of
the use case specification.
Flow of events is understood by the customer. A detailed
description is necessary so that one can better understand the
complexity that might be involved in realising the use cases.
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Flow of Events / Pathways
Flow of events describes how and when the use case starts
and ends, when the use case interacts with the actors, and the
information exchanged between an actor and the use case.
Flow of events is derived from a what perspective, NOT how
perspective. Hence, specific information like: interface details
and technical specifications should NOT be included in a use
case description.
Use case description serves as a ‘bridge’ between
stakeholders of a system and the development team.
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Flow of Events / Pathways
Use case description serves as a ‘bridge’ between
stakeholders of a system and the development team.
Use Case Diagram
Use CaseSpecification
Programmers look at use case specification to understand complete requirements - SRS
Systems analyst produce usecase diagram & use case specification in consultation with end users
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Flow of Events / Pathways
Flow of Events
Describes how and when use casestarts and ends.
Does NOT describe user interface details.
Is generally a text-based file that is included under its use case in Rational Rose/Visual Paradigm
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Types Flow of Events / Pathways
Types of
Flow of Events
Basic Flow of Events@ Happy Path - is the most common pathway. It usually depicts a perfect situation, in which nothing goes wrong.
Alternate Flow of Events @ Alternate Pathway - is a pathway that is still considered a good pathway; it’s just not the most heavily travelled one
Exception Flow of Events @ Exception Pathways @ Unhappy Pathway – things don’t always go as planned. An exception is an error condition that is important enough to the application to capture.
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Types Flow of Events / Pathways
Basic Flow of Events@ Happy Path – You get to the ATM and successfully withdraw money
Alternate Flow of Events @ Alternate Pathway - You get to the ATM but could not withdraw money due to insufficient funds in your account.
Exception Flow of Events @ Exception Pathways @ Unhappy Pathway – You get to the ATM machine but your valid pin number is not accepted.
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
See Example Word Document on Use Case Specification based on Remulak Productions
Use Case Specifications - Example
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Review Questions
UML SIG – UML Lecture Series Requirements Modeling
UML SIGA use case specification cannot be done for an included use case.
True
False
Review Question
UML SIG – UML Lecture Series Requirements Modeling
UML SIGUse case specification together with a use case diagram become part of what is know as system requirements specification (SRS)
True
False
Review Question
UML SIG – UML Lecture Series Requirements Modeling
UML SIG
Although non-functional requirements (i.e shadow use cases) are not “technically speaking” a use case, are still considered a use case to acknowledge the importance it has in the overall system.
True
False
Review Question
UML SIG – UML Lecture Series Requirements Modeling
UML SIGBasic Flow of Events @ Happy Path is a series of events that happens some of the time
True
False
Review Question
UML SIG – UML Lecture Series Requirements Modeling
UML SIGAlternate Flow of Events @ Alternate Pathway is a series of events that happens all the time
True
False
Review Question
UML SIG – UML Lecture Series Requirements Modeling
UML SIGException Flow of Events @ Exception Pathway is a series of events that is impossible to happen.
True
False
Review Question
UML SIG – UML Lecture Series Requirements Modeling
UML SIGBoth use case diagram and use case specification should not be too detailed.
True
False
Review Question
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Use Case Diagram - In Class Exercise
Write use case specification based on the case diagram for Inventory System.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Summary
1. Use Case Diagram as a means to model functional requirements of a system.
2. Awareness of typical mistakes by students.
3. Write use case description for a use case.
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Further Reading
http://download.boulder.ibm.com/ibmdl/pub/software/dw/rationaledge/jan03/UseCaseFAQS_TheRationalEdge_Jan2003.pdf
Use Case FAQs
UML SIG – UML Lecture Series Requirements Modeling Slide 2 (of 48)
UML SIG
Reference
Jacobson I. 2003, “Use Case – Yesterday, Today and Tomorrow”, The Rational Edge, IBM