[go: up one dir, main page]

0% found this document useful (0 votes)
25 views12 pages

Graph Matrix in Software Testing

The document discusses the importance of software testing metrics in evaluating the quality, effectiveness, and cost of software projects. It explains how graphs are used to represent various testing elements, such as test completion status and defect status, and introduces the concept of a graph matrix for control flow graphs. Additionally, it describes the connection matrix and provides steps to compute cyclomatic complexity from the control flow graph.

Uploaded by

Hamza Main
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views12 pages

Graph Matrix in Software Testing

The document discusses the importance of software testing metrics in evaluating the quality, effectiveness, and cost of software projects. It explains how graphs are used to represent various testing elements, such as test completion status and defect status, and introduces the concept of a graph matrix for control flow graphs. Additionally, it describes the connection matrix and provides steps to compute cyclomatic complexity from the control flow graph.

Uploaded by

Hamza Main
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Graph matrix in

software testing
Week 11
Description
• Testing the quality, effectiveness, and cost of a software project and processes
is extremely important and without measuring these aspects, the project
development cannot be fully completed. By implementing the practice of
testing these elements, software engineers can ensure that no defects and
errors are left undetected in the system as well as validate its functionality. This
perfection of software testing can be achieved exceptionally by testing software
metrics. Metrics can be defined as the standard of measurement, it is a unit
used for describing and measuring attributes of a particular object or system.
With the assistance of testing metrics, one can easily measure the software
quality and ensure its performance. Graph, which is an integral part of Metrics
in software testing, is used by testers to describe the various testing stages as
well as the reports provided during the process of testing metrics of a software.
Elements represented through
graphs
• Test completion status, defects raised and closed, issue type, work log distribution of
testers per task and more.
• Test execution completion percentage. It represents the total number of test cases
executed.
• The generated detailed summary reports for projects, milestones, plans, and runs are
simplified and presented.
• Depicts number of passed, blocked, and failed test cases. The numbers of cases that
require retesting are also illustrated.
• Testers also use graph metrics in software testing to depict the remaining tests,
remaining efforts, as well as the track the ideal progress.
• The cost and efforts are monitored and represented.
• Represents the defect status provided by priority: critical, high, medium and low.
Graph matrix example
• A graph matrix is a square matrix whose size represents the number
of nodes in the control flow graph. If you do not know what control
flow graphs are, then read this article. Each row and column in the
matrix identifies a node and the entries in the matrix represent the
edges or links between these nodes. Conventionally, nodes are
denoted by digits and edges are denoted by letters.
• Let’s take an example.
• Let’s convert this control flow graph into a graph matrix. Since the graph has 4
nodes, so the graph matrix would have a dimension of 4 X 4. Matrix entries will
be filled as follows :

• (1, 1) will be filled with ‘a’ as an edge exists from node 1 to node 1
• (1, 2) will be filled with ‘b’ as an edge exists from node 1 to node 2. It is
important to note that (2, 1) will not be filled as the edge is unidirectional and
not bidirectional
• (1, 3) will be filled with ‘c’ as edge c exists from node 1 to node 3
• (2, 4) will be filled with ‘d’ as edge exists from node 2 to node 4
• (3, 4) will be filled with ‘e’ as an edge exists from node 3 to node 4
• The graph formed is shown below .
Connection Matrix :
• Connection Matrix :
• A connection matrix is a matrix defined with edges weight. In simple
form, when a connection exists between two nodes of control flow
graph, then the edge weight is 1, otherwise, it is 0. However, 0 is not
usually entered in the matrix cells to reduce the complexity.
• For example, if we represent the above control flow graph as a
connection matrix, then the result would be :
• As we can see, the weight of the edges are simply replaced by 1 and
the cells which were empty before are left as it is, i.e., representing 0.

• A connection matrix is used to find the cyclomatic complexity of the


control graph.
• Although there are three other methods to find the cyclomatic
complexity but this method works well too.
• Following are the steps to compute the cyclomatic complexity:
• Count the number of 1s in each row and write it in the end of the row
• Subtract 1 from this count for each row (Ignore the row if its count is 0)
• Add the count of each row calculated previously
• Add 1 to this total count
• The final sum in Step 4 is the cyclomatic complexity of the control flow
graph
• Let’s apply these steps to the graph above to compute the cyclomatic
complexity.

You might also like