Muhammad Usman, Assistant Professor

Slides:



Advertisements
Similar presentations
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.
Advertisements

Use Case & Use Case Diagram
Presentation material is based on notes from Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 1 ECE.
© 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.
Actors and use cases Use-case diagram Brief notation Prioritization Fully dressed notation Requirements Functional requirements  Use-cases.
Writing Use Cases: Requirements in Context
Use cases.
Information System Engineering
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.
COMP 350: Object Oriented Analysis and Design Lecture 3 Case Studies, Inception & Use Cases References: Craig Larman Chapters 3-6.
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” - may be of.
Fall 2009ACS-3913 Ron McFadyen1 Use Cases Used to capture functional requirements – there are other requirements categories such as usability, reliability,
Use Cases & Requirements Analysis By: Mostafa Elbarbary.
Understanding Requirements
Use Cases Chapter 4. After Scenarios Find all the use cases in the scenario that specifies all possible instances of how to report a fire –Ex: “Report.
1 Real-time requirements  Intro to Software Engineering  Software Development Process Models  Formal methods in software specification  Structured.
Copyright ©2004 Cezary Z Janikow 1 Use Cases n Within Requirements discipline/workflow n Verbal descriptions of important functional (behavioral, transactional,
Object Interaction Modeling
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.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Use cases: deciding what you want.
The first step in getting what you want is to decide what you want.
TK2023 Object-Oriented Software Engineering CHAPTER 6 SYSTEM SEQUENCE DIAGRAMS.
Software Engineering 1 Object-oriented Analysis and Design Chap 30 Relating Use Cases.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 1 Functional Modeling.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 06. Requirements.
Managing Changing Requirements: Structure the Use Case Model PowerPoint Presentation derived from IBM/Rational course Mastering Requirements Management.
Requirements Functional requirements  Use-cases
1 IBM Software Group ® Mastering Requirements Management with Use Cases Module 10: Structure the Use-Case Model.
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.
Using UML, Patterns, and Java Object-Oriented Software Engineering Functional Modeling.
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Writing Use Cases: Requirements in Context.
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
Object-Oriented Analysis and Design Jan 14, 2009.
OOSE Use Case. Requirement Functional: –Features, capabilities, and security Non Functional: –Usability: Human factors, help, and documentation –Reliability:
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 4, Requirements Elicitation: Functional Modeling.
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.
Systems Analysis and Design in a Changing World, 6th Edition
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 4, Requirements Elicitation: Functional Modeling.
Use Cases Use Cases are employed to describe the functionality or behavior of a system. Each use case describes a different capability that the system.
Adv. Use cases Actor generalization – general and special actors Use case generalization – general and special use cases Include and extend relationships.
1 Chapter 5 Modeling System Requirements Finding the Use Cases Page
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.
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.
22 August, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 8 Use Case Diagrams.
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Writing Use Cases: Requirements in Context.
Understanding Requirements
Larman chapter 61 Use cases Larman chapter 6. 2 Fig. 6.1.
SYSTEM-LEVEL SEQUENCE DIAGRAMS Sys466. System-Level Sequence Diagrams  Use cases describe how external actors interact with the software system…  An.
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.
Requirements capture: Using UML Use Cases David Millard and Yvonne Howard {dem,
Jan Ron McFadyen1 Use Cases Used to capture functional requirements – there are other requirements categories such as usability, reliability,
Elaboration popo.
Use Case Modeling - II Lecture # 27.
System Sequence Diagrams and Operation Contracts
UML Use Case Diagrams.
Writing Use Cases.
Relating Use Cases popo.
Chapter 4, Requirements Elicitation: Functional Modeling
Use Case Modeling.
Chapter 4, Requirements Elicitation: Functional Modeling
Use cases Dr. X.
Presentation transcript:

Muhammad Usman, Assistant Professor Lecture 8 COMSATS Islamabad Enterprise Systems Development ( CSC447) Muhammad Usman, Assistant Professor College of Statistical and Acturial Science

Use Case Modeling

They are stories or scenarios of how people use the system What is a Use Case? Narrative descriptions of domain processes in a structured prose format They are stories or scenarios of how people use the system

A Short Example to Start With Dice game A software simulates a player rolling two dice. If the total is seven, they win; otherwise, they lose.

A Short Example to Start With Use case: Play a game Actors: Player Description: Player requests to roll the dice. System presents results: If the dice face value totals seven, player wins; otherwise, player loses.

Case Study – The NextGen POS System Computerized application used to record sales and handle payments Used in retail store It includes hardware and software It also interfaces to other applications, such as a third-party tax calculator and inventory control Multiple and varied clients-side terminals and interfaces Commercial POS

Use Case, Actor, and Scenario Actors Something with behavior such as person, computer system, or organization Scenario It is a specific sequence of actions and interactions between actors and the system. It is also called use case instance It is one particular story of using a system E.g. scenario of successfully purchasing items with cash or scenario of failing to purchase items because of credit payment denial Use case then is a collection of success and failure scenarios Use cases are requirements, primarily functional.

Use Case, Actor, and Scenario A UC is a dialogue between an Actor and a system that accomplishes a task. The dialogue is presented as a sequence of steps A complete sequence of steps is a use case scenario A scenario (UC instance) forms a complete path thru the UC.

Use Case, Actor, and Scenario UC can contain multiple scenarios (i.e., >1 path thru UC) Can range from simple (brief summary) to elaborate (detailed steps using adopted document template) UCs are NOT object-oriented artifacts! They feed into other OO models

Use Cases Kinds of Actors Primary actor Supporting actor has user goals fulfilled through using services of the SuD Why identify? To find user goals, which drive the use cases. Supporting actor provides a service (for example, information) to the SuD Why identify? To clarify external interfaces and protocols. Offstage actor has an interest in the behavior of the use case Why identify? To ensure that all necessary interests are identified and satisfied.

Guidelines Use Cases How to find use cases Choose the system boundary Find primary actors Identify goals for each primary actor Define Use cases that satisfy user goals

1. System Boundary

2 and 3. Primary actors and Goals Brainstorm the primary actors first. Questions to help identify Actors and Goals Who starts and stops the system? Who does user and security management? Who does system administration? Is “Time” an actor because the system does something in response to a time event? Are there any external software system that call upon the services of the system? Organize the actors and goals in an Actor Goal List

4. Define Use cases for user goals

Alternate Actor Notation

Writing Use Cases Use cases are text documents, not diagrams and use case modeling is primarily an act of writing text, not drawing diagrams. Use Case Style Black Box Use cases Focus on what not how Use Case Formats Brief Casual Fully dressed

Black Box Use cases

Use Case Formats Brief

Use Case Formats Causal

Fully dressed Use case Section Comment Use case name Start with a verb Scope The system under design Level “user goal” or “sub function” Primary Actor Calls on system to deliver its services Stakeholders and interests who cares about the system and what do they want Preconditions what must be true on start Success Guarantee What must be true on successful completion Main Success Scenario Unconditional happy path scenario of success Extensions Alternate scenario of success or failure Special Requirements Related NFRs Technology and Data variation list Varying I/O methods Frequency of occurrence Influences investigation, testing Miscellaneous Open issues

Process Sale Use Case UC: Process Sale User selects new sale option System requests item identifier User enters item identifier System records sale of item, and System displays item description, price, current total Steps 2-5 repeated until user finished User selects sale finished option System displays total and taxes due User selects payment option System requests payment information User enters payment information System handles payment System logs completed sale and sends sale information to Accounting System and Inventory System System generates receipt

Alternate Flow or Extensions 3a. Invalid identifier: 1 . System signals error and rejects entry. 3-6a: Customer asks Cashier to remove an item from the purchase: 1. Cashier enters item identifier for removal from sale. 2. System displays updated running total. 3-6b. Customer tells Cashier to cancel sale: 1. Cashier cancels sale on System. 4a. The system generated item price is not wanted (e.g., Customer complained about something and is offered a lower price): 1. Cashier enters override price. . 2. System presents new price. ….. Link to Full Use Case PDF

Common UC Issues What Tests Can Help Find Useful Use Cases? The Boss Test The EBP Test: A task performed by 1 user in 1 place at 1 time in response to a business event, that adds measurable value to the business and leaves data in a consistent state. The Size Test Writing Style Essential (keep the UI out) Concrete (UI decisions embedded in the UC text) Write ‘black box’ UCs Defer implementation details Avoid reference to specific technologies

Library Use Case Diagram A computerized library system for a university keeps track of all books and periodicals in the library and their check-out status. Checkout and return are automated through a bar code reader (an external device). The library system also interfaces with an external relational database which stores information about the library users (students, faculty, and staff), including whether they have any library items checked out. Library users can access the catalog and recall books and periodicals. Library employees have the same access as well as additional capabilities (e.g., listing the status of an item). Note: the library catalog is part of the library computer system so it is not shown as an actor. EmployeeLogin LibEmployee CheckAvailability LibUser Recall CheckOut BarCodeReader CheckIn UsersDB

Use Case for Employee Login Employee initiates use case by entering user name System prompts for password If password is valid, employee is logged on and now has access to employee commands Starting and Ending Conditions? Exceptions? e.g., cannot find the employee login EmployeeLogin LibEmployee CheckAvailability LibUser Recall CheckOut BarCodeReader CheckIn UsersDB

Use Case for Check Book Availability User/Employee initiates use case by selecting the check book availability option System prompts for choice of search by title, author, or call number User makes selection and enters title, author or call number System performs search through the library catalog database If a match is found, system displays item status (not checked out, checked out and due date, overdue) Starting and Ending Conditions? Exceptions? EmployeeLogin LibEmployee CheckAvailability LibUser Recall CheckOut BarCodeReader CheckIn UsersDB

Terminology: Concrete, Abstract, Base, and Addition Use Cases Concrete use case is initiated by an actor is an EBP use case e.g., Process Sale Abstract use case is never instantiated by itself is a sub-function use case (part of another use case) e.g., Handle Credit Payment Base use case that includes another use case, or that is extended or specialized by another use case e.g., Process Sale with respect to the included Handle Credit Payment Addition use case that is an inclusion, extension, or specialization Handle Credit Payment in the include relationship to Process Sale Addition use cases are usually abstract Base use cases are usually concrete

Use case association = relationship between use cases Important types: Use Case Associations Use case association = relationship between use cases Important types: Include A use case uses another use case (functional decomposition and reuse of existing functionality) Extends A use case extends another use case Generalization A use case has different specializations

≪Include≫: Functional Decomposition Problem: A function in the original problem statement is too complex to be solvable immediately Solution: Describe the function as the aggregation of a set of simpler functions. The associated use case is decomposed into smaller use cases CreateDocument ≪include≫ ≪include≫ ≪include≫ OCR Check Scan

≪Include≫: Reuse of Existing Functionality Problem: There are already existing functions. How can we reuse them? Solution: The include association from Use Case A to Use Case B indicates that an instance of A performs all the behavior described in B (“A delegates to B”) Example: The use case “ViewMap” describes behavior that can be used by the use case “OpenIncident” (“ViewMap” is factored out) Note: The base use case cannot exist alone. It is always called with the supplier use case ≪include≫ OpenIncident Base Use Case ViewMap ≪include≫ Supplier Use Case AllocateResources

Example: Include Relationship UC1: Process Sale … Main Success Scenario: 1. Customer arrives at a POS checkout with goods and/or services to purchase .… Customer pays and System handles payment. Extensions: 7b. Paying by credit: Include Handle Credit Payment. 7c. Paying by check: Include Handle Check Payment.

Example: Include Relationship cont… UC12: Handle Credit Payment … Level: Sub-function Main Success Scenario: Customer enters their credit account information. System sends payment authorization request to an external Payment Authorization Service System, and requests payment approval. System receives payment approval and signals approval to Cashier. Extensions: 2a. System detects failure to collaborate with external system: System signals error to Cashier. Cashier asks Customer for alternate payment.

When to Use Include Relationship? Use include when you are repeating yourself in two or more separate use cases and you want to avoid repetition. A use case is very complex and long, and separating it into subunits aids comprehension.

≪Extend≫ Association for Use Cases Problem: The functionality in the original problem statement needs to be extended. Solution: An extend association from Use Case B to Use Case A indicates that B is an extension of A. 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 Note: In an extend association, the base use case can be executed without the use case extension Base Use Case B Help FieldOfficer A ≪extend≫ ReportEmergency

≪Extend≫ Association for Use Cases The idea is to create an extending or addition use case, and within it, describe where and under what condition it extends the behavior of some base use case.

Example: Extend Relationship ____Process Sale___ Extension Points: Payment VIP Customer UML Notation: The extending use case points to the base use case. 2. The condition and the extension point can be shown on the line. ≪Extend≫ Payment, if customer presents a gift certificate Handle gift certificate payment

Example: Extend Relationship UC1: Process Sale (the base use case) … Extension Points: VIP Customer, step 1. Payment, step 7. Main Success Scenario: 1. Customer arrives at a POS checkout with goods and/or services to purchase .… 7. Customer pays and System handles payment

Example: Extend Relationship cont… UC15: Handle Gift Certificate Payment (the extending use case) … Trigger: Customer wants to pay with gift certificate. Extension Points: Payment in Process Sale. Level: Sub-function Main Success Scenario: Customer gives gift certificate to Cashier. Cashier enters gift certificate ID.

Generalization Association in Use Cases Problem You have common behavior among use cases and want to factor this out. Solution The generalization association among use cases factors out common behavior. The child use cases inherit the behavior and meaning of the parent use case and add or override some behavior. Example Consider the use case “ValidateUser”, responsible for verifying the identity of the user. The customer might require two realizations: “CheckPassword” and “CheckFingerprint” CheckPassword Parent Case ValidateUser Child Use Case CheckFingerprint

References Craig Larman, Applying UML and Patterns, 3rd Edition