written 6.8 years ago by | modified 2.8 years ago by |
Subject: Software Engineering
Topic: Testing Stratergies and Tactics
Difficulty: High
written 6.8 years ago by | modified 2.8 years ago by |
Subject: Software Engineering
Topic: Testing Stratergies and Tactics
Difficulty: High
written 6.7 years ago by |
Computing Cyclomatic Complexity: Cyclomatic complexity has a foundation in graph theory and provides us with extremely useful software metric. Complexity is computed in one of the three ways:
The number of regions of the flow graph corresponds to the Cyclomatic complexity.
Cyclomatic complexity, V(G), for a flow graph, G is defined as V (G) = E-N+2P Where E, is the number of flow graph edges, N is the number of flow graph nodes, P is independent component.
Cyclomatic complexity, V (G) for a flow graph, G is also defined as: V (G) = Pie+1 where Pie is the number of predicate nodes contained in the flow graph G.
Graph Matrices:The procedure for deriving the flow graph and even determining a set of basis paths is amenable to mechanization. To develop a software tool that assists in basis path testing, a data structure, called a graph matrix can be quite useful.
A Graph Matrix is a square matrix whose size is equal to the number of nodes on the flow graph. Each row and column corresponds to an identified node, and matrix entries correspond to connections between nodes. The connection matrix can also be used to find the cyclomatic complexity