1 CSE 403 Software Requirements and Use Cases Reading: Writing Effective Use Cases A. Cockburn These lecture slides are copyright (C) Marty Stepp, 2007,

Slides:



Advertisements
Similar presentations
Software Requirements
Advertisements

Chapter 11 Designing the User Interface
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
9/10/2004Use Case Workshop 1 CSC480 Software Engineering Workshop 1 Requirements Modeling.
GCSE PROJECT GUIDELINES Use this presentation to make sure you have the correct content for you project - click on.
Introduzione ai casi d’uso  Adriano Comai 1999 Pag. 1 Use Cases: an Introduction  Adriano Comai 1999.
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.
8 September Announcements  GIT Class: Friday 3-5 SN 115 (Peter Parente)  Information for Project Links PageProject Links Page  Hot Topics Teams.
CT1404 Lecture 2 Requirement Engineering and Use Cases 1.
SWE Introduction to Software Engineering
Lecture 4 Class Responsibility Collaboration Cards
Documenting Requirements using Use Case Diagrams
Software Requirements
Overview of Software Requirements
1 TCSS 360, Spring 2005 Lecture Notes Use Cases Relevant Reading: Writing Effective Use Cases A. Cockburn.
Software Engineering Chapter 6 Software requirements
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 1 Requirements engineering l The process of establishing the services that the.
Chapter 13: Designing the User Interface
User Interface Theory & Design
® IBM Software Group © 2006 IBM Corporation Writing Good Use Cases Module 4: Detailing a Use Case.
Object-Oriented Analysis - Instructor Notes
Use Cases 2 ENGR ♯10 Peter Andreae
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 06. Requirements.
MSF Requirements Envisioning Phase Planning Phase.
المحاضرة الثالثة. Software Requirements Topics covered Functional and non-functional requirements User requirements System requirements Interface specification.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 6 Slide 1 Software Requirements.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 6 Slide 1 Software Requirements.
1 CSE 403 Software Requirements and Use Cases Reading: Writing Effective Use Cases A. Cockburn These lecture slides are copyright (C) Marty Stepp, 2007,
Software Requirements Presented By Dr. Shazzad Hosain.
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.
What are Requirements?. "The hardest single part of building a system is deciding what to build... No other part of the work so cripples the resulting.
Software Requirements Engineering: What, Why, Who, When, and How
1 CSE 403 Software Requirements Reading: Pragmatic Programmer Ch. 7: Before the Project These lecture slides are copyright (C) Marty Stepp, 2007, with.
 Development is organized in a series of short, fixed-length mini-projects called iterations  Iterations are also incremental  Successive enlargement.
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.
Requirements Reference: Chapters 5, 6, & 8. CMSC 345, Fall Objectives To introduce the concepts of user and system requirements To explain functional.
Rational Requirements Management with Use Cases v5.5 Copyright © Rational Software, all rights reserved 1 Requirements Management with Use Cases.
Yarmouk University Department of Computer Information Systems CIS 499 Yarmouk University Department of Computer Information Systems CIS 499 Yarmouk University.
User Interface Theory & Design Lecture 6a 1.  User interface is everything the end user comes into contact with while using the system  To the user,
1 Software Requirements l Specifying system functionality and constraints l Chapters 5 and 6 ++
L To identify the services that the customer requires from a system and the constraints under which it operates and is developed.
Slide 1 CS 310 Ch 6: Software Requirements Requirements engineering: establishing the services that the customer requires from a system and the constraints.
Requirements Engineering Lesson 2. Terminologies:  Software Acquisition is where requirement engineering significantly meets business strategy.  Software.
Systems Development Life Cycle
Requirements specification Why is this the first major stage of software development? –Need to understand what customer wants first Goal of requirements.
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.
Requirement Engineering. Recap Elaboration Behavioral Modeling State Diagram Sequence Diagram Negotiation.
CMSC 345 Use Cases. u Describes the system’s behavior under various conditions as the system responds to a request from one of the stakeholders, called.
Requirements CSE Lecture outline What are requirements? How can we gather requirements? How can we document requirements? Use cases.
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Writing Use Cases: Requirements in Context.
Software Engineering, COMP201 Slide 1 Software Requirements BY M D ACHARYA Dept of Computer Science.
CSE 403, Spring 2007, Alverson Requirements Pragmatic Programmer Tip: Don’t Gather Requirements – Dig for them Requirements rarely lie on the surface.
1 Software Requirements Engineering (CS 708) Dr. Ghulam Ahmad Farrukh.
Requirements capture: Using UML Use Cases David Millard and Yvonne Howard {dem,
1 Software Requirements Descriptions and specifications of a system.
Relevant Reading: Writing Effective Use Cases A. Cockburn
Software Requirements Engineering (CS 708)
CMPE 280 Web UI Design and Development August 29 Class Meeting
Use Cases Discuss the what and how of use cases: Basics Benefits
Presentation on Software Requirements Submitted by
Chapter 5 – Requirements Engineering
Fundamentals of Information Systems, Sixth Edition
Use Case Model.
CSE 403 Lecture 3 Software Requirements Reading:
Software requirements
Requirements Very High level specification of what system should do
Software Requirements
Object-Oriented Software Engineering
Subject Name: SOFTWARE ENGINEERING Subject Code:10IS51
Presentation transcript:

1 CSE 403 Software Requirements and Use Cases Reading: Writing Effective Use Cases A. Cockburn These lecture slides are copyright (C) Marty Stepp, 2007, with significant content taken from slides written by Valentin Razmov. They may not be rehosted, sold, or modified without expressed permission from the author. All rights reserved.

2 Software requirements requirements: specify what to build tell "what" and not "how" tell the system design, not the software design tell the problem, not the solution (in detail) Some goals of doing requirements: understand precisely what is required of the software communicate this understanding precisely to all development parties control production to ensure that system meets specs (including changes)

3 Requirements abstraction "If a company wishes to let a contract for a large software development project, it must define its needs in a sufficiently abstract way that a solution is not pre- defined. The requirements must be written so that several contractors can bid for the contract, offering, perhaps, different ways of meeting the client organization's needs. Once a contract has been awarded, the contractor must write a system definition for the client in more detail so that the client understands and can validate what the software will do. Both of these documents may be called the requirements document for the system."

4 F. Brooks quote "The hardest single part of building a software system is deciding precisely what to build. No other part of the conceptual work is so difficult as establishing the detailed technical requirements, including all the interfaces to people, to machines, and to other software systems. No other part of the work so cripples the resulting system if done wrong. No other part is more difficult to rectify later. Therefore the most important function that software builders do for their clients is the iterative extraction and refinement of the product requirements." -- Fred Brooks, The Mythical Man-Month

5 Requirement roles to people roles of requirements customers: show what should be delivered; contractual base managers: a scheduling / progess indicator designers: provide a spec to design coders: list a range of acceptable implementations / output QA / testers: provide a basis for testing, validation, and verification

6 Classifying requirements A classic way to classify requirements: functional: map inputs to outputs nonfunctional: other constraints performance, dependability, reusability, safety Another way to classify them (Faulk) behavioral: everything about implementation features, performance, security can be objectively observed / measured development quality attributes: things about internal construction flexibility, maintainability, reusability subjective, relative; who says what design is more maintainable?

7 Functional requirements Examples of functional requirements: The user shall be able to search either all of the initial set of databases or select a subset from it. The system shall provide appropriate viewers for the user to read documents in the document store. Every order shall be allocated a unique identifier (ORDER_ID) which the user shall be able to copy to the account’s permanent storage area.

8 Non-functional requirements Examples of non-functional requirements: It shall be possible for all necessary communication between the APSE and the user to be expressed in the standard ASCII character set. The system development process and deliverable documents shall conform to the process and deliverables defined in XYZCo-SP-STAN-95. The system shall not disclose any personal information about customers apart from their name and reference number to the operators of the system.

9 Use cases use cases: written descriptions of user's interaction with the software product to accomplish a goal (in a business system): "A sequence of transactions in a system whose task is to yield a result of measurable value to an individual actor of the business system" (in an information system): "A behaviorally related sequence of transactions performed by an actor in a dialogue with the system to provide some measurable value to the actor" (Jacobson 1995) Use cases are the ways in which a system can be used (the functions which the system provides to its users) Use cases help us discover/document requirements

10 Benefits of doing use cases The list of goal names provides executives: Shortest summary of what system will contribute Project planning skeleton (priorities & timing) The main success scenario provides all: Agreement as to the system’s responsibilities The extension conditions provide programmers: List of things programmers have to watch for List of things analysts have to investigate Extension handling steps provide dev team: A record of (tricky) business policy decisions

11 Cockburn's requirements list Requirements Outline (p13-14) - good template of all functional requirements 1.purpose and scope 2.terms / glossary 3.use cases 4.technology used 5.other 5a.development process - participants, values (fast-good- cheap), visibility, competition, dependencies 5b.business rules / constraints 5c.performance demands 5d.security (now a hot topic), documentation 5e.usability 5f.portability 5g.unresolved / deferred 6.human issues: legal, political, organizational, training

12 Actors and stakeholders What is an actor? A primary actor? What is the difference between an actor and a stakeholder? actor: anything with behavior that acts on the system primary actor: initiates interaction to achieve goal (when system is a software product, primary actor is often the computer user) supporting actor: performs sub-goals to help use case stakeholder: anyone interested in the system examples: supplier, stock agency, vendor the difference: stakeholder might not "act" in any scenario

13 Use case goals and levels goal: action that actor wants to accomplish level: type / scope of a goal summary goals ("above sea level"):multi-sitting user goals ("sea-level"):one sitting subfunctions ("below sea level"):partial user goal summary goal subfunction Why? How? What?

14 Goals and levels, examples What level are these goals at? Withdraw money from an ATM Purchase a book from the online store, and have it shipped to the user; can be cancelled while in transit Purchase shares of stock online using a "stock trap." Update user's balance after a deposit. Answers: user goal, summary goal, summary goal, subfunction

15 Qualities of a good use case A good use case: starts with a request from an actor to the system ends with the production of all the answers to the request defines the interactions (between system and actors) related to the function takes into account the actor's point of view, not the system's focuses on interaction, not internal system activities doesn't describe the GUI in detail has 3-9 steps in the main success scenario is easy to read

16 Use cases vs. internal features consider software to run a cell phone: Use Cases call someone receive a call send a message memorize a number Point of view: user Internal Functions transmit / receive data energy (battery) user I/O (display, keys,...) phone-book mgmt. Point of view: developer / designer

17 Do use cases capture these? Which of these requirements should be represented directly in a use case? Order cost = order item costs * 1.06 tax. Promotions may not run longer than 6 months. Customers only become Preferred after 1 year. A customer has one and only one sales contact. Response time is less than 2 seconds. Uptime requirement is 99.8%. Number of simultaneous users will be 200 max. Answer: NONE. Most of these requirements are non- functional, so the use cases wouldn't explicitly mention them. The user doesn't see them directly in the success scenario.

18 Styles of use cases 1. Actor / goal list or UML use case diagram shows all use cases in system 2. Informal use case 3. Formal use case Let's examine each of these in detail...

19 1. Actor / goal list It can be useful to create a list or table of actors and their "goals" (use cases they start):

20 Use case summary diagrams The overall list of your system's use cases can be drawn as high-level diagrams, with: actors as stick-men, with their names below use cases as ellipses with their names below or inside association indicated by lines, connecting an actor to a use case in which that actor participates use cases can be connected to other cases that they use / rely on customer open account

21 Use case summary diagram

22 Use case summary diagram 2 Control System Set limits Calibrate Take profile Scan Liaison Physicist Hardware Specialist Experimental Physicist

23 Use case summary diagram 3 Order Food Hire Employee Reorder supplies Produce mgt. reports Track sales and inv. data > Customer Applicant Supplier Service Person Manager

24 2. Informal use case informal use case: written as a paragraph describing the scenario Example: Customer Loses a Tape The customer reports to the clerk that he has lost a tape. The clerk prints out the rental record and asks customer to speak with the manager, who will arrange for the customer to pay a fee. The system will be updated to reflect lost tape, and customer's record is updated as well. The manager may authorize purchase of a replacement tape.

25 Formal use case example

26 Formal use case elements "Place an order" (User goal / Clerk) Main scenario: 1. Clerk identifies customer, item and quantity. 2. System accepts and queues the order. Extensions: 1a. Low credit & Customer is 'Preferred': 1a1. System gives them credit anyway. 1b. Low credit & not 'Preferred' customer: 1b1. Clerk performs Sign Up Preferred Customer scenario and accepts only prepayment. 2a. Low on stock: Customer accepts rain-check: 2a1. Clerk reduces order to available stock level. (goal of primary actor) (level of goal [summary, user, subfunction]) (action steps: full sentences showing who takes the action! steps long.) (condition causing different actions) (action step(s) handling those conditions) (primary actor) (calling another use case)

27 Example use case Use Case 12. Buy stocks over the web Primary Actor: Purchaser (user) Scope: PAF Level: user goalPrecondition: User already has PAF open. Guarantees: sufficient log information exists that PAF can detect what went wrong. Success Guarantees: remote web site acknowledged purchase, user's portfolio updated. Main success scenario: 1. User selects to buy stocks over the web. 2. PAF gets name of web site to use (E*Trade, Schwabb, etc.) 3. PAF opens web connection to the site, retaining control. 4. User browses and buys stock from the web site. 5. PAF intercepts responses from the web site, and updates the user's portfolio. 6. PAF shows the user the new portfolio standing. Extensions: 2a. User wants a web site PAF does not support: 2a1. System gets new suggestion from user, with option to cancel use case. 3a....

28 Use case tables Formal use cases can also be written as a table:

29 One method to do use cases Now that we know the syntax for doing use cases, what 4 steps does Cockburn recommend when actually brainstorming and writing our use cases? Let's look at each step in detail identify actors and their goals 2. write the main success scenario 3. identify and list possible failure extensions 4. describe how the system handles each failure

30 1. Identify actors and goals Ask oneself the following questions: what computers, subsystems and people will drive our system? (actors) examples: Customer, Clerk, Corporate Mainframe what does each actor need our system to do? each need may show up as a trigger to a use case result: a list of use cases, a sketch of the system short, fairly complete list of usable system function can now draw UML use case diagram for reference

31 Identify actors/goals example Exercise: Together, let's identify some major actors and their goals for software for a video store kiosk system. The software can be used for looking up movies and actors by keywords, as well as usable to check out movies from the kiosk to known customers, without a cashier present. A customer can check out up to 3 movies at a time, for up to 5 days each. If a movie is returned late, late fees can be paid at the time of return or time of next checkout.

32 2. Write the success scenario Main success scenario is the preferred "happy" case example: customer=good credit and item=in stock easiest to read and understand everything else is a complication on this Capture each actor's intent and responsibility, from trigger to goal delivery say what information passes between them number each line Exercise: Let's do this for the Customer Returns a Movie scenario.

33 3. List the failure extensions Usually, almost every step can fail example: customer has bad credit example: item is not in stock in desired quantity Note the failure condition separately, after the main success scenario Exercise: Let's do this for the Customer Returns a Movie scenario.

34 4. Describe failure-handling Recoverable extensions rejoin main course example: low credit + valued customer -> accept example: low stock + reduce quantity -> accept Non-recoverable extensions fail directly not a valued customer -> decline order out of stock -> decline order Each scenario goes from trigger to completion "extensions" are merely a writing shorthand can write "if" statements can write each scenario from beginning to end Exercise: Let's do this for the Customer Returns a Movie scenario.

35 Pros and cons of use cases pro: they hold functional requirements in an easy- to-read text format they make a good framework for non-functional requirements & scheduling con: they show only the functional reqs design is not done only in use case units

36 User stories (usage narratives) user story: narrative told from user's perspective, describing his/her usage of the system Example: Bill is a marine biologist who wants to see an article about fish. He selects "Article or journal" from the menu. He chooses topic "fish" from the subsequent list shown. The system returns articles to Bill about his chosen topic. The annotated list designates the physical location of articles. Bill clicks articles of interest to him. Abstracts of each flagged article are displayed. Bill makes a final selection of articles based on abstracts. The abstracts are printed, and Bill retrieves them from the printer. How is this different from an informal use case? personal; focused on UI; contains non-software details (printing)

37 How do use cases fit in? "Hub and spokes" model puts use cases as central to all requirements Adolph's "Discovering" Requirements in New Territory What do you think? use cases help us discover functional requirements in our system and document them Do use cases affect UI design decisions?

38 Use case exercises Consider the case of a video store that wants a kiosk with intelligent software that can replace human checkout workers. A customer with an account can simply use their membership and credit card with a reader at the kiosk to check out a video. Come up with 5 use case names for such software, and draw a UML use case diagram of these cases and their actors. Write a formal (complete) use case for the Customer Checks Out a Movie scenario.