30
Lecture 7: Requirements Engineering and Use Cases Software System Design and Implementation ITCS/ITIS 6112/8112 001 Fall 2008 Dr. Jamie Payton Department of Computer Science University of North Carolina at Charlotte Sept. 16, 2008

Lecture 7: Requirements Engineering and Use Cases

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 7: Requirements Engineering and Use Cases

Lecture 7:Requirements Engineering

and Use Cases

Software System Design and ImplementationITCS/ITIS 6112/8112 001Fall 2008

Dr. Jamie PaytonDepartment of Computer ScienceUniversity of North Carolina at Charlotte

Sept. 16, 2008

Page 2: Lecture 7: Requirements Engineering and Use Cases

2

Announcements

Homework 1 is available Due Tuesday, Sept. 23 at 5:00 pm

• No late submissions accepted for credit

Submit by email to [email protected]• Electronic copy only, preferably in PDF

Page 3: Lecture 7: Requirements Engineering and Use Cases

3

Lecture Overview

Requirements engineering activities Requirements change management Requirements and use cases

Page 4: Lecture 7: Requirements Engineering and Use Cases

4

Requirements Engineering Activities

Inception Elicitation Elaboration/Analysis

Negotiation

Specification Validation

Page 5: Lecture 7: Requirements Engineering and Use Cases

5

Requirements Engineering Activities

Inception Elicitation Elaboration/Analysis

Negotiation

Specification Validation

Page 6: Lecture 7: Requirements Engineering and Use Cases

6

Requirements Validation Techniques

Requirements reviews Systematic manual analysis of the requirements

Prototyping Using an executable model of the system to check

requirements• Covered in Chapter 17

Test-case generation Developing tests for requirements to check testability

• If difficult to design tests, requirement will be difficult to Implement Validate

Page 7: Lecture 7: Requirements Engineering and Use Cases

7

Reviewing Requirements

Individual Requirements Verifiability

• Is the requirement realistically testable?

Comprehensibility• Is the requirement properly understood?

Traceability• Is the origin of the requirement clearly stated?

Adaptability• Can the requirement be changed without a large impact on

other requirements?

Page 8: Lecture 7: Requirements Engineering and Use Cases

8

Reviewing Requirements

Collection of requirements (SRS) Consistency

• Are there any requirements conflicts?

Completeness• Are all functions required by the customer included?

Realism• Can the requirements be implemented given available budget

and team?

Page 9: Lecture 7: Requirements Engineering and Use Cases

9

Requirements Management

Requirements change during a project Need to understand, control, and track changes

• Policies Requirements identification Change management process Traceability policy CASE tool support

Page 10: Lecture 7: Requirements Engineering and Use Cases

10

Requirements Change Management

Should apply to all proposed changes to therequirements

Principal stages Problem analysis

• Discuss requirements problem and propose change Change analysis and costing

• Assess effects of change on other requirements Change implementation

• Modify documentation to reflect change

Page 11: Lecture 7: Requirements Engineering and Use Cases

11

Traceability

Traceability is concerned with the relationships betweenrequirements, their sources and the system design

Requirements should be uniquely identified to aid in traceability Naming convention should reflect traceability relationships

Traceability relationships Source traceability

• Links from requirements to stakeholders who proposed theserequirements

Requirements traceability• Links between dependent requirements

Design traceability• Links from the requirements to the design

Page 12: Lecture 7: Requirements Engineering and Use Cases

12

Traceability Matrix

Relates requirements to Stakeholders Other requirements System features Design modules

• Subsystems• Interfaces

Req.

id

1.1 1.2 1.3 2.1 2.2 2.3 3.1 3.2

1.1 D R

1.2 D D D

1.3 R R

2.1 R D D

2.2 D

2.3 R D

3.1 R

3.2 R

Creation Manual for small projects Generated from database in

large projects

Traceability and requirement relationships

Page 13: Lecture 7: Requirements Engineering and Use Cases

13

CASE Tools forRequirements Change Management

Basic productivity tools Word processors, spreadsheets, databases

Workbenches CASE Spec

• www.analysttool.com• Free demo

Borland Caliber Analyst• http://www.borland.com/us/products/caliber/index.html• Free trial

DOORS (by IBM)• http://www.telelogic.com/corp/products/doors/• Free trial

Page 14: Lecture 7: Requirements Engineering and Use Cases

14

The Software RequirementsSpecification Document

The official statement of what is required of thesystem developers

Should include: a definition of user requirements a specification of the system requirements

Page 15: Lecture 7: Requirements Engineering and Use Cases

15

Requirements Document Structure

Preface Intended audience Version Change summary

Introduction Project overview

Glossary Requirements

User requirements definition System requirements specification

Appendices Hardware, software related requirements

Page 16: Lecture 7: Requirements Engineering and Use Cases

16

Lecture Overview

Requirements engineering activities Requirements change management Requirements and use cases

Page 17: Lecture 7: Requirements Engineering and Use Cases

17

Developing Use Cases

Use Case Scenario-based approach to capturing functional

requirements Model behavior as a sequence of actions

Describes how an actor interacts with the system Actor (UML terminology)

• Represents role people or device play when using the system• External to system (system is not an actor)

Provides an observable result of value to the actor• Related to some tangible amount of work

Page 18: Lecture 7: Requirements Engineering and Use Cases

18

Use Cases in UML

Use Case Diagram Represents a product’s use cases and actors involved in each

use case Models a static view of a system Catalogs all use cases

Graphical Notation

Page 19: Lecture 7: Requirements Engineering and Use Cases

19

Use Case Diagram Example

University Library System Who are the actors? What do they want to do with the system?

Automated Carwash Who are the actors? What do they want to do with the system?

Page 20: Lecture 7: Requirements Engineering and Use Cases

20

Use Case Specification Guidelines (1)

Never make the product an actor Name actors with noun phrases Name use cases with verb phrases Each use case must be associated with at least one

actor Each actor must be associated with at least one use

case Associations only link actors to use cases

Page 21: Lecture 7: Requirements Engineering and Use Cases

21

Use Case Specification Guidelines (2)

Draw use case diagrams on a single page Organize by actor, problem domain, or solution categories

Make uses cases of similar size/complexity Use cases should achieve something useful (a goal)

for an actor If it isn’t useful, you’re specifying use cases at a level that is

too detailed!

Page 22: Lecture 7: Requirements Engineering and Use Cases

22

Use Case Model

Use Case Diagrams Static model Capture user-level requirements Names product use cases and actors

Use Case Descriptions Specifies actors’ interactions with product Model operational-level requirements in greater detail Dynamic model

• Textual descriptions of activities Will use a standard template

• Supplemented by activity, statechart diagrams Order of interactions Possible courses of interaction

Page 23: Lecture 7: Requirements Engineering and Use Cases

23

Writing Use Case Descriptions

Finding the actors Stakeholders are a superset of human use case actors

Preconditions Only state conditions that are necessary and important E.g., user must be logged in to system

Postconditions Must be true, no matter which flow is executed E.g., Account balance is greater than or equal to $0.00

Trigger Sometimes the first step in the use case

Page 24: Lecture 7: Requirements Engineering and Use Cases

24

Writing Use Case Descriptions(2)

Basic Flow Choose a simple and common activity flow Start at the beginning and write the flow to successful

completion• Number each step• Write each step in simple, declarative sentence

Basic Flow Example Fingerprint Access System

• Enter Secure Facility Use Case

Page 25: Lecture 7: Requirements Engineering and Use Cases

25

Organizing the Use Case Model

May have overlap in use case model Use cases may be specified at different levels of granularity Use cases may have variant

Want to reduce redundancy to promote consistency Can extract common and related behavior among use cases Can specify relationships between use cases

Use Case Relationships in UML Generalization

• One use case is a specialization of another Include

• One use case is a part of another Extend

• One use case extends the behavior of a core use case

Page 26: Lecture 7: Requirements Engineering and Use Cases

26

Generalization

A specific (child) use case inherits behavior and meaning of a more general (parent)

use case May add to behavior or override behavior or more general

(parent) use case

Customer

Perform Transaction

Withdraw Money Deposit Money

Page 27: Lecture 7: Requirements Engineering and Use Cases

27

Include

One use case explicitly incorporates another An included use case is always instantiated by larger containing use

case• Not based on meeting conditions• Never stands alone!• Executes exactly as stated

Used to extract common behaviors from multiple use cases into asingle description

Customer

Withdraw Money

Validate UserCheck Balance<<include>>

Page 28: Lecture 7: Requirements Engineering and Use Cases

28

Extend

A use case implicitly incorporates the behavior ofanother Extension is not a stand alone use case Captures conditional behavior

• Instantiated only if triggering condition is met

CustomerPay Overdraft feePay Invoice

<<extend>>

Page 29: Lecture 7: Requirements Engineering and Use Cases

29

Writing Use Cases with Extensions

Extensions Find the branch points Think of alternatives to finish the activity/task How might the use case end in success? How might the use case end in failure?

Treat extensions as a separate use case Condition is the trigger Extension steps are basic flow Completing use case or returning to branch point are goals

Extension Example Fingerprint Access System

• Enter Secure Facility Use Case

Page 30: Lecture 7: Requirements Engineering and Use Cases

30

A bank wishes to design a billing and payment system. Thesystem will use the Internet to send orders, invoices, andpayments between buyers and sellers. The bank’s motivation fordeveloping the system is to attract new customers by offering alow payment-processing fee. The bank will also be able to reduceits wage costs by processing payment requests automaticallythrough the Internet instead of manually through cashiers.

The motivations for buyers and sellers are to reduce costs,paperwork, and processing time. The payment of invoices will behandled, for instance, between the buyer’s computer and theseller’s computer. Buyers and sellers will also have a betteroverview of the status of their invoices and payments.

Example