Software Testing Techniques
Software Testing Techniques
• What is it?
• Who does it?
• Why is it important?
• What are the steps?
– White Box Testing
– Black Box Testing
• What is the Work
Product?
Testing Fundamentals
• Testing Objectives
– Testing is a process of executing a program with the intent of
finding an error
– A good test case is one that has a high probability of finding an as-
yet-undiscovered error
– A successful test is one that uncovers an as-yet-undiscovered error
• Testing Principles
– All tests should be traceable to customer requirements
– Tests should be planned long before testing begins
– Exhaustive testing is not possible
– Testing should be conducted by an independent third party
Contd….
Testing Fundamentals
• Testability
– Operability
– Observability
– Controllability
– Decomposability
– Simplicity
– Stability
– Understandability
Test Case Design
• Black Box Testing
• White Box Testing
– Basis Path Testing
• Flow Graph Notation
• Cyclomatic Complexity
• Deriving Test Cases
Flow Graph Notation
Cyclomatic Complexity
•The number of
1 Regions of the flow
graph correspond to
2,3 the Cyclomatic
Complexity
6 4,5 •V(G) = E – N + 2
8 •V(G) = P + 1 where P
7
11 is the number of
9 Predicate nodes
10
Predicate Node
IF a OR b THEN
a Procedure x ELSE
Procedure y
END IF
• a and b are Predicate
b x
Nodes
x
y
Deriving Test Cases
10 4 8
No. of
12 11 5 7 Predicate
Nodes = 5
6
13 Region = 6
The Paths
Path 1 1-2-10-11-13
Path 2 1-2-10-12-13
Path 3 1-2-3-10-11-13 BUILD TEST
CASES
Path 4 1-2-3-4-5-8-9-2 ACCORDINGLY
Path 5 1-2-3-4-5-6-8-9-2
Path 6 1-2-3-4-5-6-7-8-9-
2
Graph Matrices
1
a
3
e
b
5 f 4
c d
g
2