Slides Chapter 13-15
Slides Chapter 13-15
1
Software Testing
Testing is the process of exercising a
program with the specific intent of finding
errors prior to delivery to the end user.
2
What Testing Shows
errors
requirements conformance
performance
an indication
of quality
3
Who Tests the Software?
4
Validation vs Verification
Verification – Are we building the
product right?
Is the code correct with respect to its
specification?
system validation
test test
6
Testing Strategy
Begin with unit testing and work your way up to
system testing.
Unit testing – test individual components (modules in
procedural languages; classes in OO languages)
Integration testing – test collections of components
that must work together
Validation testing – test the application as a whole
against user requirements
System testing – test the application in the context of
an entire system
7
Unit Testing
module
to be
tested
results
software
engineer
test cases
8
Unit Testing
module
to be
tested
interface
local data structures
boundary conditions
independent paths
error handling paths
test cases 9
Unit Test Environment
driver
interface
local data structures
Module boundary conditions
independent paths
error handling paths
stub stub
test cases
RESULTS 10
Integration Testing Strategies
Options:
• the “big bang” approach
• an incremental construction strategy
11
Top Down Integration
A
top module is tested with
stubs
B F G
12
Bottom-Up Integration
A
B F G
cluster
13
Regression Testing
The selective retesting of a modified
system to help ensure that no bugs
have been introduced during
modification.
15
What is a “Good” Test?
A good test is one that has a high
probability of finding an error.
16
Test Case Design
loop < 20 X
14
There are 10 possible paths! If we execute one
test per millisecond, it would take 3,170 years to
test this program!! 18
Selective Testing
Selected path
loop < 20 X
19
Software Testing
white-box black-box
methods methods
Methods
Strategies
20
White-Box Testing
or
23
Cyclomatic Complexity
A number of industry studies have indicated
that the higher V(G), the higher the probability
or errors.
modules
V(G)
Since V(G) = 4,
2 there are four paths
3 Path 1: 1,2,3,6,7,8
4
5 6 Path 2: 1,2,3,5,7,8
Path 3: 1,2,4,7,8
Path 4: 1,2,4,7,2,4,...7,8
7
Finally, we derive test
cases to exercise these
8
paths. 25
Basis Path Testing Notes
you don't need a flow chart,
but the picture will help when
you trace program paths
26
Black-Box Testing
requirements
output
input events
27
Equivalence Partitioning
user output FK
queries formats input
mouse data
picks prompts
28
Sample Equivalence
Classes
Valid data
user supplied commands
responses to system prompts
file names
computational data
physical parameters
bounding values
initiation values
output data formatting
responses to error messages
graphical data (e.g., mouse picks)
Invalid data
data outside bounds of the program
physically impossible data
proper value supplied in wrong place
29
Boundary Value
Analysis
user output FK
queries formats input
mouse data
picks prompts
output
input domain domain
30
OOT Methods: Behavior Testing
operation working
sequences should balance
acct
withdraw
cause the credit
accntInfo
Account class to withdrawal
make transition (final)
31