Lecture 3-1 Emily Navarro

Slides:



Advertisements
Similar presentations
UML Use Case Diagram / Use Case Text / Activity Diagram
Advertisements

Object-Oriented Analysis and Design Evolutionary Requirements.
CPSC 333: Foundations of Software EngineeringJ. Denzinger 2.2. Use Cases: Scenario based requirements modeling Recommended: Booch, Rumbaugh, Jacobson:
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.
Karolina Muszyńska Based on:
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.
Information System Engineering
Lecture 2-2 Emily Navarro
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Use-case Modeling.
Documenting Requirements using Use Case Diagrams
Use Case Modelling.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Introduction to Software Engineering Dr. Basem Alkazemi
Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
UFCEPM-15-M Object-oriented Design and Programming Jin Sa.
USE Case Model.
® IBM Software Group © 2006 IBM Corporation Writing Good Use Cases Module 4: Detailing a Use Case.
Object-Oriented Analysis - Instructor Notes
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 06. Requirements.
Developing Use Cases in a Group Carolyn L. Cukierman Face-to-Face Technology Conference March 27, 2000.
Requirement Engineering. Review of Last Lecture Problems with requirement Requirement Engineering –Inception (Set of Questions) –Elicitation (Collaborative.
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.
Requirements Artifacts Precursor to A & D. Objectives: Requirements Overview  Understand the basic Requirements concepts and how they affect Analysis.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
 Development is organized in a series of short, fixed-length mini-projects called iterations  Iterations are also incremental  Successive enlargement.
Faculty of Computer & Information
Requirements Analysis and Design Engineering Southern Methodist University CSE 7313.
1 Object-Oriented Modeling Using UML CS 3331 Section 2.4 Modeling Requirements with Use Cases.
® IBM Software Group © 2006 IBM Corporation Writing Good Use Cases Module 1: Introduction to Use-Case Modeling.
A Use Case Primer 1. The Benefits of Use Cases  Compared to traditional methods, use cases are easy to write and to read.  Use cases force the developers.
Yarmouk University Department of Computer Information Systems CIS 499 Yarmouk University Department of Computer Information Systems CIS 499 Yarmouk University.
Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology.
Object Oriented Analysis & Design & UML (Unified Modeling Language) 1 Part II: Requirements The requirements workflow Use case modeling Advanced.
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
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.
Use Case Model Use case diagram.
Use Case Diagram The purpose is to communicate the system’s functionality and behaviour to the customer or end user. Mainly used for capturing user requirements.
1 Version /05/2004 © 2004 Robert Oshana Requirements Engineering Use cases.
Informatics 43 – October 6, 2015 Lecture 2-1 Emily Navarro.
Analysis Modeling CpSc 372: Introduction to Software Engineering
Requirements specification Why is this the first major stage of software development? –Need to understand what customer wants first Goal of requirements.
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.
Systems Analysis and Design in a Changing World, Fourth Edition
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” Used to capture and describe.
22 August, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 8 Use Case Diagrams.
UML (Unified Modeling Language)
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.
CSCI 383 Object-Oriented Programming & Design Lecture 7 Martin van Bommel.
Introduction to Software Engineering 1. Software Engineering Failures – Complexity – Change 2. What is Software Engineering? – Using engineering approaches.
Chapter 3: Software Design –Use case Diagram Nouf Alghanmi.
Requirements capture: Using UML Use Cases David Millard and Yvonne Howard {dem,
1 Team Skill 3 Defining the System Part 1: Use Case Modeling Noureddine Abbadeni Al-Ain University of Science and Technology College of Engineering and.
Use Cases Discuss the what and how of use cases: Basics Examples Benefits Parts Stages Guidelines.
Object-Orientated Analysis, Design and Programming
CMPE 280 Web UI Design and Development August 29 Class Meeting
Use Case Modeling - II Lecture # 27.
Systems Analysis and Design in a Changing World, 6th Edition
Use Cases Discuss the what and how of use cases: Basics Benefits
Use Case Model Use case diagram.
Concepts, Specifications, and Diagrams
Systems Analysis and Design in a Changing World, 6th Edition
Object Oriented Analysis and Design
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Object-Oriented Software Engineering
Presentation transcript:

Lecture 3-1 Emily Navarro Informatics 43 – October 21, 2014 Lecture 3-1 Emily Navarro

Today’s Lecture Quiz #1 answers Use Cases

Today’s Lecture Quiz #1 answers Use Cases

Today’s Lecture Quiz #1 answers Use Cases

What is a Use Case (I) A depiction of the following requirement information Basic functionality Any precondition for the functionality Flow of events (scenario) for the functionality Any postcondition for the functionality Any error condition and alternative flow

Why Use Cases? (I) Other requirements engineering methods have many limitations Do not necessarily map well to design/code Require additional work/effort/thought Do not translate well to acceptance tests Are difficult for non-experts/other stakeholders to understand Use cases attempt to bridge the understandability gap Describe system behavior, flows of events Describe user requests and system responses Useful in formulating test steps and verification points Why not just the other requirements engineering techniques you learned about?

Why Use Cases? (II) Together, the set of use cases specify the complete functionality of the system But they do not encompass all of the requirements Not good for specifying User interfaces Data formats Business rules Non-functional requirements Data format: e.g., a customer in our records consists of the following info… Business rules: e.g., what is a gold, bronze, silver member

Why Use Cases? (II) Together, the set of use cases specify the complete functionality of the system But they do not encompass all of the requirements Not good for specifying User interfaces Data formats Business rules Non-functional requirements Produce use cases in conjunction with other requirements engineering methods

Use Cases: Keep it Simple This is a diagram of a use case. Use cases are a simple and powerful way to define requirements for software behavior

Example: ATM Use Case Diagram This is a diagram of a use case.

What is a Use Case? (II) Use cases are textual descriptions of Major functions the system will perform for its users Goals the system achieves for its users along the way A use case describes a set of flows or scenarios Each scenario is a sequence of steps describing an interaction between a “user” and a “system” The use case is a collection of scenarios that together accomplish a specific user “goal” Each scenario corresponds to a single path or flow through a use case Goals e.g., creating a login, loggin in, user authorization, etc. as part of doing a bigger task within the system Single path/flow: e.g., scenario 1: PIN entered successfully. Scenario 2: PIN incorrect. Scenario 3: PIN incorrect 3 times, system boots user out

Example: Buy a Product A scenario is a sequence of steps describing an interaction between a user and a system For an online store, we might use narrative text to describe the following “Buy a Product” scenario*: “The customer browses the catalog and adds desired items to the shopping basket. When the customer wishes to pay, the customer describes the shipping and credit card information and confirms the sale. The system checks the authorization on the credit card and confirms the sale both immediately as well as with a follow-up email.” *Adapted from “UML Distilled” by Martin Fowler

Alternative Flows for Buy a Product In our Buy a Product scenario things went well… It is the “happy day” scenario or Basic Flow But things can go wrong… The credit card authorization might fail This would be a separate scenario or Alternative Flow You may not need to capture shipping and credit card information for returning customers This is yet another scenario, a second alternative flow A use case is a set of scenarios serving a common goal The user does not always succeed but the goal remains

Alternative Flows for Buy a Product In our Buy a Product scenario things went well… It is the “happy day” scenario or Basic Flow But things can go wrong… The credit card authorization might fail This would be a separate scenario or Alternative Flow You may not need to capture shipping and credit card information for returning customers This is yet another scenario, a second alternative flow A use case is a set of scenarios serving a common goal The user does not always succeed but the goal remains And there are usually multiple scenarios for success and “unsuccess.” A use case should capture all possible scenarios—successful and unsuccessful ones

What is an Actor? Actors are not part of the system—they represent roles a user of the system can play An actor may actively interchange information with the system An actor may be a provider or a receiver of information (or both) An actor can represent a human, a machine, or another system (e.g., software, hardware, database)

Identifying Actors (I) Actors are discovered In any documents describing system scope/definition By talking with customers and domain experts Useful questions for identifying actors include: Who uses the system? Who installs the system? Who starts up the system? Who shuts down the system? What other devices and external systems work directly with the system?

Identifying Actors (II) Addition questions for identifying actors are: Who gets information from this system? Who provides information to the system? Does anything happen automatically at a preset time? Who is interested in a certain requirement? Where in the organization is the system used? Who will benefit from the use of the system? Who will support and maintain the system? Does the system use an external resource? Does one person play several different roles? Do several people play the same role? Does the system interact with a legacy system? Automatic: e.g., system sends email when bill due External resource: e.g., travel systems that use other (e.g., orbitz), similarly insurance quoting systems, paypal, UCI net ID Legacy system: an old system that is outdated in some way. Sometimes they keep them around for various reasons (too critical to take down, old data formats, still works well, etc.), but a new system will use them.

What is a Use Case? (III) A use case is a dialogue between actors and the system A use case is initiated by an actor to invoke a certain functionality in the system A use case is a complete and meaningful flow of events A use case captures the contract or “guarantees” that will hold at the conclusion of the use case

Benefits of Use Cases Capture the intended behavior of the system you are developing Without having to specify how that behavior is implemented Allow developers to come to a common understanding with your system’s end users and domain experts Realized by design and implementation elements working together to carry out each use case Help verify and validate your design and implementation features Against user goals and requested functions

A Variety of Readers Marketing personnel, human factors engineers, specialty engineers: Approve what the system should do System engineers: Ensure system requirements are met by the use cases Reviewers: Examine the flow of events Software developers: Use as a basis for analysis, design, implementation System and software testers: Use as basis for test cases Project leads: Use for project planning Technical writers: Use for writing the end user’s guide These are not necessarily unique to use cases over req docs, all of these people and all those I told you about before with req docs might read req docs/use cases too. Neither list is exhaustive, just some possible types of people.

Identifying Use Cases – Useful Questions What functions will the actor want from the system? Does the system store information? What actors will create, read, update, or delete that information? Does the system need to notify an actor about changes in its internal state? Are there any external events the system must know about? What actor informs the system about those events? What are the tasks of each actor? What use cases will support and maintain the system? Can all functional requirements be performed by the use cases?

Use Case Flow of Events Describe only the events needed to accomplish required behavior of the use case In terms of what the system should do, not how it does it In terms the audience (customer/stakeholder/other) will understand Using business domain terminology, not implementation terminology The flow of events should describe When and how the use case starts and ends The interactions (in sequence) between use case and actors What data is needed by/exchanged during the use case The basic flow (normal sequence) of events for the use case Description of any alternative or exceptional flows of events

Example Use Case: Buy a Product Level: Sea Level Basic Flow (Main Success Scenario) Customer browses catalog and selects items to buy Customer goes to check out Customer fills in shipping information System presents full pricing information, including shipping Customer fills in credit card information System authorizes purchase System confirms sale immediately System sends confirmation email to customer Alternative Flow 3a. Customer is regular (repeat) customer 1. System displays current shipping, pricing, and billing information 2. Customer may accept or override defaults, returns to BF at step 6

Discussion (I) Begin by describing the Basic Flow Add variations Main success scenario Sequence of numbered steps Add variations Alternative Flows Still achieve the goal successfully Exception Flows Fail to achieve the goal

Discussion (II) Each use case has a primary actor Has the goal the use case is trying to achieve There may be additional, secondary actors Each step in the use case flow should be a clear, simple statement Show who is engaged and involved in the step Show the intent of the actor—what the actor wants, not how the system does it Therefore do not describe or include UI details in the text of the use case steps

Use Case Levels of Granularity (I) Cockburn’s use case level of granularity or “level” is useful but challenging Core use cases are at “sea level” An interaction with an actor toward a visible tangible goal Can be done at one sitting at a computer Fish level Use cases that are included by sea-level use cases Kite level Show how sea-level use cases fit into larger business context Also called summary-level or business-level use cases Cannot be done in one sitting, and may require multiple people, organizations, and systems interacting Establish your own conventions for levels for your project Examples sea level: withdraw money, deposit check, check balance Fish level: Authorize customer, generate receipt Kite level: Mange ATM operations, manage investments, manage loans This is just one scheme, there are others, and you can make your own

Use Case Levels of Granularity (II) Clamp level: e.g., put cursor in entry field

Use Case “Includes” One use case includes another use case in its entirety Analogous to a program calling another or a routine using a subroutine The “call” is mandatory The calling/including use case must flow through the included use case An application of reuse, modularity, anticipation of change Multiple use cases share the same functionality This functionality is placed in a separate use case Avoids repetition of the same information in multiple use cases Examples Logon/logoff User authentication/authorization

Example: Course Enrollment System

Use Case “Extends” An extends relationship is used to show Optional behavior Behavior that is only run under certain conditions, such as triggering an alarm An “interruption” in the basic flow when the condition comes true For example, a use case that monitors the flow of packages on a conveyer belt can be extended by a Trigger Alarm use case if the packages jam Typically occurs when an alternative flow has gotten too big for a particular use case

Example: Auto Purchasing System Differing schools of thought as to what “extends” really means and what should happen after the extended UC is finished—go back to main flow, terminate UC, or something else?

Parts of a Use Case Use cases can be as simple as Or as complex as a paragraph of informal text Or as complex as template-based forms that remind developers what information to include What to use depends on the formality level of the project High formality -> formal templates Mid formality -> templates with some of the fields Low formality -> paragraphs of text

Use Case Template Name/title Description Revision History Actors System Scope Goal Level Assumptions Relationships Includes Extends Extension Points Precondition Trigger Events

Use Case Template (cont’d) Basic Flow 1 – Title Description (steps), etc. Post conditions Alternative Flow 1 – Title Description (steps) Alternative Flow 2 – Title Alternative Flow 3 – Title Exception Flow 1 – Title Activity Diagram User Interface Special Requirements Performance Requirements Reports Data Requirements Outstanding Issues Activity diagrams used to visualize business workflow

Use Case Diagrams A use case diagram is a graphical view of some or all of the actors, use cases, and their interactions identified for a system Each system typically has a Main Use Case diagram A picture of the system boundary (actors) and the major functionality provided by the system (use case packages) Other use case diagrams may be created as needed A diagram showing all the use cases for a selected actor A diagram showing all the use cases being implemented in an iteration A diagram showing a use case and all of its relationships

Example Use Case Diagram: Air Travel

Example Use Case Diagram: ATM

Use Case Model - Definition Consists of Use cases Illustrating the system’s intended functions/behaviors Actors Illustrating the system’s immediate surroundings Diagrams Illustrating relationships between the system and its surroundings There will generally be one use case model per system, containing multiple use cases, actors, and diagrams

Use Case Model – Purpose (I) Used as a unifying thread throughout development The same use case model used in requirements is used in design, implementation, and test Used to identify Who will interact with the system and what the system should do What interfaces the system should have Other related requirements documents may be linked Security, performance, reusability, other “ilities” UI, reports, messages, outstanding items, other project management/tracking issues

Use Case Model – Purpose (II) Used to communicate with the end users and domain experts Provides buy-in at an early stage of development Ensures a mutual understanding of the requirements Used to verify that All behavioral (system interaction) requirements have been captured Developers have understood the requirements

Use Case Model – Purpose (II) Used to communicate with the end users and domain experts Provides buy-in at an early stage of development Ensures a mutual understanding of the requirements Used to verify that All behavioral (system interaction) requirements have been captured Developers have understood the requirements The most important role of a use case model is to communicate the system’s functionality and behavior to the customer or end user

Use Cases: Not so Fast… If you don’t fully understand the ins and outs of use cases, it is easy to misuse them or turn them into “abuse” cases Ellen Gottesdiener: “Top Ten Ways Project Teams Misuse Use Cases – and How to Correct Them.” The Rational Edge, June 2002 (Part I), July 2002 (Part II). Martin Fowler: “Use and Abuse Cases.” Distributed Computing, April 1998. Doug Rosenberg: “Top Ten Use Case Mistakes.” Software Development, February 2001. Susan Lilly: “How to Avoid Use Case Pitfalls.” Software Development, January 2000. Kulak and Guiney: “Use Cases: Requirements in Context.” Second Edition, Addison-Wesley 2003.

Top Misguided Guidelines (Gottesdiener) Don’t bother with any other requirements representations Use cases are the only requirements model you’ll need! Stump readers about the goal of your use case Name use cases obtusely using vague verbs such as “do” or “process” Include nonfunctional requirements and UI details in your use case text Use lots of extends and includes in your initial use case diagrams This allows you to decompose use cases into tiny units of work Include nonfunction req’s… SEPARATE CONCERNS Use lots of extends… INCREMENTALITY

Ten Misguided Guidelines (Cont’d) Don’t involve subject matter experts in creating, reviewing, or verifying use cases They’ll only raise questions! If you involve users in use cases definitions at all, just “do it” Why bother to prepare for meetings with the users? Write your first and only use case draft in excruciating detail Why bother iterating with end users when they don’t even know what they want? Don’t validate or verify your use cases That will only cause you to make revisions and do more rework! For meetings w/ users, come prepared with “focus questions” about how they accomplish the tasks they do Write your first and only use case… INCREMENTALITY Don’t validate or verify… RIGOR AND FORMALITY

Reminder: Fundamental Principles Rigor and formality Separation of concerns Modularity Abstraction Anticipation of change Generality Incrementality Time for an example? These principles apply to all aspects of software engineering

For Informatics 43 – Keep it simple We will do simple use case diagrams. It’s a model - don’t try to make the model do too much. Focus on the most important activities. For homework 1: no pictures. Use actor – use case style, e.g.: In discussion this week you will do slightly more complicated ones Bank customer – withdraw cash Student – enroll in course Web user – search by keyword Ticket vendor – sell ticket

Homework 1 Identify main use cases in the Use Cases section Expand on each one in the System Requirements Specification section Might have a section for each use case/actor

Summary System behavior is documented in a use case model, illustrating intended functions (use cases) surroundings (actors) relationships between them (use case diagrams) The most important role of a use case model is to communicate the system’s functionality and behavior Written in concise, simple prose, use cases are understandable by a wide range of stakeholders Each use case contains a flow of events Written in terms of what the system should do, not how it should do it

Don’t forget Homework 1 draft due tonight 11:55pm Introduction and Overview/Executive Summary

Next Time Software architecture Quiz 2 Mythical Man Month Today’s lecture (use cases) MMM: Know the causes of late SW projects he suggests, Brooks’ Law, the purposes of use cases, what a use case, actor, diagram, etc. are and how to use them at a basic level. Basic, alternative, exception flow.