0% found this document useful (0 votes)
75 views

Software Testing Techniques

The document discusses software testing techniques including: - The objectives of testing are to find errors by executing a program and having a high probability of discovering errors. - All tests should be traceable to requirements, testing should be planned ahead of time, and conducted by an independent party. - Black box and white box testing techniques are described. White box techniques include flow graph notation, cyclomatic complexity, and deriving test cases from graphs.

Uploaded by

er_aritra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Software Testing Techniques

The document discusses software testing techniques including: - The objectives of testing are to find errors by executing a program and having a high probability of discovering errors. - All tests should be traceable to requirements, testing should be planned ahead of time, and conducted by an independent party. - Black box and white box testing techniques are described. White box techniques include flow graph notation, cyclomatic complexity, and deriving test cases from graphs.

Uploaded by

er_aritra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

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

Using the design or code as a foundation, draw a


corresponding flow graph
Determine the cyclomatic complexity of the
resultant flow graph
Determine a basis set of linearly independent paths
Prepare test cases that will force execution of each
path in the basis set
PROCEDURE average;
Sample Procedure
I = 1;
Total.input = total.valid = 0; 1
Sum = 0.; 2 3
DO WHILE value[I] <> -999 AND total.input < 100
Total.input++; 4
5 6
IF value[I] > = minimum AND value[I] < = maximum
THEN total.valid++; sum = sum + value[I];
ELSE skip 7
ENDIF
I++; 8
ENDDO 9
IF total.valid > 0 10
THEN average = sum / total.valid 11
ELSE average = -999; 12
ENDIF 13
END average
Flow graph for the
procedure average
1
V(G) has 6 Regions
2 E = 17 N = 13 so E – N
+2 = 6
3
9

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

You might also like