Use Case Driven Development

advertisement
®
IBM Software Group
Getting a Good Start with Better Requirement
Management
- Use Case Driven Development
© 2004 IBM Corporation
IBM Software Group
Objectives

Understand what is meant by Use Case Driven Development

Understand the benefits of Use Case Driven Development

Understand how the IBM Software Development Platform toolset
supports Use Case Driven Development

Best practices for configuring the IBM Software Development Platform
toolset to support Use Case Driven Development.
2
IBM Software Group
Agenda

Characteristics and Benefits of Using Use Cases

What is Use Case Driven Development?

Capturing Use Cases

Use Cases Driving Process/Project Management

Use Cases Driving Analysis and Design

Use Cases Driving Testing

Summary
3
IBM Software Group
Agenda

Characteristics and Benefits of Using Use Cases

What is Use Case Driven Development?

Capturing Use Cases

Use Cases Driving Process/Project Management

Use Cases Driving Analysis and Design

Use Cases Driving Testing

Summary
4
IBM Software Group
The Challenge: Managing Your Requirements
Unmanaged requirements cause unmanageable budgets
 Primary reason for excessive rework, delays, and poor quality
Relative Cost to Repair
200
Time not spent in
requirements is time
spent in rework
(at cost x200)
50
20
10
5
1-2
0
Analysis
Design
Coding
Unit Test
Acceptance Maintenance
Test
Stage in which Requirements Error Is Discovered
5
IBM Software Group
Business Driven Development Approach
Business
Executive
End User
Prioritize&
Allocate
Model
Business
Optimize
Analyst
Analyze
& Design
Operations
Manager
Govern
Manage
Application
Support
Project
Manager
Architect
Implement
Deploy
Test
Operations
Deployment
Manager
Developer
Tester
Development
6
IBM Software Group
Requirements Drive Development
 Requirements represent the contract with the Customer/Users and other
Stakeholders
 Requirements (and derived requirements) drive all development activities:
analysis, design, implementation, testing etc.
 Many different types of requirements

 Design Constraints
FURPS
Functionality
 Operating systems
Usability
 Environments
Use Cases
Reliability
 Compatibility
 Application standards
Performance
Supportability

Legal and Regulatory requirements
Federal Communication Commission
Food and Drug Administration
Department of Defense
7
IBM Software Group
What is a Use Case?
 Definition:
 A use case is the specification of a set of actions
performed by a system, which yields an observable result
that is, typically, of value for one or more actors or other
stakeholders of the system (UML 2.0)
 Use:
 Used to describe the functional requirements of a system
 Representation:
Use cases are shown
in UML diagrams
 Use cases are usually described
in text
 They tell the story of the
interactions between actors
and the system
8
IBM Software Group
Components of a Use Case
Actor:
Someone/something
outside the system that
interacts with the system
Communication – Association:
Shows the Actor and the Use
Case communicate
Use Case:
Defines a piece of
functionality of the
system
Use Case Specification:
Basic flow of events,
alternate flows, error
flows and sub-flows as
appropriate
9
IBM Software Group
Use Case Structure
Use Case Name
1 Brief Description
2 Actors
3 Flow of Events
3.1 Basic Flow
3.1.1 Step 1
3.1.2 Step 2…
3.2 Alternative Flows
3.2.1 Alternative Flow 1
3.2.1.1 Step 1
3.2.1.1 Step 2…
3.2.1 Alternative Flow 2…
3.3 Error Flows
3.3.1 Error Flow 1…
3.3.1.1 Step 1
3.3.1.1 Step 2…
3.4 Sub- Flows
3.4.1 Sub-Flow 1…
3.4.1.1 Step 1
3.4.1.1 Step 2…
4 Special requirements
5 Pre-Conditions
6 Post-Conditions
7 Extension Points
 Each path through
the use case is a
Use Case
Scenario
 One use case may
contain many Use
Case Scenarios
 All Use Case
Scenarios must be
covered during
development and
testing but not
necessarily in the
same iteration
10
IBM Software Group
Use Case Diagram – The Big Picture
11
IBM Software Group
Use Cases vs. Declarative Statements (Traditional)
Declarative
 The system shall provide a list of class
offerings for the current semester
 The system shall only allow registration
for courses where the prerequisites are
fulfilled.
 The systems shall provide a secure
login.
 The system shall…
Use Cases
1. The Student enters a student ID and
password and the system validates the
student.
2. The system displays the functions
available to the student: create, modify,
delete. The student chooses create.
3. The system presents a list of course
offerings. The student chooses up to
four courses to add to the schedule…
 Describes the system’s perspective
“The system shall do this”
 Describe the users’ perspectives
This user needs to accomplish this task.”
 Does not define the context well
Who is using the system? Why?
 Defines scope and context
Who is using the system? Why?
What else interacts with the system?
 Ignores workflow
Creates usability issues
 May work well for batch operation
systems
 Captures workflow
Addresses usability early
 Supports interactive systems more
effectively
12
IBM Software Group
Benefits of Use Cases
 Simple enough that everyone can understand them; greatly aid
communication
 Give a concise view of what the system must do for its users and
stakeholders
 Clearly defines the boundaries of a system
 Facilitate agreement with customers/users and stakeholders
 Places requirements in context
 Use Cases: what users use the system for
 Actors: who/what wants to use the system
 Helps verify that all requirements are captured
 Captures workflow
 Addresses usability early
 Helps all of project team retain users’ perspectives
 Supports iterative and incremental development; basis for planning goals
and content of iterations
13
IBM Software Group
Agenda

Characteristics and Benefits of Using Use Cases

What is Use Case Driven Development?

Capturing Use Cases

Use Cases Driving Process/Project Management

Business Modeling to Derive Use Cases

Use Cases Driving Analysis and Design

Use Cases Driving Testing

Summary
14
IBM Software Group
Use-Case Driven Development
 Using use cases to drive development activities
 May start at the business level with business use cases
Identify business use cases
Develop business processes to fulfill business use cases
Identify automation opportunities and define systems (software
applications) to provide automation capability
Identify system use cases for software applications
 Use cases can be used for:
Planning and scoping of iterations
Creation and validation of the architecture/design
Definition of test cases and procedures
Design of user interfaces and creation of user documentation
15
IBM Software Group
Requirements
Driven Flow-Down
Business
Vision
Regulatory doc’s
Business
Rules
Business Use-Case
Model
Business Modeling
Policy doc’s
Commercial doc’s
Supplementary
Business
Specification
Business
Business
Object/Process Use-Case
Model
Specification
Traceability
Requirements
Glossary
Analysis and
Design
Supplementary
System
Specification
Software Architecture
Design Subsystem
Document
Implementation
Use-Case Model
Survey
Vision
Data Model
Use-Case
Model
Requirements
Driven
Flow-Down
Use-Case
Specification
Design Model Analysis Model
Class
Implementation
Model
Components (code)
Test
Test
Scripts/Procedures
Test Cases
Test Model
Test Plan
Following the IBM Rational Unified Process
16
IBM Software Group
Use-Case Driven Flow-Down
Business
Business
Requirements Use-Case Model
Business
Processes
System (Application)
Requirements
Analysis and Design
Implementation
Test
Object/Process
Model
realized by
System (Application)
Use-Case Model
automation
Analysis & Design Model
realized by
Implementation Model
implemented by
verified by
Test Model
17
IBM Software Group
Role of Traceability
 Traceability helps us manage the flow down from one requirement to
another. It allows us to:
 Keep track of the origin of a derived requirement
 Where does this requirement come from?
 Keep track of the artifacts dependent on a particular requirement e.g.
subsystems, design components, test cases etc.
 Traceability is key to ensure:
 Implementation fulfils the requirements
 Ensure all requirements are addressed
 Implementation scope is managed
 Only implement what is needed
 Manage Changes
 Analyze the impact of making changes – what is the real impact?
 If a change is implemented ensure all dependent requirements, models,
designs and tests are updated
18
IBM Software Group
Agenda

Characteristics and Benefits of Using Use Cases

What is Use Case Driven Development?

Capturing Use Cases

Use Cases Driving Process/Project Management

Use Cases Driving Analysis and Design

Use Cases Driving Testing

Summary
19
IBM Software Group
IBM Rational RequisitePro
 Used to capture and manage textual part of use cases
 Use Case Specifications
 Manages other requirements too, non-functional requirements, business
rules, constraints etc.
 Enables traceability between
different requirement types
 Integrated with other IBM Rational
tools
Synchronized
Client Interface
Word Document Interface
20
IBM Software Group
Best Practices for Using RequisitePro
 Each use case specification is a separate document in RequisitePro
 Within each document mark requirements to manage, control and allow
traceability between requirements and other artifacts
 How granular should you mark requirements?
 Whole use case? Each use case
flow (basic, alternative, etc.)?
Each use case step?
 Recommend:
 Mark at each use case and its flows as
child requirements. Minimum for
traceability
 Could also mark each use case step
as child requirements of the use case
flows
 Use attributes to track, risk, priority,
architectural significance, iteration etc.
for each marked flow
21
IBM Software Group
IBM Rational Software Architect (RSA)
 Used to capture the visual part of use cases using the Unified
Modeling Language version 2.0
 Use Case Diagrams, Activity Diagrams and Sequence Diagrams as
appropriate
 Also used to model
analysis, architecture,
design and
implementation
aspects of a system
 Integrated with other
IBM Rational tools
22
IBM Software Group
Best Practices for Modeling Use Cases In RSA
 Use case structural building blocks provided as part of use case
model template
 Copy and paste structures to build up use case model
Overview diagrams
of the most
significant actors
and use cases
Use case structure
with supporting
activity and
sequence diagrams
under each use case.
One diagram per
use case flow as
appropriate
Functional Grouping
of use cases with
functional overview
diagram
Common Actor
definitions
See Model Structure Guidelines for Rational Software Modeler and Rational Software Architect by Bill Smith
(09 Jun 2005) http://www-128.ibm.com/developerworks/rational/library/04/r-3155/index.html
23
IBM Software Group
RequisitePro – RSA Integration
 Open and browse multiple RequisitePro projects from RSM/A
 View, create and update RequisitePro requirements
 Display RequisitePro Views
 Associate requirements
with model elements via
drag and drop
Visual model
information
 Create model elements
from requirements or
requirements from model
elements via drag and
drop
 Customizable
synchronization
Requirement
information
24
IBM Software Group
Best Practices for RequisitePro – RSA Integration
 Trace use cases directly
 Trace activity (or sequence) diagrams as appropriate
 Include version number on diagram name for change
tracking
Use case activity
diagram traced
through proxy to
use case
 Name proxies
appropriately
Use case in
RSM/A directly
traced to use case
in RequisitePro
Flow sequence (or
activity) diagrams
traced through
proxies to
requirements
25
IBM Software Group
Agenda

Characteristics and Benefits of Using Use Cases

What is Use Case Driven Development?

Capturing Use Cases

Use Cases Driving Process/Project Management

Business Modeling to Derive Use Cases

Use Cases Driving Analysis and Design

Use Cases Driving Testing

Summary
26
IBM Software Group
Use Cases Driving Project/Process Management
 Process
 The Rational Unified Process is a process
framework promoting iterative development and is
use case driven
Rational Unified
 The RUP framework can
Process
be tailored using Rational
Method Composer (RMC)
– an new process authoring and
publishing tool provided with RUP
 Recommend RUP is tailored on a
project by project basis – previously
via a development case but can now
be easily achieved using RMC
Rational Method
Composer
New – December 2005
27
IBM Software Group
Use Cases Driving Project/Process Management
 Project Management
 Rational Portfolio Manager is a
complete project and portfolio
management tool and includes
RUP templates for use case
driven iterative development
 RUP tasks can be scheduled,
tracked and managed in RPM;
these tasks promote use case
driven iterative development
IT &
Executive
Leadership
 Balance portfolios, prioritize
investments
 Align resources with strategic
enterprise objectives
 Make timely, informed decisions
based on accurate project data
 Ensure best practices are repeated
for all management processes
Project &
Program
Managers
 Input and track time and expense
 Leverage reusable process templates
for collaboration and communication
Practitioners
 Generate accurate, objective
status data
Development
Environment
 Considerations for use case driven development:
Rational Portfolio Manager
New v6.2 – December 2005
 Use cases drive the goals and content of each
iteration and hence the tasks
 Complete use case scenarios should be implemented in a single iteration
 Use case scenarios will also be tested and evaluated in each iteration
 Changes should be introduced at iteration boundaries
28
IBM Software Group
Impact of Iterative Development on Use Cases
 Key Considerations:
 All use cases will not be defined and implemented together
 May flesh out details of some use cases in later iterations.
 Need to be able to track requirement status in terms of completeness and the
iteration in which it will be implemented.
 Need to prioritize use cases
 Not all requirements are equal - effective iterative development requires
architecturally significant use cases and high risk use cases to be
implemented first.
 Need to be able to track requirement priority, architectural impact and risk
 Need a good understanding of the impact of changes – will changes affect
design and implementation?
 Need traceability between stakeholder requirements, features, use cases, test
cases etc. to understand and manage the impact of change.
 Iterative development more effective but requires strong Requirements
Management – RequisitePro helps achieve this
29
IBM Software Group
Agenda

Characteristics and Benefits of Using Use Cases

What is Use Case Driven Development?

Capturing Use Cases

Use Cases Driving Process/Project Management

Use Cases Driving Analysis and Design

Use Cases Driving Testing

Summary
33
IBM Software Group
Use Cases Driving Analysis and Design
 Use cases are analyzed and the results are
captured in an analysis model in RSA
 Analysis approach:
 Study each use case
 Discover objects/classes needed to implement use case behavior
 Figure out what each class should do
 Determine object interaction needed to implement use case behavior
 Document the design in a set of UML diagrams in RSM/A
 Design model is derived from the analysis model,
architectural considerations, system constraints
and the non-functional requirements
 Analysis and design models are validated
through use case realizations
 A set of UML diagrams are produced
showing how each use case will be realized
in the analysis and design models
Use Case
Use-Case
Realization
Sequence Diagrams
Collaboration
Diagrams
Class Diagrams
34
IBM Software Group
Best Practices for Modeling Analysis and Design In
RSA
 Analysis and design structural building blocks
provided as part of analysis and design model
template respectively
 Copy and paste structures to build up analysis and
Functional
grouping of analysis and
design models
design models with functional overview
diagram
Overview diagrams
Use case realizations with supporting
sequence diagrams under each
realization. One diagram per use case
flow as appropriate
See Model Structure Guidelines for Rational Software Modeler and Rational Software Architect by Bill Smith
(09 Jun 2005) http://www-128.ibm.com/developerworks/rational/library/04/r-3155/index.html
35
IBM Software Group
Best Practices for Analysis/Design Traceability
 Options for implementing traceability from use cases to the use case
realizations
 Use UML Realize relationship
 Use RequisitePro – RSM/A integration
Use Case
Use-Case
Realization
 Or use both – recommended to communicate traceability in both environments
 Granularity of RequisitePro – RSA tracing:
 Trace to realization use case
 Trace to realization diagrams e.g. class, sequence
diagrams
 Include version number on diagram name for
change tracking
 Trace to analysis and design classes?
– not recommended
 Need to keep traceability manageable
36
IBM Software Group
Agenda

Characteristics and Benefits of Using Use Cases

What is Use Case Driven Development?

Capturing Use Cases

Use Cases Driving Process/Project Management

Business Modeling to Derive Use Cases

Use Cases Driving Analysis and Design

Use Cases Driving Testing

Summary
37
IBM Software Group
Use Cases Driving Testing
 Use cases represent how the user will use the system and are therefore
the ideal starting point for system testing
 Derive the initial set of Test Cases from the use cases
 Goal to test each use case scenario – however there may be many
scenarios for each use case
Basic flow
with sub flow 1
Basic flow
with sub flow 1
and alternative flow 1
Basic flow
with sub flow 1
and error flow 1
Basic flow
with sub flow 1
and alternative flow 2
with sub flow 1
38
IBM Software Group
Best Practices for Testing
 Testing approach is to cover all paths in each use case but minimize
duplicate testing:
 Test each flow at least once
 Loops should be tested twice (with and without exiting)
 Repeat testing of selected flows to cover appropriate variable testing i.e. invalid
passwords, negative entries, out of range entries etc.
 For complex scenarios could create scenario requirements in
RequisitePro and use case trace flows to the scenarios
 For simpler scenarios could just trace use case flows in RequisitePro to
the appropriate test cases in IBM Rational TestManager
See Traceability from Use Cases to Test Cases by Peter Zielczynski
(16 Dec 2004) http://www-128.ibm.com/developerworks/rational/library/04/r-3217/
39
IBM Software Group
Use Case Based Testing using IBM Rational
TestManager
 TestManager supports test planning,
execution, results capture and results
analysis
 Integrated with RequisitePro allowing
test cases to be associated requirements
in RequisitePro
Requirements
from RequisitePro
Test Cases
Associated with
Requirements
 Plan functional testing
structure to support use case
testing
 At least one test case per
basic flow, alternative flow,
error flow and sub flow.
 May have additional test
cases to support variable
testing
40
IBM Software Group
Summarizing
Keep your team on track and out of the red zone
with IBM Rational RequisitePro
Relative Cost to Repair
200
50
Maximize your time and
decrease your cost
by spending time and
effort in requirements
20
10
5
1-2
0
Analysis
Design
Coding
Unit Test
Acceptance Maintenance
Test
Stage in which Requirements Error Is Discovered
41
IBM Software Group
Summary
 Use Case Driven Development uses use cases to provide a valuable
focus for development activities
 Use cases drive work content in iterations as well as the analysis, design and
testing activities
 Use case realizations allow analysis models and design models to be
validated against the use case requirements prior to implementation and
testing
 Helps ensure all requirements are captured
 Reduces risks
 Use cases drive functional testing
 Test planning can start early – as soon as the use cases are define
 IBM Software Development Platform integrated toolset supports Use
Case Driven Development
 Rational Method Composer (process), Rational Portfolio Manager (project
management), Rational RequisitePro (requirements management), Rational
Software Modeler/Architect (modeling), Websphere Business Modeler (business
modeling) and Rational TestManager (test management)
42
IBM Software Group
Next Steps
 Contacting your IBM representative - 1 800 728 1212
 Ordering IBM Rational RequisitePro – IBM How to Buy site
http://www.ibm.com/software/rational/howtobuy/index.html
 ROI information - Achieving ROI with Requirements Management Tools
http://www3.software.ibm.com/ibmdl/pub/software/rational/web/reports/roirm.pdf
 Success stories - IBM Case Studies
http://www-306.ibm.com/software/success/cssdb.nsf/topstoriesFM?OpenForm&Site=software
 Training - Web-based or Instructor-led
http://www-306.ibm.com/services/learning/ites.wss/us/en?pageType=page&contentID=a0000337
 Mastering Requirements Management with Use Cases
 Essentials of IBM Rational RequisitePro
 Essentials of IBM Rational RequisitePro Baseline Manager
43
IBM Software Group
IBM Rational RequisitePro
<presenter name and email>
44
IBM Software Group
45
IBM Software Group
Organizing Requirements - Types, Attributes and Views
 User-defined requirement
types
 User-defined attributes
 User-defined filters (views)
 Saved views
46
IBM Software Group
Reporting on Requirements
 Customizable views
 Export views to Word or Excel
 Create
and
compare
partial or
complete
baselines
47
IBM Software Group
Managing Changing Requirements - Traceability
 Graphical
trace matrix
 Textual
trace matrix
 Graphical
trace tree
48
IBM Software Group
Communicating Changes and Their Impact
 Email notification
of changes
“With Rational
RequisitePro's
suspect links, my
team members and I
can immediately see
changes that are
made…”
Jason Oliver,
Kodak
 Suspect links
49
IBM Software Group
Live Integrations – Rational Software Architect
Access Requirements,
Views and
Documents in
Requirements
Explorer
Drag and Drop
Requirements to create
model elements
Create requirements from
model elements
See Traceability
Information in
Requirement Trace View
View and Edit
Requirements in
Requirement Query
Results View
50
IBM Software Group
Live Integrations – Rational Software Architect
Access Requirements
Information and
Documents from
Model Elements
51
IBM Software Group
IBM: The software development leader
#
#
#
#
#
1
1
2
2
1
Analysis, Modeling & Design
Twice the market share of nearest competitor
IDC, July 2004
Software Configuration Management,
Widened market lead with double digit growth 2002/2003
IDC, July 2004
Requirements Management
Double-digit revenue growth 2002/2003
Gartner, July 2004
Automated Software Quality
Double-digit revenue growth outpaced #1 competitor
IDC, August 2004
Embedded Software Modeling and Test Automation
Modeling: twice the market share of nearest competitor
VDC, July 2004
1IDC, 2Standish, 3Gartner
52
Download