Use-Case Diagram

advertisement
Contents
Introduction
Use-Case Diagram
Business Model using Activity Diagram
Domain Analysis using Use-Case Description
Documenting Requirements using Use-Case
Diagram
Create Use-Case Description & Diagram
Use-Case Consideration
MIT, Walailak University
by
Dr.Wichian Chutimaskul
Dennis: Copyright 2009 © John Wiley & Sons, Inc.
2
1. Introduction
User-Centred Design (UCD)
Problem: failed to involve users adequately in the
development process
Users’ Requirements
Need to understand how the organization
operates at present
What are the problems with the current
system (AS-IS)?
What are the requirements users have of a
new system (TO-BE) that are not in the
current system?
Lethbridge
Ignore users
Don’t have functions users’ needed
It is hard to understand
It is time consuming to use
User-Centred Design: to describe approaches to
system development that focus on the needs of users
to ensure that extensive and expensive modifications
are not needed
3
Lethbridge
4
Documenting Requirements
IS Development Project Track Record
Activity diagram
to model tasks (i.e. business process)
to describe functions of a system represented by a
use case
to describe the logic of an operation
Use-case diagram
to document functional requirements
Ivar Jacobson 1990 Æ Scenario
Document behavior of the system from users’ point of
view
Over budget,
late, or without
needed features
canceled
before
completion
Source: The Standish Group International, Inc., “Chaos: A Recipe for Success”
Whitten
5
Activity Diagram
6
2. Activity Diagram
Requirements
Analyst
Define how activities are coordinated
Project Initiation
Document
Notation
1 Activity
Elicit
requirements
Glossary
Candidate
Requirements
Select
requirements
Develop
use cases
Bennett
Add a New
Client
rectangle with rounded ends
meaningful name (verb + noun)
Requirements
List
2 Transition
Assign Staff
Contact
arrows with open arrowheads
Use Case Model
7
Lethbridge
8
Notation of Activity Diagram
Notation of Activity Diagram
3 Start state/marker
7 Alternative notation for
branching:
black circle
Add a New
Client
4 Decision point
diamond
alternative transitions
are shown leaving the
activity with guard
conditions
Assign Staff
Contact
5 Guard condition
in square brackets
[no campaign to add]
6 Final state/ stop marker
9
Notation of Activity Diagram
[campaign to add]
Add New
Campaign
Lethbridge
10 Swimlanes
:Campaign
[Active]
9 Objects
10
Notation of Activity Diagram
8 Object flows
Lethbridge
[no campaign to add]
Add New
Campaign
Lethbridge
rectangle
with name of object
underlined
optionally shows the
state of the object in
square brackets
Assign Staff
Contact
[campaign to add]
black circle in white circle
dashed arrow
Add a New
Client
vertical columns
labeled with the
person, organisation
or department
responsible for the
activities in that
column
Record completion
of a campaign
:Campaign
[Completed]
11
Lethbridge
Campaign
Manager
Accountant
Client
Record Completion
of a campaign
Issue invoice
Pay invoice
Record client
payment
Human: activity diagram shows workflow
Software component: activity diagram shows program control flow
12
Drawing Activity Diagram
Exercise
Sales
Customer
Warehouse
Logic
1 Customer buys
goods
2 Send order to
sales
3 Request items
from inventory
4 Pack items
5 Ship items to
customer &
billing (parallel)
6 Payment
1 Identify activities
2 Organize the activities in order with transitions
3 Identify any alternative transition and the
condition on them
4 Identify any process that is repeated
5 Add swimlanes, if required
6 (option) Add object & object flow
13
3. Use-Case Description
14
Elements of a Use-Case Description (Template)
Describe basic functions of the system
A. Overview
Information
Use-Case Name: Verb+noun ID:
What the user can do
How the system responds
The set of all use-case descriptions specifies
the complete “functionality” of the system
Primary Actor:
Importance Level:
Use-Case Type: (overview-detail/essential-real)
Stakeholders and Interests:
Brief Description:
Trigger:
C. Flow
of Events
B.
15
Relationships: (Association, Include, Extend, Generalization)
Normal Flow of Events:
Subflows: *******
Alternate/Exceptional Flows:
16
“7 Guidelines” for Creating Use-Case Description
Exercise
1 Write each step in “SVDPI” form
subject-verb-direct object-preposition-indirect
object
2 Clarify initiator and receivers of action
3 Write from independent observer perspective
4 Write at same level of abstraction
5 Ensure a sensible set of steps (betw. actor & system)
6 Apply KISS (keep it simple stupid) principle liberally
7 Write repeating instructions after the set of steps to
be repeated.
How would you make requirements gathering
(interviews, questionnaires, observation, and
document analysis) more effective by
knowing that eventually you will be creating
use-case description and diagram?
17
18
4. Use-Case Diagram
Actor - Use-Case - Association - Boundary
Actor Æ users | system | organization
Summarize all the use-cases for a system being
modeled together in one picture
Purpose: documenting requirements
Document the functionality of the system
from the users’ perspective
Document the scope of the system
Document the interaction between the users
and the system using supporting use-case
description
Bennett
drawn as stick people with a name
communicate with particular use-case(s)
Use-case Æ main function
drawn as an ellipse with a name in each ellipse
the name is usually an active verb and a noun
phrase
Association Æ connect use-cases and actor
Boundary
19
Bennett
20
Syntax of Use-Case Diagram
Syntax of Use-Case Diagram
21
Use-Case Diagram for Appointment System
22
Use-Case Diagram with Specialized Actor
Use case
Actor
association
System or subsystem boundary
23
24
Use-Case Type
Use-Case Relationship
Basic Use-Case
Extension Use-Case
Abstract Use-Case (for reuse)
Association
An association between an actor and a use-case
Extend-relationship: «extend»
Used to make optional interactions explicit or to handle
exceptional cases
List all steps from the beginning of a use case to the end
An abstract use case is a use case that is never directly
instantiated, but rather exits for other use cases to reuse
Abstract
Include- (abs) relationship: «include» or «use»
Allow one to express commonality between several
different use cases
to avoid repeating details in multiple use cases
Basic
Extension
25
Extend and Include Relationships (1)
26
Extend and Include Relationships (2)
Library IS
Extend loan
<<include>>
Borrower
Borrow copy
of book
Return copy
of book
27
Check for reservation
<<include>>
Calculate Fine
<<extend>>
28
Which of the following use-case diagram is legal?
Exercise
Draw a use-case diagram showing the relationship among the
following. The ‘exit car park’ requires to pay cash or debit card.
There is also an abnormal case of exiting car park without initially
entering enough money.
A
C
«use»
«use»
«extend»
B
D
«use»
«extend»
«use»
29
«extend»
30
5. Major Steps in Writing Use-Case
a) Identifying the Major Use-Cases
a. Identify the major use-case
b. Expand the major use-case
c. Confirm the major use-case
d. Create the use-case diagram
1 Identify the system’s boundaries
2 List the primary actors
3 List the goals of each primary actor
4 Identify and write the major use-cases
5 Carefully review use-cases
#
31
«extend»
Actor Use Case Description
32
b) Expand the Major Use-Cases
c) Confirm the Major Use Cases
6 Choose one major use-case to expand
7 Fill in details on the use-case template
8 Fill in the steps of the normal flow of events
9 Normalize the size of each step
10 Describe alternate or exceptional flows ***
11 Simplify and organize as necessary
12 Review the current set
Consider semantics and syntax
Helpful to involve the users
13 Iterate the entire set of steps until all use
cases are defined
33
34
6. Use-Case Consideration
d) Create the Use-Case Diagram
Use-Case Packaging
1 Start with system boundary
2 Place elements (use-cases) in order to be easy
to read
3 Place actors on the diagram
4 Conclude by connecting actors to use cases by
lines
<<extends>>
Buy Goods
Out of Stock
<<
ex
ten
d
Customer
s>
>
Return Goods
<<include>>
Sell Goods to Company
Buying
<<include>>
Handle returned goods
Common
Selling
35
Peter Swin
36
Consideration
How Precise should Use-case be?
Understandable by users
Don’t use use-cases to functionally
decompose system
Don’t use use-cases to formally specify the
system
Disciplined and consistent in terms used
A UC diagram is not a specification
–
It is a road map for reading the flows of events
A UC diagram is not a software design
–
It is used to structure a textual description.
A UC should not provide details of UI interaction
–
It is a sequence of actions that yields a measurable
value to the actor
Larry Constantine
Model:
Function/Task
Structure
Behavior
37
OO
Summary
Structured
Use-case diagram
Class diagram
Interaction diagram
38
Context diagram
ERD
DFD
Activity diagram
Use-case description is the basis for further analysis
and design. They are created based on 7 guidelines
and 13 steps.
Use-case diagram presents a graphical overview of
the main functionality of a system.
Sequence diagram
Communication /
Collaboration diagram
State diagram
Activity diagram
Business process
Use case
Operation
Further Read: http://www.omg.org
39
40
Question and Answer
T/F Question
1. A(n) _________ is an informal way of representing
how a business system interacts with its
environment.
2. Each use-case describes one function in which users
interact with the system.
3. The association relationship in use cases allows use
cases to support the concept of inheritance.
4. An alternate or exceptional flow in a use case
documents the decomposition of the normal flow of
events.
5. An informal way of representing how a business
system interacts with its environment is termed a
use-case.
Systems Analysis and Design with UML:
An Object-Oriented Approach, 3rd Edition,
Dennis, B.H. Wixon and D. Tegarden,
Wiley 2009: Chapter 5
41
42
Case-Study: ECO Storage Depot
Team Assignment
1. The ECO Storage Depot operates in accordance with the
Environmental Protection Agency (EPA) regulations controlling the
storage of environmentally damaging chemicals. The ECO depot is
licensed only to store drums of chemicals classified as EPA hazard
types 1, 2 or 3.
2. The drums are stored in special storage buildings; in the depot there
are also buildings that house scientific and administrative staff. Each
storage building is licensed to hold a maximum number of drums.
Furthermore the EPA requires that types 1 and 2 must not be stored
together in the same building; however, type 3 may be stored with
either types 1 or 2. If either of these regulations is violated, then the
EPA will close the depot as unsafe, pending emergency action.
3. Management has decided to install a computerized system to manage
and control the depot. It is of paramount concern that the system
never allows the depot to become unsafe.
Draw an activity diagram (business process) of your
project study
Complete the functional analysis (user-case diagram)
of your project study
Submission
Date: two days before the class
Time: 1 p.m.
Email to: wichian@sit.kmutt.ac.th
cc: your team members
Subject: OOSAD# (x)
(where # is your team number & “x” is any text.
Send: Only one “.doc file” (including the old work)
43
44
ECO Storage Depot
4. ECO management is concerned about avoiding litigation from employees or the local
council. They have introduced a company regulation that requires the depot manager to
be able to monitor the state of the depot and to always be able to check if the depot is
in a vulnerable state. The regulation states that the depot is vulnerable if any of two
neighboring buildings contain the maximum permitted number of drums.
5. When a truck arrives at the loading bay, the clerk enters the manifest accompanying the
load and checks the drums one at a time. As each drum is checked in, it is allocated an
identifier. Once all the drums have been checked in, any discrepancy between the
checked load and the manifest are notified to the loading bay clerk. The system then
produces a drum-to-building allocation list that specifies where each drum to be stores.
The loading bay clerk is notified of any drum that must be returned to the truck
through lack of space.
6. Drum collections are initiated by the loading bay clerk inputting an order manifest for
the number and type of drums required. The system identifies the drums that are to be
retrieved from storage buildings. A manifest for the order is sent to the loading bay
clerk.
7. Because there is only one loading bay, it must be empty before a delivery or collection
can begin. It is the clerk’s responsibility to notify the system when the bay is empty.
Exercise: Create Use-Case Diagram of this system.
45
Answer
46
Download