You are on page 1of 2

Aim: - study of construction and implementation CFG (Control Flow Graph) and deriving test cases.

Control flow graph:-

A CFG in computer science is representation using graph notation of all path that might be
traverse through a program during its execution.

In a CFG each node in the graph represents a basic block that is straight line peace of code
without any jumps or jump target, jump target start a block and jump end block. There is two specially
design block.

1) Entry block.

2) Exit block.

Flow graph notation for a program:-

Flow graph notation for a program is defined as several nodes connected through the edges.

How to Calculate Cyclomatic Complexity

Mathematical representation:

Mathematically, it is set of independent paths through the graph diagram. The Code
complexity of the program can be defined using the formula -

V(G) = E - N + 2

Where,

E - Number of edges

N - Number of Nodes
V (G) = P + 1

Where P = Number of predicate nodes (node that contains condition)

You might also like