|
The Flowgraph depicts logic or control flow
using the following notation.

- Node-represented by a circle and
it represents one or more non-branching procedural statements
or a block scope definitions.
- Edges-represented by arrows and
represent flow of control or logic. An edge must terminate at
a node
To ensure maximum path coverage, we need
enough test cases to ensure that:
- Every statement in a component has been
executed at least once,
- Every decision (branch or case
statement) has been executed on its true and false side.
Any procedural design representation, PDL,
flow charts, box diagrams, except decision tables, can be
translated into a Flowgraph.
Areas bounded by edges and nodes are called
regions. When counting regions, we include the area outside the
graph and count it as a region. a predicate node is a node
having two exit points. The case construct may be expressed as
n-1 predicate nodes where n is the number of action branches in
the case construct.
Next, after obtaining the Flowgraph, we
need to compute the Cyclomatic Complexity of the
Flowgraph
Cyclomatic Complexity
It is denoted by V(G), which is a software
metric that provides a quantitative measure of the logical or
control complexity of an algorithm or program.
It can be determined by the following three
ways:
- Count the regions of the Flowgraph
- Compute V(G) = Edges- Nodes+2
- Add one to number of predicate nodes
Industry studies have indicated that the
higher the V(G), the higher the probability of error.
|