CMSC 345 Use Cases Use Cases u u

  • Slides: 12
Download presentation
CMSC 345 Use Cases

CMSC 345 Use Cases

Use Cases u u u Describes the system’s behavior under various conditions as the

Use Cases u u u Describes the system’s behavior under various conditions as the system responds to a request from one of the stakeholders, called the primary actor. The PA initiates some interaction with the system to accomplish some goal. The system responds, protecting the interests of the stakeholders. Different sequences of behaviors (scenarios) can unfold. Depending on the request and the conditions surrounding the request. The use case gathers these scenarios together.

Use Case Terminology u u Primary Actor: The stakeholder that requests the system to

Use Case Terminology u u Primary Actor: The stakeholder that requests the system to deliver some service Scope • Functional scope – services the system will offer, identified by the use cases • Design scope – set of software (hardware) we are designing; the boundary of our system. This is what we identify in use case » Enterprise scope – behavior of the entire ogranization » System scope – SW/HW we’re building » Subsystem scope – a component of the system

Enterprise Scope Primary Actor: Customer Scope: My. Tel. Co Level: Summary Scenario: 1. Customer

Enterprise Scope Primary Actor: Customer Scope: My. Tel. Co Level: Summary Scenario: 1. Customer calls My. Tel. Co, requests new service 2. My. Tel. Co delivers new service…. Etc…. .

System Scope Primary Actor: Clerk (for external customer) Scope: My. System Level: User Goal

System Scope Primary Actor: Clerk (for external customer) Scope: My. System Level: User Goal Scenario: 1. Customer calls in, clerk discusses request with customer 2. Clerk finds customer info in My. System 3. My. System presents customer’s current info 4. . Etc…. .

Use Case Terminology u Goal Level • Summary Goal – multiple user goal »

Use Case Terminology u Goal Level • Summary Goal – multiple user goal » Context in which user goals operate » “TOC” for lower level use cases • User Goal (of greatest interest) » “Will the PA go away happy after having done this? ” • Subfunctions – carry out the user goals » List only as needed • • u Put your energy into user goals Have a few summary goals for context Trigger – what starts the use case • May be first step, or precede the first step

Use Case Terminology u u u Preconditions • What the system will ensure is

Use Case Terminology u u u Preconditions • What the system will ensure is true before starting the use case » E. g. “The user is logged on” » Some other use case has already run to set it up Minimal Guarantee(s) • Fewest possible promises the system makes to the stakeholder, particularly when the PA’s goal cannot be delivered » Commonly, the system logs how far it got Success Guarantee(s) • What interests of the stakeholders are satisfied after a successful completion of the use case

Use Case Terminology u Scenario – a sequence of actions and interactions that occur

Use Case Terminology u Scenario – a sequence of actions and interactions that occur under certain conditions, expressed without ifs or branches • • • What makes it run (precondition + trigger) What’s it’s goal? (use case name) Set of action steps » Use simple active action statements » Use simple grammar Person 1 kicks ball to person 2 u Person 2 dribbles a while u Person 2 kicks ball to person 3 Possible set of extensions written in scenario format u •

Use Case Terminology u Extension • • u Written below the scenario for every

Use Case Terminology u Extension • • u Written below the scenario for every point where behavior can branch because of a condition. Write condition and steps that handle it Technology and Data Variations • • • Express that there may be several different ways to perform an action step. The “what” is the same, the “how” is different. Example: » Scenario action step u 7. Repay customer for returned goods » Technology and Data variation u 7 a. Repay by check, ETF, or credit against future purchases

Use Case Example Name: Buying stocks over the web Primary Actor: Purchaser Scope: Personal

Use Case Example Name: Buying stocks over the web Primary Actor: Purchaser Scope: Personal Advisors / Financial package (PAF) Level: User Goal Stakeholders and Interests Purchaser - wants to buy stocks and get them add to portfolio Stock Agency – wants full purchase information Pre. Condition: User already has PAF open Minimal Guarantee: Sufficient logging information will exist so that the PAF can detect that something went wrong and ask the user for details Success Guarantee: Remote website has acknowledged the purchase; the logs and portfolio are updated

Use Case Example (cont’d) Main Success Scenario: 1. Purchaser selects to buy stocks over

Use Case Example (cont’d) Main Success Scenario: 1. Purchaser selects to buy stocks over the web 2. PAF gets name of website to use from user 3. PAF opens web connection to site, retaining control 4. Purchaser browses and buys stocks from the web site 5. PAF intercepts responses from the website and updates user’s portfolio 6. PAF shows user the new portfolio standing

Use Case Example (cont’d) Extensions: 2 a. Purchaser wants a website PAF does not

Use Case Example (cont’d) Extensions: 2 a. Purchaser wants a website PAF does not support 2 a 1. System gets a new suggestion from purchaser, with option to cancel use case. 3 a. Website failure of any sort during setup 3 a 1. System reports failure to purchaser with advice, backs up to previous step 3 a 2. Purchaser either backs out of this use case or tries again 4 a. Computer crashes or is switched off during purchase transaction 4 a 1. ? ? ? 4 b. Website does not acknowledge purchase, but puts it on delay 4 b 1. PAF logs delay, sets a timer to ask purchaser about tx.