A code error positioning method based on variable value sequence
By employing a code error localization method based on variable value sequences, combined with static and dynamic analysis, the problems of low localization accuracy and privacy and security risks in existing technologies are solved. This method achieves efficient and secure code error localization and automatic repair, and is suitable for online programming platforms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies for fault location methods suffer from low accuracy and inefficiency, cannot adapt to the dynamic characteristics of the Python language, and have issues with privacy and security risks and insufficient scenario adaptability. In particular, they cannot handle information sparsity and provide sufficient interpretability in programming education scenarios.
A code error localization method based on variable value sequences is adopted. By retrieving the optimal reference code that matches the code to be corrected, the structural differences and variable correlations are analyzed. Static and dynamic localization agents are used for collaborative analysis, and instrumentation and frequent pattern growth algorithms are combined to output the error location and information.
It improves the accuracy and efficiency of code error location, reduces deployment costs, ensures privacy and security, adapts to the real-time requirements of online programming platforms, and provides interpretable location results, supporting automatic repair and iterative optimization.
Smart Images

Figure CN122432035A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software engineering, specifically a code error localization method based on variable value sequences. Background Technology
[0002] Fault Localization (FL) is a core technology at the intersection of software engineering and programming education. Its development revolves around the evolution of information utilization depth and scenario adaptability, and can be mainly divided into three stages. The first stage is the traditional non-LLM-driven stage, which has formed four core technology families based on spectrum (SBFL), information retrieval (IRFL), mutation (MBFL), and hybrid approaches. This stage focuses on statically typed languages such as Java and uses Defects4J as the experimental benchmark. The technical paradigm is mature, but it has not adapted to the dynamic characteristics of Python and the core characteristics of its code, such as "high proportion of syntax errors, small code size, few test cases, and sparse information," resulting in insufficient localization accuracy and scenario adaptability. The second stage is the LLM-driven stage. Some research relies on closed-source LLMs such as GPT-3.5 / GPT-4 and is limited to dynamic test case input. In recent years, although some research has constructed a two-stage architecture of "space reduction + localization refinement" and applied open-source LLMs such as Llama3-8B to fault localization and supported the fusion of static and dynamic information, a code-specific full-process solution has not yet been formed. The third stage is the exploration stage of intelligent agent workflow. The "information extraction-space reduction-precise positioning" framework was established, represented by the modular design of FlexFL. However, industrial-grade methods are difficult to adapt to the special characteristics of student programs, and the adaptation to the dynamic typing characteristics and code error characteristics of Python is still in its infancy.
[0003] Existing technologies suffer from numerous defects and shortcomings: In traditional fault location methods, static methods lack runtime dynamic information, resulting in extremely low location accuracy; dynamic methods such as SBFL are prone to "sususpicion level" and depend on test suite quality; MBFL has high time overhead and suffers from "mutant bias"; IRBL has coarse location granularity and low efficiency; and traditional methods have limited support for the Python language. LLM-based methods face a dual dilemma: high cost, difficult deployment, privacy and security risks, insufficient scenario adaptability, and insufficient performance of open-source LLMs. Specialized technologies suffer from poor versatility, require significant resources, neglect human-computer collaboration, and are excessively time-consuming. For student scenarios, existing technologies cannot handle information sparsity, have insufficient interpretability of location results, fail to balance pedagogical and tool-like aspects, pose privacy risks, and lack a complete closed-loop process. These problems lead to low accuracy and inefficiency in code error location, making it difficult to meet the actual needs of programming education scenarios. Summary of the Invention
[0004] The purpose of this invention is to provide a code error localization method based on variable value sequences, comprising the following steps:
[0005] Step 1) Retrieve the best reference code that matches the code to be corrected from the existing correct submissions for the current programming problem;
[0006] Step 2) Analyze the structural differences between the code to be corrected and the optimal reference code to form an initial list of suspected errors;
[0007] Analyze the correlation between variables in the code to be corrected and the optimal reference code to form a list of key variables;
[0008] Step 3) Use a static localization agent to perform static suspicion list cause analysis on the initial suspicion list and key variable list to form a static suspicion list;
[0009] Step 4) Based on the initial list of suspected cases and the list of key variables, design a targeted instrumentation plan;
[0010] Pytest instrumentation and the sys.settrace tool were used to collect dynamic characteristics of error codes and best reference code during execution.
[0011] By comparing the sequence of variable values during the execution process using the frequent pattern growth algorithm, the differences between sequence outliers and sequence variable patterns can be obtained.
[0012] The dynamic localization agent performs dynamic suspicious list analysis based on dynamic features to analyze the differences in control flow between the code to be corrected and the optimal reference code, thus forming a dynamic suspicious list.
[0013] Step 5) The fusion localization agent analyzes the dynamic and static suspicious lists, handles the discrepancies between the dynamic and static suspicious lists through conflict resolution strategies, and outputs the error location and error information of the code to be corrected by combining the differences between sequence outliers and sequence variable patterns.
[0014] Furthermore, in step 1), the step of retrieving the optimal reference code in the correct codebase that matches the code to be corrected includes:
[0015] The Smith-Waterman algorithm is used to calculate text similarity to initially filter candidate code with similar logic;
[0016] The abstract syntax tree is generated using the pycparser tool. Logical node sequences are extracted using depth-first search. The similarity of the abstract syntax trees is calculated, and the candidate code with the highest similarity is used as the optimal reference code.
[0017] The Kuhn-Munkres algorithm was used to complete the functional matching and naming consistency between the code to be corrected and the optimal reference code.
[0018] Furthermore, before filtering candidate code with similar logic, preprocessing operations are performed on the code to be corrected and the reference code in the correct code library. These preprocessing operations include dead code removal, comment removal, and variable anonymization.
[0019] Furthermore, in step 2), the steps for forming the initial list of suspects include:
[0020] By comparing the code structure differences between the code to be corrected and the optimal reference code using the Levenshtein distance algorithm, the differences in the addition, deletion, and modification of syntax nodes are located, forming an initial list of suspected errors.
[0021] Furthermore, in step 3), the code to be corrected, the optimal reference code, the initial list of suspected errors, and the list of key variables are used as inputs to the static localization agent. Relying on the code semantic understanding and structural analysis capabilities of the large language model, the agent reasoning and judging the differences in code syntax nodes, the logic of variable usage, and the suspicious code areas, outputting a static list of suspected errors, and simultaneously providing an analysis of the error causes corresponding to each static suspected variable.
[0022] Furthermore, in step 4), the dynamic feature is the suspiciousness of each code element in the program, i.e., the SBFL feature;
[0023] The SBFL feature is calculated using any one of the formulas (1)-(3);
[0024] (1)
[0025] (2)
[0026] (3)
[0027] In the formula, The number of times the statement was executed and the test failed. This represents the number of tests that failed even though the statement was not executed. The number of times the statement was executed and the test was successful. This represents the number of tests that succeeded without executing the statement. This is a feature of SBFL;
[0028] Frequent pattern growth algorithm refers to extracting frequent change patterns in variable value sequences and detecting mutation values in reference sequences;
[0029] The dynamic agent takes four types of information as input: error code, execution result, control flow difference, and SBFL characteristics. It combines dynamic execution data reasoning to output a dynamic suspicious list.
[0030] Furthermore, the causes of static suspicious lists include syntactic structure deviations and abnormal variable definitions, while the causes of dynamic suspicious lists include execution path deviations and abnormal coverage.
[0031] Furthermore, in step 5), the static suspicious list and the dynamic suspicious list are integrated using a weighted stock method, namely:
[0032] (4)
[0033] In the formula, For variables The final weighted suspiciousness score, ranging from 0 to 1. ≤1; and, These are static weights and dynamic weights, respectively. ; , These are static suspicion scores and dynamic suspicion scores, respectively.
[0034] Furthermore, after determining the error location and error message in the code to be corrected, the erroneous lines of code are deleted based on the error location and error message, and automatic repair and closed-loop verification are performed until the corrected code passes the verification of all test cases.
[0035] Furthermore, automatic repair and closed-loop verification refer to generating a repair solution using a large language model and filling in the code, verifying the repair effect through all test cases, and if it fails, feeding the verification result back to the fusion positioning agent in step 5) for iterative analysis.
[0036] The technical effects of this invention are undeniable, and the main technical effects of this invention are as follows:
[0037] First, it addresses the challenge of locating code in information-sparse scenarios. Through a two-layer reference code retrieval and variable mapping mechanism combining text and abstract syntax trees (ASTs), it provides a reliable comparison benchmark for code information-sparse scenarios, effectively resolving semantic alignment issues caused by inconsistent variable naming and improving location accuracy.
[0038] Second, it improves positioning accuracy and efficiency. The three-agent collaborative architecture enables efficient collaboration of static and dynamic information, and word-level fine-grained positioning breaks through the accuracy bottleneck of traditional methods; the targeted instrumentation scheme reduces data redundancy, and the lightweight open-source LLM deployment shortens the average positioning time, adapts to the real-time requirements of online programming platforms, and significantly improves Top-1 accuracy in weak test suite scenarios.
[0039] Third, it protects privacy and reduces costs. Deploying based on open-source LLM avoids the data privacy leakage risks of closed-source models, and can be supported by consumer-grade GPUs, significantly reducing the cost of large-scale deployment of educational technology products.
[0040] Fourth, it balances pedagogical and instrumental aspects. The location results are accompanied by step-by-step reasoning about the causes of errors, helping students understand the essence of the errors. This meets the "precise + easy to understand" requirements of programming education, while also reducing the burden of grading and tutoring for teachers and optimizing the allocation of educational resources.
[0041] Fifth, it forms a closed-loop process. The entire process of "retrieval-analysis-location-verification" is covered, supporting automatic repair and iterative optimization. It can cope with extreme scenarios such as "code failing tests" and "multiple faults coexisting", and is adapted to the core technical requirements of online programming platforms such as LeetCode and Blue Bridge Cup practice system.
[0042] Sixth, improve the technical system and its promotional value. The modular intelligent agent design framework and Python scenario adaptation solution are reusable, providing a full-process evaluation benchmark for subsequent researchers. The widespread adoption of open-source privacy-preserving tools helps narrow the educational technology gap and promotes universal access to programming education and educational equity. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the overall technical roadmap of the present invention;
[0044] Figure 2 This is a schematic diagram of the three-agent collaborative architecture of the present invention;
[0045] Figure 3 This is a flowchart of the reference code retrieval and variable mapping process for the present invention. Detailed Implementation
[0046] The present invention will be further described below with reference to embodiments, but it should not be construed that the scope of the present invention is limited to the following embodiments. Various substitutions and modifications made based on ordinary technical knowledge and common practices in the art without departing from the above-described technical concept of the present invention should be included within the scope of protection of the present invention.
[0047] Example 1:
[0048] See Figures 1 to 3 A code error localization method based on variable value sequences includes the following steps:
[0049] Step 1) Retrieve the best reference code that matches the code to be corrected from the existing correct submissions for the current programming problem;
[0050] Step 2) Analyze the structural differences between the code to be corrected and the optimal reference code to form an initial list of suspected errors;
[0051] Analyze the correlation between variables in the code to be corrected and the optimal reference code to form a list of key variables;
[0052] Step 3) Use a static localization agent to perform static suspicion list cause analysis on the initial suspicion list and key variable list to form a static suspicion list;
[0053] Step 4) Based on the initial list of suspected cases and the list of key variables, design a targeted instrumentation plan;
[0054] Pytest instrumentation and the sys.settrace tool were used to collect dynamic characteristics of error codes and best reference code during execution.
[0055] By comparing the sequence of variable values during the execution process using the frequent pattern growth algorithm, the differences between sequence outliers and sequence variable patterns can be obtained.
[0056] The dynamic localization agent performs dynamic suspicious list analysis based on dynamic features to analyze the differences in control flow between the code to be corrected and the optimal reference code, thus forming a dynamic suspicious list.
[0057] Step 5) The fusion localization agent analyzes the dynamic and static suspicious lists, handles the discrepancies between the dynamic and static suspicious lists through conflict resolution strategies, and outputs the error location and error information of the code to be corrected by combining the differences between sequence outliers and sequence variable patterns.
[0058] Example 2:
[0059] The main structure of this embodiment is the same as that of Embodiment 1. Further, in step 1), the step of retrieving the optimal reference code that matches the code to be corrected in the correct code library includes:
[0060] The Smith-Waterman algorithm is used to calculate text similarity to initially filter candidate code with similar logic;
[0061] The abstract syntax tree is generated using the pycparser tool. Logical node sequences are extracted using depth-first search. The similarity of the abstract syntax trees is calculated, and the candidate code with the highest similarity is used as the optimal reference code.
[0062] The Kuhn-Munkres algorithm was used to complete the functional matching and naming consistency between the code to be corrected and the optimal reference code.
[0063] Example 3:
[0064] The main structure of this embodiment is the same as any one of embodiments 1-2. Furthermore, before screening candidate codes with similar logic, preprocessing operations are performed on the code to be corrected and the reference code in the correct code library. The preprocessing operations include dead code removal, comment removal, and variable anonymization.
[0065] Example 4:
[0066] The main structure of this embodiment is the same as any one of embodiments 1-3. Further, in step 2), the step of forming the initial suspicion list includes:
[0067] By comparing the code structure differences between the code to be corrected and the optimal reference code using the Levenshtein distance algorithm, the differences in the addition, deletion, and modification of syntax nodes are located, forming an initial list of suspected errors.
[0068] First, by employing vertical federated learning to collaboratively train a variable importance assessment model using multi-source programming code data while ensuring data privacy and security, we can uncover variable features that are strongly correlated with code errors globally and generate a highly generalizable list of candidate variables. Then, by combining a variable-based fault location method, we analyze the scope, frequency of use, execution trajectory, and fault contribution of variables based on the differences in the AST structure between the code to be corrected and the optimal reference code, and accurately select a list of key variables directly related to the current code error from the candidate variable list.
[0069] Example 5:
[0070] The main structure of this embodiment is the same as any one of embodiments 1 to 4. Further, in step 3), the code to be corrected, the optimal reference code, the initial list of suspected variables and the list of key variables are used as inputs to the static localization agent. The code understanding ability of the large language model is used to output the static list of suspected variables and the causes of the static suspected variables.
[0071] Example 6:
[0072] The main structure of this embodiment is the same as any one of embodiments 1 to 5. Further, in step 4), the dynamic feature is the suspiciousness of each code element in the program, i.e., the SBFL feature.
[0073] SBFL features are calculated using any of the following formulas:
[0074]
[0075]
[0076]
[0077] In the formula, calculate The closer the ratio of the result to the geometric mean is to 1, the greater the suspicion. calculate Enhanced The weighting is more sensitive to elements that have a high number of failed coverage tests. Calculate the ratio of failure rate to success rate.
[0078] The frequent pattern growth algorithm refers to extracting frequent change patterns of variable value sequences (taking 20% or more of the total sequence length, or ≥3 consecutive changes) and detecting mutation values in the reference sequence;
[0079] The dynamic agent takes error codes, execution results, control flow differences, and SBFL features as input, combines them with dynamic execution data reasoning, and outputs a dynamic list of suspicious cases.
[0080] Example 7:
[0081] The main structure of this embodiment is the same as any one of embodiments 1 to 6. Furthermore, the causes of static suspicious lists include syntactic structure deviations and abnormal variable definitions, while the causes of dynamic suspicious lists include execution path deviations and abnormal coverage.
[0082] Example 8:
[0083] The main structure of this embodiment is the same as any one of embodiments 1-7. Further, in step 5), the static suspicious list and the dynamic suspicious list are integrated using a weighted stock method, that is:
[0084]
[0085] In the formula, For variables The final weighted suspiciousness score, ranging from 0 to 1. ≤1; and, These are static weights and dynamic weights, respectively. ; , These are static suspicion scores and dynamic suspicion scores, respectively. and The specific value is determined by the fusion positioning agent, which determines the error type based on the causes of the static and dynamic suspicious lists. Different error types correspond to... and The values are shown in the table below:
[0086]
[0087] Example 9:
[0088] The main structure in this embodiment is the same as any one of embodiments 1 to 8. Further, after determining the error location and error information of the code to be corrected, the error code line is deleted based on the error location and error information of the code to be corrected, and automatic repair and closed-loop verification are performed until all test cases pass the verification.
[0089] Example 10:
[0090] The main structure of this embodiment is the same as any one of embodiments 1 to 9. Furthermore, automatic repair and closed-loop verification refers to generating a repair scheme using a large language model and filling in the code, verifying the repair effect through all test cases, and if it fails, feeding back the verification result to the fusion positioning agent in step 5) for iterative analysis.
[0091] Example 11:
[0092] This invention addresses Python code error localization scenarios by combining static analysis, dynamic execution, and intelligent agent collaboration technologies to construct a complete "retrieval-analysis-localization-verification" solution. The specific technical solution is illustrated below with reference to the accompanying drawings:
[0093] 1. Precise retrieval of similar reference code and variable mapping (combined with...) Figure 3 (This presents the two-layer retrieval mechanism of "text comparison + AST analysis" and the steps, logic, and key modules of Kuhn-Munkres variable mapping.)
[0094] Based on the correct code repository of an online judge (OJ) system, a two-layer retrieval mechanism of "text comparison + variable value sequence comparison" is designed. First, the code and reference code undergo preprocessing such as dead code removal, comment removal, and variable anonymization. The Smith-Waterman algorithm is used to calculate text similarity to initially filter logically similar candidate code. Then, the pycparser tool is used to generate an abstract syntax tree (AST), and depth-first search (DFS) is used to extract the "logical node sequence" to calculate AST similarity, determining the optimal reference code. Finally, the Kuhn-Munkres algorithm is used to achieve variable function matching and name unification, resolving the variable naming inconsistency problem.
[0095] 2. AST divergence detection and key variable extraction
[0096] Based on the AST of the code and the best reference code, the differences in code structure are compared using the Levenshtein distance algorithm to locate differences in the addition, deletion, and modification of syntax nodes, forming an initial list of suspected variables (AST divergences). A multi-dimensional static variable evaluation system is designed, which combines variable usage frequency, scope depth, type complexity, and correlation with output for weighted scoring. The variable association analysis logic of VFL and VarDT is referenced to screen the list of key variables and focus on the code areas related to highly suspicious variables.
[0097] 3. Multi-dimensional dynamic data acquisition and feature extraction
[0098] Based on key variables and AST divergences, a targeted instrumentation scheme was designed. Pytest instrumentation and the sys.settrace tool were used to collect variable value sequences, control flow trajectories, coverage data, and execution results during the test case execution process. In the dynamic feature extraction stage, SBFL formula features (Ochiai, DStar², Tarantula) were calculated to analyze the control flow differences between the code and the reference code. Frequent pattern growth algorithms were used to extract frequent change patterns of variable value sequences, and pattern differences were compared to detect sequence outliers (such as abrupt changes deviating from the reference sequence).
[0099] 4. Multi-agent cooperative error localization mechanism (combined with...) Figure 2 This includes the module composition and interaction relationships of static positioning agents, dynamic positioning agents, and fusion positioning agents, and labels the serial number and name of the core functional modules of each agent.
[0100] A collaborative architecture of "static localization, dynamic localization, and fusion localization" is constructed, with each agent receiving a unique prompt template and incorporating beginner scenario adaptation elements from the StuFLP framework. The static localization agent inputs code pairs, problem descriptions, and AST discrepancies. Leveraging the code understanding capabilities of open-source LLM, it outputs a static suspicious list containing causes such as syntactic structure deviations and variable definition anomalies. The dynamic localization agent inputs test cases, execution results, control flow differences, and SBFL features. Combining dynamic execution data inference, it outputs a dynamic suspicious list containing causes such as execution path deviations and coverage anomalies. The fusion localization agent uses a weighted voting method to integrate the two suspicious lists, combining sequence anomalies and variable pattern differences, and handles discrepancies through conflict resolution strategies, ultimately outputting error localization results accurate to the token level.
[0101] 5. Automatic repair and closed-loop verification (combined) Figure 1 This demonstrates the entire process of "retrieval-analysis-location-verification," covering core aspects such as correct codebase, reference code matching, static analysis, instrumentation monitoring, multi-agent collaborative localization, automatic repair, and closed-loop verification, as well as data flow logic.
[0102] Based on the error location results, delete the erroneous code lines, generate a repair solution using open-source LLM code such as CodeLlama, and populate the code; verify the repair effect through all test cases. If it fails, the verification result is fed back to the fusion localization agent for iterative analysis until all test cases pass, forming a "localization-verification" closed loop.
[0103] The hardware required for this solution can be conventional computer equipment. The lightweight LLM can be deployed on consumer-grade GPUs without the need for special high-end hardware. Data acquisition is implemented using open-source tools such as the Python ast module, pycparser, and Pytest instrumentation. The core algorithms (Smith-Waterman, Levenshtein distance, Kuhn-Munkres, etc.) all have clear engineering implementation paths, and those skilled in the art can implement them according to the instructions.
Claims
1. A code error localization method based on variable value sequences, characterized in that, Includes the following steps: Step 1) Retrieve the best reference code that matches the code to be corrected from the existing correct submissions for the current programming problem; Step 2) Analyze the structural differences between the code to be corrected and the optimal reference code to form an initial list of suspected errors; Analyze the correlation between variables in the code to be corrected and the optimal reference code to form a list of key variables; Step 3) Use a static localization agent to perform static suspicion list cause analysis on the initial suspicion list and key variable list to form a static suspicion list; Step 4) Based on the initial list of suspected cases and the list of key variables, design a targeted instrumentation plan; Pytest instrumentation and the sys.settrace tool were used to collect dynamic characteristics of error codes and best reference code during execution. By comparing the sequence of variable values during the execution process using the frequent pattern growth algorithm, the differences between sequence outliers and sequence variable patterns can be obtained. The dynamic localization agent performs dynamic suspicious list analysis based on dynamic features to analyze the differences in control flow between the code to be corrected and the optimal reference code, thus forming a dynamic suspicious list. Step 5) The fusion localization agent analyzes the dynamic and static suspicious lists, handles the discrepancies between the dynamic and static suspicious lists through conflict resolution strategies, and outputs the error location and error information of the code to be corrected by combining the differences between sequence outliers and sequence variable patterns.
2. The code error localization method based on variable value sequences according to claim 1, characterized in that, Step 1), the step of retrieving the optimal reference code in the correct codebase that matches the code to be corrected, includes: The Smith-Waterman algorithm is used to calculate text similarity to initially filter candidate code with similar logic; The abstract syntax tree is generated using the pycparser tool. Logical node sequences are extracted using depth-first search. The similarity of the abstract syntax trees is calculated, and the candidate code with the highest similarity is used as the optimal reference code. The Kuhn-Munkres algorithm was used to complete the functional matching and naming consistency between the code to be corrected and the optimal reference code.
3. The code error localization method based on variable value sequences according to claim 2, characterized in that: Before filtering candidate code with similar logic, preprocessing operations are performed on the code to be corrected and the reference code in the correct code library. Preprocessing operations include dead code removal, comment removal, and variable anonymization.
4. The code error localization method based on variable value sequences according to claim 1, characterized in that, Step 2), the steps for forming the initial list of suspects include: By comparing the code structure differences between the code to be corrected and the optimal reference code using the Levenshtein distance algorithm, the differences in the addition, deletion, and modification of syntax nodes are located, forming an initial list of suspected errors.
5. The code error localization method based on variable value sequences according to claim 1, characterized in that, In step 3), the code to be corrected, the optimal reference code, the initial list of suspected errors, and the list of key variables are used as inputs to the static localization agent. Relying on the code semantic understanding and structural analysis capabilities of the large language model, the agent reasoning and judging the differences in code syntax nodes, the logic of variable usage, and the suspicious code areas, outputting a static list of suspected errors, and simultaneously providing an error cause analysis corresponding to each static suspected variable.
6. The code error localization method based on variable value sequences according to claim 1, characterized in that, In step 4), the dynamic feature is the suspiciousness of each code element in the program, i.e., the SBFL feature; The SBFL feature is calculated using any one of the formulas (1)-(3); ;(1) ;(2) ;(3) In the formula, The number of times the statement was executed and the test failed. This represents the number of tests that failed even though the statement was not executed. The number of times the statement was executed and the test was successful. This represents the number of tests that succeeded without executing the statement. This is a feature of SBFL; frequently Pattern growth algorithms are used to extract frequent change patterns in variable value sequences and detect abrupt changes in reference sequences. The dynamic agent takes four types of information as input: error code, execution result, control flow difference, and SBFL characteristics. It combines dynamic execution data reasoning to output a dynamic suspicious list.
7. The code error localization method based on variable value sequences according to claim 1, characterized in that: Static suspicious lists are caused by grammatical structure deviations and abnormal variable definitions, while dynamic suspicious lists are caused by execution path deviations and abnormal coverage.
8. The code error localization method based on variable value sequences according to claim 1, characterized in that, In step 5), the static and dynamic suspicious lists are integrated using a weighted stock method, i.e.: ;(4) In the formula, For variables The final weighted suspiciousness score, ranging from 0 to 1. ≤1; and, These are static weights and dynamic weights, respectively. ; , These are static suspicion scores and dynamic suspicion scores, respectively.
9. The code error localization method based on variable value sequences according to claim 1, characterized in that: After identifying the error location and error message in the code to be corrected, the erroneous lines of code are deleted based on the error location and error message. Automatic repair and closed-loop verification are then performed until the corrected code passes the verification of all test cases.
10. The code error localization method based on variable value sequences according to claim 9, characterized in that: Automatic repair and closed-loop verification refers to generating a repair solution using a large language model and filling in the code, verifying the repair effect through all test cases, and if it fails, feeding the verification result back to the fusion positioning agent in step 5) for iterative analysis.