White Box Testing
White Box Testing
White-Box Testing
•Control Flow
Testing
•Data Flow Testing
White Box Testing
White box testing is a strategy in which testing is based
on the internal paths, structure, and implementation of
the software under test. Unlike black box testing, white
box testing generally requires good programming skills.
Control Flow Testing
Control Flow Testing
• This testing approach identifies the execution paths through a module
of program code and then creates and executes test cases to cover
those paths
• A Path is a sequence of statement execution that begins at an entry
and ends at an exit.
How it Works?
• Control Flow Graphs Document the Control Structure of the Code
Modules
• Modules of the Code are Converted to Control Flow Graphs
• Paths through the Graphs are Analyzed
• Test Cases are Created against Paths
Control Flow Graphs
• A process block is a sequence of program
statements that execute sequentially from
beginning to end.
• A decision point is a point in the module at
which the control flow can change.
• A junction point is a point at which control
flows join together.
Control Flow Graphs
Levels of Coverage: Level—1
100% Statement Coverage
• Every Statement within the Module is Executed at Least Once During Testing.
• Execution of All Statements Does Not Necessarily Mean Execution of All Paths
• For Example: Use a = 6, b = 3
if (a>0 && c==1) Test Case 1 Input: a=3, c=1, b=3, d=-2
{x=x+1;} and
if (b==3 || d<0) Test Case 2 Input: a=0, c=2, b=1, d=4
{y=0;}
Levels of Coverage: Level—4
100% Decision & Condition Coverage
• At this Level, Test cases are created for every condition and every
decision