A software defect localization method based on feature crossover and KAN networks.
The software defect localization method using feature crossover and KAN networks addresses the 'curse of dimensionality' by capturing high-order feature interactions, ensuring accurate and efficient defect detection in complex software systems.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- HANGZHOU DIANZI UNIV
- Filing Date
- 2025-11-04
- Publication Date
- 2026-06-04
AI Technical Summary
Conventional feature cross-network methods face the 'curse of dimensionality' issue in high-dimensional spaces, leading to increased complexity and computational resource demands, making them unsuitable for fast and accurate defect localization in complex software systems.
A software defect localization method using feature crossover and KAN networks, which includes preprocessing bug reports and source code, extracting features, and utilizing a KAN network with parameterized nonlinear activation functions to capture high-order feature interactions, and employing L1 regularization and pruning to reduce complexity.
The method effectively addresses the 'curse of dimensionality' by accurately capturing complex feature interactions, reducing computational load, and enabling rapid defect localization with minimal information, suitable for critical systems with strict time requirements.
Smart Images

Figure 2026091809000001_ABST
Abstract
Description
[Technical Field]
[0001] This invention belongs to the field of data analysis technology and relates to software defect localization, and more specifically, to a software defect localization method based on feature crossover and KAN networks. [Background technology]
[0002] In the software development process, the occurrence of defects is unavoidable. As the size and complexity of software increase, the frequency and impact of defects also increase. Software defects can cause a range of problems, including system crashes, data loss, and security vulnerabilities, affecting not only the user experience but also potentially leading to serious security issues in critical business scenarios. Therefore, quickly and accurately localizing and repairing software defects has become a critical challenge in ensuring software quality and system stability.
[0003] To address this challenge, researchers have proposed various defect localization methods. Among these, information retrieval-based defect localization techniques have shown some effectiveness. The core idea of this type of technique is to quantify the similarity between bug reports and source code, sort them based on similarity values, and find the files most likely to contain defects. In addition, some researchers further assist defect localization by extracting structural and semantic features from bug reports and source code, calculating similarity based on a combination of data features and structural / semantic features to enhance the effectiveness of localization.
[0004] Feature crossing networks are used in defect localization to more accurately capture the interactions and complex relationships between different features. A feature crossing network is a model that obtains nonlinear relationships by constructing combinations of multiple types of features. Its core idea is to generate higher-order features by crossing multidimensional features, thereby obtaining more contextual information. Feature crossing networks based on multilayer perceptrons (MLPs) can automatically learn nonlinear interrelationships between features, eliminating the need to manually design complex feature crossings, and have proven effective in practical applications. This method utilizes the high learning ability of neural networks to establish higher-order nonlinear relationships between different features, thereby improving the performance of the model. [Overview of the Initiative] [Problems that the invention aims to solve]
[0005] However, conventional feature cross-network methods also have several significant problems. First, when using a multilayer perceptron as the feature cross-network, there is the problem of the "curse of dimensionality." That is, the sparsity of the data and the complexity of the processing increase rapidly in high-dimensional space, making it difficult to capture and adapt to changes in complex functions with high accuracy in high-dimensional space, and thus difficult to capture complex higher-order feature interaction information in defect localization. In addition, some advanced methods rely on extracting bug reports and information such as the structure, meaning, and code map structure of the source code, which requires a large amount of computational resources and time cost information, 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 to perform defect localization quickly and with high accuracy using a small amount of information is also one of the important issues that needs to be addressed urgently.
[0006] In response to the limitations of conventional technologies, the present invention presents a software defect localization method based on feature crossing and KAN networks. This method solves the "curse of dimensionality" problem and improves defect localization performance by crossing and associating different features using a crossing layer, extracting hidden relationships between features, and further learning using a parameterized nonlinear activation function of the KAN network. [Means for solving the problem]
[0007] A method for localizing defects in software based on feature crossover and KAN networks, which specifically includes the following steps:
[0008] Step 1: Obtain the original bug report b and source code file s, perform preprocessing, and then obtain the training dataset.
[0009] Step 2: From the training dataset, features for each sample are extracted, including the VSM-based similarity score 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). These features are then vectorized and combined to obtain the feature vector feature(b,s) for the source code file s.
[0010] Step 3: Calculate the similarity score between bug report b and source code file s based on feature crossover and the KAN network.
[0011] s3.1, the sample feature vector feature(b,s) is input into N consecutive cross-layers, feature cross-referencing is performed on features with different vectors, and the hidden relationships between features are extracted, and the output x of the (n+1)th cross-layer is obtained. n+1 teeth,
[0012]
number
[0013] s3.2. Output x of the cross layer of the last layer N Take it as the input crossScore(b, s) of the KAN network, fit it to the objective function by learning a parameterized non-linear activation function, and at the same time use L1 regularization to sparsify the weights of the KAN network and perform pruning based on the sparsification result.
[0014] s3.3. Input the output result KAN(b, s) of the KAN network into 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 defects.
Advantages of the Invention
[0017] Compared with the prior art, the present invention has the following beneficial effects.
[0018] 1. Use the KAN network to obtain high-order feature interaction information, and based on the Kolmogorov-Arnold representation theorem, convert the process of fitting a polynomial function by a feature cross network into the process of fitting it to multiple univariate functions. By changing the learning of fixed non-linear activation functions and linear parameters to direct learning of parameterized non-linear activation functions, the problem of the "curse of dimensionality" is solved. Also, it can capture and adapt to the changes of complex functions with higher precision, more accurately obtain the complex high-order feature interaction information in defect localization, thereby improving the performance of defect localization.
[0019] 2. By only using the amount of information called data features, an effect close to or higher than that of the prior art can be obtained. This means that the present method can perform defect localization accurately and quickly with a small amount of information, and is particularly suitable for applications to important operations with strict time requirements.
Brief Description of the Drawings
[0020] [Figure 1] It is a schematic diagram of a software defect localization method based on feature intersection and KAN. [Figure 2] It is a configuration diagram of an intersection layer. [Figure 3] It is a configuration diagram of a KAN network. [Figure 4] It is a configuration diagram of the KAN network after sparsification and pruning.
Embodiments for Carrying Out the Invention
[0021] Hereinafter, the present invention will be further described with reference to the drawings.
[0022] As shown in FIG. 1, a software defect localization method based on feature intersection and KAN, specifically including the following steps.
[0023] Step 1. In this embodiment, taking the dataset tomcat as the original bug report b and the source code file s, first, preprocessing including text normalization, stop word removal, stemming, etc. is performed to obtain a training dataset.
[0024] [[ID=3,7]]s1.1. Text normalization performs processing on all characters of the text, including converting all text from uppercase to lowercase, removing punctuation marks in the text, deleting or replacing non-alphabetic characters, and expanding abbreviations to their official notations, unifying its format and simplifying its content.
[0025] s1.2, stop word removal involves removing common vocabulary such as "the," "is," and "in" that are deemed unnecessary for analysis in text processing, thereby reducing redundant information and retaining vocabulary with significant semantic impact.
[0026] s1.3, Stemming is the process of reducing a word to its basic stem form and removing suffixes such as "-ing" and "-ed" so that words with the same root are considered the same word.
[0027] Step 2: Extract the features of 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). Vectorize these features and combine them to form the sample feature vector feat We obtain ure(b,s).
[0028] s2.1, the VSM-based similarity rVSM(b,s) is used to quantify the text similarity between bug report b and source code file s. It uses TF-IDF (Term Frequency-Inverse Document Frequency) to convert the text into a vector, and then calculates the cosine similarity in 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) related to source code file s prior to bug report b.
[0031]
number
[0032] s2.3, the stack trace score tr(b,s) is used to evaluate the correlation between the stack trace information in bug report b and the source code file s. The above stack trace records the function and method chain called when the program crashed, and the stack frame is 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 a method implemented by the JVM, and such methods do not belong to source files that require localization, so they can be removed directly. Unknown Source represents a source file where debugging information is missing. In Java, the name of a public class and the name of the source file are the same, so it is sufficient to check from the left side of the stack frame whether the class name and the project file name match, and if a match is found, the class name is used as the file name of the Unknown Source stack frame. After extracting and processing stack frame information using regular expressions, a score is assigned to the rank of each source code file in the stack trace, and the rank of source code file s in the stack trace is determined. s The higher a feature is ranked, the more likely it is to contain that defect, and naturally, the higher its score will be.
[0033]
number
[0034] s2.4, Cyclomatic complexity cc(s) represents the number of different execution paths generated by flow control statements in a source code file s, and is an indicator used to evaluate the complexity and quality of code. A higher cyclomatic complexity cc(s) indicates higher logical complexity of the code and a potentially higher risk of potential defects.
[0035]
number
[0036] s2.5, the repair frequency ff(b,s) represents the number of times the source code file s was repaired before processing the current bug report b |before(b,s)|. A higher number of repairs indicates that the file is more likely to have problems. Therefore, the repair frequency can be used as a reference to assess whether the source file is likely to contain defects again.
[0037]
number
[0038] s2.6, the repair time interval fr(b,s) represents the reciprocal of the time between the last repair of source code file s and the current bug report b. A shorter time interval means that the source file was recently repaired, but defects may still exist. Therefore, a larger reciprocal of the repair time interval indicates a higher probability that the source file will have problems again.
[0039]
number
[0040] The features obtained from calculations s2.7 and s2.1 to s2.6 are combined to obtain the feature vector feature(b,s) of the source code file s.
[0041]
number
[0042] Step 3: Calculate the similarity score between bug report b and source code file s based on feature crossover and the KAN network.
[0043] As shown in Figure 2, the sample feature vector feature(b,s) is input to N consecutive cross-layers, feature cross-referencing is performed on features with different vectors, and the hidden relationships between features are extracted, and the output x of the (n+1)th cross-layer is obtained. n+1 teeth,
[0044]
number
[0045]
number
[0046] As shown in Figure 3, in s3.2, the crossScore(b,s) output of the last layer's cross layer is used as input to the KAN network, and the parameterized nonlinear activation function is trained to fit the target function, thereby obtaining higher-order feature interaction information.
[0047] The above KAN network includes M layers of KAN layers, and each KAN layer is a set of single-variable function matrices Φ m ={φ j,i} is defined as and the input dimension is din The output dimension is d out where m = 1, 2, ..., M and j = 1, 2, ..., d in and i = 1, 2, ..., d out Each φ j,i is a trainable univariate function, parameterized by using B-spline curves, and each B-spline curve has learnable parameters. In the (m + 1)-th layer, the activation function output value y m+1,i of the i-th neuron is the sum calculated by using the activation function for the activation function output values y m,j of all neurons in the previous layer.
[0048]
Number
[0049] The output y m+1 of the KAN layer in the (m + 1)-th layer is
[0050]
Number
[0051] Finally, the outputs of all KAN layers are combined to obtain the final output KAN(b, s) of the KAN network.
[0052]
Number
[0053] By constructing a multi-layer B-spline function network, a complex function is approximated. Even when the depth and complexity of the network increase, the KAN network is not affected by the "curse of dimensionality" because it approximates high-order functions by means of a fine mesh division .
[0054] To reduce the model's memory requirements and computational load, L1 regularization is used to increase the sparsity of the KAN network's weights, reducing weight values towards zero, thereby improving the model's generalization performance and reducing the risk of overfitting. After sparsification, unnecessary connections and neurons, i.e., locations with zero weights, are further removed using pruning techniques. As shown in Figure 4, the KAN network solves the "curse of dimensionality" problem in high-dimensional spaces, enabling it to capture and adapt to changes in complex functions with greater accuracy and to more accurately capture complex higher-order feature interaction information in defect localization.
[0055] In s3.3, the output of the KAN network, KAN(b,s), is input to a fully connected layer to obtain the final similarity score fc between the bug report b and the source code file s.
[0056]
number
[0057] In Step 4, the source code files are sorted in descending order of their final similarity score (fc) calculated in Step 3. The higher the rank of a source code file, the more likely it is to contain defects.
[0058] To verify the effectiveness of this method, we selected convolutional neural networks (CNNs) and feature crossing networks (DCNs and ResNets), which demonstrate excellent performance in the field of feature crossing, and conducted comparative experiments with this method on the Tomcat dataset. Top-N, MAP, and MRR were selected as evaluation metrics for the experimental results. Top-N represents the percentage of times the model correctly predicted that the rank of a defective file would be within the top N ranks when defect localization was performed; a higher percentage indicates better model performance. MAP represents the average accuracy of the model during prediction and reflects the model's accuracy across the entire rank list. MRR represents the average inverse rank of the first related file predicted by the model in the test set and reflects the accuracy when localizing the most likely defective file. The results are shown in Table 1.
[0059] [Table 1]
[0060] As the results show, DCN and ResNet far outperformed CNNs in all three metrics—Top-N, MAP, and MRR—proving that feature-crossing networks can reliably enhance the effectiveness of defect localization. On the other hand, compared to DCN and ResNet, two typical types of defect localization methods using feature crossing... In comparison, this method shows further improvements in each metric, clearly demonstrating that it can capture and adapt to changes in complex functions in high-dimensional spaces with greater accuracy, thereby enabling the more accurate and rapid detection of relevant defect files.
[0061] In the Tomcat dataset, this method was further compared with methods that perform defect localization using different features, and the results are shown in Table 2. LR and BRTracer used only data features, while LR+WR, DeepLoc, DreamLoc, and BugRadar used structural and semantic features in addition.
[0062] [Table 2]
[0063] Experiments clearly demonstrated that this method performs well in defect localization and is superior to most conventional methods. Furthermore, the iterative training times for both methods, compared with DreamLoc, which yielded the best results, are shown in Table 3.
[0064] [Table 3]
[0065] While this method uses only data features, DreamLoc further calculates the structural and semantic correlation between bug reports and source code, significantly increasing localization time. Therefore, although this method does not show a significant difference in localization performance compared to DreamLoc, it is remarkably superior in computational efficiency, enabling highly accurate and rapid defect localization with less information, making it particularly suitable for critical tasks with strict time requirements.
Claims
1. A method for localizing software defects based on feature crossover and KAN, specifically, Step 1 involves obtaining the original bug report b and source code file s, performing preprocessing, and then obtaining the training dataset. The steps include extracting multiple data features from each sample in a training dataset, vectorizing and combining them to obtain a feature vector feature(b,s) for a source code file s, wherein the data features of the sample include a VSM-based similarity score rVSM(b,s), a collaborative filtering score cf(b,s), a stack trace score tr(b,s), a cyclomatic complexity score cc(s), a repair frequency ff(b,s), and a repair time interval fr(b,s). s2.1, The similarity based on VSM is, [Math 1] s2.2, the collaborative filtering score is, [Math 2] Therefore, before(b,s) represents all report digests related to source code file s prior to bug report b, s2.3, the stack trace score is, [Math 3] Therefore, stack trace represents stack trace information, and rank s This represents the rank in the stack trace of source code file s, s2.4, Cyclosystem complexity is, [Math 4] Here, E is the number of edges in the code, and N is the number of nodes. s2.5, repair frequency is, [Math 5] And |before(b,s)| represents the number of times source code file s was repaired before the current bug report b was processed. s2.6, The repair time interval is, [Math 6] Step 2, where b. month represents the time bug report b was submitted, and last(b, s) represents the time source code file s was last repaired. The sample feature vector feature(b,s) is input into N consecutive cross-layers, and the output x of the last cross-layer is then used. N The input crossScore(b,s) of the KAN network is used, and finally the output of the KAN network is input to the fully connected layer, and a bug report b is generated. The step is to obtain the final similarity score fc of the source code file s, The aforementioned crossover layer comprises N layers and is used to perform feature crossover on different features of the feature vector feature(b,s) to extract hidden relationships between features, with the output of the (n+1)th crossover layer x n+1 teeth, [Number 7] The KAN network includes M KAN layers, and each KAN layer includes a set of single-variable function matrices Φ m ={φ j,i}, the input dimension is d in , the output dimension is d out , where m = 1, 2,..., M, j = 1, 2,..., d in , i = 1, 2,..., d out , and each φ j,i is a trainable single-variable function. In the (m + 1)-th layer, the activation function output value y m+1,i of the i-th neuron is the sum of the activation function output values y m,j of all neurons in the previous layer calculated using the activation function [Number 8] And, Output y of the m+1th layer KAN layer m+1 teeth, [Number 9] And, The outputs of all KAN layers are combined to form the final output of the KAN network, KAN(b,s). [Number 10] [Math 11] Step 3, Step 3 calculates the final similarity score fc, and the source code files are sorted in descending order. The higher the rank, the more likely the source code file is to contain defects. Step 4 and A method for localizing software defects based on feature crossover and KAN, characterized by including the following:
2. The method for localizing defects in software based on feature crossover 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 source code file s is: [Math 12] A method for localizing defects in software based on feature crossover and KAN as described in claim 1, characterized in that it is the same as described in claim 1.
4. b n The initial value of W is set to zero, n This uses Xavier standard initialization, [Number 13] dense in is the number of input units, i.e., the number of dimensions of the input that the current layer receives, and dense out The method for localizing defects in software based on feature crossover 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. A method for localizing defects in software based on feature crossovers and KAN, as described in claim 1, characterized by sparsifying the weights of a KAN network using L1 regularization, reducing the weight values to approach zero, and then further removing connections or neurons with zero weights by pruning techniques.