Graph Matrix Example in STM (Software Testing Methodologies)
This diagram shows a simple program converted into a flow graph and its corresponding adjacency
matrix.
1. Nodes represent different parts of the code (start, decision, assignments, print, end).
2. Arrows indicate the flow of control.
3. The adjacency matrix indicates which node connects to which, using 1s and 0s.
4. Cyclomatic Complexity (CC) = Edges - Nodes + 2 = 6 - 6 + 2 = 2
5. Two independent paths exist:
a) 1 -> 2 -> 3 -> 6 -> 7
b) 1 -> 2 -> 5 -> 6 -> 7