Software Testing Strategies
Software Testing Strategies
Software Testing Strategies
Chapter 13
Software Testing Strategies
copyright © 1996, 2001, 2005
R.S. Pressman & Associates, Inc.
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 1
Software Testing
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 2
What Testing Shows
errors
requirements conformance
performance
an indication
of quality
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 3
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 4
Testing Strategy
unit test integration
test
system validation
test test
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 5
V Model
Testing Strategy
We begin by ‘testing-in-the-small’
testing-in-the-small’ and move toward
‘testing-in-the-large’
testing-in-the-large’
For conventional software
The module (component) is our initial focus
Integration of modules follows
For OO software
our focus when “testing in the small”
small” changes from an
individual module (the conventional view) to an OO class that
encompasses attributes and operations and implies
communication and collaboration
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 7
Strategic Issues
State testing objectives explicitly.
Understand the users of the software and develop a profile for each user category.
Develop a testing plan that emphasizes “rapid cycle testing.”
testing.”
Build “robust”
robust” software that is designed to test itself
Use effective formal technical reviews as a filter prior to testing
Conduct formal technical reviews to assess the test strategy and test cases
themselves.
Develop a continuous improvement approach for the testing process.
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 8
Unit Testing
module
to be
tested
results
software
engineer
test cases
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 9
Unit Testing
module
to be
tested
interface
local data structures
boundary conditions
independent paths
error handling paths
test cases
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 10
Unit Test Environment
driver
interface
local data structures
Module boundary conditions
independent paths
error handling paths
stub stub
test cases
RESULTS
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 11
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 12
Top Down Integration
A
top module is tested with
stubs
B F G
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 13
Bottom-Up Integration
A
B F G
cluster
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 14
Sandwich Testing
A
Top modules are
tested with stubs
B F G
cluster
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 15
Object-Oriented Testing
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 16
Broadening the View of “Testing”
It can be argued that the review of OO analysis
and design models is especially useful because the
same semantic constructs (e.g., classes, attributes,
operations, messages) appear at the analysis,
design, and code level. Therefore, a problem in the
definition of class attributes that is uncovered
during analysis will circumvent side effects that
might occur if the problem were not discovered
until design or code (or even the next iteration of
analysis).
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 17
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 18
OOT Strategy
class testing is the equivalent of unit testing
operations within the class are tested
the state behavior of the class is examined
integration applies
applies three different strategies
thread-based testing—
testing—integrates the set of classes
required to respond to one input or event
use-based testing—
testing—integrates the set of classes required
to respond to one use case
cluster testing—
testing—integrates the set of classes required to
demonstrate one collaboration
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 19
Smoke Testing
A common approach for creating “daily builds”
builds” for product
software
Smoke testing steps:
Software components that have been translated into code are
integrated into a “build.”
build.”
A build includes all data files, libraries, reusable modules, and
engineered components that are required to implement one or more
product functions.
A series of tests is designed to expose errors that will keep the build
from properly performing its function.
The intent should be to uncover “show stopper”
stopper” errors that have the
highest likelihood of throwing the software project behind schedule.
The build is integrated with other builds and the entire product (in
its current form) is smoke tested daily.
The integration approach may be top down or bottom up.
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 20
High Order Testing
Validation testing
Focus is on software requirements
System testing
Focus is on system integration
Alpha/Beta testing
Focus is on customer usage
Recovery testing
forces the software to fail in a variety of ways and verifies that recovery is
properly performed
Security testing
verifies that protection mechanisms built into a system will, in fact, protect it
from improper penetration
Stress testing
executes a system in a manner that demands resources in abnormal quantity,
frequency, or volume
Performance Testing
test the run-time performance of software within the context of an integrated
system
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 21
Debugging:
A Diagnostic Process
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 22
The Debugging Process
test cases
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 23
Debugging Effort
time required
to diagnose the
time required symptom and
to correct the error determine the
and conduct cause
regression tests
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 24
Symptoms & Causes
symptom and cause may be
geographically separated
symptom may disappear when
another problem is fixed
cause may be due to a
combination of non-errors
cause may be due to a system
or compiler error
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 25
Consequences of Bugs
infectious
damage
catastrophic
extreme
serious
disturbing
annoying
mild
Bug Type
Bug Categories: function-related bugs,
system-related bugs, data bugs, coding bugs,
design bugs, documentation bugs, standards
violations, etc.
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 26
Debugging Techniques
backtracking
induction
deduction
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 27
These coursew are materials are to be used in conjunction w ith S oft ware Engineering: A Pract it ioner’s Approach,
6/e and are provided w ith permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 28