1 comp 350: object oriented analysis and design lecture 3 case studies, inception & use cases...

29
1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Upload: grant-lloyd

Post on 15-Jan-2016

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

1

COMP 350: Object Oriented Analysis and Design

Lecture 3 Case Studies, Inception & Use Cases

References: Craig Larman Chapters 3-6

Page 2: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Fig. 3.1

User Interface

Sale Payment

Logging ... Database Access ...

application logic layer

other layers or components

minor focus

explore how to connect to other layers

primary focus of case studies

explore how to design objects

secondary focus

Page 3: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Fig. 3.2

Iteration 1

Iteration 2

Iteration 3Introduces just thoseanalysis and designskills related toiteration one.

Additional analysis anddesign skills introduced.

Likewise.

Page 4: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Next Gen POS – Case Study 1• A computerized application used to record sales

and handle payments• Typically used in a retail store• Includes both hardware components such as _____

and software components• Interfaces to several external systems such as ____• Must be fault tolerant, e.g. if an external service is

temporarily unavailable• Must support multiple and varied client-side

terminals and interfaces• Flexibility and customization to cater to business

rules of different prospective clients 4

Page 5: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Monopoly Game – Case Study 2

• An example that shows OOAD can be applied to different problems

• The game will run as a simulation

• One person starts the game and indicates the number of simulated players

• The game runs to completion, presenting a trace of the activity during the simulated player turns.

5

Page 6: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

6

Inception• Inception is not the requirements phase• Initial short step to establish a common vision and a

basic scope for the project• A number of questions need to be explored:

– What is the vision and business case for this project?– Is it feasible?– Buy and/or build?– Rough estimate of cost.– Should we proceed or stop?

• The intent is to establish some initial common vision for the objectives of the project, determine if it is feasible and decide if it is worth some serious investigation in elaboration.

Page 7: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

7

What artifacts may start in inception?

• Vision and business case– Describes high-level goals and constraints.

• Use Case model– Describes functional requirements

• Supplementary specification– Describes other requirements

• Glossary– Key domain terminology

• Risk list and Risk Management Plan– Describes business, technical, resource and schedule risks

and ideas for their mitigation or response.

Page 8: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

8

What artifacts may start in inception?

• Prototypes and proof-of-concepts• Iteration plan

– Describes what to do in the first elaboration iteration

• Phase Plan & Software development Plan– Guess for elaboration phase duration. Tools, people,

education and other resources.

• Development Case– Description of the customized UP steps and artifacts for this

project.

• Artifacts will be partially completed in this phase and will be refined in later iterations.

Page 9: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

9

Introduction to Requirements

• Requirements are system capabilities and conditions to which the system must conform.

• Functional requirements– Features and capabilities.– Recorded in the Use Case model (see next), and in the systems

features list of the Vision artifact.• Non-functional (or quality requirements)

– Usability (Help, documentation, …), Reliability (Frequency of failure, recoverability, …), Performance (Response times, availability, …), Supportability (Adaptability, maintainability, …)

– Recorded in the Use Case model or in the Supplementary Specifications artifact.

• The nature of UP supports changing requirements.

Page 10: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Requirements Artifacts

• Use Case Model

• Supplementary Specification

• Glossary

• Vision

• Business Rules

10

Page 11: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Evolutionary Requirements

• UP embraces change in requirements as a fundamental driver on projects.

• This is at the heart of waterfall vs iterative & evolutionary thinking

11

Page 12: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Sample UP Artifacts

Operation: enterItem(…)

Post-conditions:- . . .

Operation Contracts

Sale

date. . .

SalesLineItem

quantity

1..*1 . . .

. . .

Domain Model

Use-Case Model

Design Model: Register

enterItem(itemID, quantity)

: ProductCatalog

spec = getProductSpec( itemID )

addLineItem( spec, quantity )

: Sale

objects, attributes, associations

Require-ments

Business Modeling

Design

Sample UP Artifact Relationships

: System

enterItem(id, quantity)

Use Case Text

System Sequence Diagrams

makeNewSale()

system events

Cashier

Process Sale

: Cashier

use case

names

system operations

Use Case Diagram

Vision

SupplementarySpecification

Glossary

scope, goals, actors, features

terms, attributes, validation

non-functional reqs, quality attributes

requirements

Process Sale

1. Customer arrives ...2. Cashier makes new sale.3. ...

Page 13: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Goal: Process sales

Cashier

Customer

POS System

Checkout Service

Goal: Buy items

Enterprise Selling Things

Sales TaxAgency

Goal: Collecttaxes on sales Sales Activity

System

Goal: Analyze salesand performance data

Page 14: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Use Case DiagramNextGen POS

Manage Users

. . .

Cashier

SystemAdministrator

actor

use case

communicationsystem boundary

PaymentAuthorization

Service

«actor»Tax Calculator

«actor»Accounting

System

alternatenotation for a computer system actor

«actor»HR System

Cash In

«actor»Sales Activity

System

Manage Security

Analyze Activity

Customer

Manager

Process Sale

Handle Returns

Page 15: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

NextGen

Process Sale

. . .Cashier

Show computer system actorswith an alternate notation tohuman actors.

primary actors onthe left

supporting actorson the right

For a use case contextdiagram, limit the use cases touser-goal level use cases.

«actor»Payment

AuthorizationService

Page 16: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

NextGen

Process Sale

«system»Payment

AuthorizationService

...

«actor»Payment

AuthorizationService

Some UML alternatives toillustrate external actors that areother computer systems.

The class box style can be usedfor any actor, computer orhuman. Using it for computeractors provides visualdistinction.

PaymentAuthorization

Service

Page 17: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6
Page 18: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

Monopoly

Play Monopoly Game

Observer

Page 19: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

January February

Use Case: Capture a Sale. . .Main Success Scenario:1. ...2. ...3. ...Extensions:

Use Case: Handle Returns. . .Main Success Scenario:1. ...2. ...3. ...Extensions:

WhenOnce during inception. Short; do not try to define or polish all requirements.

Several times during elaboration iterations.

WhereAt a requirements workshop.

WhoMany, including end users and developers, will play the role of requirements specifier, helping to write use cases.

Led by system analyst who is responsible for requirements definition.

How: ToolsSoftware:· For use case text, use a web-enabled requirements tool

that integrates with a popular word processor.For use case diagrams, a UML CASE tool.Hyperlink the use cases; present them on the project website.

Hardware: Use two projectors attached to dual video cards and set the display width double to improve the spaciousness of the drawing area or display 2 adjacent word processor windows .

Developer

CustomerSystemAnalyst

End User

Two adjacent projections.

SoftwareArchitect

Page 20: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

20

Use cases and adding value

• Actor: something with behavior, such as a person, computer system, or organization, e.g. a cashier.

• Scenario: specific sequence of actions and interactions between actors and the system under discussion, e.g. the scenario of successfully purchasing items with cash.

• Use case: a collection of related success and failure scenarios that describe actors using a system to support a goal.

Page 21: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

21

Use cases and adding value

Handle returnsMain success scenario: A customer arrives at a checkout

with items to return. The cashier uses the POS system to record each returned item…

Alternate scenarios:If the credit authorization is reject, inform customer and

ask for an alternative payment method.If item identifier not found in the system, notify the

Cashier and suggest manual entry of the identifier code.…

Page 22: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

22

Use cases and adding value

• A key point is to focus on the question “how can using the system provide observable value to the user, or fulfill their goals?”

• Use cases mainly constitute functional requirements.

Page 23: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

23

Use case types and formats

• Black-box use cases describe system responsibilities, i.e. define what the system must do.

• Uses cases may be written in three formality types– Brief: one-paragraph summary, usually of the main success

scenario.

– Casual: Informal paragraph format (e.g. Handle returns)

– Fully dressed: elaborate. All steps and variations are written in detail.

Page 24: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

24

Fully-dressed example: Process SaleUse case UC1: Process SalePrimary Actor: CashierStakeholders and Interests:

-Cashier: Wants accurate and fast entry, no payment errors, …-Salesperson: Wants sales commissions updated.…

Preconditions: Cashier is identified and authenticated.Success Guarantee (Postconditions):

-Sale is saved. Tax correctly calculated.…

Main success scenario (or basic flow): [see next slide]Extensions (or alternative flows): [see next slide]Special requirements: Touch screen UI, …Technology and Data Variations List:

-Identifier entered by bar code scanner,…Open issues: What are the tax law variations? …

Page 25: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

25

Main success scenario (or basic flow): The Customer arrives at a POS checkout with items to purchase.The cashier records the identifier for each item. If there is more thanone of the same item, the Cashier can enter the quantity as well.The system determines the item price and adds the item information tothe running sales transaction. The description and the price of the currentitem are presented.On completion of item entry, the Cashier indicates to the POS system that item entry is complete.The System calculates and presents the sale total.The Cashier tells the customer the total.The Customer gives a cash payment (“cash tendered”) possibly greaterthan the sale total.

Extensions (or alternative flows):If invalid identifier entered. Indicate error.If customer didn’t have enough cash, cancel sales transaction.

Fully dressed example: Process Sale (cont.)

Page 26: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

26

Goals and Scope of a Use Case

• At what level and scope should use cases be expressed?• A: Focus on uses cases at the level of elementary

business process (EBP).• EBP: a task performed by one person in one place at

one time which adds measurable business value and leaves the data in a consistent state.– Approve credit order - OK.– Negotiate a supplier contract - not OK.

• It is usually useful to create separate “sub” use cases representing subtasks within a base use case.– e.g. Paying by credit

Page 27: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

27

Finding primary actors, goals and use cases

• Choose the system boundary.• Identify primary actors.

– Those that have user goals fulfilled through using services of the system

• For each actor identify their user goals.– Tabulate findings in the Vision artifact.

• Define use cases that satisfy user goals; name them according to their goal.

Page 28: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

28

Essential vs. Concrete style

• Essential: Focus is on intend.– Avoid making UI decisions

• Concrete: UI decisions are embedded in the use case text.– e.g. “Admin enters ID and password in the

dialog box (see picture X)”– Concrete style not suitable during early

requirements analysis work.

Page 29: 1 COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6

29

Use Case Diagrams

NextGen

Cashier Handle returnsPayment

AuthorizationServiceProcess Rental

<<actor>>Tax Calculator

Primary actors tothe left: have user goals.

Supporting actors tothe right: they providea service.

Alternative notation forcomputer system actor

Process Sale