Fine-grained defect localization method, system and storage medium based on abstract syntax tree path

Through a fine-grained defect localization method based on the abstract syntax tree path, the defective code tokens are accurately located and the repair operations are optimized, which solves the problems of low repair accuracy and efficiency caused by coarse positioning granularity in the existing technology and realizes efficient and accurate defect repair.

CN117035012BActive Publication Date: 2025-09-26NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310868783.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-14
Publication Date
2025-09-26
Estimated Expiration
2043-07-14

AI Technical Summary

Technical Problem

Existing defect location technology can only locate at the code statement or function level, and cannot accurately locate the specific elements of the defect, resulting in low repair accuracy and efficiency.

Method used

A fine-grained defect localization method based on abstract syntax tree paths is adopted. Through training data preprocessing, model training and defect prediction, the operation path is extracted using abstract syntax tree difference technology, and the attention vector is calculated through the encoder-decoder network and pointer network to accurately locate the defect code tokens and repair operations.

Benefits of technology

It achieves defect localization at the code token level, improves repair accuracy and efficiency, and reduces the search space and machine resource consumption of patch generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117035012B_ABST
    Figure CN117035012B_ABST
Patent Text Reader

Abstract

The present invention discloses a fine-grained defect localization method, system, and storage medium based on an abstract syntax tree path. The method comprises: Step S1: training data preprocessing: preprocessing historical patch data to obtain training data that meets model requirements; Step S2: model training: using the training data obtained in Step S1 to train the model to obtain a neural network model; Step S3: defect prediction: for a given defect function, using the model trained in Step S2 to predict the specific defect code token, defect location, and specific operational behavior for repairing the token. The system and storage medium are both implemented based on the above method. The present invention has the advantages of simple principle, wide applicability, and higher efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the technical field of software defect detection, and in particular to a fine-grained defect localization method, system and storage medium based on an abstract syntax tree path. Background Art

[0002] As software scale continues to grow, defects are inevitable. Software defect localization technology is a crucial task and research topic in software debugging. Accurate defect localization not only reduces the workload of developers, but also, as an upstream task for automated defect repair, improving its accuracy can further promote the research and development of automated defect repair.

[0003] Defect localization aims to accurately diagnose the location of defects to facilitate program debugging. Among the many defect localization techniques, the most widely studied is spectrum-based fault localization (SBFL). This technique typically uses the execution traces of successful and failed test cases to identify suspicious code elements (e.g., code lines or methods). The mechanism behind this technique is that if a code element is covered by more failing tests but fewer passing tests, it is more likely to have defects than other code elements. Therefore, researchers usually apply statistical analysis to calculate the probability of defects in code elements and arrange them in descending order of the probability of defects to represent the defect localization results.

[0004] An inherent limitation of the SBFL approach is that executing a code element that fails a test case does not necessarily indicate that the element is responsible for the test failure. To address this issue, practitioners have proposed mutation-based fault localization (MBFL) techniques, which mutate code elements and then examine their impact on test results.

[0005] In recent defect localization research, other practitioners have attempted to incorporate more advanced machine learning techniques to achieve more accurate localization results. For example, using learning-to-rank methods, the results of the different defect localization methods mentioned above can be combined to achieve even more accurate results. Learning-based defect localization techniques first collect historical defect data, then use this data to train a model to obtain a neural network model. This neural network model is then used to perform defect localization.

[0006] Despite a long history of research in defect localization, the most advanced techniques can only locate defects at the granularity of code statements. Consequently, surveys of developers have shown that existing defect localization techniques are not well-received. Studies have found that some assumptions made by automatic debugging techniques (for example, "for developers, checking a single faulty statement is sufficient") do not hold true in practice. Improving existing defect localization techniques so that the results can better assist developers in program development remains a significant challenge.

[0007] As can be seen from the above, existing software defect location technology has the following shortcomings:

[0008] (1) Existing defect localization technologies can only produce function-level or statement-level localization results. Existing defect localization technologies are difficult to locate the specific elements that cause defects. Existing defect localization technologies, due to their coarse localization granularity, can only locate the line of code where the defect occurs, and cannot accurately locate the specific elements that cause the defect.

[0009] (2) Defect repair methods based on existing defect localization technologies have low repair accuracy. Due to the large granularity of defect localization, the search space for patch generation is large, resulting in low repair accuracy. Defect repair methods based on existing defect localization technologies only receive sentence-level localization results as input. For the located defect sentences, fewer correct patches are generated.

[0010] (3) Defect repair methods based on existing defect localization technologies have low repair efficiency. Due to the large granularity of defect localization, the search space for patch generation is large, resulting in a large number of candidate patches and high resource consumption. During the patch verification phase, each candidate patch needs to be verified, which consumes a large amount of machine resources and reduces repair efficiency. Summary of the Invention

[0011] The technical problem to be solved by the present invention is: in response to the technical problems existing in the prior art, the present invention provides a fine-grained defect localization method, system and storage medium based on abstract syntax tree paths with simple principles, wide application range, higher efficiency and accuracy.

[0012] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0013] A fine-grained defect localization method based on an abstract syntax tree path, comprising:

[0014] Step S1: training data preprocessing: preprocess the historical patch data to obtain training data that meets the model requirements;

[0015] Step S2: Model training: using the training data obtained in step S1 to train the model and obtain a neural network model;

[0016] Step S3: Defect prediction: For a given defect function, use the model trained in step S2 to predict the specific defect code token, defect location, and specific operation behavior to repair the token.

[0017] As a further improvement of the method of the present invention: Step S1 includes:

[0018] Step S11: Operation path extraction: For each patch in the training dataset, use the abstract syntax tree difference technique to calculate the code change difference between the defective program and the correct patch at the abstract syntax tree level. Based on the obtained code change difference, the abstract syntax tree path and operation path are extracted. The abstract syntax tree path is the path from the root node to the modified leaf node, and the operation path is the abstract syntax tree path, code tokens, and code transformation operations. The operation path serves as the positive example corresponding to this patch.

[0019] Step S12: For all abstract syntax tree paths pointing to non-defective leaf nodes in each defective method, alternately fill them with "replace", "add", and "delete", so that one abstract syntax tree path derives three operation paths. These newly obtained operation paths serve as negative samples corresponding to this patch.

[0020] As a further improvement of the method of the present invention: Step S2 includes:

[0021] Step S21: encoding the operation path; the operation path consists of a code token, a code token modification operation, and an abstract syntax tree path, and the code token, the code token modification operation, and the abstract syntax tree path are encoded respectively;

[0022] Step S22: Extract features using the encoder-decoder network; assume that there are k input operation paths, namely {op1, op2, ..., op k After encoding each operation path, it is fed into a fully connected layer, and then the features are captured using an LSTM-based encoder-decoder structure.

[0023] Step S23: Obtain output using the pointer network; after obtaining the encoder hidden layer state (e1, ..., e k ) and the decoder hidden layer state (b1, ..., b k ), calculate the attention vector;

[0024] Step S24: Model training: The model is trained using a cross entropy loss function.

[0025] As a further improvement of the method of the present invention: Step S21 includes:

[0026] Step S211: Encoding the code token and the code token modification operation; using different encoding matrices to encode the split code sub-tokens and modification operations respectively. This process is expressed as:

[0027]

[0028] V o =E o (o)

[0029] Among them E t (*) and E o (*) represent different encoding matrices for sub-tokens and modification operations respectively; T s is the sub-token stream of code token t, V t Represents the vector representation of token t, V o A vector representation representing the change operation 0;

[0030] Step S212: encoding the abstract syntax tree path. An abstract syntax tree path is composed of multiple abstract syntax tree nodes. When encoding the abstract syntax tree path, a coding matrix is ​​first used to encode each node, and a bidirectional long short-term memory network is used to encode the entire path. The final output of the neural network is the result of encoding the abstract syntax tree path. The process is expressed as follows:

[0031] V p =LSTM(E p (n1), E p (n2),…,E p (n l ))

[0032] Among them, E p (*) is the embedding matrix used to encode the node, LSTM represents the bidirectional long short-term memory network model used, V p Represents the final vector representation of the abstract syntax tree path p; after obtaining the vector representations of the three parts of the operation path, the vector representations of the three parts are connected together as the vector representation of the operation path [V t ; V p ; V o ].

[0033] As a further improvement of the method of the present invention: the fully connected layer and the LSTM-based encoder-decoder structure in step S22 are expressed as:

[0034] z i =tanh(W in [V t ; Vp ; V o ])

[0035] (e1,…,e k )=LSTM encoder (z1,…,z k )

[0036] (b1,…,b k )=LSTM decoder (e1,…,e k )

[0037] Where W in The dimension is (d t +2d p +d o )×d t The fully connected layer weight matrix, (e1,…,e k ) and (b1,…,b k ) are the hidden layer states of the encoder and decoder respectively.

[0038] As a further improvement of the method of the present invention: the process of calculating the attention vector in step S23 is:

[0039] u j =v T tanh(W1e j +W2b j )

[0040] Among them, j∈(1,…,k), v, W1, W2 are all parameters that need to be learned during the model training process; u j The value of is used as the attention weight of the j-th input:

[0041] p(op j |op1,…,op k )=softmax(u j ))

[0042] The softmax function transforms the vector u=[u1,…,u k ] is normalized to the probability distribution of the input operation path; the final output of the model is a list of operation paths arranged from high to low according to the distribution weight.

[0043] As a further improvement of the method of the present invention: the cross entropy loss function in step S24 is:

[0044]

[0045] where Y op ={1,0} indicates whether the operation path is a positive example, P opis the weight of the operation path output by the model, and Loss is the value of the cross entropy loss function. During the model training process, the adaptive moment estimation method is used to reduce the Loss value in the above formula.

[0046] As a further improvement of the method of the present invention: Step S3 includes:

[0047] Step S31: in a given defective function, extract all abstract syntax tree paths pointing to leaf nodes, and alternately assign each of the three operation operators to each abstract syntax tree path to generate all possible operation paths for the defective method;

[0048] Step S32: Obtain the vector representation of each operation path, and feed the vector representation into the trained model to obtain the prediction result, which is a list of operation paths sorted by weight;

[0049] Step S33: parse the returned prediction result to obtain the predicted defect token, defect location, and code modification operation information required to repair the defect.

[0050] The present invention further provides a fine-grained defect localization system based on an abstract syntax tree path, comprising:

[0051] A training data preprocessing unit is used to preprocess historical patch data to obtain training data that meets the model requirements;

[0052] A model training unit, configured to train a model using the training data obtained by the training data preprocessing unit to obtain a neural network model;

[0053] The defect prediction unit is used to predict the specific defect code token, defect location and specific operation behavior for repairing the token for a given defect function using the model trained by the model training unit.

[0054] The present invention further provides a storage medium storing a computer program for executing the above-mentioned fine-grained defect localization method based on an abstract syntax tree path.

[0055] Compared with the prior art, the advantages of the present invention are:

[0056] 1. The present invention's fine-grained defect localization method, system, and storage medium based on an Abstract Syntax Tree path offer a simple principle, wide applicability, and enhanced efficiency and accuracy. Relying on the Abstract Syntax Tree path, the present invention can precisely locate the AST node where the defect occurs, thereby providing defect localization results at the code token level. In other words, the present invention can precisely locate the AST node where the defect occurs, achieving fine-grained defect localization.

[0057] 2. The present invention's fine-grained defect localization method, system, and storage medium based on abstract syntax tree paths. Based on the defect localization technology proposed in this invention, the designed defect repair method achieves high repair accuracy due to the fine granularity of defect localization and the smaller search space for patch generation. In other words, this invention achieves a high repair accuracy rate, achieving essentially 100% accuracy for repairable defects.

[0058] 3. The fine-grained defect localization method, system, and storage medium based on the abstract syntax tree path of the present invention, based on the defect localization technology proposed in the present invention, and the designed defect repair method, due to the fine granularity of defect localization, have a smaller search space for patch generation, and generate fewer candidate patches, thus achieving higher repair efficiency. In other words, the present invention generates fewer candidate patches, consumes less machine resources, and has higher repair efficiency.

[0059] 4. The difference between the fine-grained defect localization method, system and storage medium based on abstract syntax tree path of the present invention and the existing learning-based defect localization technology is that the current learning-based defect localization technology only learns and locates the code as a text, and the output localization result is only the code statement line, while the localization result output by the present invention is the defect code token. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a schematic flow diagram of the method of the present invention. DETAILED DESCRIPTION

[0061] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] In order to facilitate understanding of the content of the present invention, the present invention first explains the following technical terms:

[0063] Defect location: It is one of the necessary modules of software automatic repair technology, mainly used to locate the location of defects.

[0064] Patch generation: It is the core module of software automatic repair technology, mainly used to modify defective programs and generate patch programs.

[0065] Patch verification: It is one of the necessary modules of software automatic repair technology, mainly used to verify whether the patch program complies with the program's own specifications.

[0066] An abstract syntax tree (AST) is a tree-like data structure used to represent the structure of program code. It converts program code into a tree structure consisting of tree nodes and leaf nodes. Each node represents a grammatical structure in the program and records information such as the type, value, and location of the grammatical structure.

[0067] Code token: It is the smallest grammatical unit in program code, such as keywords, identifiers, operators, separators, etc.

[0068] Pointer Network: It is a simple variant of the attention model. Given an input sequence, the pointer network can learn the probabilistic conditions of the output sequence.

[0069] Bidirectional Long Short-Term Memory Network: A special type of recurrent neural network that can better capture long-range dependencies when processing sequence data.

[0070] like Figure 1 As shown, the fine-grained defect localization method based on the abstract syntax tree path of the present invention includes the following steps:

[0071] Step S1: training data preprocessing: preprocess a large amount of historical patch data to obtain training data that meets the model requirements;

[0072] Step S2: Model training: Use the training data obtained in step S1 to train the model and obtain a neural network model;

[0073] Step S3: Defect prediction: For a given defect function, use the model trained in step S2 to predict the specific defect code token, defect location, and specific operational behavior to repair the token.

[0074] In a specific application example, step S1 may include, but is not limited to, the following process:

[0075] Step S11: Operation path extraction. For each patch in the training dataset, use the abstract syntax tree difference technique (GumTree) to calculate the code change difference between the defective program and the correct patch at the abstract syntax tree level. Based on the obtained difference, the abstract syntax tree path (i.e., the path from the root node to the modified leaf node) and the operation path (i.e., the abstract syntax tree path, code tokens, and code transformation operations) are extracted. This operation path is used as the positive example corresponding to this patch;

[0076] Step S12: For all abstract syntax tree paths pointing to non-defective leaf nodes in each defective method, alternately fill them with "replace", "add", and "delete", so that one abstract syntax tree path derives three operation paths. These newly obtained operation paths serve as negative samples corresponding to this patch.

[0077] In a specific application example, step S2 may include, but is not limited to, the following process:

[0078] Step S21: Operation path encoding. The operation path consists of code tokens, code token modification operations, and abstract syntax tree paths. The code tokens, code token modification operations, and abstract syntax tree paths are encoded respectively.

[0079] Step S22: Extract features using the encoder-decoder network. Assume that there are k input operation paths, namely {op1, op2, ..., op k After encoding each operation path, in order to extract more hidden information, it is input into a fully connected layer, and then the features are captured using the LSTM-based encoder-decoder structure;

[0080] Step S23: Obtain output using the pointer network. After the encoder hidden layer state (e1, ..., e k ) and the decoder hidden layer state (b1, ..., b k ), calculate the attention vector;

[0081] Step S24: Model training: The model is trained using a cross entropy loss function.

[0082] As a preferred embodiment, the specific steps of operating the path encoding in step S21 of the present invention are:

[0083] Step S211: Encoding the code token and the code token modification operation. Different encoding matrices are used to encode the split code sub-tokens and modification operations respectively. This process can be expressed as:

[0084]

[0085] V o =E o (o)

[0086] Among them E t (*) and E o (*) represent different encoding matrices for sub-tokens and modification operations respectively. s is the sub-token stream of code token t, V t The vector representation of token t, V o A vector representation of the change operation o.

[0087] Step S212: Abstract syntax tree path encoding. An abstract syntax tree path consists of multiple abstract syntax tree nodes. When encoding an abstract syntax tree path, a coding matrix is ​​first used to encode each node. Then, to capture the structural features contained in adjacent nodes in the abstract syntax tree path, a bidirectional long short-term memory network (BiLSTM) is used to encode the entire path. The final output of the neural network is the result of encoding the abstract syntax tree path. This process can be expressed as:

[0088] V p =LSTM(E p (n1), E p (n2),…,E p (n l ))

[0089] Among them, E p (*) is the embedding matrix used to encode the node, LSTM represents the bidirectional long short-term memory network model used, V p Represents the final vector representation of the abstract syntax tree path p. After obtaining the vector representations of the three parts of the operation path, the vector representations of the three parts are connected together as the vector representation of the operation path [V t ; V p ; V o ].

[0090] As a preferred embodiment, the fully connected layer and LSTM-based encoder-decoder structure in step S22 of the present invention can be expressed as:

[0091] z i =tanh(W in [V t ; V p ; V o ])

[0092] (e1,…,e k )=LSTM encoder (z1,…,z k )

[0093] (b1,…,b k )=LSTM decoder (e1,…,e k )

[0094] Where W in The dimension is (d t +2d p +d o )×d t The fully connected layer weight matrix, (e1,…,e k ) and (b1,…,b k ) are the hidden layer states of the encoder and decoder respectively.

[0095] As a preferred embodiment, the specific process of calculating the attention vector in step S23 of the present invention is:

[0096] u j =v T tanh(W1e j +W2b j)

[0097] Among them, j∈(1,…,k), v, W1, and W2 are all parameters that need to be learned during the model training process. j The value of is used as the attention weight of the j-th input:

[0098] p(op j |op1,…,op k )=softmax(u j ))

[0099] The softmax function transforms the vector u=[u1,…,u k ] is normalized to the probability distribution of the input operation path. The final output of the model is a list of operation paths sorted from high to low according to the distribution weight.

[0100] As a preferred embodiment, the cross entropy loss function in step S24 of the present invention is:

[0101]

[0102] where Y op ={1,0} indicates whether the operation path is a positive example, P op is the weight of the operation path output by the model, and Loss is the value of the cross-entropy loss function. During model training, the adaptive moment estimation method (Adam) is used to reduce the Loss value in the above formula.

[0103] In a specific application example, step S3 may include, but is not limited to, the following process:

[0104] Step S31: in a given defective function, extract all abstract syntax tree paths pointing to leaf nodes, and alternately assign each of the three operation operators to each abstract syntax tree path, thereby generating all possible operation paths for the defective method;

[0105] Step S32: Obtain a vector representation of each operation path, and feed the vector representation into the trained model to obtain a prediction result (i.e., a list of operation paths sorted by weight);

[0106] Step S33: parse the returned prediction result to obtain the predicted defect token, defect location, and code modification operation information required to repair the defect.

[0107] In the above embodiment, the present invention utilizes code tokens, code token modification operations, and abstract syntax tree paths to construct an operation path in step S2, and the operation path is encoded. The components of the operation path are replaceable. In other embodiments, the present invention may also utilize code tokens, code token modification operations, and code token contexts to construct an operation path.

[0108] The present invention further provides a fine-grained defect localization system based on an abstract syntax tree path, comprising:

[0109] The training data preprocessing unit is used to preprocess a large amount of historical patch data to obtain training data that meets the model requirements;

[0110] A model training unit, configured to train a model using the training data obtained by the training data preprocessing unit to obtain a neural network model;

[0111] The defect prediction unit is used to predict the specific defect code token, defect location and specific operation behavior for repairing the token for a given defect function using the model trained by the model training unit.

[0112] The present invention further provides a storage medium storing a computer program for executing the above-mentioned fine-grained defect localization method based on an abstract syntax tree path.

[0113] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A fine-grained defect localization method based on abstract syntax tree paths, characterized in that: It includes: Step S1: training data preprocessing: preprocess the historical patch data to obtain training data that meets the model requirements; Specifically include: The step S1 comprises: Step S11: Operation path extraction: For each patch in the training dataset, use the abstract syntax tree difference technique to calculate the code change difference between the defective program and the correct patch at the abstract syntax tree level. Based on the obtained code change difference, the abstract syntax tree path and operation path are extracted. The abstract syntax tree path is the path from the root node to the modified leaf node, and the operation path is the abstract syntax tree path, code tokens, and code transformation operations. The operation path serves as the positive example corresponding to this patch. Step S12: For all abstract syntax tree paths pointing to non-defective leaf nodes in each defective method, alternately fill them with "replace", "add", and "delete" operations, so that one abstract syntax tree path derives three operation paths. These newly obtained operation paths serve as negative examples corresponding to this patch; Step S2: Model training: Use the training data obtained in step S1 to train the model to obtain a neural network model; specifically, the following steps are included: The step S2 comprises: Step S21: encoding the operation path; the operation path consists of a code token, a code token modification operation, and an abstract syntax tree path, and the code token, the code token modification operation, and the abstract syntax tree path are encoded respectively; Step S22: Extract features using the encoder-decoder network; assuming that there are k input operation paths, that is, After encoding each operation path, it is input into a fully connected layer, and then the features are captured using an LSTM-based encoder-decoder structure; Step S23: Obtain output using the pointer network; after obtaining the encoder hidden layer state and the decoder hidden state After that, calculate the attention vector; Step S24: Model training: using the cross entropy loss function to train the model; Step S3: Defect prediction: For a given defect function, use the model trained in step S2 to predict the specific defect code token, defect location, and specific operation behavior to repair the token.

2. The fine-grained defect localization method based on abstract syntax tree path according to claim 1 is characterized in that: The step S21 includes: Step S211: Encoding the code token and the code token modification operation; using different encoding matrices to encode the split code sub-tokens and modification operations respectively. This process is expressed as: in and E o (*) represent different encoding matrices for sub-tokens and modification operations respectively; is the sub-token stream of code token t, represents the vector representation of token t, A vector representation representing the change operation o; Step S212: encoding an abstract syntax tree path. An abstract syntax tree path consists of multiple abstract syntax tree nodes. When encoding an abstract syntax tree path, a coding matrix is ​​first used to encode each node, and a bidirectional long short-term memory network is used to encode the entire path. The final output of the neural network is the result of encoding the abstract syntax tree path. This process is expressed as follows: in, is the embedding matrix used to encode nodes, and LSTM represents the bidirectional long short-term memory network model used. Represents the final vector representation of the abstract syntax tree path p; after obtaining the vector representations of the three parts of the operation path, the vector representations of the three parts are connected together as the vector representation of the operation path .

3. The fine-grained defect localization method based on abstract syntax tree path according to claim 1 is characterized in that: The fully connected layer and LSTM-based encoder-decoder structure in step S22 are expressed as: in The dimension is The fully connected layer weight matrix, and are the hidden layer states of the encoder and decoder respectively.

4. The fine-grained defect localization method based on abstract syntax tree path according to claim 1 is characterized in that: The process of calculating the attention vector in step S23 is: in, , , , These are parameters that need to be learned during model training; The value of is used as the attention weight of the j-th input: The softmax function transforms the vector The probability distribution of the operation path normalized to the input; The final output of the model is a list of operation paths arranged from high to low according to distribution weight.

5. The fine-grained defect localization method based on abstract syntax tree path according to claim 1 is characterized in that: The cross entropy loss function in step S24 is: in Indicates whether the operation path is a positive example. is the weight of the operation path output by the model, is the value of the cross entropy loss function; during the model training process, the adaptive moment estimation method is used to reduce the Loss value in the above formula.

6. The fine-grained defect localization method based on an abstract syntax tree path according to any one of claims 1 to 5, characterized in that: The step S3 comprises: Step S31: In a given defective function, extract all abstract syntax tree paths pointing to leaf nodes, and alternately assign each of the three operation operators to each abstract syntax tree path to generate all possible operation paths for the defective method; Step S32: Obtain the vector representation of each operation path, and feed the vector representation into the trained model to obtain the prediction result, which is a list of operation paths sorted by weight; Step S33: parse the returned prediction result to obtain the predicted defect token, defect location, and code modification operation information required to repair the defect.

7. A positioning system based on the fine-grained defect positioning method of the abstract syntax tree path according to any one of claims 1 to 6, characterized in that: include: A training data preprocessing unit is used to preprocess historical patch data to obtain training data that meets the model requirements; A model training unit is used to train the model using the training data obtained by the training data preprocessing unit to obtain a neural network model; The defect prediction unit is used to predict the specific defect code token, defect location and specific operation behavior for repairing the token for a given defect function using the model trained by the model training unit.

8. A storage medium, characterized in that: The storage medium stores a computer program for executing any one of the methods of claims 1 to 6.