An Introduction To Control Flows Testing

Posted By : Sakshi Dewan Gandhi | 28-May-2018

Meaning of Control Flow:

First of all let us understand what is Control Flow Testing Well! this type of testing comes under White Box Testing Technique and is a structural testing strategy. The entire structure, design and code of the software have to be studes for this type of testing. Often this type of testing method is used by developers themselves to test their own code and design as they are very familiar with the code. This method is implemented with the intention to test the logic of the code so that the required results or functionalities can be achived. Its aplication is generally done to relatively small programs or segments of larger programs, thus it is mostly used for unit testing.


Process:

The fundamental idea behind control flow testing is selecting paths and come up with the inputs value/Test case to execute through the path. It includes following 4 steps:

 

1. Right from the Source Code a control Flow graph(CFG) is created either manually or with automation(using a software).

2. A coverage target is defined over the CFG eg, nodes, paths, branches, edges etc.

3.Test cases are created using CFG to cover the coverage target.

4.Execute the test cases.

5.Analyze the results and determine whether the program is error free or has some bugs.

Components to be used:

Node: It represents one or more procedural statements.

Edges or Links: They represent the flow of controol in a program.

Decision node: A node with more than one arrow leaving is called a decision node.

Junction Node: A node with more than one arrow entering it is called a junction.

Regions: Areas bounded by edges and nodes are called regions.


The Cyclomatic complexity can be mesured for knowing the number of independent paths in a program's source code, the formula is:

M=E-N+2P
OR
M= D+1
OR
M=R+1,
E=edges, N=nodes, P= components, D=Decision node, R= enclosed regions.

Importance of Control Flow Testing:

-It catches 50 percent of all the bugs caught during unit testing. That amounts to 33% of all the bugs caught in the program.
-The Flowcharts can be made through automated programs  or doing path selection can be done.

Related Tags

About Author

Author Image
Sakshi Dewan Gandhi

Sakshi has experience into Testing, which comprises of Functional, Performance and End-to end-System Testing. She has worked in various domains like: Telecom, E-Commerce, E-Learning and Language Translation.

Request for Proposal

Name is required

Comment is required

Sending message..