Chapter 5: Use Cases Chapter 6 & 25 in Applying UML and Patterns Book.

Slides:



Advertisements
Similar presentations
Use-Cases.
Advertisements

Object-Oriented Analysis and Design Evolutionary Requirements.
Withdrawal Transaction Use Case Primary Actor: Customer Pre-conditions: The customer must have a valid ATM card and PIN. Post-conditions: The customer.
Use case tutorial examples.
Use cases Use-cases are a scenario based technique in the UML which identify the actors in an interaction and which describe the interaction itself A set.
Use Case Diagrams Damian Gordon.
Use Case & Use Case Diagram
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
Use cases.
Extending the Requirements Model - techniques for detailing use cases
Information System Engineering
CS3773 Software Engineering Lecture 03 UML Use Cases.
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
January Ron McFadyen1 Use Cases in the UML Functionality under consideration is represented by use cases (named ellipses) enclosed in a box.
Conversation Form l One path through a use case that emphasizes interactions between an actor and the system l Can show optional and repeated actions l.
Jan Ron McFadyen1 Use Cases in the UML Functionality under consideration is represented by use cases (named ellipses) enclosed in a box Actors.
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” - may be of.
Solving the Problem Analysis & Design.
Use Cases & Requirements Analysis By: Mostafa Elbarbary.
Documenting Requirements using Use Case Diagrams
Copyright ©2004 Cezary Z Janikow 1 Use Cases n Within Requirements discipline/workflow n Verbal descriptions of important functional (behavioral, transactional,
Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 More on use cases System sequence.
Use Case Modeling. Use case diagram For each use case we develop  Object class diagram (with attributes only)  System sequence diagram (analysis) 
Chapter 7 Structuring System Process Requirements
Chapter 3 Use Cases.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 06. Requirements.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
Interaction Modeling Interaction model describes how objects interact to produce useful results. Interactions can be modeled at different levels of abstraction:
Chapter 6 Use Cases. Use Cases: –Text stories Some “actor” using system to achieve a goal –Used to discover and record requirements –Serve as input to.
Faculty of Computer & Information Software Engineering Third year
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 20. Review Software Requirements Requirements Engineering Process.
USE CASE Bayu Adhi Tama, MTI Faculty of Computer Science, University of Sriwijaya Slides are adapted from Petrus Mursanto
Faculty of Computer & Information
Originated by K.Ingram, J.Westlake.Edited by N.A.Shulver Use Case Scripts What is a Use Case Script? The text to describe a particular Use Case interaction.
Chapter 9 Applying UML and Patterns -Craig Larman
1 Object-Oriented Modeling Using UML CS 3331 Section 2.4 Modeling Requirements with Use Cases.
Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology.
Business Analysis with For PG MDI, Gurgaon Kamna Malik, Ph.D.
1 Chapter 5 Modeling System Requirements Finding the Use Cases Page
1 Graph Coverage (6). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
Staffordshire UNIVERSITY School of Computing Version Jan 08 original by K.Ingram & J.Westlake1 Use Case Scripts The text to describe a particular Use Case.
CS212: Object Oriented Analysis and Design Lecture 32: Use case and Class diagrams.
Scenario A scenario is a sequence of steps describing an interaction between a user and a system. Use case is a set of scenarios tied together by a common.
Use cases Week Use‐case diagram 2 – Depicts the interactions between the system and external systems and users. – Graphically describes who will.
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” Used to capture and describe.
PRESENTATION ON USE CASE. Use Case Modeling Use case diagrams describe what a system does from the standpoint of an external observer. The emphasis is.
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Writing Use Cases: Requirements in Context.
Understanding Requirements
UML - Development Process 1 Software Development Process Using UML.
Chapter 6: Structuring Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Use Case Diagrams. Introduction In the previous Lecture, you saw a brief review of the nine UML diagrams. Now that you have the clear, you'll start to.
Chapter 7 Part II Structuring System Process Requirements MIS 215 System Analysis and Design.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
1 After the scenarios are formulated Find all the use cases in the scenario Describe each of these use cases in more detail Participating actors Describe.
UC Diagram & Scenario RKPL C & D. Using Use Case Diagram Use case diagrams are used to visualize, specify, construct, and document the (intended) behavior.
Requirements capture: Using UML Use Cases David Millard and Yvonne Howard {dem,
Using Use Case Diagrams
Chapter 4: Business Process and Functional Modeling, continued
CMPE 280 Web UI Design and Development August 29 Class Meeting
IS223D: OBJECT-ORIENTED DESIGN
Creating Use Cases.
UML Use Case Diagrams.
Start at 17th March 2012 end at 31th March 2012
Use Case Modeling - techniques for detailing use cases
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Using Use Case Diagrams
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Chapter 5: Use Cases Chapter 6 & 25 in Applying UML and Patterns Book.
Presentation transcript:

Chapter 5: Use Cases Chapter 6 & 25 in Applying UML and Patterns Book.

Overview What use cases are and how to write them. Different format of use cases. How to draw a use case diagram. Extend and include use cases.

By the end of this chapter, you will.. Understands the use case diagram and the different relationship types inside the use case diagram. Understands the meaning of “Use Case”. Understands the different methods in writing the use cases.

Capturing functional requirements with use case diagram It describes the main system functions from the standpoint of an external observer. Used during requirements elicitation to represent external behavior. It emphasize on what the system does rather than how it. It is created during the early stages of a project – during the analysis phase rather than during the design phase. It provides a high-level view of what the system does and who uses it. It provides the basis for determining the user interfaces (UIs) to the system.

Example: Use Case Diagram ATM Banking System

Use Case Diagram Any use case diagram should contain: Actor(s). Use cases. Associations/Relationships among actors and use cases.

Use Case Diagram Actor Actors are drawn as stick persons with the role of the actor written below. Actor names are unique typically represent the role that an actor plays with respect to the system. Is someone (e.g. human beings) or something (e.g. other objects or systems) that interact with the system. Is entity external to the system who participates in the story of the use case (receive or input), such as a person, computer system or organization. Example: a library clerk, cashier, customer, Passenger, GPS satellite, bank, customer department. Actor role name

Use Case Diagram Use Case Use cases are drawn as ellipses with the name of the use case written inside the ellipse. Use case name typically consists of an active verb and one or more nouns that concisely describe the system function modeled. Use case

Use Case Diagram Use Case Use Cases: is a collection of related scenarios that describe actors using a system to support a goal. Scenario (Use Case instance): Is a possible example of what happens when an actor interacts with the system. Represents a unit of functionality that the system provides. Contains a specific sequence of actions and interactions between actors and the system under discussion. Example: the scenario of entering book information into the catalog, or buying items at a store, or using an ATM.

Use Case Diagram Association/Relationship Actors are connected to the use case(s) with which they interact by a line, which represents the relationship between the actor(s) and the use case(s). One actor may be associated with one or more use cases. One use case may be associated with one or more actors.

Example 1: Use Case Diagram Banking System

Example 2: Use Case Diagram Registration System

Example 3: Use Case Diagram Library System

Activity: Use Case Diagram Possible use cases for an online ticket reservation website: Sign in, sign out, register, add post, delete post. Sign in, sign out, Book flight, cancel flight, buy ticket. Sign in, sign out, rate service, buy item.

Use Case(s) Each use case have an associated behavior specification which describes the sequence of actions making up a use case scenario. Use case behavioral description has two formats: Expanded Use Case High Level Use Case Describes a process in details. It has an additional section not present in HL. Describes a process very briefly, usually in 2 or 3 sentences. Purpose: Intention of the use case. Type: 1- Primary, Secondary or Optional. 2- Essential or Real. Cross References: Related use cases and system functions. Typical course of actions: describes in detail the conservation of interaction between the actors and the system. It consists of : Use Case: Use case name. Actors: List of actors (external agents) indicating who initiates the use case. Description (Success scenario): Narrative description of the process.

High Level Use Case Format: HL Example 1: Buy Items Use Case: Buy Items Actor: Customer(initiator) , Cashier Description (Success Scenario): A customer arrives at a checkout with items to purchase. The Cashier records the purchase items and collects payment. On completion, the Customer leaves with the items.

High Level Use Case Format: HL Example 2: Library - Add Resources Use Case: Add Resources Actor: Librarian Description (Success Scenario): The use case begins when the Librarian receives new resources (books and videos) to add to the catalog. The title, call number, and other information are recorded. Then the resources are placed on a shelf organized by resource type and call numbers.

Expanded Use Case Types Primary - Secondary - Optional Represents processes that may not be tackled. Describes a rare, unusual, or exceptional processes. Ex: Request for stocking new product. Describes a major, common process. Ex: Buy items.

Expanded Use Case Types Primary - Secondary - Optional Book ticket use cases is a: Primary Secondary Optional

Expanded Use Case Types Essential - Real Abstract level use cases: Real Essential Concretely describes the process in terms of its real current design, committed to specific input and output Technology. Design-oriented. Expressed in terms of the solution. Ex: screen shots of windows, entry into input fields, and so forth. The essence of the process. Analysis-oriented. Expanded use cases that are expressed in an ideal form free of technology and implementation details. HL are always essential. Expresses process relatively independent of HW/SW solutions.

Expanded Use Case Types Essential - Real Examples of essential vs. real types: Real Essential The Librarian uses the laser wand to scan the bar code for the call number, which is transmitted to the computer. The Librarian records the call number. Ex1 The Account Holder inserts the card into the ATM card reader. He is prompted to enter his PIN (see screen shot 4), which he inputs with a numeric keypad. The Account Holder identifies himself to the ATM. Ex2

Expanded Use Case Format Example: Buy Items with Cash Use Case: Buy Items with Cash. Actor: Customer (initiator), cashier. Purpose: Capture a sale & its cash payment. Overview (Success Scenario): A customer arrives at a checkout with items to purchase. The Cashier records the purchase items and collects a cash payment. On completion, the Customer leaves with the items. Type: Primary. Cross References: Functions R1.2,…

Expanded Use Case Format Example: Buy Items with Cash (cont.) System Response Actor Action 1. This use case begins when a Customer arrives at the POST checkout with items to purchase. 3. Determines the item price and adds the item information to the running sales transaction. The description and price of the current item are presented. 2. The Cashier records the identifier from each item. If there is more than one of the same item, the Cashier can enter the quantity as well. 5. Calculate and presents the sale total. 4. On completion of item entry, the Cashier indicates to the POST that item entry is complete. 6. The Cashier tells the Customer the total.

Expanded Use Case Format Example: Buy Items with Cash (cont.) System Response Actor Action 7. The Customer gives a cash payment possibly greater than the sale total. 9. Shows the balance due back to the Customer & generate a receipt. 8. The Cashier records the cash received amount. 11. Logs the completed sale. 10. The Cashier deposits the cash received & extracts the balance owing. The Cashier gives the balance owing, & the printed receipt to the Customer. 12.The Customer leaves with the items purchased. Alternatives: Line 2. Invalid identifier entered. Indicate errors. Line 7. Customer didn’t have enough cash. Cancel sales transaction.

Expanded Use Case - Essential vs Expanded Use Case - Essential vs. Real Types Example 1: Buy Items with Cash Essential use case Real use case System Response Actor Action Determines the item price & adds the item information to the running sales transaction. The description and the price of the items are presented. This Cashier records the identifier for each item. System Response Actor Action Display the item price & adds the item information to the running sales transaction. The description & price of the current item are displayed in Textbox 2 of Window1. For each item, the Cashier types in the UPC field of Window1. They then press “Enter Item” button with the mouse or Enter key.

Expanded Use Case - Essential vs Expanded Use Case - Essential vs. Real Types Example 2: ATM Withdraw Cash Essential use case Real use case System Response Actor Action Presents options. This Customer identifies themselves. System Response Actor Action 2. Prompts for PIN. 1. The Customer inserts his card. 4. Display options menu. 3. Enter PIN on keypad.

Identifying Use Cases Either by: Example: Type 2: Event based Type1: Actor based Identify the external events that a system must respond to. Relate the events to actors and use cases. Identify the actors related to an organization. For each actor, identify the processes they initiate or participate in. Log in, Cash out. Cashier Buy items, Refund items. Customer

Use Cases = Processes A use case describes a process, such as business process. A process describes, from start to finish, a sequence of events, actions and transactions required to produce or complete something of value. Example: Withdraw cash from an ATM. Order a product. Register for courses at a school. Check the spelling. Handle a call.

Decision Point & Branching A Use case may contain decision points such as in Buy Items, the customer may choose to pay via cash, credit or check. If one of them is the typical case (usual), then the typical case is the one written in Typical course of events, and the other alternatives should be written in the Alternatives section. If all the alternatives are equal in their likelihood, (like the payment types), write in the main section of Typical course of events a branch event, that indicates that the possible branches are written in subsections. Then write a subsection for each branch, again using Typical course of events. If subsections have alternatives, write them in an Alternatives section.

Decision Point & Branching Example: Buy items Section: Main System Response Actor Action 1. This use case begins when a Customer arrives at POST checkout with items to purchase. 2. ….. 3. Customer chooses payment type: a. If cash payment, see section pay by Cash. b. If credit payment, see section pay by Credit. c. If check payment, see section pay by Check. 4. Logs the completed sale. 5. Print the receipt. 6. The cashier gives the receipt to the customer. 7. The customer leaves with the items.

Decision Point & Branching Example: Buy items (cont.) Section: Pay by cash System Response Actor Action 1. The customer gives a cash payment- possible greater than the sale total. 2. The Cashier records the cash tendered. 3. Shows the balance due back to the Customer. 4. The Cashier deposits the cash received and extracts the balance owing. The Cashier gives the balance owing to the Customer. Alternatives: Line 4. Insufficient cash in drawer to pay balance. Ask for cash from supervisor or ask Customer for a payment closer to sale total.

Plan and Elaborate Phase Steps Define system function. Define system boundary, actors & use cases. HL use cases. Draw use case diagram. Expand critical use cases (Essential / Analysis). Real use case (Design). Rank use case (not discussed).

System Administrators Example 1 2- Define actors and use cases: Log in, Cash out. Cashier Buy items, Refund items. Customer Start up, Shut down. Manager Add new users. System Administrators

Example 1 (cont.) 3- Use cases in HL format: Use Case: Buy Items Actors: Customer (initiator), Cashier Type: Primary Description: A Customer arrives at a checkout with items to purchase. The Cashier records the purchase items and collects a payment. On completion, the Customer leaves the store with the items. Use Case: Start Up Actors: Manager Type: Primary Description: A Manager powers on a POST in order to prepare it for use by Cashiers. The Manager makes sure the date and time are correct, after which the system is ready for Cashiers’ use.

Example 1 (cont.) 4- Use cases diagram:

Example 1 (cont.) 5- Expand critical use cases:

Example 1 (cont.) 5- Expand critical use cases:

Example 1 (cont.) 5- Expand critical use cases:

Example 2 Use Case: Make a book Entry Use Case: UC1 - Make Book Entry Actor: Library clerk Success Scenario: A library clerk accesses a terminal in order to enter one or possibly many book entries in a database. At the end of every entry, the system displays a confirmation message. At the end of the session the system would display an informative message.

Example 2 (cont.) Use Case Diagram

The <<extends>> Relationship <<extends>> relationships represent exceptional or seldom invoked cases. A reusable use case (component) that conditionally interrupts (is invoked optionally - like a menu selection in an application) the execution of another use case to augment its functionality. The functionality in the original problem statement needs to be extended. The exceptional event flows are factored out of the main event flow for clarity. The base use case can be executed without the use case extension in extend associations. The responsibility for deciding when the extending use case should be used lies with the extending use case. Arrow points to use case being extended.

The <<extends>> Relationship Use cases representing exceptional flows can extend more than one use case. The direction of an <<extends>> relationship is to the extended use case. For example: the use case “ReportEmergency” is complete by itself, but can be extended by the use case “Help” for a specific scenario in which the user requires help.

The <<extends>> Relationship Major variation: If you have a major alternative path in the use case, and it’s complex enough to have its own alternative paths, then placing it on your diagram will honestly expose the complexity - which is helpful in costing, assignment and scheduling. Optional subgoal: If you have parts of the use case that would be optional to implement (or even optional to execute) to meet the actor’s goals, put those parts into their own use case. Doing so clarifies the relationships between actors and their goals. It also emphasizes that you may deliver these optional goals in later releases.

The <<extends>> Relationship

The <<extends>> Relationship

The <<extends>> Relationship

The <<extends>> Relationship

The <<extends>> Relationship

The <<include>> Relationship <<includes>> relationship represents behavior that is factored out of the use case. A use case uses another use case (“functional decomposition”). Used to indicate that one use case includes the functionality of another use case. A function in the original problem statement is too complex to be solvable immediately. Describe the function as the aggregation of a set of simpler functions. The associated use case is decomposed into smaller use cases. A reusable use case (component) that is unconditionally called into the execution of another use case (always included in the process – like running BIOS in a system boot).

The <<include>> Relationship Responsibility for the decision about when to use it lies with the calling use case. Arrow points to the included use case. The direction of a <<includes>> relationship is to the using use case (unlike <<extends>> relationships).

The <<include>> Relationship

The <<include>> Relationship

The <<include>> Relationship

<<extends>> and <<include>> Relationships Summary Do not try to identify «include» and «extend» relationships in your first cut model. Use «include» to abstract sequences of steps out of the primary Use Cases that are useful to the analyst to avoid repetitious descriptions. Use «extend», sparingly, to overlay additional functionality on top of a well-formed Use Case to divide up the complexity of a large and complex Use Case.

Generalization/Specialization Relationship Called inheritance relationship. Occurs when there is a general sequence of events, but when considering the details, there are many specialised variations of the use case. Graphically, this is shown by a generalisation line pointing from the specialised use case to the more general use case.

Actor Generalization

Actor Generalization

Actor Generalization