CONTROL FLOW TESTING
WHAT IS CONTROL FLOW TESTING?
Control flow testing is technique that comes under white box testing. The aim
of this technique is to determine the execution order of statements or
instructions of the program through a control structure. The control structure
of a program is used to develop a test case for the program.
In this technique, a particular part of a large program is selected by the
tester to set the testing path.
It is mostly used in unit testing.
CONTROL FLOW TESTING PROCESS:
Control Flow Graph Creation: From the given source code a control flow graph is
created either manually or by using the software.
Coverage Target: A coverage target is defined over the control flow graph that
includes nodes ,edges, paths, branches etc.
Test Case Creation: Test case are created using control flow graphs to cover the
defined coverage target.
Test Case Execution: After the creation of test cases over coverage target, further test
cases are executed.
Analysis: Analysis the result and find out whether the program is error free or has
some defects.
CONTROL FLOW GRAPH:
Control flow graph is a graphical representation of control flow or
computation that is done during the execution of the program.
Control flow graphs are mostly used in static analysis as well as compiler
applications, as they can accurately represent the flow inside of a program
unit.
EXAMPLE:
n=5
If(n>=18):
print(“you are eligible for voting”)
else:
print(“you are not eligible for voting”)
ADVANTAGES OF CONTROL FLOW
TESTING:
It detects almost half of the defects that are determined during the unit
testing.
It also determines almost one-third of the defects of the whole program.
It can be performed manually or automated as the control flow graph that is
used can be made by hand or by using software also.
DISADVANTAGES OF CONTROL FLOW
TESTING:
• Good knowledge of programming is required for proper testing.