Software fault localization method based on feature intersection and KAN network

The software fault localization method using feature intersection and KAN network addresses the 'curse of dimensionality' by extracting hidden relationships and using a parameterized nonlinear activation function, enabling rapid and accurate defect localization with reduced computational resources.

JP7793247B1Active Publication Date: 2026-01-05HANGZHOU DIANZI UNIV

Patent Information

Application Number
JP2025185703
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2024-11-25
Filing Date
2025-11-04
Publication Date
2026-01-05
Estimated Expiration
2045-11-04

AI Technical Summary

Technical Problem

Conventional feature crossover network methods face the 'curse of dimensionality' problem, leading to increased data sparsity and computational complexity, making it difficult to accurately capture complex high-level feature interactions for defect localization, especially in high-dimensional spaces, and require excessive computational resources, which is unsuitable for critical systems with strict time constraints.

Method used

A software fault localization method using feature intersection and KAN network, which extracts hidden relationships between features through cross-layer operations and employs a parameterized nonlinear activation function to overcome the 'curse of dimensionality', enabling rapid and accurate defect localization with reduced computational demands.

Benefits of technology

The method effectively captures complex high-level feature interactions, achieving performance comparable to or better than conventional techniques with less data, making it suitable for critical tasks with strict time constraints.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007793247000001_ABST
    Figure 0007793247000001_ABST
Patent Text Reader

Abstract

To provide a software fault localization method based on feature intersection and KAN network. The method first extracts different types of features from bug reports and source code files, then uses a crossover layer to crossover and correlate the features and extract hidden relationships between them. Furthermore, by utilizing the KAN network's learning of parameterized nonlinear activation functions, the process of fitting a polynomial function using the feature crossover network is transformed into a process of fitting multiple univariate functions, thereby overcoming the "curse of dimensionality" and more accurately capturing and adapting to complex function changes and complex high-order feature interaction information in defect localization, thereby improving defect localization performance. Finally, the output of the KAN network is input to a fully connected layer to calculate a final similarity score, which is then sorted in descending order based on the final similarity score to obtain the defect localization results.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention belongs to the technical field of data analysis, and relates to software fault localization, and particularly to a software fault localization method based on feature intersection and KAN network. [Background technology]

[0002] Defects are inevitable during software development. As software grows in size and complexity, the frequency and impact of defects also increase. Software defects can cause a series of problems, including system crashes, data loss, and security holes, which not only affect user experience but can also pose serious security risks in critical business scenarios. Therefore, quickly and accurately localizing and repairing software defects has become a key challenge for ensuring software quality and system stability.

[0003] To address this challenge, researchers have proposed various defect localization methods. Among them, defect localization techniques based on information retrieval have proven effective. The core idea of ​​this type of technology is to quantify the similarity between bug reports and source code, sort them based on the similarity value, and find the files most likely to contain defects. In addition, some researchers have further enhanced defect localization by extracting structural and semantic features from bug reports and source code. The similarity is calculated by combining data features with structural and semantic features, thereby improving the localization effect.

[0004] Feature crossover networks are used in defect localization to better capture the interactions and complex relationships between different features. A feature crossover network is a model that obtains nonlinear relationships by constructing combinations between multiple types of features. Its core idea is to generate higher-order features by crossing multidimensional features to obtain more contextual information. A feature crossover network based on a multilayer perceptron (MLP) can automatically learn nonlinear interrelationships between features, eliminating the need for manual design of complex feature crossovers and demonstrating good performance in practical applications. This method utilizes the high learning ability of neural networks to establish high-order nonlinear relationships between different features, thereby improving model performance. Summary of the Invention [Problem to be solved by the invention]

[0005] However, conventional feature crossover network methods also have several significant problems. First, when using a multilayer perceptron as a feature crossover network, the "curse of dimensionality" problem occurs. This means that data sparsity and processing complexity increase exponentially in high-dimensional spaces. This makes it difficult to accurately capture and adapt to complex function changes in high-dimensional spaces, making it difficult to capture complex high-level feature interaction information for defect localization. Furthermore, some advanced methods rely on extracting information such as the structure and semantics of source code and code map structure from bug reports. This requires a large amount of computational resources and time, making them difficult to apply to software systems that require high reliability and fast response, such as financial systems and online servers. Therefore, developing a method for rapid and accurate defect localization using a small amount of information is also an important challenge that must be addressed urgently.

[0006] To overcome the shortcomings of the prior art, the present invention presents a software fault localization method based on feature intersection and KAN network, which cross-correlates different features through the cross-layer, extracts hidden relationships between features, and then uses the parameterized nonlinear activation function of the KAN network for training, thereby solving the "curse of dimensionality" problem and improving the performance of fault localization. [Means for solving the problem]

[0007] A software fault localization method based on feature intersection and KAN network, specifically including the following steps:

[0008] Step 1, we obtain the original bug report b and source code file s and preprocess them to obtain a training dataset.

[0009] Step 2: Extract features for each sample from the training dataset, including VSM-based similarity rVSM(b,s), collaborative filtering score cf(b,s), stack trace score tr(b,s), cyclomatic complexity cc(s), repair frequency ff(b,s), and repair time interval fr(b,s), and combine them through vectorization to obtain the feature vector feature(b,s) of the source code file s.

[0010] Step 3, based on feature intersection and KAN network, calculate the similarity score between bug report b and source code file s.

[0011] s3.1. The feature vector of the sample, feature(b,s), is input to the N successive crossover layers, and feature crossover is performed on the different features of the vector to extract the hidden relationships between the features. The output of the n+1th crossover layer is x n+1 teeth,

[0012]

number

[0013] s3.2, the output of the last crossover layer x N is used as the input crossScore(b,s) of the KAN network, and a parameterized nonlinear activation function is fitted to the objective function by learning it. At the same time, the weights of the KAN network are sparsified using L1 regularization, and pruned based on the sparsification results.

[0014] s3.3, the output result of the KAN network, KAN(b, s), is input to the fully connected layer to obtain the final similarity score fc between the bug report b and the source code file s.

[0015]

number

[0016] Step 4: Sort the source code files in descending order of the final similarity score fc calculated in Step 3. The higher the rank, the higher the possibility that the source code file contains a defect. [Effects of the Invention]

[0017] Compared with the prior art, the present invention has the following beneficial effects:

[0018] 1. The KAN network is used to obtain high-level feature interaction information. Based on the Kolmogorov-Arnold representation theorem, the process of fitting a polynomial function using a feature intersection network is transformed into a process of fitting multiple univariate functions. This solves the "curse of dimensionality" problem by changing the learning of a fixed nonlinear activation function and linear parameters to direct learning of a parameterized nonlinear activation function. It can also more accurately capture and adapt to complex function changes, more accurately capturing complex high-level feature interaction information in defect localization, thereby improving the performance of defect localization.

[0019] 2. By simply using the amount of information in the form of data features, we can achieve results similar to or even better than those of conventional techniques. This means that our method can perform accurate and rapid defect localization with a small amount of information, making it particularly suitable for applications in critical tasks with strict time constraints. [Brief explanation of the drawings]

[0020] [Figure 1] 1 is a schematic diagram of a software fault localization method based on feature intersection and KAN. [Figure 2] FIG. 1 is a diagram illustrating the cross layer configuration. [Figure 3] FIG. 1 is a diagram illustrating the configuration of a KAN network. [Figure 4] This is a diagram of the KAN network after sparsification and pruning. DETAILED DESCRIPTION OF THE INVENTION

[0021] The present invention will now be further described with reference to the drawings.

[0022] As shown in FIG. 1, the software fault localization method based on feature intersection and KAN specifically includes the following steps:

[0023] Step 1,In this embodiment, we take the dataset tomcat as the original bug report b and the source code file s, and first perform preprocessing including text normalization, stop word removal, stemming, etc. to obtain a training dataset.

[0024] s1.1, Text normalization, involves processing all characters of text to unify its format and simplify its content, including converting all text from uppercase to lowercase, removing punctuation marks from text, removing or replacing non-alphabetic characters, and expanding abbreviations to their full spelling.

[0025] S1.2, Stopword Removal, removes common vocabulary such as "the," "is," and "in" that are deemed unnecessary for analytical purposes in text processing, reducing redundant information and leaving vocabulary with greater semantic impact.

[0026] s1.3, Stemming, reduces words to their basic stem forms and removes affixes such as "-ing" and "-ed" so that words with the same root are considered the same word.

[0027] Step 2: Extract features for each sample from the training dataset, including the VSM-based similarity rVSM(b,s), collaborative filtering score cf(b,s), stack trace score tr(b,s), cyclomatic complexity cc(s), repair frequency ff(b,s), and repair time interval fr(b,s), and combine them through vectorization to obtain the sample feature vector feat Obtain ure(b,s).

[0028] s2.1, VSM-based similarity rVSM(b,s) is used to quantify the text similarity between a bug report b and a source code file s. It converts the text into vectors using TF-IDF (Term Frequency-Inverse Document Frequency), and then calculates the cosine similarity in the vector space.

[0029]

number

[0030] s2.2, the collaborative filtering score cf(b,s) is used to quantify the similarity between the text of bug report b and all report digests before(b,s) associated with source code file s that precede bug report b.

[0031]

number

[0032] s2.3, stack trace score tr(b,s), is used to evaluate the correlation between the stack trace information (stack trace) of bug report b and source code file s. The stack trace records the functions and method chains called when the program crashed. Stack frames are usually recorded in a specific format, such as at package_name.class_name.method_name (file_name.java:line_number | Native Method | Unknown Source). file_name.java represents the file name and line number where the defect occurred. These file names are checked against the project file name, and stack frames that do not belong to the project code repository are removed. This allows for the removal of incorrect file names and stack frames from external third-party libraries. Native Method represents methods implemented by the JVM. Such methods do not belong to source files that require localization, so they can be removed directly. Unknown Source represents source files lacking debug information. In Java, the name of a public class is the same as the name of the source file. Therefore, the left side of the stack frame can be checked to see if the class name and project file name match. If a match is found, the class name is used as the file name for the Unknown Source stack frame. After extracting and processing the stack frame information using regular expressions, we assign a score to the rank of each source code file in the stack trace, and calculate the rank rank of source code file s in the stack trace. s The higher the ranking, the more likely it is to contain that defect, and naturally the higher the score.

[0033]

number

[0034] S2.4, cyclomatic complexity cc(s) represents the number of different execution paths that can be created by flow control statements in source code file s, and is a metric for evaluating code complexity and quality. The higher the cyclomatic complexity cc(s), the higher the logical complexity of the code, potentially increasing the risk of potential defects.

[0035]

number

[0036] s2.5, repair frequency ff(b,s) represents the number of times |before(b,s)| that source code file s was repaired before processing the current bug report b. The more repairs there are, the more likely the file is to have problems. Therefore, repair frequency can be used as a reference for assessing whether a source file is likely to contain defects again.

[0037]

number

[0038] s2.6, the repair time interval fr(b,s) represents the inverse of the time between the last repair of source code file s and the current bug report b. The shorter the time interval, the more recently the source file was repaired, and the more likely the defect is still present. Therefore, the larger the inverse of the repair time interval, the higher the probability that the source file will have a problem again.

[0039]

number

[0040] The features obtained by the calculations in s2.7, s2.1 to s2.6 are combined into one to obtain the feature vector feature(b,s) for the source code file s.

[0041]

number

[0042] Step 3, based on feature intersection and KAN network, calculate the similarity score between bug report b and source code file s.

[0043] As shown in Figure 2, the feature vector of a sample, feature(b,s), is input to N successive crossover layers, and feature crossover is performed on different features of the vector to extract hidden relationships between the features. The output of the (n+1)th crossover layer is x n+1 teeth,

[0044]

number

[0045]

number

[0046] As shown in Fig. 3, the output of the last cross layer, crossScore(b, s), is used as the input of the KAN network, and is fitted to the objective function by learning a parameterized nonlinear activation function to obtain high-level feature interaction information.

[0047] The KAN network includes M KAN layers, each of which is a set of one-variable function matrices Φ m ={φ j,i}, and the input dimension is din , the output dimension is d out where m=1,2,...,M, j=1,2,...,d in , i=1,2,...,d out Each φ j,i are trainable univariate functions, parameterized by B-spline curves, and each B-spline curve has learnable parameters. In the m+1th layer, the activation function output value y of the i-th neuron m+1,i is the activation function output value y of all neurons in the previous layer using the activation function. m,j This is the sum calculated as follows:

[0048]

number

[0049] The output of the (m+1)th KAN layer, y m+1 teeth,

[0050]

number

[0051] Finally, the outputs of all KAN layers are combined to form the final output of the KAN network, KAN(b,s).

[0052]

number

[0053] Complex functions are approximated by building a multi-layered B-spline function network. As the depth and complexity of the network increase, the KAN network maintains a dense mesh partition. It does not suffer from the "curse of dimensionality" because it approximates higher-order functions by

[0054] To reduce the model's memory requirements and computational load, L1 regularization is used to increase the sparsity of the KAN network weights, shrinking the weight values ​​to approach zero, improving the model's generalization performance and reducing the risk of overfitting. After sparsification, unnecessary connections and neurons, i.e., those with zero weights, are further removed using pruning techniques, as shown in Figure 4. This allows the KAN network to overcome the "curse of dimensionality" problem in high-dimensional spaces, more accurately capture and adapt to complex function changes, and better capture complex high-level feature interaction information in defect localization.

[0055] s3.3, the output result of the KAN network, KAN(b, s), is input to the fully connected layer to obtain the final similarity score fc between the bug report b and the source code file s.

[0056]

number

[0057] Step 4: Sort the source code files in descending order of the final similarity score fc calculated in Step 3. The higher the rank, the higher the possibility that the source code file contains a defect.

[0058] To verify the effectiveness of our method, we selected the convolutional neural network (CNN) and the feature crossover networks (DCN and ResNet), which have demonstrated excellent performance in the field of feature crossover, and conducted comparative experiments on the tomcat dataset. Top-N, MAP, and MRR were selected as evaluation metrics for the experimental results. Top-N represents the percentage of cases in which the model correctly predicted the rank of a defective file to be within the top N ranks during defect localization. A higher percentage indicates a more effective model. MAP represents the average accuracy of the model's prediction, reflecting the accuracy of the model across the entire rank list. MRR represents the average reverse rank of the first related file predicted by the model in the test set, reflecting the accuracy of localizing the most likely defective file. The results are shown in Table 1.

[0059] [Table 1]

[0060] As can be seen from the results, DCN and ResNet far outperform CNN in all three metrics, Top-N, MAP, and MRR, proving that feature crossover networks can certainly significantly improve the effectiveness of defect localization. On the other hand, compared with the two typical defect localization methods using feature crossover, DCN and ResNet, In comparison, our method shows further improvements in each index, clearly indicating that our method can more accurately capture and adapt to complex function changes in high-dimensional space, thereby finding relevant defective files more accurately and quickly.

[0061] We further compared our method with defect localization methods using different features on the Tomcat dataset, and the results are shown in Table 2. LR and BRTracer use only data features, while LR+WR, DeepLoc, DreamLoc, and BugRadar additionally use structural and semantic features.

[0062] [Table 2]

[0063] Experiments clearly show that our method performs well in defect localization and outperforms most conventional methods. Furthermore, we compare it with DreamLoc, which has the best results, and the iterative training times for both methods are shown in Table 3.

[0064] [Table 3]

[0065] While our method only uses data features, DreamLoc also calculates the structural and semantic correlation between bug reports and source code, which significantly increases the localization time. Therefore, while our method does not differ significantly from DreamLoc in localization performance, it is significantly more efficient in computation and can perform high-precision, rapid defect localization with a small amount of information, making it particularly suitable for applications in critical tasks with strict time constraints.

Claims

1. A software fault localization method based on feature intersection and KAN, specifically comprising: Step 1: obtain a training dataset after obtaining and preprocessing original bug reports b and source code files s; extracting a plurality of data features for each sample from the training dataset, and combining them through vectorization to obtain a feature vector feature(b,s) for the source code file s, wherein the data features of the sample include a VSM-based similarity rVSM(b,s), a collaborative filtering score cf(b,s), a stack trace score tr(b,s), a cyclomatic complexity cc(s), a repair frequency ff(b,s), and a repair time interval fr(b,s); s2.1, the similarity based on VSM is [Equation 1] s2.2, the collaborative filtering score is [Equation 2] where before(b, s) represents all report digests associated with source code file s before bug report b; s2.3, Stack trace score is, [Equation 3] , where stack trace represents stack trace information, and rank s represents the rank of source code file s in the stack trace, s2.4, Cyclomatic complexity is [Equation 4] where E is the number of edges in the code and N is the number of nodes. s2.5, repair frequency is [Equation 5] |before(b,s)| represents the number of times source code file s was repaired before processing the current bug report b; s2.6, the repair time interval is [Equation 6] Step 2, where b.month represents the submission time of bug report b, and last(b,s) represents the time when source code file s was last repaired; The feature vector of the sample, feature(b, s), is input to successive N cross-layers, and the output of the last cross-layer, x N is the input of the KAN network, crossScore(b, s), and finally the output of the KAN network is input to the fully connected layer, and the bug report b and obtaining a final similarity score f c for the source code file s, The crossover layer includes N layers, and is used to perform feature crossover on different features of the feature vector feature(b, s) and extract hidden relationships between the features. The output of the (n+1)th crossover layer is x n+1 teeth, [Equation 7] The KAN network includes M KAN layers, each of which has a set of one-variable function matrices Φ m ={φ j,i }, and the input dimension is d in , the output dimension is d out , m=1,2,...,M, j=1,2,...,d in , i=1,2, . .. .. ,d out and each φ j,i are trainable single-variable functions, and in the m+1th layer, the activation function output value y m+1,i is the activation function output value y of all neurons in the previous layer using the activation function. m,j The calculated sum [Equation 8] and Output y of the (m+1)th KAN layer m+1 teeth, [Equation 9] and The outputs of all the KAN layers are combined to form the final output of the KAN network, KAN(b, s), [Equation 10] [0011] Step 3 and The source code files are sorted in descending order of the final similarity score fc calculated in step 3. The higher the rank, the higher the possibility that the source code file contains a defect.

1. A software fault localization method based on feature intersection and KAN, comprising:

2. The software fault localization method based on feature intersection and KAN according to claim 1, characterized in that the preprocessing in step 1 includes text normalization, stop word removal and stemming.

3. The feature vector of a source code file s is [0012] 2. The software fault localization method based on feature intersection and KAN according to claim 1, wherein:

4. b n The initial value of is set to zero, and W n uses Xavier normal initialization, [0013] dense in is the number of input units, i.e., the number of dimensions of the input received by the current layer, and dense out 2. The software fault localization method based on feature intersection and KAN according to claim 1, characterized in that: is the number of output units, i.e., the number of dimensions output by the current layer.

5. 2. The software fault localization method based on feature intersection and KAN according to claim 1, characterized in that L1 regularization is used to sparsify the weights of the KAN network, shrinking the weight values ​​to approach zero, and then further removing connections or neurons with zero weights by pruning techniques.

Citation Information

Patent Citations

  • Software defect positioning method based on deep neural network

    CN110109835A

  • Software defect positioning method combining sentence embedding and particle swarm optimization algorithm

    CN112286799A

  • Code dependency influenced bug localization

    US20200097387A1

Cited By

  • Defect severity prediction method based on developer modification history

    CN121996563A