3
White Box Testing Tutorial –1: What is a Flow Graph & understand its notations Introduction to Flow Graph In order to compute logical complexity measure, V(G), of a code, testers perform the basis path testing. The value of V(G), defines the maximum number of test cases to be designed by identifying basis set of execution paths to ensure that all statements are executed at least once. The process begins with the construction of the flow graph from the source code or flow charts. The control flow of a program can be represented using a graphical representation known as a 'Flow Graph'. It consists of nodes and edges. Using the flow graph, an independent path can be defined as a path in the flow graph that has at least one edge that has not been traversed before in other paths. The flow graph is a directed graph in which nodes are either entire statements or fragments of a statement. Edges represent the flow of control. If “u” and “v” are nodes in the program graph, there is an edge from node “u” to node “v” if the statement (fragment) corresponding to node “v” can be executed immediately after the statement (fragment) corresponding to node “u” i.e. A set of independent paths that cover all edges is known as a basis set. Once a basis set is formed, test cases are written to execute all the paths in the basis set. Standard notations used in constructing a flow graph are as under 1) To indicate a Sequence: 2) To indicate “IF – THEN – ELSE”:

White Box Testing Tutorial –1: What is a Flow Graph & understand its notations

Embed Size (px)

DESCRIPTION

Highly descriptive Articles, Tutorials & FAQ's on White Box Testing a Software Testing Technique

Citation preview

Page 1: White Box Testing Tutorial –1: What is a Flow Graph & understand its notations

White Box Testing Tutorial –1: What is a Flow Graph & understand its notations

Introduction to Flow GraphIn order to compute logical complexity measure, V(G), of a code, testers perform the basis path testing. The value of V(G), defines the maximum number of test cases to be designed by identifying basis set of execution paths to ensure that all statements are executed at least once.

The process begins with the construction of the flow graph from the source code or flow charts.

The control flow of a program can be represented using a graphical representation known as a 'Flow Graph'. It consists of nodes and edges. Using the flow graph, an independent path can be defined as a path in the flow graph that has at least one edge that has not been traversed before in other paths.

The flow graph is a directed graph in which nodes are either entire statements or fragments of a statement. Edges represent the flow of control. If “u” and “v” are nodes in the program graph, there is an edge from node “u” to node “v” if the statement (fragment) corresponding to node “v” can be executed immediately after the statement (fragment) corresponding to node “u” i.e.

A set of independent paths that cover all edges is known as a basis set. Once a basis set is formed, test

cases are written to execute all the paths in the basis set.

Standard notations used in constructing a flow graph are as under

1) To indicate a Sequence:

2) To indicate “IF – THEN – ELSE”:

3) To indicate a “WHILE” Loop:

Page 2: White Box Testing Tutorial –1: What is a Flow Graph & understand its notations

4) To indicate a “Repeat – Until” Loop:

5) To indicate a “SWITCH” Statement:

6) To indicate a Post Test “FOR” Loop:

Page 3: White Box Testing Tutorial –1: What is a Flow Graph & understand its notations

7) To indicate Pre Test “FOR” Loop:

Please Click here to read many more Articles & Tutorials on White Box Testing