Use Cases and ScenariosWe Will CoverWhat is a Use-CaseUser Goals versus User InteractionsGoals and InteractionsUse-Case Diagrams (POST)Another ExampleIncludes and ExtendsSetting the System BoundaryA Different BoundaryEmbedded System “Onion Skin”Partial POSTPOST Use-CasePOST Expanded Use-CaseThe Home Heating SystemHome Heating Use-Case DiagramHome Heating Use-CasesModified Home HeatingModified: Home Heating Use-CasesSlide 23Slide 24Scenarios -- One Use CaseSlide 26HACSHACS Use-Case DiagramHACS Use-CasesAlternate HACSAlternate HACS Use-CasesWhen to use Use-CasesHow it Fits Together05-Use-Cases05-Use-Cases11Use Cases and ScenariosUse Cases and Scenarios205-Use-CasesWe Will CoverWe Will CoverWhat is a use-caseUse-case versus user interactionUse-Case diagramsThe constructs in the use-case diagramsCapturing the use-case High-level use-caseExtended use-caseDifference between use case and scenario305-Use-CasesWhat is a Use-CaseWhat is a Use-CaseA use-case captures some user visible functionThis may be a large or small functionDepends on the level of detail in your modeling effortA use-case achieves a discrete goal for the userExamplesFormat a documentRequest an elevatorHow are the use cases found (captured or elicited)?405-Use-CasesUser Goals versus User InteractionsUser Goals versus User InteractionsConsider the following when formatting a documentDefine a styleChange a styleCopy a style from one document to the nextversusFormat a documentEnsure consistent formatting of two documentsThe latter is a user goalSomething the user wants to achieveThe former are user interactionsThings the user does to the system to achieve the goal505-Use-CasesGoals and InteractionsGoals and InteractionsThere is a place for both goals and interactionsUnderstand what the system shall doCapture the user goalsUnderstand how the user will achieve the goalsCapture user interactionsSequences of user interactionsThus, start with the user goals and then refine the user goals into several (many) user interactions605-Use-CasesUse-Case Diagrams (POST)Use-Case Diagrams (POST)CustomerCashierBuy ItemLog InRefund a Purchased ItemPOSTUse CaseSystem BoundaryAdapted from Larman “Applying UML and Patterns”POST: Point of Sale Terminal705-Use-CasesSalespersonTraderAccounting SystemTrading ManagerSet LimitsUpdate AccountsAnalyze RiskPrice DealCapture DealLimit ExceededValuation«includes»«includes»«extends»Another ExampleAnother ExampleAdapted from Fowler “UML Distilled”805-Use-CasesIncludes and ExtendsIncludes and ExtendsIncludesYou have a piece of behavior that is similar across many use casesBreak this out as a separate use-case and let the other ones “include” itExamples includeValuationValidate user interactionSanity check on sensor inputsCheck for proper authorizationExtendsA use-case is similar to another one but does a little bit morePut the normal behavior in one use-case and the exceptional behavior somewhere elseCapture the normal behaviorTry to figure out what can go wrong in each stepCapture the exceptional cases in separate use-casesMakes it a lot easier to understand1105-Use-CasesC u s t o m e rC a s h i e rB u y I t e mL o g I nR e f u n d a P u r c h a s e d I t e mP O S TM HSetting the System BoundarySetting the System BoundaryThe system boundary will affect your actors and use-casesAdapted from Larman “Applying UML and Patterns”1205-Use-CasesCustomerBuy ItemRefund a Purchased ItemStoreA Different BoundaryA Different BoundaryLet us view the whole store as our systemAdapted from Larman “Applying UML and Patterns”1305-Use-CasesEmbedded System “Onion Skin”Embedded System “Onion Skin”Perception/ActionSensors/ActuatorsSystemInterfaces*1405-Use-CasesPartial POSTPartial POSTC u s t o m e rC a s h i e rB u y I t e mL o g I nR e f u n d a P u r c h a s e d I t e mP O S TS t a r t U pM a n a g e U s e r sA n d a L o t M o r eM a n a g e rS y s t e m A d m i n i s t r a t o rM HAdapted from Larman “Applying UML and Patterns”1505-Use-CasesPOST Use-CasePOST Use-CaseUse case: Buy ItemActors: Customer (initiator), CashierType: PrimaryDescription: The Customer arrives at thecheckout with items to purchase.The Cashier records the purchaseitems and collects a payment.On completion the Customerleaves with the items1605-Use-CasesPOST Expanded Use-CasePOST Expanded Use-CaseUse case: Buy ItemActors: Customer (initiator), CashierType: Primary and essentialDescription: The Customer arrives at the checkout with items to purchase. The Cashier records the purchaseitems and collects a payment. On completion the Customer leaves with the items.Cross Ref.: Requirements XX, YY, and ZZUse-Cases: Cashier must have completed the Log In use-case1805-Use-CasesFuel Valve9080706050OnOffControllerBurnerWater PumpHot WaterFuelTemp SensorWater ValveControl PanelHomeThe Home Heating SystemThe Home Heating SystemTemp Sensor*1905-Use-CasesHome Heating Use-Case DiagramHome Heating Use-Case DiagramH o m e O w n e rM HP o w e r U pP o w e r D o w nC h a n g e T e m p .H o m e H e a t i n g2005-Use-CasesHome Heating Use-CasesHome Heating Use-CasesUse case: Power UpActors: Home Owner (initiator)Type: Primary and essentialDescription: The Home Owner turns the power on. Each roomis temperature checked. If a room is below thethe desired temperature the valve for the room is opened, the water pump started. If the water temp falls below threshold, the fuel valve isopened, and the burner ignited. If the temperature in all rooms is above the desiredtemperature, no actions are taken. Cross Ref.: Requirements XX, YY, and ZZUse-Cases: None2105-Use-CasesModified Home HeatingModified Home HeatingHome OwnerMHPower UpPower DownChange Temp.Home HeatingAdjust TempTemp. HighTemp. Low«includes»«includes»«includes»«includes»2205-Use-CasesModified:Home Heating Use-CasesModified:Home Heating Use-CasesUse case: Power UpActors: Home Owner (initiator)Type: Primary and essentialDescription: The Home Owner turns the power on. Perform Adjust Temp. If the temperature in all rooms isabove the desired temperature, no actions are taken. Cross Ref.: Requirements XX, YY, and ZZUse-Cases: Perform Adjust Temp*2305-Use-CasesModified:Home Heating Use-CasesModified:Home Heating Use-CasesUse case:
View Full Document