120 likes | 216 Views
CMSC 345. Use Cases. Use Cases. 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.
E N D
CMSC 345 Use Cases
Use Cases • 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 • PrimaryActor: The stakeholder that requests the system to deliver some service • Scope • Functionalscope – services the system will offer, identified by the use cases • Designscope – 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: MyTelCo Level: Summary Scenario:1. Customer calls MyTelCo, requests new service2. MyTelCo delivers new service…. Etc…..
System Scope Primary Actor: Clerk (for external customer) Scope: MySystem Level: User Goal Scenario:1. Customer calls in, clerk discusses request with customer2. Clerk finds customer info in MySystem3. MySystem presents customer’s current info4 .. Etc…..
Use Case Terminology • 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 • 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 • 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 • 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 • Person 2 dribbles a while • Person 2 kicks ball to person 3 • Possible set of extensions written in scenario format
Use Case Terminology • Extension • 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 • 7. Repay customer for returned goods • Technology and Data variation • 7a. Repay by check, ETF, or credit against future purchases
Use Case Example Name: Buying stocks over the webPrimary Actor: PurchaserScope: Personal Advisors / Financial package (PAF)Level: User GoalStakeholdersandInterests Purchaser - wants to buy stocks and get them add to portfolio Stock Agency – wants full purchase informationPreCondition: User already has PAF openMinimalGuarantee: Sufficient logging information will exist so that the PAF can detect that something went wrong and ask the user for detailsSuccessGuarantee: 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 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: 2a. Purchaser wants a website PAF does not support 2a1. System gets a new suggestion from purchaser, with option to cancel use case. 3a. Website failure of any sort during setup 3a1. System reports failure to purchaser with advice, backs up to previous step 3a2. Purchaser either backs out of this use case or tries again4a. Computer crashes or is switched off during purchase transaction 4a1. ?????4b. Website does not acknowledge purchase, but puts it on delay 4b1. PAF logs delay, sets a timer to ask purchaser about tx.