48
4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements (Satzinger: Systems Analysis & Design in a Changing World)

4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

Embed Size (px)

Citation preview

Page 1: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 1

Topic 4:The Object-Oriented Approach

to Requirements

Adopted from:

Ch.7 The Object-Oriented Approach to Requirements (Satzinger: Systems Analysis &

Design in a Changing World)

Page 2: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 2

Learning Objectives

Develop use case diagrams

Write use case and scenario descriptions

Develop system sequence diagrams

Explain how UML diagrams work together to define functional requirements for the object-oriented approach

Page 3: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 3

Overview Objective of requirements definition is

understanding user’s needs, business processes, and system to support business processes

Understand and define requirements for a new system using object-oriented analysis models and techniques

Object-oriented analysis and object-oriented design

Iterative approach to development

Models built in analysis are refined during design

Page 4: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 4

1. The Unified Modeling Language and the Object Management Group

Object-oriented modeling notation is Unified Modeling Language (UML 2.0)

UML was accepted by Object Management Group (OMG) as standard modeling technique

Purpose of Object Management Group

Promote theory and practice of object technology for development of distributed systems

Provide common architectural framework for OO

Page 5: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 5

2. Object-Oriented Requirements (continued)

Object-oriented system requirements are specified and documented through process of building models

Modeling process starts with identification of use cases and problem domain classes (things in users’ work environment)

Business events trigger elementary business processes (EBP) that new system must address as use cases

Use cases define functional requirements

Page 6: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 6

3. Object-Oriented Requirements Models

Use case diagrams – identify actors and their use cases (goals)

Use case descriptions – include details of a use case and how actors use the system

Systems sequence diagrams (SSDs) – define inputs and outputs and sequence of interactions between user and system for a use case

Activity diagrams – describe user and system activities for a use case

State machine diagrams – describe states of each object

Page 7: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 7

3.1 Requirements Models: Traditional vs OO Models

Page 8: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 8

4. The System Activities – A Use Case / Scenario View (1)

Use case analysis used to identify and define all business processes that system must support

Use Case - an activity a system carried out, usually in response to a user request

Page 9: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 9

4. The System Activities – A Use Case / Scenario View (2)

Actor

Role played by user

Outside automation boundary

2 types of actors:

Primary actor – the one who starts the sequence of events, or calls the system to finish a task/goal

Supporting actors – provide service to the system, might be a printer, web service, human or another system

Page 10: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 10

5. Techniques for Identifying Use Cases

1. Identify user goals (Actor-Goal list)

Each goal at the elementary business process (EBP) level is a use case

2. Event decomposition technique (Event Analysis with the event table)

3. CRUD analysis technique (create, read/report, update, delete) to ensure coverage

Page 11: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 11

5.1 Using EBP Guideline to identify a Use Case

EBP stands for Elementary Business Process

An EBP – a task performed by one person in one place and in response to business event that adds measurable business value, and leaves system and data in consistent state

Example Use cases:- Add new customers

Handle returns

Buy a cinema ticket

Page 12: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 12

5.1.1 How EBP helps to identify Use Cases? EBP filters out

excessive low-level use cases

It is not a single small step like “delete a line item”, or “enter customer name”

excessive high-level use cases

Such as “negotiate a contract”, which takes days to complete

The main flow probably contains five to ten steps

It does not take days and multiple sessions

It is a task done during a single session

It emphasizes adding measurable business value

Page 13: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 13

5.2 CRUD analysis for Identifying/Confirming Use Cases

CRUD – Create, Read/Report, Update, Delete

Identify event table events or develop use case diagram directly

Compares identified use cases with domain model class diagram

Every class in class diagram must have use cases to support creating, reading, reporting, updating, and deleting object instances

Confirms system integration requirements

Page 14: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 14

6. Use Case Model

The Use Case Model consists of use case diagram and a set of Use Case descriptions

Page 15: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 15

6.1 Use Case Diagram

Graphical UML diagram that summarizes information about actors and use cases

Simple diagram shows overview of functional requirements

Can have multiple use case diagrams

By subsystem

By actor

Page 16: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 16

6.1.1 Simple Use Case with an Actor (Figure 7-2)

Page 17: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 17

6.2 Use Case Diagram with Automation Boundary and Alternate Actor Notation (Figure 7-3)

Page 18: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 18

6.3 All Use Cases Involving Customer as Actor (Figure 7-4)

Page 19: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 19

6.4 Use Cases of RMO Order Entry Subsystem (Partial Figure 7-5 with package symbol)

Page 20: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 20

7. <<includes>> Relationships

Documents situation where one use case requires the services of a common subroutine

Another use case is developed for this common subroutine

A common use case can be reused by multiple use cases

Page 21: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 21

7.1 Example of Order-Entry Subsystem with <<includes>> Use Cases (Figure 7-6)

Page 22: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 23

8. Use Case Description

Use case description provides details of preconditions, postconditions, sequence of activities, and exception conditions in use case

Describes actor interacting with computer system step-by-step to carry out business activity

May have several scenarios for a use case, each a specific use case instance

Three levels of detail: brief, intermediate (casual), and fully developed (fully dressed) description

Many analysts prefer to write narrative descriptions of use cases instead of drawing activity diagrams

Page 23: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 24

8.1 The 3 levels of Use Cases

1. brief

One-paragraph summary, usually of the main success scenario (Fig 7-7)

2. intermediate (casual)

Multiple paragraphs that cover various scenarios (Fig 7-8, Fig 7-9)

3. fully developed (fully dressed)

All steps and variations are written in details, and there are supporting sections such as Preconditions and Postconditions. (Fig 7-10)

Page 24: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 25

8.1.1 Brief Description of Create New Order Use Case (Figure 7-7)

Page 25: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 26

8.1.2 Intermediate Description of the Telephone Order Scenario for Create New Order Use Case (Figure 7-8)

Page 26: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 27

8.1.2 Intermediate Description of the Web Order Scenario for Create New Order (Figure 7-9)

Page 27: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 28

8.1.3Fully

Developed Description

of Telephone

Order Scenario for Create New Order Use

Case

(Figure 7-10)

Page 28: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 29

8.1.3 Top Detail from Fully Developed Use Case Description (Figure 7-10)

Page 29: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 30

8.1.3 Middle Detail from Fully Developed Use Case Description (Figure 7-10)

Page 30: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 31

8.1.3 Bottom Detail from Fully Developed Use Case Description (Figure 7-10)

Page 31: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 32

8.2 Sections of a Use Case Description

Use case name/scenario name

Actors/stakeholders

Related use cases

Preconditions – set of criteria that must be true prior to initiation of the use case

Postconditions – set of criteria that must be true upon completion of the use case

Flow of activities (or Basic Flow or Main Path or Main Success Scenario)

(steps in one column or two)

Exception conditions (or Alternative Flows or Extensions)

Page 32: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 33

9. Guidelines (tips) for writing Use Case Description

1. Give the use case an appropriate name

2. Use a consistent style

3. Use active voice

4. Use subsections (or steps)

5. Describe the flow as something that actually happens

6. Always use the name of the actor in the interaction

7. Do not mention GUI design details in the flow

8. Do not mention design or implementation details in the flow

9. Specify information retrieval and calculation means

10. Define long alternatives separately

Page 33: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 34

10. Activity Diagrams

Used to document workflow of business process activities for each use case or scenario

Can support any level of use case description; a supplement to use case descriptions

Helpful in developing system sequence diagrams

Page 34: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 35

10.1Activity

Diagram— Telephone

Order Scenario

(Figure 7-12)

Page 35: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 36

10.2Activity

Diagram— Web Order

Scenario

(Figure 7-13)

Page 36: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 37

11. Identifying Inputs and Outputs—The System Sequence Diagram

System sequence diagram (SSD) is type of UML 2.0 interaction diagram

Used to model input and output messaging requirements for a use case or scenario

Shows actor interacting with system

Shows sequence of interactions as messages during flow of activities

System is shown as one object: a “black box”

Page 37: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 38

12. System Sequence Diagram (SSD) Notation (Figure 7-14)

Page 38: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 39

12.1 SSD Notation

Actor represented by a stick figure – a person (or role) that interacts with system by entering input data and receiving output data

Object is a rectangle with name of object underlined – shows individual object and not class of all similar objects ( :System for SSD )

Lifeline or object lifeline is a vertical line under object or actor to show passage of time for object

Message is labeled on arrows to show messages sent to or received by actor or system

Page 39: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 40

12.2 SSD Lifelines

Vertical line under object or actor

Shows passage of time

If vertical line dashed

Creation and destruction of thing is not important for scenario

Long narrow rectangles

Activation lifelines emphasize that object is active only during part of scenario

Page 40: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 41

12.3 SSD Messages

Internal events identified by the flow of objects in a scenario

Requests from one actor or object to another to do some action

Invoke a particular method

Page 41: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 42

12.4Repeating Message

(Figure 7-15)

Page 42: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 43

12.4 Repeating Message

Asterisk (*) indicates repeat or looping of message.

Brackets [ ] indicate a true/false condition. It is a test for that message only. If it evaluates to true, the message is sent. If it evaluates to false, the message is not sent.

Message-name is the description of the requested service. It is omitted on dashed-line return messages, which only show the return data parameters.

Parameter-list (with parentheses on initiating messages and without parentheses on return messages) shows the date that is passed with the message.

* [true/false condition] return-value := message-name (parameter-list)

Page 43: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 44

13. Developing a System Sequence Diagram

Begin with detailed description of use case from fully developed form or activity diagram

Identify input messages

Describe message from external actor to system using message notation

Identify and add any special conditions on input message, including iteration and true/false conditions

Identify and add output return messages

Page 44: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 45

13.1 Activity Diagram and Resulting SSD for Telephone Order Scenario (Figures 7-16 and 7-17)

Page 45: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 46

13.2SSD of the Web Order Scenario for the Create New Order Use

Case

(Figure 7-18)

Page 46: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 47

14. Integrating Object-Oriented Models

Complete use case diagram is needed to understand total scope of new system

Domain model class diagrams should be as complete as possible for entire system

With iterative approach, only construct use case descriptions, activity diagrams, and system sequence diagrams for use cases in iteration

Development of a new diagram often helps refine and correct previous diagrams

Page 47: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 48

14.1 Relationships Between OO Requirements Models

Page 48: 4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements

4

2009/10 Object Oriented Technology 49

Summary

Object-oriented approach has complete set of diagrams that define the system requirements

Requirements specified using following models:

Domain model class diagrams (Topic 3)

Use case diagrams (Topic 4)

Use case detailed model, either descriptive format (Topic 4) or activity diagram

System sequence diagrams (SSDs) (Topic 4)