6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and...

30
6-1 © Prentice Hall, 2007 Chapter 6: Chapter 6: Structuring Systems Structuring Systems Requirements: Use Case Requirements: Use Case Description and Description and Diagrams Diagrams Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer

Transcript of 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and...

Page 1: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

6-1© Prentice Hall, 2007

Chapter 6:Chapter 6:Structuring Systems Structuring Systems

Requirements: Use Case Requirements: Use Case Description and DiagramsDescription and DiagramsObject-Oriented Systems Analysis and

DesignJoey F. George, Dinesh Batra,

Joseph S. Valacich, Jeffrey A. Hoffer

Page 2: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 2© Prentice Hall, 2007

Chapter ObjectivesChapter Objectives

After studying this chapter you should be able to:– Understand how to structure

requirements with use case diagrams.– Explain the basics of use case

construction using UML standards.– Construct use case diagrams.– Write text-based use cases.

Page 3: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 3© Prentice Hall, 2007

Page 4: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 4© Prentice Hall, 2007

What Is Requirements What Is Requirements Structuring?Structuring?

The process of analyzing, organizing, and modeling the requirements obtained via interviews, questionnaires, observation, and document analysis

Relevant UML models include use cases, class diagrams, interaction diagrams, and activity or statechart diagrams

Page 5: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 5© Prentice Hall, 2007

Use Case DeliverablesUse Case Deliverables

Use case diagrams

Written descriptions of use-case contents

Page 6: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 6© Prentice Hall, 2007

Page 7: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 7© Prentice Hall, 2007

UML Use Case Diagram SymbolsUML Use Case Diagram Symbols

Use Case

Actor

Boundary

Connection

Include relationship

Extend relationship

<<include>>

<<extend>>

Page 8: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 8© Prentice Hall, 2007

What Is a Use Case?What Is a Use Case?

A depiction of a system’s behavior or functionality under various conditions as the system responds to requests from users

Full functioning for a specific business purpose

Page 9: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 9© Prentice Hall, 2007

What Is an Actor?What Is an Actor?

• An external entity that interacts with the system

• Most actors represent user roles, but actors can also be external systems.

• An actor is a role, not a specific user; one user may play many roles, and an actor may represent many users.

Page 10: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 10© Prentice Hall, 2007

What Is a Boundary?What Is a Boundary?

The dividing line between the system and its environment

- Use cases are within the boundary.

- Actors are outside of the boundary.

Page 11: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 11© Prentice Hall, 2007

What Is a Connection?What Is a Connection?

An association between an actor and a use case

Depicts a usage relationship

Connection does not indicate data flow

Page 12: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 12© Prentice Hall, 2007

What Is an <<include>> What Is an <<include>> Relationship?Relationship?

A connection between two use cases

Indicates a use case that is used (invoked) by another use case

Links to general purpose functions, used by many other use cases

Page 13: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 13© Prentice Hall, 2007

Page 14: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 14© Prentice Hall, 2007

What Is an <<extend>> What Is an <<extend>> Relationship?Relationship?

A connection between two use cases

Extends a use case by adding new behavior or actions

Specialized use case extends the general use case

Page 15: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 15© Prentice Hall, 2007

What Is a StereotypeWhat Is a Stereotype

• A construct that extends the UML vocabulary

• Adds new meanings to existing entities

• Depicted with << >> delimiters

• <<extend>> and <<include>> are stereotypes

Page 16: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 16© Prentice Hall, 2007

Use Case Diagram in MS VisioUse Case Diagram in MS Visio

Page 17: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 17© Prentice Hall, 2007

Page 18: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 18© Prentice Hall, 2007

Include vs. ExtendInclude vs. Extend

Use <<extend>> if you want to model an extension to, or a variation of, a complete use case that exists in its own right

Use <<include>> if you want to factor the common behavior among two or more use cases into a single generalized use case

Page 19: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 19© Prentice Hall, 2007

Actors can be grouped in generalization categories.

Page 20: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 20© Prentice Hall, 2007

Written Use CasesWritten Use Cases

Document containing detailed specifications for a use case

Contents can be written as simple text or in a specified format

Page 21: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 21© Prentice Hall, 2007

Page 22: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 22© Prentice Hall, 2007

Level of Use CaseLevel of Use Case Refers to degree of detail in the use case

description

Five suggested levels (Cockburn)1. White – as seen from clouds2. Kite – “birds-eye view”3. Blue – sea-level view4. Fish – below sea-level5. Black – bottom of the sea

summary

detail

Page 23: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 23© Prentice Hall, 2007

summary

detail

Page 24: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 24© Prentice Hall, 2007

Sample Format for Written Use Sample Format for Written Use CaseCase

Title – descriptive name, matches name in use case diagram

Primary actor – usually a user role

Stakeholders – any group or individual with an interest in the function of the use case

Page 25: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 25© Prentice Hall, 2007

Sample Format for Written Use Sample Format for Written Use Case (Continued)Case (Continued)

Precondition – conditions that must be satisfied in order to execute the use case

Minimal guarantee – outputs that can be expected if the service attempt failed

Success guarantee – outputs that can be expected if the service succeeds

Page 26: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 26© Prentice Hall, 2007

Sample Format for Written Use Sample Format for Written Use Case (Continued)Case (Continued)

Trigger – an event or action that initiates the use case

Main success scenario – description of sequence of interactions between actor and use case during the use case execution

Extensions – detailed description of how errors are dealt with

Page 27: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 27© Prentice Hall, 2007

A sample written use case at kite level

Page 28: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 28© Prentice Hall, 2007

Use case at sea level

Corresponds with Step 1 of kite-level use case

Page 29: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 29© Prentice Hall, 2007

Use case at sea level

Corresponds with Step 2 of kite-level use case

Page 30: 6-1 © Prentice Hall, 2007 Chapter 6: Structuring Systems Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey.

Chapter 6 30© Prentice Hall, 2007

Guidelines for Good Use CasesGuidelines for Good Use Cases

Choose a good nameIllustrate a complete behaviorIdentify a completable behaviorProvide “inverse” use casesLimit each use case to one behaviorRepresent the actor’s point of view