# Can Defect Prediction Be Useful for Coarse-Level Tasks of Software Testing?
## 2 Reviews of Related Works
### Incidence Matrix  
Before summarizing the incidence matrix, we first understand the definitions of graph, undirected or directed graph, and incidence matrix, as shown in Definitions 1-3:  
**Definition 1** (Graph).: _The graph is composed of a finite set of non-empty vertices and a set of edges between vertices, denoted as \(G(V,E)\), where_  
1. \(G\) _represents a graph._
2. \(V\) _is the set of vertices in graph_ \(G\) _(i.e., the vertex set),_ \(V=\{v_{1},v_{2},...,v_{n}\}\)_._
3. \(E\) _is the set of edges in graph_ \(G\) _(i.e., the edge set),_ \(E=\{e_{1},e_{2},...,e_{m}\}\)_._  
**Definition 2** (**Undirected/Directed graph)**.: _If the graph \(G\) that is defined in Definition 1 does not have a directed edge, which means that the edge between the vertices \(v_{i}\) and \(v_{j}\) has no direction, the graph \(G\) is called undirected graph. Otherwise, it is called directed graph, whose edge are called directed edge or arc._  
1. _An undirected edge is expressed as_ \((v_{i},v_{j})\) _or_ \((v_{j},v_{i})\)_._
2. _A directed edge is represented by_ \(<v_{i},v_{j}>\)_, where_ \(v_{i}\)_,_ \(v_{j}\) _are called the arc tail and head, respectively._  
**Definition 3** (**Incidence Matrix)**.: _Let arbitrary graph \(G(V,E)\), where \(h_{ij}\) represents the number of times the vertex \(v_{i}\) is associated with the edge \(e_{j}\). The possible values are 0, 1, 2,..., and the resulting matrix \(H(G)=(h_{ij})_{n\times m}\) is the incidence matrix of graph \(G\)._  
That is, \(H\) is the \(n\times m\) incidence matrix, such that  
\[h_{ij}=\begin{cases}1,\text{if $v_{i}$ is connected to $e_{j}$;}\\ 0,\text{else.}\end{cases} \tag{1}\]  
being \(h_{ij}\) the element in the \(i\)th row and \(j\)th column of matrix \(H\).  
Similarly, for directed graph \(G^{\prime}\), the element \(h^{\prime}_{ij}\) of corresponding incidence matrix \(H^{\prime}\) is denoted as  
\[h^{\prime}_{ij}=\begin{cases}\begin{array}{c}1,\text{if $v_{i}$ is connected to the tail of $e_{j}$;}\\ -1,\text{else if $v_{i}$ is connected to the head of $e_{j}$;}\\ 0,\text{else.}\end{array}\end{cases} \tag{2}\]  
being \(h^{\prime}_{ij}\) the element in the \(i\)th row and \(j\)th column of matrix \(H^{\prime}\).  
Incidence matrix is a graph representation method to represent the relationships between the vertices and edges. Many researchers used the incidence matrix to solve different problems, such as paper [60] for the traffic assignment problem, article [61] for urban development projectsevolution, paper [62] for stability analysis of multi-agent systems, and literature [63] for tracing power flow.  
In ST, coarse-level tasks need to call many functions or other fine-level units to implement the requirement. Therefore, we only take the positive direction of the directed graph. Because changes of high-level functions do less effect on the low-level functions. For example, a high-level function \(T\) calls a low-level function \(F\). When we change the parameters in \(F\), the output from \(F\) usually changes, which leads to the change of \(T\). However, if we change the parameters in \(T\) that are not related to \(F\), the output result of \(F\) will not be affected by \(T\). Thus, in the paper, we define a positive incidence matrix (PIM) \(H^{\prime\prime}\). The related description of is as follows:  
**Definition 4** (Positive Incidence Matrix).: _Let arbitrary graph \(G^{\prime\prime}(V,E)\), where \(h_{ij}^{\prime\prime}\) represents the number of times the vertex \(v_{i}\) is associated with the tail of the edge \(e_{j}\). The possible values are 0, 1, 2,..., and the resulting matrix \(H^{\prime\prime}(G)=(h_{ij})_{n\times m}^{\prime\prime}\) is the positive incidence matrix of graph \(G^{\prime\prime}\)._  
That is, \(H^{\prime\prime}\) is the \(n\times m\) positive incidence matrix, such that  
\[h_{ij}^{\prime\prime}=\begin{cases}1,\text{if $v_{i}$ is connected to the tail of $e_{j}$;}\\ 0,\text{else.}\end{cases} \tag{3}\]  
being \(h_{ij}^{\prime\prime}\) the element in the \(i\)th row and \(j\)th column of matrix \(H^{\prime\prime}\).