0% found this document useful (0 votes)
16 views1 page

Graph Matrix in Software Testing

The document presents a flow graph of a simple program along with its adjacency matrix, where nodes represent code components and arrows show control flow. It calculates the Cyclomatic Complexity (CC) as 2 and identifies two independent paths through the program. The paths are detailed as 1 -> 2 -> 3 -> 6 -> 7 and 1 -> 2 -> 5 -> 6 -> 7.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

Graph Matrix in Software Testing

The document presents a flow graph of a simple program along with its adjacency matrix, where nodes represent code components and arrows show control flow. It calculates the Cyclomatic Complexity (CC) as 2 and identifies two independent paths through the program. The paths are detailed as 1 -> 2 -> 3 -> 6 -> 7 and 1 -> 2 -> 5 -> 6 -> 7.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like