Software Testing Techniques
Software Testing Techniques
Table of Contents
1. Introduction
2. Software Testing Fundamentals
3. White Box Testing
1. The Nature of Software Defects
2. Basis Path Testing
1. Flow Graphs
2. The Basis Set
3. Deriving Test Cases
4. Automating Basis Set Derivation
3. Loop Testing
1. Simple Loops
2. Nested Loops
3. Concatenated Loops
4. Unstructured Loops
4. Other White Box Techniques
4. Black Box Testing
1. Introduction
2. Equivalence Partitioning
3. Boundary Value Analysis
4. Cause-Effect Graphing Techniques
Introduction
Because of the fallibility of its human designers and its own
abstract, complex nature, software development must be
accompanied by quality assurance activities. It is not unusual
for developers to spend 40% of the total project time on
testing. For life-critical software (e.g. flight control, reactor
monitoring), testing can cost 3 to 5 times as much as all other
activities combined. The destructive nature of testing requires
that the developer discard preconceived notions of the
correctness of his/her developed software.
Software Testing Fundamentals
Testing objectives include
Flow Graphs
The derivation of the flow graph and the set of basis paths is
amenable to automation. A software tool to do this can be
developed using a data structure called a graph matrix. A
graph matrix is a square matrix whose size is equivalent to the
number of nodes in the flow graph. Each row and column
correspond to a particular node and the matrix corresponds to
the connections (edges) between nodes. By adding a link
weight to each matrix entry, more information about the
control flow can be captured. In its simplest form, the link
weight is 1 if an edge exists and 0 if it does not. But other
types of link weights can be represented:
Loop Testing
1. simple loops,
2. nested loops,
3. concatenated loops, and
4. unstructured loops.
Simple Loops
Nested Loops
1. Start at the innermost loop. Set all other loops to minimum values.
2. Conduct simple loop tests for the innermost loop while holding the outer
loops at their minimums. Add tests for out-of-range or excluded values.
3. Work outward, conducting tests for the next loop while keeping all other
outer loops at minimums and other nested loops to typical values.
4. Continue until all loops have been tested.
Concatenated Loops
Unstructured Loops
1. Condition testing
o exercises the logical conditions in a program.
2. Data flow testing
o selects test paths according to the locations of definitions and uses
of variables in the program.
Equivalence Partitioning
1. For input ranges bounded by a and b, test cases should include values a
and b and just above and just below a and b respectively.
2. If an input condition specifies a number of values, test cases should be
developed to exercise the minimum and maximum numbers and values
just above and below these limits.
3. Apply guidelines 1 and 2 to the output.
4. If internal data structures have prescribed boundaries, a test case should
be designed to exercise the data structure at its boundary.
1. Causes (input conditions) and effects (actions) are listed for a module
and an identifier is assigned to each.
2. A cause-effect graph is developed.
3. The graph is converted to a decision table.
4. Decision table rules are converted to test cases.