1
Use case DiagramUse case Diagram
Use case specificationUse case specificationUse case specificationUse case specification
Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
USE CASE DIAGRAMUSE CASE DIAGRAM
System behavior is captured by use cases.
– Use cases describe the system, its environment,
and the relationship between the system and
its environment.its environment.
– “A use case diagram is a graphic representation
of the key features of the written use case
reports that comprise a system.”
(McLeod, Jordan)
What Is a Use-Case Model?
• A model that describes a system’s functional
requirements in terms of use cases
• Represents
– system’s intended functionality (use cases)
and its environment (actors)
What Is an Actor?
Actors are not part of the system.
Actors represent
roles a user of the system can play.
 anything that interacts with the system
 a human, a machine, or system.
Actors are EXTERNAL.
 a human, a machine, or system.
They can actively interchange information
with the system.
They can be a giver of information.
They can be a passive recipient of
information. Actor
 Who will supply, use, or remove information?
 Who will use this functionality?
 Who is interested in a certain requirement?
 Where in the organization is the system
Useful Questions in Finding Actors?Useful Questions in Finding Actors?
Actor
 Where in the organization is the system
used?
 What are the system’s external resources?
 What other systems will need to interact with
this one?
USEUSE CASECASE:: a sequence of actions a
system performs that yields an
observable result of value to a
particular actor. Use Case
Use Cases and ActorsUse Cases and Actors
A use case models a dialog between actors and the
system. A use case is initiated by an actor to
invoke a certain functionality in the system.
QuestionsQuestions toto findfind useuse casescases..
– For each actor you have identified,
what are the tasks the system would
be involved in?
– Does the actor need to be informed
about certain occurrences in theabout certain occurrences in the
system?
– Will the actor need to inform the
system about sudden, external
changes?
– What information must be modified or
created in the system?
Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
Brief Overview of Use Case Core
Components and Structure
Brief Overview of Use Case Core
Components and Structure
Relationship between Use-CaseRelationship between Use-Case
– Use the include relationship to show
that
•the behavior of one use case is wholly and
unconditionally used in another use case
Perform Transaction
The Perform Transaction
use case includes the
Perform Transaction
Send Command Receive Response
Application «include» «include»
use case includes the
processing specified by
both the Send Command
and Receive Response
use cases.
Use Case Diagram Rules
• Use the generalizationgeneralization relationship to show
that
– a use case is a specialization of another
use case
Run Applications Install Applications
User Super User
A User can Run Applications.
A Super User can Install
Applications and Run
Applications, since a Super
User is a specialization of
User.
• Use the extendextend relationship to show that
– one use case conditionally augment (or
extend) the behavior of another use
case.
1. Actor
2. Use case
3. Association
4. System Boundary
Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
5. Include
6. Extend
7. Generalization
8. Dependency
9. Comment
10. Artifact
Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
Types of Actors
1. Initiating actor ( primary actor or “user”):
initiates the use case to realize a goal
2. Participating actor (Secondary actor):
participates in the use case but does not initiateparticipates in the use case but does not initiate
it:
3. Supporting actor:
helps the system-to-be to complete the use case
4. Offstage actor: passively participates in the
use case, i.e., neither initiates nor helps
complete the use case
Practice: Find the Actors
• In the Course Registration System Requirements
document, read the Problem Statement for the
Course Registration case study.
• As a group, identify the following
– Actors
– Description of the actor
Use-Case Specifications
• Name
• Brief description
• Flows of Events
• Relationships
• Activity diagrams
Use-Case Model
Actor• Activity diagrams
• Use-Case diagrams
• Special
requirements
• Pre-conditions
• Post-conditions
• Other diagrams Use-Case Specifications
...
Actor
s Use
Cases
Brief Overview of
Use Case Core Components and Structure –
Use Case Description
Basic Structure and
Components
• Use Case: Name
• Brief Description
Additional Components
• Special Requirements
• Data Sources *
• Brief Description
• Actors
• Pre-Conditions
• Post-Conditions
• Basic Flow
• Alternate Flows
• Exception Flows
• Data Sources *
• Dependencies
• Assumptions
• Open Issues
Scenarios..
•Scenario: a set of actions performed to
achieve a goal under some conditions
– Actions specified as a sequence of steps
– A step is a logically complete action performed– A step is a logically complete action performed
either by the actor or the system
•Main success scenario – when things go
normally and the goal is achieved
•Alternate scenarios: When things go wrong
and goals cannot be achieved
21
Example 1
Use Case 1: Buy stocks
Primary Actor: Purchaser
Goals of Stakeholders:
– Purchaser: wants to buy stocks
– Company: wants full transaction info
Precondition: User already has an account
Main Success Scenario
Requirements 22
Main Success Scenario
User selects to buy stocks
System gets name of web site from user for trading
Establishes connection
User browses and buys stocks
System intercepts responses from the site and updates
user portfolio
System shows user new portfolio standing
Alternatives
2a: System gives error message, asks for new
suggestion for site, gives option to cancel
3a: Web failure.
1. Sys reports failure to user & backs up to
previous step.
2. User exits or tries again
4a: Computer crashes4a: Computer crashes
4b: web site does not acknowledge purchase
5a: web site does not return needed info
Requirements 23
Example 2
• Use Case 2: Buy a product
• Primary actor: buyer/customer
• Goal: purchase some product
• Precondition: Customer is already logged in
Main Scenario
Customer browses and selects items
Customer goes to checkout
Requirements 24
Customer goes to checkout
Customer fills shipping options
System presents full pricing info
Customer fills credit card info
System authorizes purchase
System confirms sale
System sends confirming email
Alternatives
6a: Credit card authorization fails
Allows customer to reenter info
3a: Regular customer
System displays last 4 digits of credit card
no
Asks customer to OK it or change it
Moves to step 6
Requirements 25
Student Assignment
5 Marks
Submission Date:
14 – Nov – 201414 – Nov – 2014
Friday
Analyze the given Use Case Diagram
Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
Answer the following questions
1.Which use cases will a 1.5 Marks
 STUDENT be able to perform?
 PROFESSOR be able to perform?
 REGISTRAR be able to perform?
2.Identify 2 types of actors ? 0.5 Marks
3. Identify 2 types of relationships and write clearly3. Identify 2 types of relationships and write clearly
which relationship between which elements 0.5 Marks
4. Which use case needs to run first, Register for
Courses or View Report Card? 0.5 Marks
5. If Charlie is a student and professor, which use
cases will he be able to execute 1 Mark
6. Describe the functionality of this system. 1 Mark
Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill

2.1 usecase diagram

  • 1.
    1 Use case DiagramUsecase Diagram Use case specificationUse case specificationUse case specificationUse case specification Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
  • 2.
    USE CASE DIAGRAMUSECASE DIAGRAM System behavior is captured by use cases. – Use cases describe the system, its environment, and the relationship between the system and its environment.its environment. – “A use case diagram is a graphic representation of the key features of the written use case reports that comprise a system.” (McLeod, Jordan)
  • 3.
    What Is aUse-Case Model? • A model that describes a system’s functional requirements in terms of use cases • Represents – system’s intended functionality (use cases) and its environment (actors)
  • 4.
    What Is anActor? Actors are not part of the system. Actors represent roles a user of the system can play.  anything that interacts with the system  a human, a machine, or system. Actors are EXTERNAL.  a human, a machine, or system. They can actively interchange information with the system. They can be a giver of information. They can be a passive recipient of information. Actor
  • 5.
     Who willsupply, use, or remove information?  Who will use this functionality?  Who is interested in a certain requirement?  Where in the organization is the system Useful Questions in Finding Actors?Useful Questions in Finding Actors? Actor  Where in the organization is the system used?  What are the system’s external resources?  What other systems will need to interact with this one?
  • 6.
    USEUSE CASECASE:: asequence of actions a system performs that yields an observable result of value to a particular actor. Use Case Use Cases and ActorsUse Cases and Actors A use case models a dialog between actors and the system. A use case is initiated by an actor to invoke a certain functionality in the system.
  • 7.
    QuestionsQuestions toto findfinduseuse casescases.. – For each actor you have identified, what are the tasks the system would be involved in? – Does the actor need to be informed about certain occurrences in theabout certain occurrences in the system? – Will the actor need to inform the system about sudden, external changes? – What information must be modified or created in the system?
  • 8.
    Object-Oriented Systems DevelopmentBahrami © Irwin/ McGraw-Hill
  • 9.
    Brief Overview ofUse Case Core Components and Structure
  • 10.
    Brief Overview ofUse Case Core Components and Structure
  • 11.
  • 12.
    – Use theinclude relationship to show that •the behavior of one use case is wholly and unconditionally used in another use case Perform Transaction The Perform Transaction use case includes the Perform Transaction Send Command Receive Response Application «include» «include» use case includes the processing specified by both the Send Command and Receive Response use cases.
  • 13.
    Use Case DiagramRules • Use the generalizationgeneralization relationship to show that – a use case is a specialization of another use case Run Applications Install Applications User Super User A User can Run Applications. A Super User can Install Applications and Run Applications, since a Super User is a specialization of User.
  • 14.
    • Use theextendextend relationship to show that – one use case conditionally augment (or extend) the behavior of another use case.
  • 15.
    1. Actor 2. Usecase 3. Association 4. System Boundary Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
  • 16.
    5. Include 6. Extend 7.Generalization 8. Dependency 9. Comment 10. Artifact Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
  • 17.
    Types of Actors 1.Initiating actor ( primary actor or “user”): initiates the use case to realize a goal 2. Participating actor (Secondary actor): participates in the use case but does not initiateparticipates in the use case but does not initiate it: 3. Supporting actor: helps the system-to-be to complete the use case 4. Offstage actor: passively participates in the use case, i.e., neither initiates nor helps complete the use case
  • 18.
    Practice: Find theActors • In the Course Registration System Requirements document, read the Problem Statement for the Course Registration case study. • As a group, identify the following – Actors – Description of the actor
  • 19.
    Use-Case Specifications • Name •Brief description • Flows of Events • Relationships • Activity diagrams Use-Case Model Actor• Activity diagrams • Use-Case diagrams • Special requirements • Pre-conditions • Post-conditions • Other diagrams Use-Case Specifications ... Actor s Use Cases
  • 20.
    Brief Overview of UseCase Core Components and Structure – Use Case Description Basic Structure and Components • Use Case: Name • Brief Description Additional Components • Special Requirements • Data Sources * • Brief Description • Actors • Pre-Conditions • Post-Conditions • Basic Flow • Alternate Flows • Exception Flows • Data Sources * • Dependencies • Assumptions • Open Issues
  • 21.
    Scenarios.. •Scenario: a setof actions performed to achieve a goal under some conditions – Actions specified as a sequence of steps – A step is a logically complete action performed– A step is a logically complete action performed either by the actor or the system •Main success scenario – when things go normally and the goal is achieved •Alternate scenarios: When things go wrong and goals cannot be achieved 21
  • 22.
    Example 1 Use Case1: Buy stocks Primary Actor: Purchaser Goals of Stakeholders: – Purchaser: wants to buy stocks – Company: wants full transaction info Precondition: User already has an account Main Success Scenario Requirements 22 Main Success Scenario User selects to buy stocks System gets name of web site from user for trading Establishes connection User browses and buys stocks System intercepts responses from the site and updates user portfolio System shows user new portfolio standing
  • 23.
    Alternatives 2a: System giveserror message, asks for new suggestion for site, gives option to cancel 3a: Web failure. 1. Sys reports failure to user & backs up to previous step. 2. User exits or tries again 4a: Computer crashes4a: Computer crashes 4b: web site does not acknowledge purchase 5a: web site does not return needed info Requirements 23
  • 24.
    Example 2 • UseCase 2: Buy a product • Primary actor: buyer/customer • Goal: purchase some product • Precondition: Customer is already logged in Main Scenario Customer browses and selects items Customer goes to checkout Requirements 24 Customer goes to checkout Customer fills shipping options System presents full pricing info Customer fills credit card info System authorizes purchase System confirms sale System sends confirming email
  • 25.
    Alternatives 6a: Credit cardauthorization fails Allows customer to reenter info 3a: Regular customer System displays last 4 digits of credit card no Asks customer to OK it or change it Moves to step 6 Requirements 25
  • 26.
    Student Assignment 5 Marks SubmissionDate: 14 – Nov – 201414 – Nov – 2014 Friday
  • 27.
    Analyze the givenUse Case Diagram Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill
  • 28.
    Answer the followingquestions 1.Which use cases will a 1.5 Marks  STUDENT be able to perform?  PROFESSOR be able to perform?  REGISTRAR be able to perform? 2.Identify 2 types of actors ? 0.5 Marks 3. Identify 2 types of relationships and write clearly3. Identify 2 types of relationships and write clearly which relationship between which elements 0.5 Marks 4. Which use case needs to run first, Register for Courses or View Report Card? 0.5 Marks 5. If Charlie is a student and professor, which use cases will he be able to execute 1 Mark 6. Describe the functionality of this system. 1 Mark Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill