Top Banner
Use Case Modeling
18

Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Dec 29, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Use Case Modeling

Page 2: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Watch the video on use cases

• Review at minute 2:41-3:37

Page 3: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Use Cases are one way to capture requirements

• A visual way to capture functional requirements

• Each bubble is a discrete user goal• Actors can be people, or external systems• Each bubble is mapped to a textual description

homeowner

Arms/ disarms system

Accesses system via Internet

Reconfigures sensors and related

system features

Responds toalarm event

Encounters anerror condition

system administrator

sensors

Page 4: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Use Case Description

• See example on class schedule• Include basic and alternate/exception flows

– Each alternate flow must start at a step in the basic flow, and may return to a step in the basic flow

– Exception flows are analogous to exceptions in code• Includes versus preconditions• Do not use language that hints at

implementation details or system interactions– Avoid click, press, type, button, etc.– Unnecessarily limits creativity

Page 5: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Use Case Diagrams

• Made up of three components– Actors (people or external systems)– Use Cases (with textual descriptions)– Relationships

AuthorizedStaff Worker

TeacherStudent

Record class grades Review Transcripts

Page 6: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

First, identify actors

• Who or what will provide input to the system?• Who or what will need output from the

system?• Exercise: identify three actors for an ATM

Page 7: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Answer: identify three actors for an ATM

• Customer• Database (for account information, etc) – this

is an external system• Maintenance person

Page 8: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Relationships between actors

• One can be a specialization of another• Actors are classes, not individual people

Student

Graduate Student

Page 9: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Next, identify user goals

• User Goals are statements that represent what the users need to accomplish, independent of specific software features– “Buy a book”– “Return a book”– “View order history”– “Record a log for a transaction”

• Exercise: identify five uses cases for an ATM https://commons.wikimedia.org/wiki/File:Girl_blowing_bubbles.jpg

Page 10: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Answer: identify five use cases for an ATM

• Authenticate user• Withdraw funds• Deposit funds• Check balance• Transfer funds• Load bills• etc• Each would be a

bubble in diagram https://commons.wikimedia.org/wiki/File:Girl_blowing_bubbles.jpg

Page 11: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Finally, add relationships

• Three types of relationships for use cases:

Includes

Extends

Generalization

Page 12: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Includes relationship

• One use case can invoke the behavior of another– arrow goes toward included use case

• Not always, but often a precursor– I.e. the “Buy a book” use case includes the

“Authenticate customer”

Teacher

Alter Student Grade

Record Grades for a Section

<<includes>>

Page 13: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Extends Relationship

• Similar to the includes, but used for handling an abnormal situation– arrow goes toward extended use case

AuthorizedStaff Worker

Alter Student Grade

Alter student grade for a class taken more

than a year ago

<<extends>>

Page 14: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Generalization Relationship

• Replaces generic functionality with an concrete implementation– arrow goes toward extended use case

User

Authenticate user

Authenticate by card swipe

Authenticate by iris scan

Page 15: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Why Use Cases?

• Visual representation easy to understand• Relationships are opportunities for reuse• Use case descriptions can be basis for testing• Can be the basis for planning and scheduling

Page 16: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

Quiz review

• What is a single use case?• What is a use case description?• What is a use case diagram?• What is an actor?• What is a relation?

– includes relation?– extends relation?– generalization relation?– which way does the arrow go?

Page 17: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

In-class Exercises

• Complete the ATM use case diagram– use each type of relation at least once

• Complete the use case description for the Withdraw Funds use case for the ATM

• Complete the exercises at: http://www.cs.gmu.edu/~kdobolyi/cs321/hwk02.html

• Due at beginning of next class

Page 18: Use Case Modeling. Watch the video on use cases Review at minute 2:41-3:37.

In-class Exercises (time permitting)

• Examine the Quiz Game description• In your teams, come up with at least seven

use cases;– At least three actors– At least one of each type of relationship– Complete a use case description for each use case

• Turn in this assignment through svn– See instructions, rubric, and details on project

page