# Software Fault Localization Based on SALSA Algorithm
## 3 Proposed Approach
### Sort Suspicious Statements
This operation normalizes the sum of each column to 1, representing the probability distribution of node \(\mathrm{j}\) being linked to, as shown in Equation (2). Note that if \(\sum_{k=1}^{n}\mathrm{W_{kj}}=0\), then \((\mathrm{W^{c}})_{\mathrm{ij}}=0\). \[(\mathrm{W^{c}})_{\mathrm{ij}}=\frac{\mathrm{W_{ij}}}{\sum_{k=1}^{n}\mathrm{W_ {kj}}} \tag{2}\]  
Based on the row-normalized matrix \(\mathrm{W^{r}}\) and the column-normalized matrix \(\mathrm{W^{c}}\) obtained above, we can derive the hub matrix \(\mathrm{H}\) and the authority matrix \(\mathrm{A}\). The hub matrix \(\mathrm{H}\) is composed of the non-zero rows and columns of \(\mathrm{W^{r}}\mathrm{W^{T}}_{\mathrm{c}}\). This matrix represents the transition probabilities from hub nodes to other hub nodes. The authority matrix is composed of the non-zero rows and columns of \(\mathrm{W^{T}}_{\mathrm{c}}\mathrm{W^{r}}\). This matrix represents the transition probabilities from authority nodes to other authority nodes. Where \(\mathrm{W^{T}}_{\mathrm{c}}\) is the transpose of \(\mathrm{W^{c}}\). As shown in Equations (3) and (4). \[\mathrm{H}=\mathrm{W^{r}}\mathrm{W^{T}}_{\mathrm{c}} \tag{3}\]  
\[\mathrm{A}=\mathrm{W^{T}}_{\mathrm{c}}\mathrm{W^{r}} \tag{4}\]  
The SALSA algorithm updates node weights through a random walk, a process that can be seen as an iterative vector update process. At the beginning of the algorithm, the initial weight of each node is taken from the suspicion values obtained in Section 3.1.2, treating the suspicion values of statements as the initial weights of the corresponding nodes. In each iteration, the vector containing node weights is updated according to the transition probability matrix. This process can be viewed as a matrix-vector multiplication. In this paper, we define two vectors, \(\mathrm{h}\) and \(\mathrm{a}\), which represent the initial weights of the hub nodes and authority nodes, respectively. The weight update formula for authority nodes is given by Equation (5). Here, \(\mathrm{a^{(t)}}\) is the current iteration's score vector for the authority nodes, \(\mathrm{H}\) is the hub matrix, and \(\mathrm{a^{(t+1)}}\) is the score vector for the authority nodes in the next iteration. \[\mathrm{a^{(t+1)}}=\mathrm{a^{(t)}}\cdot\mathrm{H} \tag{5}\]  
The weight update formula for hub nodes is given by Equation (6). Here, \(\mathrm{h^{(t)}}\) is the score vector for the hub nodes in the current iteration, \(\mathrm{A}\) is the authority matrix, and \(\mathrm{h^{(t+1)}}\) is the score vector for the hub nodes in the next iteration. \[\mathrm{h^{(t+1)}}=\mathrm{h^{(t)}}\cdot\mathrm{A} \tag{6}\]  
By the aforementioned method, the weights of the nodes are continuously updated until convergence. The final weight vectors will stabilize at a state that includes two scores for each node, reflecting the relative importance of each node as a hub or authority in the fault propagation process. In this paper, it is assumed that the faulty statements are more likely to be the source of fault propagation information. Therefore, the hub scores of nodes are chosen as the suspicion degree of statements, and the hub nodes are ranked.