Professional Documents
Culture Documents
based on
Chapter 13 - Software Engineering: A Practitioner’s Approach, 6/e
copyright © 1996, 2001, 2005
R.S. Pressman & Associates, Inc.
For University Use Only
May be reproduced ONLY for student use at the university level
when used in conjunction with Software Engineering: A Practitioner's Approach.
Any other reproduction or use is expressly prohibited.
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.
errors
requirements conformance
performance
an indication
of quality
2
Who Tests the Software?
3
Levels of Testing
Unit testing
Integration 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
4
Unit Testing
module
to be
tested
results
software interface
engineer
local data structures
boundary conditions
independent paths
error handling paths
test cases
5
Integration Testing Strategies
Options:
• the “big bang” approach
• an incremental construction strategy
6
OOT Strategy
class testing is the equivalent of unit testing
…if there is no nesting of classes
operations within the class are tested
the state behavior of the class is examined
7
Debugging: A Diagnostic Process
test cases
8
Software Testing Techniques
based on
9
What is a “Good” Test?
a high probability of finding an error
not redundant.
neither too simple nor too complex
loop < 20 X
14
There are approx. 10 possible paths! If we execute one
test per millisecond, it would take 3,170 years to test this program!!
system system
requirements integration
software acceptance
requirements test
preliminary software
design integration
detailed component
design test
Time
12
[Chung]
Software Testing
White-Box Testing Black-Box Testing
requirements
output
13
White-Box Testing
Basis Path Testing
First, we compute the cyclomatic
complexity:
or
14
White-Box Testing
Basis Path Testing
Next, we derive the
independent paths:
1
Since V(G) = 4,
2 there are four paths
3 Path 1: 1,2,4,7,8
4
5 6 Path 2: 1,2,3,5,7,8
Path 3: 1,2,3,6,7,8
Path 4: 1,2,4,7,2,4,...7,8
7
Finally, we derive test
cases to exercise these
8 paths.
A number of industry studies have indicated
that the higher V(G), the higher the probability
15
or errors.
White-Box Testing
Loop Testing
Simple
loop
Nested
Loops
Concatenated
Loops Unstructured
Loops
Why is loop testing important? 16
White-Box Testing Black-Box Testing
Equivalence Partitioning &
Boundary Value Analysis
If x = 5 then …
18
OOT—Test Case Design
Berard [BER93] proposes the following approach:
19
OOT Methods: Behavior Testing
The tests to be empty set up
designed should open acct setup Accnt acct
dead nonworking
acct close acct
21
Testability
22
Strategic Issues
Understand the users of the software and develop a profile for each user category.
Conduct formal technical reviews to assess the test strategy and test cases themselves.
23
NFRs:
Reliability [Chung, RE Lecture Notes]]
Counting Bugs
Bebugging Process - based on a Monte Carlo technique for statistical analysis of random events.
1. before testing, a known number of bugs (seeded bugs) are secretly inserted.
2. estimate the number of bugs in the system
3. remove (both known and new) bugs.
# of detected seeded bugs/ # of seeded bugs = # of detected bugs/ # of bugs in the system
# of bugs in the system = # of seeded bugs x # of detected bugs /# of detected seeded bugs
But, deadly bugs vs. insignifant ones; not all bugs are equally detectable; ( Suggestion [Musa87]:
modules
V(G)
25