Specifying Requirements with Use Case Diagrams OUTLINE - - PowerPoint PPT Presentation

specifying requirements
SMART_READER_LITE
LIVE PREVIEW

Specifying Requirements with Use Case Diagrams OUTLINE - - PowerPoint PPT Presentation

Specifying Requirements with Use Case Diagrams OUTLINE Introduction Use Case Diagrams Writing Use Cases Guidelines for Effective Use Cases SOURCE OF REQUIREMENTS Initial requirements come from the customer, by: Documents, Meetings,


slide-1
SLIDE 1

Specifying Requirements

with Use Case Diagrams

slide-2
SLIDE 2

OUTLINE

Introduction Use Case Diagrams Writing Use Cases Guidelines for Effective Use Cases

slide-3
SLIDE 3

SOURCE OF REQUIREMENTS

Initial requirements come from the customer, by:

  • Documents, Meetings, reports

Advanced requirements come from the analysts, after studying:

  • Scope and price
  • Feasibility (technological, organizational etc)
  • Prototypes

Final requirements are stabilized in an iterative process.

Introduction | Diagrams | Writing | Guidelines

slide-4
SLIDE 4

REQUIREMENTS VS. DESIGN

Requirements:

  • What the system should

do

  • More abstract

Design:

  • How the system should

do it

  • More detailed

Introduction | Diagrams | Writing | Guidelines

slide-5
SLIDE 5

TYPES OF REQUIREMENTS

Visible Functional Requirements

  • “The system will deliver cash to the

customer”

  • “Cash will be delivered after card was

taken out” Qualitative Requirements

  • “The authorization process will take no

more than 1 sec” Hidden Requirements

  • “Database maintenance processes will
  • ccur every night”

Qualitative Requirements Hidden Functional Requirements Functional Visible Requirements

Introduction | Diagrams | Writing | Guidelines

slide-6
SLIDE 6

Illustration

USE CASES

A use case is a contract of an interaction between the system and an actor. A full use-case model comprise of:

  • A diagram, describing relations between use-cases and actors.
  • A document describing the use case in details

Register User

Use case in diagram Use Case in script admin

Introduction | Diagrams | Writing | Guidelines

slide-7
SLIDE 7

USE CASE DIAGRAM OBJECTIVE

1. Create a semi-formal model of the functional requirements 2. Analyze and define:

  • Scope
  • External interfaces
  • Scenarios and reactions

Introduction | Diagrams | Writing | Guidelines

slide-8
SLIDE 8

WHAT MAKES GOOD USE-CASE SPECIFICATION?

Lack of ambiguity

  • Each requirement must be interpreted in a single manner.

Completeness

  • The collection of all use cases is everything that can be done

to/with the system. Consistency

  • Requirements should not conflict with each other. If there are,

tradeoffs must be detected and discussed. Avoid design

  • Requirements should raise a need, not answer it.

Introduction | Diagrams | Writing | Guidelines

slide-9
SLIDE 9

USE CASES AS MEANS OF COMMUNICATION

The use case should stimulate a discussion about what the system should do, mainly with people who are outside of the development team.

Introduction | Diagrams | Writing | Guidelines

Customers Designers Users

slide-10
SLIDE 10

OUTLINE

Introduction Use Case Diagrams Writing Use Cases Guidelines for Effective Use Cases

slide-11
SLIDE 11

Example

A SIMPLE EXAMPLE

Handle Message Cellular Phone Customer Bill Management Handle Call External Phone Company

Actors Use Case System boundary

Introduction | Diagrams | Writing | Guidelines

Association

slide-12
SLIDE 12

FINDING ACTORS

External objects that produce/consume data:

  • Must serve as sources and destinations for data
  • Must be external to the system

Humans Machines External systems Sensors Organizational Units

Introduction | Diagrams | Writing | Guidelines

slide-13
SLIDE 13

Example

ACTORS CAN BE GENERALIZED

The child actor inherits all use-cases associations

Introduction | Diagrams | Writing | Guidelines

Should be used if (and only if), the specific actor has more responsibility than the generalized one (i.e., associated with more use- cases)

Register Client Sales Person Institutional Sales Person Perform Sale Perform Business Sale Sales Manager Cancel Sale

slide-14
SLIDE 14

LINKING USE-CASES

Linking enables flexibility in requirements specification

  • Isolating functionality
  • Enabling functionality sharing
  • Breaking functionality into manageable chunks

Three mechanism are used:

  • Include
  • Extend
  • Inheritance

Introduction | Diagrams | Writing | Guidelines

slide-15
SLIDE 15

USE-CASE LEVELS

User goals

Perform Sale Choose Products Fill-in billing info

Sub-functionality

Introduction | Diagrams | Writing | Guidelines

Base Use Case: Used directly by the user

Alistair Cockburn “Writing Effective Use Cases”

slide-16
SLIDE 16

THE “INCLUDE” CONSTRUCT

Include is used when:

  • Decomposing complicated behavior
  • Centralizing common behavior

The base use case explicitly incorporates the behavior of another use case at a location specified in the base.

Introduction | Diagrams | Writing | Guidelines

Perform Sale

Fill-in billing info

<<include>>

Example

slide-17
SLIDE 17

EXTEND – GRAPHICAL REPRESENTATION

The base use case can incorporate another use case at certain points, called extension points. Note the direction of the arrow

  • The base use-case does not know which use-case extends it

Introduction | Diagrams | Writing | Guidelines

Perform Sale

After checkout

Gift wrap Products

<<extend>> Product is a gift

Example

slide-18
SLIDE 18

EXAMPLE: AMAZON

Product Page Review Writing Shopping Cart

Introduction | Diagrams | Writing | Guidelines

slide-19
SLIDE 19

EXAMPLE – CONT’D

Introduction | Diagrams | Writing | Guidelines

Search Product Navigate Deals Checkout Handle Order Status Login Register View Product Details

Write Revie w

Rank Supplier

«include» «include» «include» «include» «extend» user is not a member «extend» «extend» After page generation

Add to cart

«extend»

Customer

slide-20
SLIDE 20

GENERALIZATION BETWEEN USE-CASES

The child use case inherits the behavior parent use case:

  • The interaction (described in the textual description)
  • Use case links (associations, include, extend, generalization)

Child use-case can substitute parent Use case Overriding occurs through the textual description

Introduction | Diagrams | Writing | Guidelines

Example

Handle Sale Call Customer Representative Tech Assistant Representative Handle Call Handle Technical Assistance Call

  • 1. Transfer call to available

representative

  • 2. Mark representative as busy
  • 3. Start record call
  • 4. Stop record call
  • 5. Log call details
  • 6. Mark representative as free
slide-21
SLIDE 21

GENERALIZATION HAZARDS

Combining generalizations of actors and use-cases can be dangerous

Undergrad Student Graduate Student Submit Exam Submit Thesis Undergrad Student Graduate Student Submit and Get Grade Submit Thesis Submit Exam

Bad: Undergrad can submit

thesis

Good: Only graduate

student can submit thesis

Introduction | Diagrams | Writing | Guidelines

slide-22
SLIDE 22

EXAMPLE: EASTERN STATE UNIVERSITY (ESU) REGISTRATION SYSTEM.

  • 1. Professors indicate which courses they will teach on-

line.

  • 2. A course catalog can be printed
  • 3. Allow students to select on-line four courses for

upcoming semester.

  • 4. No course may have more than 10 students or less

than 3 students.

  • 5. When the registration is completed, the system sends

information to the billing system.

  • 6. Professors can obtain course rosters on-line.
  • 7. Students can add or drop classes on-line.

Introduction | Diagrams | Writing | Guidelines

slide-23
SLIDE 23

Introduction | Diagrams | Writing | Guidelines

EXAMPLE: EASTERN STATE UNIVERSITY (ESU) REGISTRATION SYSTEM.

slide-24
SLIDE 24

OUTLINE

Introduction Use Case Diagrams Writing Use Cases Guidelines for Effective Use Cases

slide-25
SLIDE 25

OUTLINE

Introduction Use Case Diagrams Writing Use Cases Guidelines for Effective Use Cases

slide-26
SLIDE 26

HOW TO MODEL?

print save Bullets format load Save as preview File action s Formattin g actions Viewing Actions Font forma t Paragraph format

Bottom-up Process Top-down Process

Starting with throwing all scenarios on the page, and then combining them: Starting with an overview of the system, and then splitting Use-cases

slide-27
SLIDE 27

HOW TO MODEL – CONT’D

Most of the analysis process are actually

Combined

slide-28
SLIDE 28

COMBINING PROCESSES

Number Limit:

  • The diagram should have between 3 to 10 base use-case. No more

than 15 use cases (base + included + extending). Abstraction:

  • All use-cases should be in similar abstraction levels.

Size:

  • Use cases should be described in half a page or more.

Interaction:

  • Use-cases which are carried out as part of the same interaction.

UC UC UC

Introduction | Diagrams | Writing | Guidelines

slide-29
SLIDE 29

DIVIDING PROCESSES

Size:

  • If a use-cases takes more than a page, consider

include/extend Weak dependency:

  • If the dependency between two parts of a use-case is weak,

they should be divided. UC

Introduction | Diagrams | Writing | Guidelines

slide-30
SLIDE 30

MORE GUIDELINES

Factor out common usages that are required by multiple use cases

  • If the usage is required use <<include>>
  • If the base use case is complete and the usage may be
  • ptional, consider use <<extend>>

A use case diagram should:

  • contain only use cases at the same level of abstraction
  • include only actors who are required

Introduction | Diagrams | Writing | Guidelines

slide-31
SLIDE 31

WHEN ARE WE DONE?

       

When every actor is specified. When every functional requirement has a use-case which satisfies it. A tractability matrix can help us determine it: Use Cases Requirements

Introduction | Diagrams | Writing | Guidelines

slide-32
SLIDE 32

SUMMARY

Introduction to the Unified Modeling Language (UML) To Use Case Diagram Use Case Diagrams Dual presentation of use-cases Include, Extend, Inheritance Writing Use Cases Preconditions & Post-conditions Main scenario vs. Alternative Flow Guidelines for Effective Use Cases