+ All Categories
Home > Documents > 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Date post: 25-Dec-2015
Category:
Upload: juliana-waters
View: 223 times
Download: 7 times
Share this document with a friend
49
60-322 Object-Oriented Analysis and Design Jan 19, 2009
Transcript
Page 1: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

60-322 Object-Oriented Analysis and Design

Jan 19, 2009

Page 2: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 20092

From last lecture….

use cases are text stories of some actor using a system to meet goals.

Actors

Format of writing use case

Use case template

Page 3: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 20093

Alternative format of use case, two column or one column?

Chapter 6 Use Cases

Page 4: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 20094

One column or two column? Which one is better?

It is up to you!

Now you saw example of use cases.

How would you write your own use cases?

Follow the guidelines….

Chapter 6 Use cases

Page 5: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 20095

Write in an essential UI-free style.

A writing style is called essential if it avoids UI details and focuses on the real user intent.

Which phase are we in in UP?

Would it be too early to consider UI?

Focus on the user's intentions and system's responsibilities rather than their concrete actions.

Write your use cases free of technology and mechanism details, especially those related to the UI.

Use cases - Guidelines

Page 6: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 20096

In contrast, there is a concrete use case style.

In this style, user interface decisions are embedded in the use case text. The text may even show window screen shots, discuss window navigation, GUI widget manipulation and so forth. For example:

1. Adminstrator enters ID and password in dialog box (see Picture 3).

2. System authenticates Administrator.

3. System displays the "edit users" window (see Picture 4).

Use cases - Guidelines

Page 7: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 20097

These concrete use cases may be useful as an aid to concrete or detailed GUI design work during a later step,

but they are not suitable during the early requirements analysis work.

During early requirements work,

"keep the user interface out, focus on user intent."

Use cases - Guidelines

Page 8: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 20098

Guideline 1:

– Write use cases in an essential style; keep the user interface out and focus on actor intent.

Guideline 2– Write terse use cases

Use cases - Guidelines

Page 9: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 20099

Guideline 3– Write black-box use cases

Do not describe the internal workings of the system, its components, or design.

Rather, the system is described as having responsibilities, which is a common unifying metaphorical theme in object-oriented thinking - software elements have responsibilities and collaborate with other elements that have responsibilities.

Use cases - Guidelines

Page 10: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200910

Specify what the system must do (the behavior or functional requirements) without deciding how it will do it (the design).

The definition of "analysis" versus "design" is sometimes summarized as "what" versus "how.“

This is an important theme in good software development.

During requirements analysis avoid making "how" decisions, and specify the external behavior for the system, as a black box.

Later, during design, create a solution that meets the specification.

Use cases - Guidelines

Page 11: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200911

Use cases - Guidelines

Page 12: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200912

Guideline 3– Take an Actor and Actor-Goal Perspective

Write requirements focusing on the users or actors of a system, asking about their goals and typical situations.

Focus on understanding what the actor considers a valuable result

Use cases - Guidelines

Page 13: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200913

Guideline 4– How to find use cases? A Step by step procedure.

1. Choose the system boundary. Is it just a software application, the hardware and application as a unit, that plus a person using it, or an entire

organization?

2. Identify the primary actors (those that have goals fulfilled through using

services of the system).

3. Identify the goals for each primary actor.

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

Usually, user-goal level use cases will be one-to-one with user goals, but there is at least one exception, as will be examined.

Use cases - Guidelines

Page 14: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200914

Step 1: Choose the System Boundary – the POS system itself is the system under design; everything

outside of it is outside the system boundary, including the cashier, payment authorization service, and so on.

Steps 2 and 3: Find Primary Actors and Goals– It is artificial to strictly linearize the identification of primary actors

before user goals; in a requirements workshop, people brainstorm and generate a mixture of both. Sometimes, goals reveal the actors, or vice versa.

In addition to obvious primary actors and goals, the following questions help identify others that may be missed:

Use cases - Guidelines

Page 15: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200915

Use cases - Guidelines

Page 16: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200916

How to Organize the Actors and Goals? Two ways:

– As you discover the results, draw them in a use case diagram, naming the goals as use cases.

– Write an actor-goal list first, review and refine it, and then draw the use case diagram.

We show use case diagram shortly.

If you create an actor-goal list, then in terms of UP artifacts it may be a section in the Vision artifact.

Use cases - Guidelines

Page 17: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200917

Use cases - Guidelines

Page 18: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200918

Is the Cashier or Customer the Primary Actor in the use case Process Sale?

The answer depends on the system boundary of the system under design, and who we are primarily designing the system for.

Use cases - Guidelines

Page 19: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200919

Use cases - Guidelines

Page 20: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200920

Use Event Analysis to find Actors and Goals.

The idea:– to identify external events. – What are they, – where from, and – why? – Often, a group of events belong to the same use case.

For example:

Use cases - Guidelines

Page 21: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200921

Use cases - Guidelines

Page 22: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200922

Step 4: Define Use Cases. In general, define one use case for each user

goal. Name the use case similar to the user goal. – For example,

Goal: process a sale; Use Case: Process Sale.

Start the name of use cases with a verb.

A common exception to one use case per goal is to collapse CRUD (create, retrieve, update, delete) separate goals into one CRUD use case, idiomatically called Manage <X>. For example, the goals "edit user," "delete user," and so forth are all satisfied by the Manage Users use case.

Use cases - Guidelines

Page 23: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200923

What Tests Can Help Find Useful Use Cases? Which of these is a valid use case?

– Negotiate a Supplier Contract– Handle Returns– Log In– Move Piece on Game Board

An argument can be made that all of these are use cases at different levels, depending on the system boundary, actors, and goals.

Use cases - Guidelines

Page 24: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200924

Instead of asking in general,– "What is a valid use case?",

A more practical question is:– "What is a useful level to express use cases for

application requirements analysis?"

There are several rules of thumb, including:– The Boss Test– The EBP Test– The Size Test

Use cases - Guidelines

Page 25: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200925

The Boss Test– Your boss asks, "What have you been doing all day?"

You reply: "Logging in!" Is your boss happy ? If not, the use case fails the Boss Test, which

implies – it is not strongly related to achieving results of

measurable value. – It may be a use case at some low goal level, but not the

desirable level of focus for requirements analysis.

That doesn't mean to always ignore boss-test-failing use cases. User authentication may fail the boss test, but may be important and difficult.

Use cases - Guidelines

Page 26: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200926

The EBP Test An Elementary Business Process (EBP) is a term

from the business process engineering field, defined as:

– A task performed by one person in one place at one time, in response to a business event, which adds measurable business value and leaves the data in a consistent state, e.g., Approve Credit or Price Order

The EBP Test is similar to the Boss Test, especially in terms of the measurable business value qualification.

Focus on use cases that reflect EBPs.

Use cases - Guidelines

Page 27: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200927

The Size Test A use case is very seldom a single action or step; rather, a

use case typically contains many steps, and in the fully dressed format will often require 3-10 pages of text.

A common mistake in use case modeling is to define just a single step within a series of related steps as a use case by itself, such as defining a use case called Enter an Item ID.

You can see a hint of the error by its small size-the use case name will wrongly suggest just one step within a larger series of steps, and if you imagine the length of its fully dressed text, it would be extremely short.

Use cases - Guidelines

Page 28: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200928

Example: Applying the Tests Negotiate a Supplier Contract

– Much broader and longer than an EBP. Could be modeled as a business use case, rather than a system use case.

Handle Returns– OK with the boss. Seems like an EBP. Size is good.

Log In– Boss not happy if this is all you do all day!

Move Piece on Game Board– Single step - fails the size test.

Use cases - Guidelines

Page 29: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200929

Although the majority of use cases identified and analyzed for an application should satisfy the tests, exceptions are common.

It is sometimes useful to write separate subfunction-level use cases representing subtasks or steps within a regular EBP-level use case. For example, a subtask or extension such as "paying by credit" may be repeated in several base use cases.

If so, it is desirable to separate this into its own use case,

even though it does not really satisfy the EBP and size

tests, and link it to several base use cases, to avoid duplication of the text.

Use cases - Guidelines

Page 30: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Jan 19, 200930

Authenticate User may not pass the Boss test, but be complex enough to warrant careful analysis, such as for a "single sign-on" feature.

USE CASE DIAGRAM - Wednesday

Use cases - Guidelines

Page 31: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

The UML provides use case diagram notation to illustrate the names of use cases and actors, and the relationships between them.

Use case diagrams and use case relationships are secondary in use case work. Use cases are text documents.

Doing use case work means to write text.

a simple use case diagram provides a succinct visual context diagram for the system, illustrating the external actors and how they use the system.

Ch6 Use Case Diagrams

Page 32: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Ch6 Use Case Diagrams

Page 33: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

A use case diagram is an excellent picture of the system context;

it makes a good context diagram, that is, – showing the boundary of a system, – what lies outside of it, and – how it gets used.

It serves as a communication tool that summarizes the behavior of a system and its actors.

Ch6 Use Case Diagrams

Page 34: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Guideline 1:– Draw a simple use case diagram in conjunction with

an actor-goal list.

Guideline 2– See the diagram

Guideline 3– Downplay Diagramming, Keep it Short and Simple.

To reiterate, the important use case work is to write text, not diagram or focus on use case relationships.

Ch6 Use Case Diagrams

Page 35: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Ch6 Use Case Diagrams

Page 36: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

A motivation for use cases is focusing on who the key actors are, their goals, and common tasks. Plus, in essence, use cases are a simple, widely-understood form (a story or scenario form).

Another motivation is to replace detailed, low-level function lists (which were common in 1970s traditional requirements methods) with use cases. These lists tended to look as follows:

Ch6 The benefits of Use Case Diagrams

Page 37: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Ch6 The benefits of Use Case Diagrams

In contrast, use cases organize a set of requirements in the context of the typical scenarios of using a system.

Page 38: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Is the feature list really bad? Abandon it?

High-Level System Feature Lists Are Acceptable.

Detailed function lists are undesirable, a terse, high-level feature list, called system features, added to a Vision document can usefully summarize system functionality.

In contrast to 50 pages of low-level features, a system features list includes only a few dozen items. It provides a succinct summary of functionality, independent of the use case view. For example:

Ch6 The benefits of Use Case Diagrams

Page 39: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Summary of System Features– sales capture– payment authorization (credit, debit, check)– system administration for users, security, code and

constants tables, and so on– …

Ch6 The benefits of Use Case Diagrams

Page 40: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Is the feature list really bad?

No, we need it. Sometimes.

Could you write a use case for application server, database products, or middleware, etc

Use cases are not a natural fit for these applications or the way they need to evolve in terms of market forces.

Ch6 The benefits of Use Case Diagrams

Page 41: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

The only significant use case in the Monopoly software system is “Play Monopoly Game”.

It doesn't pass the Boss Test!

Since the game is run as a computer simulation simply watched by one person, we might say that person is an observer, not a player.

Ch6 Case study: Monopoly Game

Page 42: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

This case study will show that use cases aren't always best for behavioral requirements.

Trying to capture all the game rules in the use case format is awkward and unnatural.

Game rules belong to domain rules (sometimes called business rules).

In the UP, domain rules can be part of the Supplementary Specification (SS).

Ch6 Case study: Monopoly Game

Page 43: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Ch6 Case study: Monopoly Game

We saw the use case diagram above, so what’s the story?

Page 44: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Ch6 Case study: Monopoly Game

Use Case UC1: Play Monopoly Game

Scope: Monopoly applicationLevel: user goalPrimary Actor: ObserverStakeholders and Interests:- Observer: Wants to easily observe the output of the game simulation.Main Success Scenario:1. Observer requests new game initialization, enters number of players.2. Observer starts play.3. System displays game trace for next player move (see domain rules, and

"game trace" in glossary for trace details).Repeat step 3 until a winner or Observer cancels.Extensions:*a. At any time, System fails:(To support recovery, System logs after each completed move)1. Observer restarts System.2. System detects prior failure, reconstructs state, and prompts to continue.3. Observer chooses to continue (from last completed player turn).Special Requirements:- Provide both graphical and text trace modes.

Page 45: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Put Use cases into perspective.

What perspective?

Iterative and evolutionary software development process, more specifically, the UP.

How to Work With Use Cases in Iterative Methods?

Ch6 Use Cases

Page 46: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Use cases are central to the UP and many other iterative methods. The UP encourages use-case driven development.

This implies:

– Functional requirements are primarily recorded in use cases (the Use-Case Model); other requirements techniques (such as functions lists) are secondary, if used at all.

– Use cases are an important part of iterative planning. The work of an iteration is, in part, defined by choosing some use case scenarios, or entire use cases. And use cases are a key input to estimation.

– Use-case realizations drive the design. That is, the team designs collaborating objects and subsystems in order to perform or realize the use cases.

Ch6 Use Cases into Perspective

Page 47: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

– Use cases often influence the organization of user manuals.

– Functional or system testing corresponds to the scenarios of use cases.

How to Evolve Use Cases and Other Specifications Across the Iterations? – A key idea in evolutionary iterative development:

The timing and level of effort of specifications across the iterations. See this table:

Ch6 Use Cases into Perspective

Page 48: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Chapter 6 Use cases

Page 49: 60-322 Object-Oriented Analysis and Design Jan 19, 2009.

Chapter 6 Use cases

a technical team starts building the production core of the system when only perhaps 10% of the requirements are detailed, and in fact, the team deliberately delays in continuing with deep requirements work until near the end of the first elaboration iteration.

This is a key difference between iterative development and a waterfall process: Production-quality development of the core of a system starts quickly, long before all the requirements are known.

near the end of the first iteration of elaboration, there is a second requirements workshop, during which perhaps 30% of the use cases are written in detail.


Recommended