31
7M701 1 Use Case Modelling

7M701 1 Use Case Modelling. 7M701 2 Use Case Diagram Example

  • View
    229

  • Download
    0

Embed Size (px)

Citation preview

7M7011

Use Case Modelling

7M7012

Use Case Diagram Example

7M7013

Use Case Modelling

• A use case is a modelling technique used to describe what a new system should do or what an existing system already does.

• System developers and customers/end-users discuss a use case model. In an iterative process, this lead to a requirement specification on which all agree.

• A use case diagram describes the interaction between a set of use cases and the actors involved in these use cases.

7M7014

Use Case definition

• Fowler: A use case is a typical interaction that a user has with

a system in order to achieve some goals. A use case is a description of a set of sequence of

actions, including variants, that a system performs to yield an observable result of value to an actor.

• Cockburn: A use case describes a system’s behavior.

7M7015

Actor

• An actor is someone or something that interacts with the system. It is who or what uses the system.

• An actor communicates with the system by sending and receiving messages.

• An actor is a role that a user plays with respect to the system.

• Actors – what exists outside the system (Rumbaugh) [external “participants”/”roles”]

7M7016

Use cases• A use-case is a set of sequences of

actions a system performs that yield an observable result of value to a particular actor.

• A use-case describes a requirement for the system, that is, what it should do, but not how it should do it.

• A use-case is a set of scenarios tied together by a common user goal.

7M7017

Use Case Diagram Example

7M7018

Use Case Diagram ExampleVideoshop

Hire a videotape

Supply new videotapes

Retrun the videotape

Client

Film importer

7M7019

7M70110

Scenario

A scenario is a sequence of steps describing an interaction between a user and a system.• A scenario is an instance of a use-case.• A scenario describes a possible interaction with

the system.

7M70111

Scenario Example

• Consider a Web-based on-line store, we might have a ‘Buy a Product’ scenario that would say this :The customer browses the catalogue and adds

desired items to the shopping basket. When the customer describes the shipping and credit card information and confirms the sale. The system checks the authorization on the credit card and confirms he sale both immediately and with a follow-up mail.

7M70112

Example of a Use Case Text

7M70113

Template of an Use Case Text

Name Name used to refer to a use case.

Actors All actors involved.

Preconditions Condition of the system at the start of the use case.

Description A complete stepwise description of the interaction between system and actor(s).

Exceptions Special and/or unexpected exceptional cases.

Result Condition of the system at the end of the use case.

7M70114

Steps

1. Define the system boundaries

2. Define actors

3. Define use cases

4. Define scenario’s

5. Describe each use case

6. Identify communal sub-cases

7M70115

Use Case relationships

• Generalization• Include relation• Extend relation

7M70116

Generalization

• Generalization is used when there is one use case similar to another.

• Inheriting parent behaviour, adding and overriding with the child’s behaviour.

• Sub use case inherits behaviour and semantics from super use cases.

7M70117

Use Case Diagram Example

7M70118

Include / Uses

• Uses / Include : this realtionship is used when there is a common chunck of behaviour across more than one use case.

• Base use case includes the functionality of included use case.

7M70119

Use Case Diagram Example

7M70120

Extend

• Extend : is similar to genralization but is used to add behaviour to the base use case at certain extension points.

• A use case is optionally extended by functionality of another use case.

7M70121

Extend and Uses relationships

Signing InsurancePolicy

Signing Car Purchase Contract

«extends»

Signing InsurancePolicy

Signing Car Insurance

Signing LifeInsurance

«uses»«uses»

7M70122

Relationships between use cases

7M70123

Short Summary

7M70124

What is Use Case modeling?

• Use Case model: a view of a system that emphasizes the behavior as it appears to outside users. A use case model partitions system functionality into transactions(“use cases’) that are meaningful to users (‘actors’)

• A Use Case Diagram visualizes a use case model.

7M70125

Core Elements

Construct Description Syntax

use case A sequence of actions, inclu-ding variants, that a system (or other entity) can perform, interacting with actors of the system.

actor A coherent set of roles that users of use cases play when interacting with these use cases.

system boundary

Represents the boundary between the physical system and the actors who interact with the physical system.

UseCaseName

ActorName

7M70126

Core Relationships

Construct Description Syntax

association The participation of an actor in a use case. I.e., instance of an actor and instances of a use case communicate with each other.

extend A relationship from an extension use case to a base use case, specifying how the behavior for the extension use case can be inserted into the behavior defined for the base use case.

generalization A taxonomic relationship between a more general use case and a more specific use case.

<<extend>>

7M70127

Core Relationships

Construct Description Syntax

Include (uses)

A relationship from a base use case to an inclusion use case, specifying how the behaviour for the inclusion use case is inserted into the behaviour defined for the base use case.

<<extend>> <<uses>>)

7M70128

Use Case Diagram Use Cases

Use Case text: Example

7M70129

NS Ticket service

• Define a use case diagram of ‘NS Ticket service’

• Describe an use case.

Take ticket

Destination

7M70130

Use Case diagram ‘NS Ticket service’

Traveller

Buy OV ticket

Buy NS ticket

Pay ticket

«extends»

«uses»

7M70131

Use Case Buy OV Ticket

Actors Traveller

Preconditions Traveller has a valid pass

Description 1. Ticket device expects destination code

2. Traveller enters destination code

3. Extension point: NS ticket

4. Ticket device checks code and calculates the charge. Shows destination code & fare. Activates ticket machine for paying

5. Traveller pays (use case: Pay ticket)

6. Ticket device print and supplies ticket

7. Traveller takes ticket

Extension Destination code = NS station.

3a. Ticket device expects ticket type

3b. Traveller enters Single/Return, Discount Y/N, Class

Exceptions Traveller interrupt the interaction or walk away

Traveller enters an incorrect destination code

Payment is not finished off successful

Result Traveller has ticket.

(NS can look forward to the payment)