Code testing method, electronic device, medium and product

CN122925233APending Publication Date: 2026-10-16HUBEI TIANRONGXIN NETWORK SECURITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611130216.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]鉴于上述问题,本申请提供一种代码测试方法、电子设备、可读存储介质及计算机程序产品,能够解决现有测试方法测试覆盖不完整、测试用例维护成本高,且代码测试的准确性和可靠性低的问题

Benefits of technology

[0015] In the above technical solution, the method can realize an automated closed loop from problem identification to code repair. The adjudicating agent accurately locates the problem and provides modification suggestions, which are then efficiently executed by the master control agent. This effectively reduces human intervention and improves the efficiency and accuracy of code repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122925233A_ABST
    Figure CN122925233A_ABST
Patent Text Reader

Abstract

The application discloses a code testing method, an electronic device, a medium and a product. The method comprises the following steps: obtaining a to-be-tested code submitted by a user; performing parallel testing on the to-be-tested code from multiple testing dimensions through multiple heterogeneous testing agents running based on different large language models, to obtain multiple parallel testing reports; performing comprehensive adjudication on the multiple parallel testing reports through an adjudication agent independent of the multiple heterogeneous testing agents, to obtain a final adjudication conclusion; and outputting the multiple parallel testing reports and the to-be-tested code when the final adjudication conclusion is that the code is verified to be correct. The method can eliminate the cognitive limitations of a single model by combining the multi-agent heterogeneous parallel testing and the independent adjudication mechanism, and improve the coverage of code defect detection and the reliability of verification results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a code testing method, electronic device, readable storage medium, and computer program product. Background Technology

[0002] In the software development process, code self-testing is a crucial step for developers to verify the correctness and robustness of code before submission, directly determining the quality baseline of the delivered code. Existing code self-testing methods mainly rely on manually written test cases to perform code coverage and functional verification. For example, methods that generate incremental test cases based on the impact scope analysis of code changes determine the test scope by identifying the program paths affected by changed functions. However, the effectiveness of such methods is limited by the quality of the test cases, making it difficult to cover unforeseen boundary conditions and abnormal scenarios. Furthermore, as the code size increases, the cost of writing and maintaining test cases rises sharply. This testing approach is also singular, lacking multi-dimensional cross-validation capabilities, thus reducing the accuracy and reliability of code testing. Summary of the Invention

[0003] In view of the above problems, this application provides a code testing method, electronic device, readable storage medium, and computer program product, which can solve the problems of incomplete test coverage, high test case maintenance costs, and low accuracy and reliability of code testing in existing testing methods.

[0004] Firstly, this application provides a code testing method, including: Get the code submitted by the user for testing; By using multiple heterogeneous test agents running on different large language models, the code under test is tested in parallel from multiple test dimensions, resulting in multiple parallel test reports. A decision agent, independent of the multiple heterogeneous test agents, comprehensively decides on the multiple parallel test reports to obtain a final decision conclusion. When the final ruling is that the code verification is successful, the multiple parallel test reports and the code to be tested are output.

[0005] In the above technical solution, this method can perform parallel testing of code by introducing multiple heterogeneous test agents running based on different large language models, eliminating the inherent cognitive blind spots of a single model and significantly improving test coverage and defect detection rate. At the same time, by using an adjudicating agent independent of the test agents to make comprehensive decisions, the "testing" and "judgment" are decoupled, effectively avoiding the bias of a single model's judgment and enhancing the accuracy and credibility of test results. Finally, the method of directly outputting the decision when it is passed provides developers with an efficient and reliable code verification mechanism, which can reduce the burden of manual review and improve the quality of code delivery.

[0006] In some implementations, the code under test is tested in parallel from multiple testing dimensions using multiple heterogeneous test agents running based on different large language models, resulting in multiple parallel test reports, including: The code to be tested is copied in a manner that ensures that the content is substantially the same, resulting in multiple copied codes; The multiple copies of code are distributed to multiple heterogeneous test agents; wherein, the heterogeneous test agents are bound to different large language models, and the large language models bound to each heterogeneous test agent have different model architectures, training data distributions and parameter magnitudes. Each heterogeneous test agent has an independent workspace and session context, and the multiple heterogeneous test agents do not share state information and session history with each other. The copied code is tested in parallel from multiple testing dimensions using the multiple heterogeneous test agents, resulting in multiple parallel test reports output by the multiple heterogeneous test agents. The parallel test report includes test dimensions, test cases, test status for each test dimension, detailed description of the problems found, and overall test conclusions, wherein the overall test conclusions are either pass or fail. The testing dimensions include one or more of the following: functional correctness, boundary condition coverage, security vulnerability detection, exception handling, and code style.

[0007] In the above technical solution, the method can effectively eliminate the cognitive bias of a single model evaluation system and the cross interference between test environments, ensuring that each agent can conduct a comprehensive review of the same code from multiple dimensions under completely independent and non-influencing conditions, thereby obtaining comprehensive test results from multiple perspectives and dimensions, and thus significantly improving the ability to discover code defects and the objectivity and credibility of test results.

[0008] In some implementations, the step of using an adjudicating agent independent of the plurality of heterogeneous test agents to comprehensively adjudicate the plurality of parallel test reports and obtain a final adjudication conclusion includes: Independent reasoning instances without historical context are created through a decision agent; wherein the large language model bound to the decision agent is different from the large language model bound to each of the heterogeneous test agents, and the comprehensive capability parameters of the large language model bound to the decision agent are higher than those of the large language models bound to each of the heterogeneous test agents. In the independent inference instance, the test dimensions recorded in the multiple parallel test reports, the test status corresponding to each test dimension, and the overall test conclusion of each parallel test report are obtained. When the overall test conclusion in all the parallel test reports is "pass", a final ruling conclusion that the code verification has passed is generated. If any of the parallel test reports has an overall test conclusion of "failed", a final ruling of "code verification failed" is generated.

[0009] In the above technical solution, the method can ensure the independence and objectivity of the adjudication process and eliminate the potential interference of historical context on the judgment results. At the same time, by using an independent large language model with better comprehensive capabilities for comprehensive adjudication, the authority and accuracy of the judgment can be improved. Furthermore, by strictly controlling the verification standards through a unanimous pass system, the method can effectively filter out possible misjudgments or biases that may exist in a single test agent, thereby significantly improving the reliability and credibility of the code verification conclusions.

[0010] In some embodiments, the method further includes: When the final decision is that the code under test fails the verification, a test report with an overall test conclusion of failure is obtained based on the multiple parallel test reports. The adjudicating agent determines whether the problem recorded in the test report to be judged is a real error; If it is a genuine error, modify the code to be tested according to the test report to obtain the target code; The target code is iteratively tested from multiple test dimensions using the multiple heterogeneous test agents until the iterative decision conclusions corresponding to the multiple iterative test reports are that the code has passed verification or the maximum number of iterations has been reached. When the iterative test stops, if the iterative decision conclusions corresponding to the multiple iterative test reports obtained are that the code verification is passed, then the target code, the iterative test reports of each round, and the iterative decision conclusions of each round are output. When the iterative test stops, if the maximum number of iterations has been reached and the iterative decision conclusions corresponding to the multiple iterative test reports obtained are that the code verification fails, then a manual judgment request is output; wherein, the manual judgment request includes the target code, the iterative test reports of each round, and the iterative decision conclusions of each round.

[0011] In the above technical solution, this method can initiate an automated defect identification and repair closed loop for code that fails verification. The adjudicating agent independently judges the authenticity of the problem and only executes code modification when it is confirmed to be a real error, thereby avoiding ineffective repair of false alarms. At the same time, the modified code automatically enters the iterative testing process, continuously verifying the repair effect through multiple rounds of loops until the code passes verification or reaches the maximum number of iterations. It can also realize the full automation of defect discovery, repair and re-verification. In addition, by setting a maximum number of iterations and introducing a manual judgment mechanism after exceeding the limit, it can ensure that the system has a backup capability in the face of complex problems, and avoid the resource consumption caused by infinite loops, thereby achieving a balance between automation efficiency and system controllability.

[0012] In some implementations, the step of the adjudicating agent determining whether the problem recorded in the test report to be judged is a genuine error includes: Obtain the problem to be determined and its detailed description from the test report to be determined; Using the detailed description of the problem to be determined as input, the adjudicating agent calls the large language model to determine whether the problem to be determined is a real error.

[0013] In the above technical solution, the method can accurately distinguish between real code defects and false alarms, thereby improving the targeting of defect handling and avoiding ineffective repair operations on non-real problems.

[0014] In some implementations, modifying the code to be tested based on the test report to obtain the target code includes: Obtain the problem to be determined and its detailed description as recorded in the test report to be determined; The adjudicating agent generates error details and modification suggestions based on the detailed description. The master control agent modifies the code under test based on the error details and the modification suggestions to obtain the target code.

[0015] In the above technical solution, the method can realize an automated closed loop from problem identification to code repair. The adjudicating agent accurately locates the problem and provides modification suggestions, which are then efficiently executed by the master control agent. This effectively reduces human intervention and improves the efficiency and accuracy of code repair.

[0016] In some implementations, after modifying the code to be tested according to the test report to obtain the target code, the method further includes: The version management module saves a snapshot of the code under test before modification and a snapshot of the target code after modification. The code snapshot before modification and the code snapshot after modification are used for comparison by the adjudicating agent during iterative testing.

[0017] In the above technical solution, the method can provide complete version traceability for the code modification process. By saving the code snapshots before and after the modification and allowing the adjudicating agent to retrieve and compare them in subsequent iterations, it effectively supports the accurate verification of the repair effect and ensures that every modification is traceable and auditable.

[0018] In some embodiments, the method further includes: When the adjudicating agent determines that the problem to be judged is not a real error based on the detailed description of the problem to be judged in the test report to be judged, it generates attention-enhancing prompt information based on the detailed description. The attention-enhancing prompts are associated with the code under test and then redistributed to the multiple heterogeneous test agents. The code to be tested is iteratively tested again from multiple testing dimensions through the multiple heterogeneous test agents until the re-judgment conclusions corresponding to the multiple retest reports are that the code verification is passed or the maximum number of iterations is reached. When the iterative test stops, if the re-adjudication conclusions corresponding to the multiple retest reports obtained are that the code verification is passed, then the code to be tested, the retest reports of each round, and the re-adjudication conclusions of each round are output. When the iterative test stops, if the maximum number of iterations has been reached and the re-adjudication conclusions corresponding to the multiple retest reports are that the code verification fails, a manual judgment request is output; wherein, the manual judgment request includes the code to be tested, the retest reports of each iteration, and the re-adjudication conclusions of each iteration.

[0019] In the above technical solution, the method can effectively handle false alarms during the testing process. When a false alarm occurs, the decision criteria are fed back to each testing agent in the form of attention-enhanced prompts, guiding them to focus on the relevant code locations in subsequent tests, thereby reducing the recurrence of similar false alarms. At the same time, through iterative testing and maximum round limit, processing efficiency is taken into account while ensuring code quality. Furthermore, a manual fallback mechanism is introduced when the automatic process cannot be terminated, ensuring reliable output even in complex scenarios.

[0020] In some implementations, generating attention-enhancing cue information based on the detailed description includes: False alarm information is generated based on the detailed description described above, and the false alarm information is recorded in the false alarm pattern library; wherein, the false alarm information includes the code location involved in the false alarm and the type of false alarm problem; Obtain the reasoning process data generated by the adjudicating agent when determining whether the problem to be judged is a real error; The master control agent generates attention-enhancing prompts based on the false alarm information and the inference process data.

[0021] In the above technical solution, the method can archive false positive cases in a structured manner and generate targeted attention enhancement prompts by combining the reasoning process data of the adjudicating agent. This enables the agent in subsequent tests to improve the judgment accuracy at similar code locations, thereby reducing the recurrence of similar false positives and continuously optimizing the overall testing efficiency of the system.

[0022] In a second aspect, this application provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor running the computer program to cause the electronic device to perform the code testing method described in any one of the first aspects.

[0023] Thirdly, this application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the code testing method described in any one of the first aspects.

[0024] Fourthly, this application provides a computer program product comprising a computer program, which, when executed by a processor, performs the code testing method described in any one of the first aspects.

[0025] The beneficial effects of this application are as follows: By introducing multiple heterogeneous testing agents based on different large language models to conduct parallel and independent testing of the code, the cognitive blind spots of a single model are eliminated, thereby significantly improving test coverage and defect detection rate. At the same time, by establishing an independent adjudicating agent and adopting a unanimous pass system and a new session mechanism, testing and evaluation can be decoupled, thereby effectively identifying and filtering false positives and ensuring the accuracy and authority of the final verification conclusion. Secondly, for false positives, the attention-enhanced redistribution mechanism guides the testing agents to focus on specific code locations, which can also reduce the recurrence of similar false positives. In addition, the system has self-learning and continuous optimization capabilities. By accumulating false positive and false negative patterns through the feedback learning module, it can gradually build behavioral profiles of each agent to assist in subsequent adjudication. Combined with complete modification traceability capabilities, it forms an efficient, reliable, and sustainably evolving code self-testing solution. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart illustrating the code testing method in some embodiments of this application; Figure 2 This is a schematic diagram of the intelligent agent collaboration framework to which the code testing methods in some embodiments of this application are applicable; Figure 3 This is a schematic diagram of the structure of the code testing device in some embodiments of this application; Figure 4 This is a schematic diagram of the structure of an electronic device in some embodiments of this application. Detailed Implementation

[0028] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0030] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more (including two), similarly, "multiple sets" refers to two or more sets (including two sets), and "multiple pieces" refers to two or more pieces (including two pieces) unless otherwise explicitly defined.

[0031] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0032] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0033] In current technologies, code testing mainly relies on manual review or automated testing using a single AI model. However, single models have cognitive blind spots and are prone to systematically missing certain types of defects; at the same time, the lack of an effective false positive detection mechanism forces developers to spend a lot of time verifying whether the problems in the test reports actually exist, resulting in low testing efficiency.

[0034] To address the aforementioned technical issues, this application provides a code testing method. This method aims to: draw upon the design concept of "heterogeneous redundancy combined with multi-model adjudication" in the mimicry defense architecture; introduce multiple heterogeneous large-model-driven test agents to perform parallel and independent testing of the same code, eliminating the cognitive limitations of a single model through differentiated examination from multiple perspectives; simultaneously, establish an independent adjudication mechanism to perform secondary screening of test results, achieving decoupling between testing and evaluation, thereby effectively filtering false positives while ensuring test coverage; and rely on automated repair loops, attention-enhanced retesting, and feedback learning mechanisms to continuously optimize the discrimination accuracy during continuous operation, ultimately constructing a self-aware, self-correcting, and self-evolving code trust verification system.

[0035] like Figure 1 As shown, some embodiments of this application provide a code testing method, which includes: S100: Obtain the code submitted by the user for testing.

[0036] In this embodiment, the executing entity of the method can be a conventional entity such as a code testing system or a code testing platform, or it can be an intelligent entity such as a master intelligent agent.

[0037] In this embodiment, the master control agent (i.e., the master control agent) is the overall controller of the system process. It is responsible for receiving the code to be tested submitted by the developers or generated by the AI ​​agent and storing it in the code storage area.

[0038] In this embodiment, the master agent is also responsible for calling the copy and distribution module to completely copy and distribute the code to each heterogeneous test agent (i.e., SubAgent), receiving the final judgment result returned by the adjudication agent (adjudication agent), determining the subsequent processing strategy based on the judgment result, and recording the code before and after the change through the version management module each time the code is modified.

[0039] S200 uses multiple heterogeneous test agents running on different large language models to perform parallel testing on the code under test from multiple test dimensions, and obtains multiple parallel test reports.

[0040] In this embodiment, the large language model may include any combination of large language models provided by different manufacturers, large language models with different architectures, large language models with different parameter levels, or large language models with different training data distributions.

[0041] In this embodiment, multiple testing dimensions may include one or more of the following: functional correctness, boundary condition coverage, security vulnerability detection, exception handling, and code style.

[0042] In this embodiment, parallel testing refers to each heterogeneous test agent performing independent tests on the code simultaneously in its own independent workspace, using its own bound large language model, without interfering with or communicating with each other.

[0043] In this embodiment, the parallel test report refers to the independent report generated by each heterogeneous test agent after the test is completed; the "multiple" means that each heterogeneous test agent outputs its own report, so the total number of reports is the same as the number of heterogeneous test agents.

[0044] S300: Through an adjudicating agent independent of multiple heterogeneous test agents, a comprehensive adjudication is made on multiple parallel test reports to obtain a final adjudication conclusion.

[0045] In this embodiment, "independent of" means that the adjudicating agent is different from the heterogeneous test agents in terms of role, does not participate in test execution, and is only responsible for evaluating the test report; in terms of model, the large language model bound to the adjudicating agent is different from the large language model bound to the heterogeneous test agents; in terms of session, the adjudicating agent starts a completely new independent inference instance for each adjudication, without carrying any historical session context.

[0046] In this embodiment, comprehensive adjudication refers to the adjudicating agent acquiring the test dimensions recorded in all parallel test reports, the test status corresponding to each test dimension, and the overall test conclusions of each parallel test report, and conducting a comprehensive review and overall judgment on multiple reports.

[0047] In this embodiment, the final decision refers to the conclusion that the code verification passed or failed. When the overall test conclusion of all parallel test reports is "passed", the final decision is that the code verification passed. When the overall test conclusion of any parallel test report is "failed", the final decision is that the code verification failed.

[0048] In this embodiment, when making a comprehensive decision, the adjudicating agent can refer to the historical pattern information stored in the feedback learning module.

[0049] In this embodiment, the feedback learning module is also responsible for experience feedback, that is, when the adjudicating agent makes the next judgment or redistributes instructions, it refers to the historical pattern information stored in the feedback learning module to enhance the accuracy of judgment on specific types of problems and specific SubAgent behaviors.

[0050] S400 When the final decision is that the code verification is passed, output multiple parallel test reports and the code to be tested.

[0051] In this embodiment, multiple parallel test reports refer to the independent test reports output by each heterogeneous test agent. The total number of reports is the same as the number of heterogeneous test agents, and each report is presented in a unified structured format.

[0052] In this embodiment, after the adjudicating agent determines that the self-test has passed, the master control agent outputs code, and the self-test process ends.

[0053] As an optional implementation, when the final ruling is that the code verification passed, the method further includes: Extract the code features or test strategy combinations that have passed the verification in this round of self-testing and record them as success patterns in the feedback and learning module. Successful patterns are used to prioritize matching the corresponding test strategies or increase the initial confidence of the corresponding code features when testing the code under test in subsequent tests.

[0054] In the above embodiments, this method can perform parallel testing of code by introducing multiple heterogeneous test agents running based on different large language models, eliminating the inherent cognitive blind spots of a single model and significantly improving test coverage and defect detection rate. At the same time, by using an adjudicating agent independent of the test agents to make comprehensive decisions, the "testing" and "judgment" are decoupled, effectively avoiding the bias of a single model's judgment and enhancing the accuracy and reliability of test results. Finally, the method of directly outputting the decision when it is passed provides developers with an efficient and reliable code verification mechanism, which can reduce the burden of manual review and improve the quality of code delivery.

[0055] In some embodiments, after step S300, the method may further include: S500 When the final decision is that the code under test fails verification, obtain the test report to be judged based on multiple parallel test reports, where the overall test conclusion is "failed".

[0056] In this embodiment, the test report to be judged refers to the test report selected from all parallel test reports, whose overall test conclusion is "fail". This report contains a detailed description of the problem to be judged, which is used by the adjudicating agent to further determine whether the problem is a real error. When multiple parallel test reports fail, the test report to be judged is a holistic report that integrates the problems to be judged recorded in each report.

[0057] S600: The adjudicating agent determines whether the problem recorded in the test report to be judged is a real error. If yes, proceed to step S700; otherwise, proceed to step S1000.

[0058] In this embodiment, a real error refers to an objective defect or error that is actually present in the code, as confirmed by the adjudicating agent after the problem recorded in the test report is independently judged by the large language model.

[0059] The judgment takes a detailed description of the problem to be judged as input and is independently identified by the adjudicating agent.

[0060] In this embodiment, when there is a test failure report, the adjudication agent first independently determines whether the reported error is genuine.

[0061] S700: Modify the code to be tested according to the test report to obtain the target code.

[0062] In this embodiment, modification refers to the main control agent making targeted code adjustments to the code under test based on the error details and modification suggestions generated by the adjudication agent, in order to eliminate code defects that the adjudication agent has identified as real errors. The adjusted code is the target code.

[0063] As an optional implementation, after step S700, the method further includes: The version management module saves a snapshot of the code under test before modification and a snapshot of the target code after modification. Among them, the code snapshot before modification and the code snapshot after modification are used for the adjudicating agent to retrieve and compare during the adjudication process in iterative testing.

[0064] In this embodiment, the method allows the controlling agent to save snapshots of the code before and after the changes via a version management module before the modifications are completed.

[0065] In this embodiment, the version management module is responsible for recording every modification made to the code by the master agent in the self-test-repair closed loop. The specific recorded content includes the code snapshot before the modification, the code snapshot after the modification, the source of the error report targeted by the modification, and the modification timestamp.

[0066] In this embodiment, the version management module provides the adjudication agent with the ability to trace code changes in subsequent adjudication rounds, enabling the adjudication agent to compare the code before and after the modification and confirm whether the repair is accurate and effective.

[0067] As a further optional implementation, the method also includes: During iterative testing, if the adjudicating agent detects a target defect in the current round of adjudication, and the target defect was not recorded in the parallel test report of the previous round, the target defect is marked as a missed detection mode and stored in the missed detection mode library. In subsequent iterative testing or redistribution, the test focus dimensions or adjudication thresholds for the code under test are adjusted based on the historical records in the miss detection pattern library.

[0068] In this embodiment, the missed detection pattern library refers to the process where, when the master agent modifies the code and redistributes the test, if the adjudication agent discovers a problem in the new round of testing that the sub-agent failed to detect in the previous round, the missed detection pattern is recorded.

[0069] S800 uses multiple heterogeneous test agents to iteratively test the target code from multiple test dimensions until the iterative decision conclusions corresponding to the multiple iterative test reports are that the code has passed verification or the maximum number of iterations has been reached.

[0070] In this embodiment, the method can return the modified target code, re-initiate the self-test, and form an iterative closed loop.

[0071] In this embodiment, the main controller can be the entity that returns the modified target code and re-initiates the self-test.

[0072] In this embodiment, the method supports setting a maximum number of iteration rounds. As an example, the maximum number of iteration rounds is 3 rounds.

[0073] As an optional implementation, this method involves iteratively testing the target code from multiple testing dimensions using multiple heterogeneous testing agents until the iterative decision conclusions corresponding to the multiple iterative test reports indicate that the code verification has passed or the maximum number of iterations has been reached. Specifically, this includes: In each iteration, the adjudicating agent compares the test conclusions of each heterogeneous test agent. If it finds that at least two heterogeneous test agents have inconsistent test conclusions for the same code location, and the inconsistency is repeated a preset number of times in subsequent iterations, the problem is marked as an unresolved dispute and recorded in the dispute problem library.

[0074] S900. When the iterative test stops, if the iterative decision conclusions corresponding to multiple iterative test reports obtained are that the code verification is passed, then output the target code, the iterative test reports of each round, and the iterative decision conclusions of each round; when the iterative test stops, if the maximum number of iterations is reached and the iterative decision conclusions corresponding to multiple iterative test reports obtained are that the code verification is not passed, then output a manual judgment request; wherein, the manual judgment request includes the target code, the iterative test reports of each round, and the iterative decision conclusions of each round.

[0075] In this embodiment, if a unanimous vote is not achieved after exceeding the maximum number of iterations, the method outputs the unresolved disputed issues and the decision records of each round to the developers, requesting manual intervention for judgment.

[0076] In this embodiment, after the adjudicating agent determines that the self-test has passed, the master control agent outputs code, and the self-test process ends.

[0077] As an optional implementation, the method further includes: After iterative testing, the system outputs the target code, iterative test reports for each round, and iterative decision conclusions for each round. It can also output any unresolved disputes.

[0078] The unresolved disputed issue refers to a problem record where, when the preset maximum number of iterations has been reached, the test conclusions of different heterogeneous test agents for the same code location still differ, and the adjudicating agent cannot determine whether the problem is a real error or a false alarm.

[0079] In the above embodiments, the method can initiate an automated defect identification and repair closed loop for code that fails verification. The adjudicating agent independently judges the authenticity of the problem and only executes code modification when it is confirmed to be a real error, thereby avoiding ineffective repair of false alarms. At the same time, the modified code automatically enters the iterative testing process, continuously verifying the repair effect through multiple rounds of loops until the code passes verification or reaches the maximum number of iterations. It can also realize the full automation of defect discovery, repair and re-verification. In addition, by setting a maximum number of iterations and introducing a manual judgment mechanism after exceeding the limit, it can ensure that the system has a backup capability in the face of complex problems, and avoid the resource consumption caused by infinite loops, thereby achieving a balance between automation efficiency and system controllability.

[0080] In some embodiments, after step S600, the method may further include: S1000: When the adjudicating agent determines that the problem to be judged is not a real error based on the detailed description of the problem to be judged in the test report, it generates attention-enhancing prompt information based on the detailed description.

[0081] In this embodiment, the detailed description refers to the content information related to the problem to be judged recorded in the test report, including the code location involved in the problem, the problem type, and a specific description of the problem.

[0082] In this embodiment, attention enhancement prompts refer to prompts generated by the adjudicating agent based on a detailed description, which are used to guide heterogeneous test agents to focus on specific code locations or specific problem types in subsequent tests during redistribution.

[0083] S1100: After associating the attention enhancement prompts with the code under test, redistribute them to multiple heterogeneous test agents.

[0084] In this embodiment, association refers to establishing a correspondence between attention enhancement prompts and the code to be tested, so that each heterogeneous test agent can simultaneously obtain the prompts corresponding to the code when it receives the redistributed code.

[0085] In this embodiment, redistribution refers to sending the code to be tested, which is associated with attention enhancement prompts, back to the workspaces of multiple heterogeneous test agents to start a new round of testing.

[0086] Specifically, this method can issue redistribution instructions to multiple heterogeneous test agents through a master agent, and attach attention-enhancing prompts to the redistribution instructions.

[0087] For example, the adjudication agent can issue a redistribution instruction to the master agent, which includes a prompt message about the specific issue in the redistribution instruction.

[0088] S1200 uses multiple heterogeneous testing agents to iteratively test the code under test from multiple testing dimensions until the re-judgment conclusions corresponding to the multiple retest reports are that the code verification is passed or the maximum number of iterations has been reached.

[0089] In this embodiment, the method supports setting a maximum number of iteration rounds. As an example, the maximum number of iteration rounds is 3 rounds.

[0090] S1300. When the iterative test stops, if the re-judgment conclusions corresponding to the multiple retest reports obtained are that the code verification is passed, then output the code to be tested, the retest reports of each round, and the re-judgment conclusions of each round; when the iterative test stops, if the maximum iteration round is reached and the re-judgment conclusions corresponding to the multiple retest reports obtained are that the code verification is not passed, then output a manual judgment request; wherein, the manual judgment request includes the code to be tested, the retest reports of each round, and the re-judgment conclusions of each round.

[0091] In this embodiment, if a unanimous vote is not achieved after exceeding the maximum number of iterations, the method outputs the unresolved disputed issues and the decision records of each round to the developers, requesting manual intervention for judgment.

[0092] In this embodiment, after the adjudicating agent determines that the self-test has passed, the master control agent outputs code, and the self-test process ends.

[0093] In the above embodiments, the method can effectively handle false alarms during the testing process. When a false alarm occurs, the decision criteria are fed back to each testing agent in the form of attention-enhanced prompts, guiding them to focus on the relevant code locations in subsequent tests, thereby reducing the recurrence of similar false alarms. At the same time, through iterative testing and maximum round limit, processing efficiency is taken into account while ensuring code quality. Furthermore, a manual fallback mechanism is introduced when the automatic process cannot be terminated, ensuring reliable output even in complex scenarios.

[0094] In some embodiments, step S200 may include: S210. Copy the code to be tested in a manner that is substantially consistent with the content, resulting in multiple copies of the code.

[0095] In this embodiment, "substantially consistent content" means that each copied code is completely identical to the code under test in terms of code logic, function, and semantics, and no information loss or semantic change occurs due to the copying process.

[0096] In this embodiment, the number of heterogeneous test agents is N, where N≥3.

[0097] In this embodiment, the method can obtain the code to be tested from the master agent through a replication and distribution module (or an agent specifically used for replication and distribution), and completely copy the code into N copies (N≥3, preferably N=3) in a lossless manner, and send them to N heterogeneous test agents (SubAgents) respectively.

[0098] In this embodiment, the replication and distribution process ensures that the code content received by each SubAgent is completely consistent, and that each SubAgent is unaware of and does not communicate with each other, thus ensuring the independence and isolation of the test.

[0099] S220. Distribute multiple copies of code to multiple heterogeneous test agents; wherein, the heterogeneous test agents are bound to different large language models, and the large language models bound to each heterogeneous test agent have different model architectures, training data distributions and parameter magnitudes. Each heterogeneous test agent has an independent workspace and session context, and the multiple heterogeneous test agents do not share state information and session history with each other.

[0100] In this embodiment, the heterogeneous test agents are unaware of each other and do not communicate with each other.

[0101] In this embodiment, the number of heterogeneous test agents is N (N≥3, preferably 3), and their heterogeneity is reflected in three aspects: heterogeneity of large language model, heterogeneity of working area, and heterogeneity of test dimension.

[0102] In this embodiment, heterogeneous large language models refer to each heterogeneous test agent (SubAgent) being bound to large language models from different manufacturers as inference backends. The large language models bound to each heterogeneous test agent have different model architectures, training data distributions, and parameter magnitudes, thereby maximizing the elimination of cognitive blind spots of a single model.

[0103] In this embodiment, heterogeneous workspace means that each SubAgent has an independent file system workspace and an independent session context. SubAgents do not share any state information, file data or session history, ensuring the independence of test results.

[0104] In this embodiment, heterogeneous testing dimensions refer to each SubAgent testing the code from multiple dimensions, including functional correctness testing, boundary condition testing, exception handling testing, security vulnerability detection, and code style checks.

[0105] S230. Through multiple heterogeneous test agents, the copied code is tested in parallel from multiple test dimensions, resulting in multiple parallel test reports output by the heterogeneous test agents.

[0106] In this embodiment, the parallel test report includes test dimensions, test cases, test status corresponding to each test dimension, detailed description of the problems found, and overall test conclusions, with the overall test conclusions being either a pass or fail status.

[0107] In this embodiment, the testing dimensions include one or more of the following: functional correctness, boundary condition coverage, security vulnerability detection, exception handling, and code style.

[0108] For example, each heterogeneous test agent runs on its own bound large language model, specifically performing parallel testing on the code from multiple testing dimensions such as functional correctness, boundary condition coverage, security vulnerability detection, exception handling, and code style.

[0109] After each heterogeneous test agent completes its test, it generates its own structured test report and sends the report to the adjudication agent in a unified structured format.

[0110] In the above embodiments, the method can effectively eliminate the cognitive bias of a single model evaluation system and the cross-interference between test environments, ensuring that each agent can conduct a comprehensive review of the same code from multiple dimensions under completely independent and non-influencing conditions, thereby obtaining comprehensive test results from multiple perspectives and dimensions, and thus significantly improving the ability to discover code defects and the objectivity and credibility of test results.

[0111] In some embodiments, step S300 may include: S310. Create independent reasoning instances without historical context through the adjudicating agent.

[0112] In this embodiment, the large language model bound to the adjudicating agent is different from the large language models bound to the heterogeneous test agents, and the comprehensive capability parameters of the large language model bound to the adjudicating agent are higher than those of the large language models bound to the heterogeneous test agents.

[0113] In this embodiment, the adjudication agent is a dedicated evaluation agent independent of the master agent and each sub-agent. It uses a large language model with the best comprehensive capabilities, which is different from each sub-agent, as the inference backend to ensure the authority and accuracy of the evaluation.

[0114] In this embodiment, the adjudicating agent starts with a new session and receives all parallel test reports.

[0115] In this embodiment, the adjudication agent starts a completely new session for each adjudication, without carrying any historical session context, thus fundamentally eliminating context pollution and confirmation bias.

[0116] S320. In an independent inference instance, obtain the test dimensions recorded in multiple parallel test reports, the test status corresponding to each test dimension, and the overall test conclusion of each parallel test report.

[0117] In this embodiment, the adjudication agent receives test reports from all N sub-agents, and the main dimensional of the evaluation is functional correctness, that is, whether the problems reported by each sub-agent are real code defects.

[0118] S330. When the overall test conclusion in all parallel test reports is "pass", generate a final decision that the code verification has passed; when the overall test conclusion in any parallel test report is "fail", generate a final decision that the code verification has failed.

[0119] In this embodiment, when all parallel test reports are in the pass state, the adjudicating agent outputs that the self-test has passed, and the process jumps to the code output.

[0120] In this embodiment, when there are failed parallel test reports, the adjudicating agent will independently identify the problems in each report.

[0121] In this embodiment, the adjudication rule adopts a unanimous pass system. Only when all SubAgent's test reports show that they have passed will the adjudication agent output that the self-test has passed. If any SubAgent reports a problem, the error identification and feedback closed-loop process will be entered.

[0122] In the above embodiments, the method can ensure the independence and objectivity of the adjudication process and eliminate the potential interference of historical context on the judgment results. At the same time, by using an independent large language model with better comprehensive capabilities for comprehensive adjudication, the authority and accuracy of the judgment can be improved. Furthermore, by strictly controlling the verification standards through a unanimous pass system, the method can effectively filter out possible misjudgments or biases that may exist in a single test agent, thereby significantly improving the reliability and credibility of the code verification conclusions.

[0123] In some embodiments, step S600 may include: S610. Obtain the problem to be determined and its detailed description from the test report to be determined.

[0124] In this embodiment, the problem to be determined refers to the specific problem item recorded in the test report to be determined, which is discovered and recorded by the heterogeneous test agent during the parallel testing process.

[0125] In this embodiment, the detailed description of the problem to be judged refers to the specific content of the problem to be judged in the test report, including the code location involved in the problem, the type of problem, and a specific description of the problem.

[0126] S620. Taking the detailed description of the problem to be decided as input, the adjudicating agent calls the large language model to determine whether the problem to be decided is a real error.

[0127] In the above embodiments, the method can accurately distinguish between real code defects and false alarms, thereby improving the targeting of defect handling and avoiding ineffective repair operations on non-real problems.

[0128] In some embodiments, step S700 may include: S710. Obtain the problem to be determined and its detailed description as recorded in the test report to be determined.

[0129] In this embodiment, the problem to be determined refers to the specific problem item recorded in the test report to be determined, which is discovered and recorded by the heterogeneous test agent during the parallel testing process.

[0130] In this embodiment, the detailed description of the problem to be judged refers to the specific content of the problem to be judged in the test report, including the code location involved in the problem, the type of problem, and a specific description of the problem.

[0131] S720: The adjudicating agent generates error details and modification suggestions based on the detailed description.

[0132] In this embodiment, if the adjudication agent determines that the error is genuine, it returns the error details and modification suggestions to the master agent.

[0133] In this embodiment, after the adjudicating agent confirms that the problem actually exists, it can send the error details and modification suggestions to the master agent.

[0134] S730: The master control agent modifies the code under test based on the error details and modification suggestions to obtain the target code.

[0135] In this embodiment, the master control agent can modify the code under test based on the error details and modification suggestions.

[0136] In the above embodiments, the method can realize an automated closed loop from problem identification to code repair. The adjudicating agent accurately locates the problem and provides modification suggestions, which are then efficiently executed by the master control agent. This effectively reduces human intervention and improves the efficiency and accuracy of code repair.

[0137] In some embodiments, step S1000 may include: S1010. Generate false alarm information based on the detailed description and record the false alarm information in the false alarm pattern library; wherein, the false alarm information includes the code location involved in the false alarm and the type of false alarm problem.

[0138] In this embodiment, when the adjudicating agent confirms that the problem is a false alarm, it can record the false alarm information to the feedback learning module.

[0139] In this embodiment, if the adjudication agent determines that the report is false (i.e., a false alarm), the false alarm information is recorded in the feedback learning module.

[0140] S1020. Obtain the reasoning process data generated by the adjudicating agent when determining whether the problem to be judged is a real error.

[0141] In this embodiment, the reasoning process data refers to the analysis steps, judgment basis, and intermediate conclusion information generated by the large language model when the adjudicating agent calls the large language model to determine whether the problem to be judged is a real error.

[0142] S1030: The main control agent generates attention-enhancing prompts based on false alarm information and inference process data.

[0143] In this embodiment, the master control agent generates attention-enhancing prompts based on false alarm information and inference process data.

[0144] In this embodiment, the feedback learning module is associated with the adjudication agent and the master control agent, and is responsible for recording and accumulating false alarm patterns and missed alarm patterns during each self-test. The false alarm pattern library is used to record erroneous reports that the adjudication agent determines to be inaccurate.

[0145] In this embodiment, the master agent generates attention-enhancing prompts based on false alarm information and inference process data.

[0146] In the above embodiments, the method can archive false positive cases in a structured manner and generate targeted attention-enhancing prompts by combining the reasoning process data of the adjudicating agent. This enables the agent in subsequent tests to improve the judgment accuracy at similar code locations, thereby reducing the recurrence of similar false positives and continuously optimizing the overall testing efficiency of the system.

[0147] This application also provides the following exemplary process to further illustrate the implementation of the above method in practical applications.

[0148] This exemplary process uses a project under development as an example to illustrate the multi-agent collaborative code self-testing method based on a mimicry defense architecture provided in this application. After module development is completed, the code is distributed to three heterogeneous SubAgents through a replication and distribution module for parallel independent testing. The adjudicating agent makes the judgment, and when a real error is found, the master agent automatically repairs and retests. When a false alarm is encountered, the feedback learning module records the pattern and redistributes the code, ultimately achieving automatic discovery, closed-loop repair, and false alarm filtering of code defects. See also: Figure 2 , Figure 2 A schematic diagram of an agent collaboration framework applicable to this example is shown.

[0149] The specific process is as follows: (1) After the developers complete the module code writing, the main control agent submits the code along with the test requirements description to the code self-testing system.

[0150] (2) After receiving the code, the copy distribution module copies the source code and test requirements into three identical copies and sends them to the independent workspaces of three SubAgents via API calls: SubAgent-A (using the large language model of manufacturer A), SubAgent-B (using the large language model of manufacturer B), and SubAgent-C (using the large language model of manufacturer C).

[0151] Each SubAgent's workspace is isolated from the others, containing an independent file system sandbox and runtime environment.

[0152] (3) After receiving the code, the three SubAgents start the first round of test tasks in parallel in their respective isolated workspaces. They execute test cases with the test dimensions of functional correctness, boundary condition coverage, security vulnerability detection, exception handling and code style respectively.

[0153] (4) After completing the first round of testing, the three SubAgents returned reports respectively: SubAgent-A reports "All test cases passed, no functional defects found"; SubAgent-B reported "Two critical security vulnerabilities discovered"; SubAgent-C reported "1 code readability issue found", while exception handling tests passed.

[0154] (5) The adjudicator agent receives three reports and a copy of the original code in a completely new session (the session ID is regenerated without carrying any historical context) and analyzes them independently using the most powerful large language model (different from the model used by each SubAgent).

[0155] The adjudicator agent reviews each item: a. Confirmed that both issues reported by SubAgent-B are genuine security vulnerabilities; b. Confirm that the bitwise operation readability issue reported by SubAgent-C actually conforms to the relevant protocol standard definition. The code readability issue does not constitute a code defect and is therefore determined to be a false alarm.

[0156] The adjudication agent outputs the adjudication result: The self-test failed, and the details of the two real security vulnerabilities reported by SubAgent-B (vulnerability location, vulnerability description, and remediation suggestions) were sent to the main agent.

[0157] (6) After receiving the error details and repair suggestions from the adjudication agent, the master agent starts the automatic repair process.

[0158] After the fix is ​​completed, the version management module automatically saves a snapshot of the code before and after the modification. The snapshot after modification also saves the hash value and metadata. The snapshot is stored in the version management module's repository.

[0159] (7) The adjudicating agent simultaneously issues a "redistribution" instruction to the controlling agent in response to the false alarm, along with an attention enhancement prompt. The complete content of the prompt is as follows: "During the previous round of self-testing, some SubAgents suspected a potential logical error in the code. After independent analysis by the adjudication agent, the bitwise operation implementation conformed to the standard parsing pattern, was logically correct, and outperformed the alternative solution, thus it was determined to be a false alarm. Please pay close attention to this bitwise operation code segment in the next round of testing to confirm its correctness."

[0160] The notification information is stored in JSON format and includes fields such as triggering SubAgent, issue type, line number, adjudication analysis summary, and redistribution instruction.

[0161] (8) The feedback learning module also records the false alarm event to the false alarm pattern library. The stored record includes the following fields: record ID (automatically generated UUID), report SubAgent, model information, problem category ("code readability"), code pattern ("bitwise expression"), adjudication result ("false alarm"), confidence level, and timestamp.

[0162] This record is used for subsequent self-testing. When the adjudication agent encounters the same sub-agent reporting bitwise operation-related issues again, this pattern record will be automatically retrieved as an auxiliary basis for judgment.

[0163] (9) The master agent will resend the repaired code and attention enhancement prompts to the three sub-agents through the copy and distribution module for a second round of self-testing.

[0164] After receiving the notification, all three SubAgents reported "No issues found" in the next round of testing.

[0165] (10) The adjudication agent receives the second round of three reports in a new session, reviews them independently, confirms that the repair code has passed all test dimensions (functionality, security, exception handling), the repair is effective and has not introduced new problems, and outputs the final adjudication result: "Self-test passed".

[0166] The controlling agent outputs the fixed code along with two rounds of test reports (the first round identifies real vulnerabilities and identifies false alarms, and the second round verifies and confirms the fixes) to the developer's integrated development environment (IDE), thus ending the self-testing process.

[0167] The version management module archives the self-test records of this round to the fix history library, and the feedback learning module updates the statistical information in the false alarm pattern library.

[0168] Some embodiments of this application provide a code testing device, the structural schematic of which is shown below. Figure 3 As shown. It should be understood that this device is related to... Figure 1The method executed in the middle corresponds to the steps involved in the aforementioned method. The specific functions and effects of the device can be found in the description above. To avoid repetition, detailed descriptions are omitted here.

[0169] The code testing device includes: Unit 1410 is used to obtain the code to be tested submitted by the user; Test unit 1420 is used to perform parallel testing on the code under test from multiple test dimensions by multiple heterogeneous test agents running based on different large language models, and to obtain multiple parallel test reports. The adjudication unit 1430 is used to make a comprehensive adjudication of multiple parallel test reports through an adjudication agent that is independent of multiple heterogeneous test agents, and to obtain a final adjudication conclusion. Output unit 1440 outputs multiple parallel test reports and the code to be tested when the final decision is that the code verification is passed.

[0170] In this embodiment, based on the functions described in the above method embodiments, the code testing device may include corresponding functional units to fully implement the method. For details, please refer to the relevant descriptions in the above method embodiments, which will not be repeated here.

[0171] like Figure 4 As shown, this application provides an electronic device 1500, which includes a processor 1501 and a memory 1502. The processor 1501 and the memory 1502 are interconnected and communicate with each other through a communication bus 1503 and / or other forms of connection mechanism (not shown). The memory 1502 stores a computer program that can be executed by the processor 1501. When the computer program is run, the processor 1501 executes the computer program to perform the method in any of the aforementioned optional implementations.

[0172] This application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the method in any of the aforementioned optional implementations.

[0173] The readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0174] This application provides a computer program product, which includes a computer program that, when run by a processor, executes the method in any of the aforementioned optional implementations.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A code testing method, characterized in that, include: Get the code submitted by the user for testing; By using multiple heterogeneous test agents running on different large language models, the code under test is tested in parallel from multiple test dimensions, resulting in multiple parallel test reports. A decision agent, independent of the multiple heterogeneous test agents, comprehensively decides on the multiple parallel test reports to obtain a final decision conclusion. When the final ruling is that the code verification is successful, the multiple parallel test reports and the code to be tested are output.

2. The code testing method according to claim 1, characterized in that, The method involves using multiple heterogeneous test agents running based on different large language models to perform parallel testing on the code under test from multiple testing dimensions, resulting in multiple parallel test reports, including: The code to be tested is copied in a manner that ensures that the content is substantially the same, resulting in multiple copied codes; The multiple copies of code are distributed to multiple heterogeneous test agents; wherein, the heterogeneous test agents are bound to different large language models, and the large language models bound to each heterogeneous test agent have different model architectures, training data distributions and parameter magnitudes. Each heterogeneous test agent has an independent workspace and session context, and the multiple heterogeneous test agents do not share state information and session history with each other. The copied code is tested in parallel from multiple testing dimensions using the multiple heterogeneous test agents, resulting in multiple parallel test reports output by the multiple heterogeneous test agents. The parallel test report includes test dimensions, test cases, test status for each test dimension, detailed description of the problems found, and overall test conclusions, wherein the overall test conclusions are either pass or fail. The testing dimensions include one or more of the following: functional correctness, boundary condition coverage, security vulnerability detection, exception handling, and code style.

3. The code testing method according to claim 1, characterized in that, The step of using an adjudicating agent independent of the multiple heterogeneous test agents to comprehensively adjudicate the multiple parallel test reports and obtain a final adjudication conclusion includes: Independent reasoning instances without historical context are created through a decision agent; wherein the large language model bound to the decision agent is different from the large language model bound to each of the heterogeneous test agents, and the comprehensive capability parameters of the large language model bound to the decision agent are higher than those of the large language models bound to each of the heterogeneous test agents. In the independent inference instance, the test dimensions recorded in the multiple parallel test reports, the test status corresponding to each test dimension, and the overall test conclusion of each parallel test report are obtained. When the overall test conclusion in all the parallel test reports is "pass", a final ruling conclusion that the code verification has passed is generated. If any of the parallel test reports has an overall test conclusion of "failed", a final ruling of "code verification failed" is generated.

4. The code testing method according to claim 1, characterized in that, The method further includes: When the final decision is that the code under test fails the verification, a test report with an overall test conclusion of failure is obtained based on the multiple parallel test reports. The adjudicating agent determines whether the problem recorded in the test report to be judged is a real error; If it is a genuine error, modify the code to be tested according to the test report to obtain the target code; The target code is iteratively tested from multiple test dimensions using the multiple heterogeneous test agents until the iterative decision conclusions corresponding to the multiple iterative test reports are that the code has passed verification or the maximum number of iterations has been reached. When the iterative test stops, if the iterative decision conclusions corresponding to the multiple iterative test reports obtained are that the code verification is passed, then the target code, the iterative test reports of each round, and the iterative decision conclusions of each round are output. When the iterative test stops, if the maximum number of iterations has been reached and the iterative decision conclusions corresponding to the multiple iterative test reports obtained are that the code verification fails, then a manual judgment request is output; wherein, the manual judgment request includes the target code, the iterative test reports of each round, and the iterative decision conclusions of each round.

5. The code testing method according to claim 4, characterized in that, The process of the adjudicating agent determining whether the problem recorded in the test report to be judged is a real error includes: Obtain the problem to be determined and its detailed description from the test report to be determined; Using the detailed description of the problem to be determined as input, the adjudicating agent calls the large language model to determine whether the problem to be determined is a real error.

6. The code testing method according to claim 4, characterized in that, The step of modifying the code to be tested according to the test report to obtain the target code includes: Obtain the problem to be determined and its detailed description as recorded in the test report to be determined; The adjudicating agent generates error details and modification suggestions based on the detailed description. The master control agent modifies the code under test based on the error details and the modification suggestions to obtain the target code.

7. The code testing method according to claim 4, characterized in that, After modifying the code to be tested according to the test report to obtain the target code, the method further includes: The version management module saves a snapshot of the code under test before modification and a snapshot of the target code after modification. The code snapshot before modification and the code snapshot after modification are used for comparison by the adjudicating agent during iterative testing.

8. The code testing method according to claim 4, characterized in that, The method further includes: When the adjudicating agent determines that the problem to be judged is not a real error based on the detailed description of the problem to be judged in the test report to be judged, it generates attention-enhancing prompt information based on the detailed description. The attention-enhancing prompts are associated with the code under test and then redistributed to the multiple heterogeneous test agents. The code to be tested is iteratively tested again from multiple testing dimensions through the multiple heterogeneous test agents until the re-judgment conclusions corresponding to the multiple retest reports are that the code verification is passed or the maximum number of iterations is reached. When the iterative test stops, if the re-adjudication conclusions corresponding to the multiple retest reports obtained are that the code verification is passed, then the code to be tested, the retest reports of each round, and the re-adjudication conclusions of each round are output. When the iterative test stops, if the maximum number of iterations has been reached and the re-adjudication conclusions corresponding to the multiple retest reports are that the code verification fails, a manual judgment request is output; wherein, the manual judgment request includes the code to be tested, the retest reports of each iteration, and the re-adjudication conclusions of each iteration.

9. The code testing method according to claim 8, characterized in that, The step of generating attention-enhancing cue information based on the detailed description includes: False alarm information is generated based on the detailed description described above, and the false alarm information is recorded in the false alarm pattern library; wherein, the false alarm information includes the code location involved in the false alarm and the type of false alarm problem; Obtain the reasoning process data generated by the adjudicating agent when determining whether the problem to be judged is a real error; The master control agent generates attention-enhancing prompts based on the false alarm information and the inference process data.

10. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the code testing method according to any one of claims 1 to 9.

11. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, performs the code testing method according to any one of claims 1 to 9.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, performs the code testing method according to any one of claims 1 to 9.