A system and method for intelligent generation of unit test cases

CN122285534BActive Publication Date: 2026-09-11BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610762609.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-09-11
Estimated Expiration
2046-05-29

AI Technical Summary

Technical Problem

[0004]鉴于现有技术的上述缺点、不足,本发明提供一种单元测试用例的智能生成系统和方法,其解决了现有单元测试生成技术在异构工程环境下生成的测试用例与目标工程代码风格不一致导致的无法直接集成使用的技术问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122285534B_ABST
    Figure CN122285534B_ABST
Patent Text Reader

Abstract

The application relates to an intelligent generation system and method of a unit test case, and relates to the technical field of computers.The system comprises a structure perception fine-tuning module configured to perform desemantic desensitization processing on historical unit test cases to obtain training samples, and to perform model optimization on the training samples by adopting a hierarchical masking enhancement strategy; a style retrieval module configured to utilize a structure perception model to perform deep analysis on historical codes to construct a style knowledge base; and in a generation task, a style reference sample is retrieved from the style knowledge base according to the query characteristics of the current code to be tested; a multi-agent collaborative generation module configured to generate a unit test case by cooperating with multiple agents to process the style reference sample; and a feedback and closed loop module configured to incrementally update the generated unit test case to the style knowledge base, thereby significantly reducing the work burden of developers and testers in the test writing and maintenance stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an intelligent system and method for generating unit test cases. Background Technology

[0002] As software systems continue to grow in scale, unit test automatic generation technology based on large language models is increasingly being applied in engineering practice. However, existing methods rely excessively on open-source general data for training. When faced with heterogeneous engineering environments such as internal enterprise private libraries and self-developed frameworks, the lack of awareness of the target project's unique coding style and implicit programming rules results in generated test cases that differ significantly from the native codebase in terms of naming conventions, exception handling logic, and assertion habits. This leads to abrupt code styles, poor readability, and developers need to spend a lot of effort manually modifying them to integrate them into the project. Summary of the Invention

[0003] (a) Technical problems to be solved

[0004] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides an intelligent generation system and method for unit test cases, which solves the technical problem that the test cases generated by the existing unit test generation technology in the heterogeneous engineering environment are inconsistent with the code style of the target project and cannot be directly integrated and used.

[0005] (II) Technical Solution

[0006] To achieve the above objectives, the main technical solutions adopted by the present invention include:

[0007] In a first aspect, embodiments of the present invention provide an intelligent generation system for unit test cases, the intelligent generation system comprising:

[0008] The structure-aware fine-tuning module is configured to extract historical unit test cases from the historical code of the target project, perform semantic desensitization and structural reconstruction on them to obtain training samples, and use a hierarchical masking enhancement strategy to optimize the training samples to generate a structure-aware model.

[0009] The style retrieval module is configured to use a structure-aware model to perform deep analysis of historical code and extract style features from multiple dimensions to build a style knowledge base. In the generation task, the structure-aware model is used to extract query features of the current code under test in multiple dimensions, and style reference samples that match in multiple dimensions are retrieved from the style knowledge base based on the query features.

[0010] A multi-agent collaborative generation module is configured to process style reference samples collaboratively by multiple agents to generate unit test cases that pass compilation and execution.

[0011] The feedback and closed-loop module is configured to incrementally update the style knowledge base with the generated unit test cases, and combine the developers' evaluation of the generated unit test cases to quantify and adjust the generation logic of the multi-agent collaborative generation module in future tasks and the retrieval strategy of the style retrieval module in future tasks.

[0012] Optionally, multiple dimensions include architectural-level dimensions, logical-level dimensions, and micro-level dimensions.

[0013] Optionally, when the structure-aware fine-tuning module performs semantic desensitization and anonymization processing on historical unit test cases, it is specifically configured to: use static analysis tools to extract the abstract syntax tree of historical unit test cases, and map the function names, variable names and private identifiers in historical unit test cases to abstract symbol sequences representing functional role attributes based on the abstract syntax tree;

[0014] When the structure-aware fine-tuning module performs structured reconstruction of historical unit test cases, it is specifically configured to: reconstruct the abstract symbol sequence into a standardized structure with a unified format based on the abstract syntax tree.

[0015] Optionally, after obtaining the training samples, the structure-aware fine-tuning module is further configured to: perform data cleaning and enhancement processing on the training samples, including removing logically redundant samples through logic fidelity verification, removing samples that do not conform to engineering best practices or have syntactic defects through static rule scanning, and using the retained samples as high-quality samples; using test case mutation technology to expand the high-quality samples by parameter perturbation, assertion transformation or logic path reorganization to generate enhanced training samples; the enhanced training samples are used for model training to execute the hierarchical masking enhancement strategy.

[0016] Optionally, the structure-aware fine-tuning module employs a layered masking enhancement strategy that includes dynamically setting hidden points in the code sequence of the training samples to mask key code snippets involving simulated object initialization, external dependency declarations, core business call flows, or logical assertions.

[0017] Optionally, when constructing the style knowledge base, the style retrieval module is specifically configured to: logically segment historical code using projects, modules, and functions as basic analysis units; for each analysis unit, extract its architectural style features, logic and control style features, and micro-expression style features, and convert the extracted features at each level into structured feature vectors for storage; among them, architectural style features include the organization of projects and modules, directory hierarchy, and global dependencies; logic and control style features include the internal structure of functions, control flow, and exception handling paradigms; and micro-expression style features include variable and function naming conventions, comment writing habits, and code format.

[0018] Optionally, when the style retrieval module retrieves style reference samples based on query features, it is specifically configured as follows: First, the architectural features in the query features are matched with the architectural features of each style entry in the style knowledge base to filter out a set of candidate samples with similar architectural features; then, within the candidate sample set, the logical features in the query features are used to calculate and match the similarity with the logical features of each candidate sample; finally, the candidate results after logical matching are sorted by the micro-features in the query features, and the sample with the highest micro-feature similarity is selected as the style reference sample; where, a style entry refers to the three-dimensional style feature vector extracted and stored for each analysis unit after logical segmentation of historical code.

[0019] Optionally, the multiple agents include a logic generation agent, a style alignment agent, and a simulation verification agent. For the function under test for which test cases need to be generated, the logic generation agent is configured to analyze the input-output contract, core business logic, and branch paths of the function under test, and construct initial test cases containing normal processes and boundary conditions. The style alignment agent is configured to refactor the naming conventions, comment formats, simulated object injection paradigms, and assertion habits of the initial test cases based on the architectural, logical, and micro-level expression style features in the style reference sample. The simulation verification agent is configured to compile and run the refactored test cases in a simulation environment, capture exceptions, extract fault features, and convert them into feedback instructions to drive the logic generation agent or style alignment agent to make corrections until the test cases pass verification.

[0020] Optionally, the feedback and closed-loop module receives evaluations from developers regarding the structural alignment, logical rationality, and code style compliance of unit test cases.

[0021] Secondly, embodiments of the present invention provide an intelligent generation method for unit test cases. This intelligent generation method is applied to the intelligent generation system for unit test cases according to any one of the first aspects. The intelligent generation method includes:

[0022] The structure-aware fine-tuning module extracts historical unit test cases from the historical code of the target project, performs semantic desensitization and structural reconstruction on them to obtain training samples, and uses a layered masking enhancement strategy to optimize the training samples to generate a structure-aware model.

[0023] The style retrieval module uses a structure-aware model to perform in-depth analysis of historical code and extracts style features from multiple dimensions to build a style knowledge base. In the generation task, the structure-aware model is used to extract query features of the current code under test in multiple dimensions, and style reference samples that match in multiple dimensions are retrieved from the style knowledge base based on the query features.

[0024] The multi-agent collaborative generation module receives style reference samples and processes them collaboratively to generate unit test cases that pass compilation and execution.

[0025] The generated unit test cases are incrementally updated to the style knowledge base through the feedback and closed-loop module. Combined with the developers' evaluation of the generated unit test cases, the evaluation is quantified and used to adjust the generation logic of the multi-agent collaborative generation module in future tasks and the retrieval strategy of the style retrieval module in future tasks.

[0026] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the intelligent generation method for unit test cases as described in any of the second aspects.

[0027] Fourthly, the present invention also provides an electronic device, the electronic device comprising a processor, a memory, and a battery module; the memory is used to store a program; the battery module is used to power the memory; the processor is used to execute the program and, when executing the program, implement the intelligent generation method for unit test cases as described in any of the second aspects.

[0028] (III) Beneficial Effects

[0029] The beneficial effects of this invention are:

[0030] This application provides an intelligent system and method for generating unit test cases. The system mainly includes four modules: a structure-aware fine-tuning module that performs semantic de-sensitization and structural refactoring on historical unit test case code, using a layered masking enhancement strategy to guide the model to deeply understand the call topology and engineering construction rules of the code, providing a foundational representation for subsequent generation of unit test cases with structural alignment characteristics; a style retrieval module that constructs a multi-dimensional code style knowledge base to accurately extract and store features of the target engineering paradigm, and provides accurate style reference samples in real time during the generation stage based on a layered retrieval mechanism; and a multi-agent collaboration module responsible for... The system executes end-to-end unit test generation tasks. Through parallel collaboration of multiple agents and in-situ self-repair mechanism, it achieves a high degree of consistency between code construction and target engineering style while ensuring the completeness of test logic. The feedback and closed-loop module is used to realize the continuous evolution of system performance. By dynamically feeding the generated qualified test cases back to the style knowledge base and fine-tuning the generation strategy in combination with human preference evaluation, a full-process structural style self-correction and self-gain closed-loop system is constructed. In this way, high-quality unit test cases with a high degree of consistency with the original code structure and style are generated through automated means, thereby significantly reducing the workload of developers and testers in the test writing and maintenance phases. Attached Figure Description

[0031] Figure 1 This illustration shows the interaction diagram of each module in an intelligent unit test case generation system provided in an embodiment of this application;

[0032] Figure 2 This paper presents an overall flowchart of a structure-aware training method according to an embodiment of this application.

[0033] Figure 3 This paper illustrates a general flowchart of a style retrieval method provided in an embodiment of this application.

[0034] Figure 4 This illustration shows a style layering architecture diagram provided in an embodiment of this application;

[0035] Figure 5 This paper illustrates an overall flowchart of multi-agent cooperation provided in an embodiment of this application.

[0036] Figure 6 This paper illustrates an overall flowchart of feedback and closed-loop processing provided by an embodiment of this application.

[0037] Figure 7 A flowchart of an intelligent method for generating unit test cases provided in an embodiment of this application is shown. Detailed Implementation

[0038] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0039] Currently, although automated test generation technology based on large language models has made initial progress, existing technical solutions still have deep limitations in terms of heterogeneous environment adaptation, code quality alignment, and automation loop in practical engineering implementation. This makes it difficult to directly integrate the model-generated results into real production environments without extensive manual intervention. Specifically:

[0040] First, existing technologies exhibit significant deviations in evaluation dimensions and goal orientation, overemphasizing physical coverage metrics of test cases while neglecting the semantic connotations of business logic. Traditional methods or general large models often use quantitative metrics such as row coverage and branch coverage as the core driving force during the generation process. This leads the system to tend to forcibly trigger edge code paths by constructing extreme, non-standard random input data. While test scripts generated purely for data coverage may perform well statistically, the assertions they generate often lack real business verification significance and fail to reflect the program's functional behavior in normal business processes, rendering test cases ineffective code that is "coverage for the sake of coverage."

[0041] Second, existing solutions lack adaptability and consistency in generating test cases, resulting in extremely poor readability and significant maintenance difficulties. Since most existing generation mechanisms are based on general open-source code distributions, they lack a deep understanding of the internal code texture of a specific target project, failing to explicitly model project-specific naming conventions, interface encapsulation layers, exception handling logic, and implicit programming paradigms. This "style gap" makes the generated unit test code visually and structurally incompatible with the existing project environment. Developers and testers need to spend more effort than manually writing the code to understand and refactor these heterogeneous fragments, severely hindering the seamless integration of automation tools in large collaborative development teams.

[0042] Third, existing technologies generally lack a closed-loop error correction mechanism that is aware of the real physical environment, resulting in severely insufficient stability in heterogeneous environments across engineering projects or multiple frameworks. Most existing methods follow a "one-stage open-loop generation" model, meaning the task terminates after the model outputs code, lacking deep interactive feedback with real compilation systems, static analysis tools, and dynamic runtime environments. When faced with complex private dependency chains, specific middleware configurations, or cross-language interface calls, the generated code often fails to compile or crashes at runtime due to subtle semantic mismatches. Because of the lack of a multi-role collaborative mechanism capable of "simulation verification, precise error correction, and logical iteration" during the generation process, existing automated generation workflows struggle to provide reliable industrial-grade output without real-time human intervention.

[0043] In summary, the shortcomings of existing methods in terms of logical semantic depth, engineering style alignment, and environmental adaptability constitute key bottlenecks for their implementation in real-world heterogeneous engineering scenarios. Existing generation paradigms struggle to balance the rigor of the underlying code logic structure with the consistency of the engineering surface expression style, resulting in test cases that lack precise coverage of complex call topologies at the logical level and are difficult to integrate into existing engineering paradigms at the formal level. Therefore, there is an urgent need for an intelligent generation method that can deeply align with target engineering patterns, possesses dual guarantees of structure awareness and style alignment, and relies on multi-agent collaborative simulation error correction capabilities. This method is of paramount practical significance for achieving logically complete, style-standardized, and environmentally adaptable industrial-grade unit tests.

[0044] Based on this, embodiments of this application provide an intelligent generation system and method for unit test cases. The system mainly includes four modules: a structure-aware fine-tuning module that performs semantic de-sensitization and structural reconstruction on the code of historical unit test cases, using a layered masking enhancement strategy to guide the model to deeply understand the call topology and engineering construction rules of the code, providing a foundational representation for the subsequent generation of unit test cases with structural alignment characteristics; a style retrieval module that constructs a multi-dimensional code style knowledge base to accurately extract and store features of the target engineering paradigm, and provides accurate style reference samples in real time during the generation stage based on a layered retrieval mechanism; and a multi-agent collaboration module. It is responsible for executing end-to-end unit test generation tasks. Through the parallel collaboration of multiple intelligent agents and in-situ self-repair mechanism, it achieves a high degree of consistency between code construction and target engineering style while ensuring the completeness of test logic. The feedback and closed-loop module is used to realize the continuous evolution of system performance. By dynamically feeding the generated qualified test cases back to the style knowledge base and fine-tuning the generation strategy in combination with human preference evaluation, it builds a full-process structure and style self-correction and self-gain closed-loop system. In this way, it generates high-quality unit test cases that are highly consistent with the original code structure and style through automated means, thereby significantly reducing the workload of developers and testers in the test writing and maintenance phases.

[0045] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and that the scope of the present invention can be fully conveyed to those skilled in the art.

[0046] First embodiment:

[0047] Please see Figure 1 , Figure 1 This illustration shows the interaction diagram of each module in an intelligent unit test case generation system provided in an embodiment of this application. For example... Figure 1 As shown, the system includes:

[0048] The structure-aware fine-tuning module is configured to extract historical unit test cases from the target project's historical code, perform semantic de-identification and structured reconstruction to obtain training samples, and optimize the training samples using a layered masking enhancement strategy to generate a structure-aware model with code structure awareness capabilities. This structure-aware model is used to understand the deep structural patterns of the historical code, including the code's call topology (call hierarchy and dependency paths between functions) and project construction patterns (code organization structure, control flow patterns, data flow relationships, etc.), thus providing a foundational understanding for subsequently generating unit test cases aligned with the target project's structure. The target project refers to the specific software project for which unit test cases need to be generated; the historical code is all existing code in the target project, including production code and historical unit test cases.

[0049] The style retrieval module is configured to perform deep analysis of historical code using a structure-aware model, extract style features from multiple dimensions to build a style knowledge base, and in the generation task, use the structure-aware model to extract query features of the current code under test in multiple dimensions, and retrieve style reference samples that match in multiple dimensions from the style knowledge base based on the query features; multiple dimensions include architectural dimension, logical dimension and micro dimension.

[0050] The multi-agent collaborative generation module is configured to process style reference samples collaboratively by multiple agents to generate unit test cases that pass compilation and execution. That is, it is used to perform end-to-end unit test case generation tasks. Through the parallel collaboration and in-situ self-repair mechanism of logic generation agent, style alignment agent and simulation verification agent, it realizes code construction that is highly aligned with the style of the target project on the basis of logical completeness. The multiple agents include logic generation agent, style alignment agent and simulation verification agent.

[0051] The feedback and closed-loop module is configured to incrementally update the generated unit test cases to the style knowledge base, thereby dynamically feeding back qualified generated test cases to the style knowledge base. It also combines the developers' evaluation of the generated unit test cases, quantifies it, and uses it to adjust the generation logic of the multi-agent collaborative generation module in future tasks and the retrieval strategy of the style retrieval module in future tasks. This constructs a full-process structural style self-correction and self-gain closed loop to achieve continuous performance evolution of the system.

[0052] To facilitate understanding of the above modules, specific embodiments are described below.

[0053] Optionally, when the structure-aware fine-tuning module performs semantic desensitization on historical unit test cases, it is specifically configured to: extract the abstract syntax tree of historical unit test cases using static analysis tools, and map function names, variable names, and private identifiers in historical unit test cases to abstract symbol sequences representing functional role attributes based on the abstract syntax tree. This semantic desensitization process refers to mapping function names, variable names, and private identifiers with specific business meanings in the source code to abstract symbol sequences representing functional role attributes, aiming to strip away the specific business semantics of the code and allow the model to focus on learning the structural patterns of the code.

[0054] When the structure-aware fine-tuning module performs structured reconstruction of historical unit test cases, it is specifically configured to: reconstruct the abstract symbol sequence into a standardized structure with a unified format based on the abstract syntax tree.

[0055] For example, this structure-aware fine-tuning module is based on the underlying cognitive shaping of large language models. Through systematic structural feature induction and sample augmentation, it guides the model to shift from traditional lexical semantic memory patterns to deep engineering structure modeling. The core logic of this module lies in decoupling and processing the original code dataset, stripping the model of its excessive dependence on specific business logic or proprietary library semantics, thereby strengthening its ability to perceive code construction rules, call topology, and internal engineering specifications. Through this design starting from the training source, this module lays a solid underlying representation foundation for resolving the distribution differences between external open-source data and the enterprise's internal private environment, thus ensuring extremely high consistency of test cases in the subsequent generation phase. Its flowchart is shown below. Figure 2 As shown, specifically:

[0056] Based on the obtained code dataset of historical unit test cases, semantic desensitization and general formatting transformation can be implemented. Specifically, static analysis tools are used to extract the abstract syntactic representation of the code, mapping function names, variable names, and private identifiers with specific business meanings in the source code to a unified sequence of abstract symbols with functional role attributes. This desemanticization operation aims to strip away specific business noise in the code, forcing the model to no longer rely on specific lexical semantics for association during training, but instead learn the structured patterns of code control flow, data flow, and dependency injection. By establishing this general functional role representation, the model can achieve alignment of underlying semantics across different engineering backgrounds, significantly improving its understanding accuracy of heterogeneous engineering code. Here, "engineering" can refer to an independent and complete software development project, including its unique codebase, architecture design, development specifications, and engineering practices.

[0057] Furthermore, to ensure the quality and distribution expansion of the dataset, this module introduces a test case mutation and cleaning mechanism. Specifically, during the data cleaning phase, the system eliminates low-quality samples from the codebase that are logically redundant, do not conform to best practices, or have syntactic defects through logic fidelity verification and static rule scanning, ensuring the purity and demonstrative value of the training data. Based on this, test case mutation technology is used to expand the high-quality samples in multiple dimensions. Through parameter perturbation, assertion transformation, and logic path reorganization, a large number of adversarial samples targeting boundary conditions and abnormal scenarios are generated. This process not only significantly broadens the coverage of the training data but also enhances the model's sensitivity to discovering potential defects when facing complex internal business logic, ensuring that the generated unit test cases have extremely high maintainability.

[0058] In other words, after obtaining the training samples, the structure-aware fine-tuning module is specifically configured to: perform data cleaning and enhancement processing on the training samples, including removing logically redundant samples through logic fidelity verification, removing samples that do not conform to engineering best practices or have syntactic defects through static rule scanning, and using the retained samples as high-quality samples; using test case mutation technology to expand the high-quality samples by parameter perturbation, assertion transformation or logic path reorganization to generate enhanced training samples; and using the enhanced training samples to train the model that executes the hierarchical masking enhancement strategy.

[0059] Furthermore, to further guide the model to grasp the deep meta-logic of unit test writing, this module employs a layered multi-dimensional masking enhancement strategy. Specifically, by dynamically setting hiding points in the training sequence of unit test cases, the system will selectively mask / obscure key segments in unit tests involving Mock initialization configurations, external dependency declarations, core business call flows, or final logic assertions. The model is required to perform logical deduction and precise filling based on the original structural context of the function under test and the incomplete unit test code. This training task forces the model to reconstruct the logical loop by understanding the code's calling contract and engineering specifications under conditions of incomplete information. This layered masking mechanism not only deepens the model's understanding of the internal engineering construction rules but also ensures the consistency of the generated results in style alignment and specification compliance from the underlying algorithmic logic. Among them, mock object initialization refers to the code that creates and configures mock objects (Mock objects) to replace the external components that the function under test depends on, isolating external dependencies and ensuring test independence; external dependency declaration refers to the code that imports other classes, modules or services that the function under test depends on, usually in the form of import statements or dependency injection declarations, clarifying the dependencies required by the test environment; core business call flow refers to the core code that calls the function under test, including constructing test parameters, executing the function under test, and obtaining return values, which is the main execution logic of the test case; logical assertion refers to the code that verifies the execution result, usually in the form of assert statements, used to determine whether the actual output is consistent with the expected result, ensuring the correctness of the code logic.

[0060] In other words, the layered masking enhancement strategy adopted by the structure-aware fine-tuning module includes: dynamically setting hidden points in the code sequence of training samples to mask key code segments involving simulated object initialization, external dependency declarations, core business call flows, or logical assertions.

[0061] Therefore, this structure-aware fine-tuning module constructs a core underlying model with engineering intuition through deep decoupling of code representation and induced training by structured tasks. By eliminating semantic bias, refining logical samples, and strengthening structural reasoning, it not only provides impetus for automated, high-coverage unit test generation but also ensures, from an engineering practice perspective, that the generated test code conforms to unified cross-engineering standards in terms of readability and maintainability, providing a high-quality logical foundation for subsequent multi-agent collaborative generation.

[0062] It should be understood that the specific model and model structure of the structure perception model can be set according to actual needs, and the embodiments of this application are not limited thereto.

[0063] Optionally, this structure-aware model uses an existing large language model as its framework, injecting syntax, data flow, and call relationship information into the code through an external structure adapter. In its implementation, this underlying large language model can be any general-purpose model or specialized code model with code understanding capabilities, including but not limited to the GPT series, Claude series, Gemini series, Qwen series, DeepSeek series, and GLM series. Through a two-stage training mechanism, the model maintains its original general capabilities while deeply mastering the structural patterns of the target project code.

[0064] Optionally, this structure-aware fine-tuning module extracts code graph information from the target project and constructs a training dataset together with the original code. This dataset is then used to fine-tune the basic large language model, enabling the model to deeply understand the unique code structure patterns of the target project. In its implementation, this basic large language model can be any general-purpose model or specialized code model with code understanding capabilities, including but not limited to the GPT series, Claude series, Gemini series, Qwen series, DeepSeek series, and GLM series.

[0065] Code graph information is a collective term for various representations that reflect the deep structure of the target project's code, including at least one or more of the following:

[0066] Abstract Syntax Tree (AST): Describes the syntactic hierarchy of code, revealing the nesting and sequence relationships between statements, expressions, and declarations;

[0067] Control Flow Graph (CFG): Describes the possible paths of code execution, including conditional branches, loop structures, and their jump relationships;

[0068] Data Flow Graph (DFG): Describes the dependencies between variable definitions and usages, reflecting the data transfer path in the program;

[0069] Call graph (CG): Describes the call relationships between functions or methods, and shows the dependency and interaction topology between modules.

[0070] When constructing the training dataset, the structure-aware fine-tuning module first performs static analysis on the historical code of the target project (including production code and historical unit test cases) to extract the aforementioned code graph information. Then, it structurally organizes the original code fragments and their corresponding graph information to form "code-graph" aligned training samples. For example, the graph information can be converted into a serialized representation (such as serializing AST nodes and encoding call relationships as adjacency sequences) and concatenated with the token sequence of the original code, or the graph information can be injected into the input context in the form of natural language descriptions using special prompt templates. In this way, the training samples contain both the original text of the code and its deep structural patterns.

[0071] Subsequently, the basic large language model is fine-tuned using the constructed training dataset. This fine-tuning refers to further training the pre-trained model using training samples constructed from the code structure information of the target project. This allows the model to maintain its general language capabilities while deeply understanding the code structure patterns specific to the target project. The fine-tuning process employs standard language modeling objectives (such as predicting the next token), enabling the model to simultaneously consider the textual semantics and underlying structural constraints of the code when generating it. Through extensive exposure to the code graph context of the target project, the model gradually learns to follow the implicit rules of the target project, such as call topology, control flow patterns, and data dependencies, when generating unit test cases, thereby achieving a deep understanding of the project's construction logic.

[0072] It's important to note that this fine-tuning process does not alter the core architecture of the base model, nor does it introduce additional encoder modules or multi-stage training mechanisms. Instead, it purely enhances the data level by injecting code graph knowledge into the model's parameters. This lightweight fine-tuning approach maintains the model's general generative capabilities while significantly improving its adaptability to specific engineering environments.

[0073] Therefore, through the data augmentation and fine-tuning methods based on code graph information, the "structure-aware model" generated by the structure-aware fine-tuning module can deeply grasp the calling topology and engineering construction rules of the target project code while maintaining the original semantic understanding ability of the large language model. This provides a solid underlying understanding foundation for the subsequent generation of unit test cases aligned with the target project structure.

[0074] Optionally, when constructing the style knowledge base, the style retrieval module is specifically configured to: logically segment historical code using projects, modules, and functions as basic analysis units; for each analysis unit, extract its architectural style features, logic and control style features, and micro-expression style features, and convert the extracted features at each level into structured feature vectors for storage; among them, architectural style features include the organization of projects and modules, directory hierarchy, and global dependencies; logic and control style features include the internal structure of functions, control flow, and exception handling paradigms; and micro-expression style features include variable and function naming conventions, comment writing habits, and code format.

[0075] For example, this style retrieval module focuses on enhancing the style alignment and specification adaptation of generated unit test cases. This module addresses the problem of generated code often being difficult to maintain in engineering practice due to jarring style differences. By introducing a retrieval-based enhanced generation mechanism, it provides the model with accurate engineering paradigm references. As a key step in improving unit test consistency, this module uses deep-aware retrieval technology to enable the model to align with the target project's coding habits in real time, ensuring that the generated code remains consistent with the native codebase in both micro-level expression and function-level logical structure. Its flowchart is shown below. Figure 3 As shown, specifically:

[0076] In achieving precise style alignment, this module decouples complex code styles into three progressive levels for decomposition and modeling, as shown in the layered architecture diagram below. Figure 4 As shown, the first layer is the architectural style, mainly covering the organization of projects and modules, directory hierarchy, and global dependencies. The second layer is the logic and control style, focusing on the developer's programming habits, including the internal structure of functions, control flow, exception and error handling paradigms, and state management habits. The third layer is the micro-expression style, focusing on variable and function naming conventions, comment writing habits, and formatting details such as blank lines and indentation. Through this layered decomposition, the system can comprehensively characterize the style features of the project code from macro-structure to micro-expression, providing a unified and measurable analytical dimension for subsequent style alignment and matching.

[0077] Based on the aforementioned style decomposition principles, a structured code style knowledge base was constructed using this module. During the knowledge base construction phase, the system logically segments the existing code (i.e., historical code) of the target project using projects, modules, and functions as basic analysis units, ensuring that each knowledge entry has a clear contextual affiliation. For each code unit (i.e., analysis unit), the system extracts corresponding architectural style features, logical and control style features, and micro-level expression style features, transforming them into structured feature vectors based on code structure and semantic information. These vectors are stored using a predefined format, thus forming style entries with multi-dimensional style attributes. This structured storage method not only preserves code logic information but also encapsulates the unique coding paradigms of the target project.

[0078] Furthermore, during the query feature retrieval and execution phase of the code under test, a hierarchical retrieval mechanism was designed for this module to achieve accurate matching of reference samples. The system first constrains the retrieval space using architectural style features to ensure that candidate samples originate from engineering areas with similar module organization or dependency backgrounds. Then, using logic and control style features as the primary basis for similarity calculation, it matches function structures and control flow patterns. Finally, it sorts or re-sorts the candidate results based on micro-level expression style features, prioritizing reference use cases that are highly consistent in naming conventions and commenting styles. Through this layered screening and matching process, the system can locate the most valuable style samples from a large-scale knowledge base.

[0079] In other words, when the style retrieval module retrieves style reference samples based on query features, it is specifically configured as follows: First, it matches the architectural features in the query features with the architectural features of each style entry in the style knowledge base to filter out a set of candidate samples with similar architectural features; then, within the candidate sample set, it calculates and matches the similarity between the logical features in the query features and the logical features of each candidate sample; finally, it sorts the candidate results after logical matching based on the micro-features in the query features and selects the sample with the highest similarity in micro-features as the style reference sample; where, a style entry refers to the three-dimensional style feature vector extracted and stored for each analysis unit after logical segmentation of historical code.

[0080] Therefore, this module achieves deep alignment between the generation environment and the target engineering paradigm by decoupling and deconstructing the style dimension, constructing a structured knowledge base, and applying a hierarchical retrieval mechanism. This solution not only provides high-quality style references for large models but also eliminates normative deviations in cross-engineering collaboration at the source through explicit paradigm injection. This style retrieval-based design greatly enhances the readability and consistency of unit test cases, providing strong technical support for achieving a fully automated, standardized, and highly maintainable unit test generation process.

[0081] Optionally, the multiple agents include a logic generation agent, a style alignment agent, and a simulation verification agent. For the function under test for which test cases need to be generated, the logic generation agent is configured to analyze the input-output contract, core business logic, and branch paths of the function under test, and construct initial test cases containing normal flow and boundary conditions. The style alignment agent is configured to refactor the naming conventions, comment formats, mock object injection paradigms, and assertion habits of the initial test cases based on the architectural, logical, and micro-level expression style features in the style reference sample. The simulation verification agent is configured to compile and run the refactored test cases in a simulation environment, capture exceptions, extract fault characteristics, and convert them into feedback instructions, driving the logic generation agent or style alignment agent to make corrections until the test cases pass verification. Here, the function under test refers to the target function for which unit test cases need to be generated, i.e., a code unit that already exists in the system but does not yet have a corresponding unit test.

[0082] For example, the multi-agent collaborative generation module adopts a multi-agent collaborative architecture, enabling automated generation of unit test cases that are end-to-end and highly consistent in style. This module integrates multiple intelligent agents with specific functions, constructing a complete production chain from logical construction to specification alignment and dynamic verification. In this module, the base model used by each agent can be either a dedicated model obtained based on the structure-induced fine-tuning method described in the structure-aware fine-tuning module, or it can directly call advanced large-scale model interfaces with powerful reasoning capabilities in the existing domain. This multi-agent collaborative design effectively addresses the challenges of balancing logical completeness and engineering consistency that are difficult to achieve in single-step generation, thereby significantly improving the industrial quality of the generated results. Its overall flowchart is shown below. Figure 5 As shown, specifically:

[0083] The logic generation agent, acting as the starting point of the task flow, is primarily responsible for deeply analyzing the function under test and its associated context information, and generating preliminary test case prototypes. This agent constructs test scenarios covering normal processes and boundary conditions by analyzing the input-output contract, core business logic, and potential branch paths of the function under test. Its core objective is to ensure that the generated test cases are functionally complete and can accurately probe the execution logic of the target code. Based on the engineering intuition provided by the first module, the logic generation agent can effectively identify dependencies in the code and construct reasonable initialization parameters and test data accordingly, laying a logical foundation for subsequent style alignment and verification. Here, the function under test refers to a specific function that serves as the input target in the unit test generation task and does not yet have a corresponding unit test; the input-output contract refers to the correspondence between the input parameters and output results agreed upon in the function's design and implementation; the core business logic refers to the core code path that implements the function's main function; and the branch paths refer to different execution paths generated by conditional judgments within the function.

[0084] Furthermore, the style alignment agent, acting as a crucial bridge connecting logic and paradigm, is specifically responsible for applying the retrieval enhancement techniques described in the style retrieval module to perform fine-grained alignment of code style. Upon receiving the initial test cases generated by the logic generation agent, this agent restructures the code organization based on the style retrieval results. By comparing the style characteristics of the target project at the architectural, logical, and micro-level expressions, the style alignment agent can dynamically correct naming conventions, comment formats, Mock object injection paradigms, and assertion habits in the test cases. This process ensures that the generated test code maintains a high degree of consistency with the native codebase, resolving the issue of poor maintainability caused by style differences in code generated by automated tools.

[0085] Furthermore, the simulation verification agent undertakes the core functions of quality control and self-repair, ensuring the compilability and runnability of test cases through an actual execution environment. This agent, by invoking backend command-line tools, compiles and runs the generated code in real-time within an isolated simulation environment, monitoring for syntax errors, missing dependencies, or runtime exceptions. If execution failure is detected, the simulation verification agent automatically captures error logs, extracts fault characteristics, and converts them into feedback instructions sent back to the generation stage for self-repair. Within a preset number of trial rounds, the agent continuously corrects defects in the code through an iterative feedback loop until it produces stable unit test cases that can be compiled and accurately reflect the logical results.

[0086] Therefore, the logic generation agent, style alignment agent, and simulation verification agent form an organic collaborative whole, jointly achieving closed-loop production of high-quality unit tests. Through the complementary functions and self-correcting feedback mechanism among the agents, this module can output test code with rigorous structure, consistent style, and high execution reliability. This multi-agent collaborative mode not only overcomes the limitations of a single model in handling complex heterogeneous code, but also significantly enhances the engineering implementation value of unit tests through dynamic verification and automated alignment technology, providing core assurance for automated R&D processes across engineering specifications.

[0087] Optionally, the feedback and closed-loop module receives evaluations from developers regarding the structural alignment, logical rationality, and code style compliance of unit test cases.

[0088] For example, this feedback and closed-loop module is used to build a continuous evolution and quality feedback closed loop for the system's generation capabilities. By linking the automatic generation process with the result evaluation process, it achieves dynamic optimization of the test case generation strategy. This module no longer treats test generation as a one-off event, but rather incorporates it into a long-term adaptive system. This allows the system to continuously correct generation deviations and improve generation quality during continuous use, gradually adapting to the actual needs of different engineering projects. Its overall flowchart is as follows: Figure 6 As shown, specifically:

[0089] In terms of automatic evolution, the system performs feature processing on newly generated and validated high-quality test cases, extracting their structural organization, assertion layout patterns, and code style characteristics, and incrementally updates the style skeleton knowledge base. This knowledge base, serving as a crucial reference source during the generation phase, continuously evolves with the accumulation of test cases, reflecting the latest structural features and coding habits of the current project code. In this way, subsequent generation processes can prioritize referencing templates that are closer to the current code style when retrieving historical samples, improving the consistency and applicability of the generated results in terms of structure and style.

[0090] Regarding human feedback, this module introduces a developer-oriented human evaluation mechanism, allowing users to assess the generated test cases in terms of structural alignment, logical rationality, and code style compliance. The system analyzes and quantifies this human feedback, using it as a regulatory signal to influence the multi-agent collaborative generation module and style retrieval module, enabling the generation process to gradually align with human development habits and engineering standards. By transforming human judgment into calculable optimization criteria, the system avoids the biases that may arise from relying solely on automated metrics, continuously improving the readability and maintainability of the generated results.

[0091] Therefore, through a dual closed-loop mechanism of automatic knowledge updates and human feedback guidance, this module ensures both automated generation efficiency and consistency in test case style and engineering maintainability. This mechanism enables the system to continuously adapt to changes in heterogeneous code environments and long-term engineering practices, stably outputting test cases that meet specifications and have practical value, providing reliable support for large-scale engineering applications.

[0092] In summary, by leveraging the aforementioned technical solutions, this application achieves end-to-end generation of high-quality unit test cases with a high degree of consistency in structure and style. The system first uses a structure-aware fine-tuning module to enable the model to grasp code construction rules and dependency topology, eliminating semantic biases. Simultaneously, a style retrieval module provides precise engineering paradigm references from architectural, logical, and micro-level perspectives, ensuring that the generated code conforms to the target engineering style. Subsequently, the logic generation, style alignment, and simulation verification agents complete test case construction, style alignment, and dynamic verification within a unified collaborative framework, thereby ensuring logical integrity and compilability. In the final stage of the entire generation process, a self-evolutionary closed-loop module adds high-quality sample increments to the knowledge base and fine-tunes the generation strategy based on human preference feedback, achieving continuous optimization of knowledge and style. Through these functions, it can automatically generate structurally sound, style-consistent, executable, and easily maintainable unit test cases in heterogeneous code environments, providing a complete and end-to-end automated test generation solution.

[0093] Furthermore, considering that existing mainstream generation technologies rely excessively on the general semantic association capabilities of large language models, they often suffer from logical illusions due to a lack of background knowledge when dealing with enterprise private libraries or complex internal call relationships. Therefore, this application employs desemantic desensitization training to force the model to shed its dependence on the surface meaning of words and instead deeply grasp the code's call topology, control flow rules, and dependency injection paradigm. This structure-aware training design ensures that the generated test cases can accurately reproduce the original engineering construction logic when facing highly heterogeneous code environments, completely solving the problem of severe logical incompatibility in complex business scenarios with traditional solutions.

[0094] Furthermore, this application systematically decouples code style into three core dimensions: architectural-level organization, logical-level control flow pattern, and micro-level expression habits, and performs real-time alignment using a refined layered retrieval mechanism. This multi-dimensional style injection mechanism ensures that the generated unit test cases not only conform to the specifications in naming and indentation, but also maintain a high degree of consistency with the native codebase in deep-seated habits such as Mock object usage, exception handling logic, and assertion style, greatly reducing the review and subsequent maintenance costs for developers.

[0095] Furthermore, unlike static generation schemes that only output once and lack verification, this application utilizes a multi-agent collaborative architecture and simulation verification closed loop to achieve in-situ error correction and dynamic repair of the generated code, significantly improving the test case compilation pass rate in heterogeneous code environments.

[0096] In addition, this application overcomes the drawbacks of traditional tools having fixed generation paradigms and being difficult to update by establishing a dual closed loop of knowledge feedback and human preference feedback, enabling the system to continuously optimize the generation strategy and accumulate high-quality testing experience as engineering projects evolve.

[0097] It should be understood that the intelligent generation system for unit test cases described above is merely exemplary, and those skilled in the art can make various modifications based on the system described above, and the modified solutions also fall within the protection scope of this application.

[0098] Second embodiment:

[0099] Please see Figure 7 , Figure 7 This document illustrates a flowchart of an intelligent unit test case generation method implemented using the intelligent unit test case generation system described in the first embodiment of this application, as provided in an embodiment of this application. Figure 7 As shown, the intelligent generation method includes:

[0100] Step S710: Extract historical unit test cases from the historical code of the target project through the structure-aware fine-tuning module, and perform semantic desensitization and structural reconstruction processing on them to obtain training samples. Then, use a layered masking enhancement strategy to optimize the training samples to generate a structure-aware model.

[0101] Step S720: The style retrieval module uses a structure-aware model to perform in-depth analysis of historical code and extracts style features from multiple dimensions to build a style knowledge base. In the generation task, the structure-aware model is used to extract query features of the current code under test in multiple dimensions, and style reference samples that match in multiple dimensions are retrieved from the style knowledge base based on the query features.

[0102] Step S730: Receive style reference samples through a multi-agent collaborative generation module, and process the style reference samples collaboratively through multiple agents to generate unit test cases that pass compilation and execution.

[0103] Step S740: The generated unit test cases are incrementally updated to the style knowledge base through the feedback and closed-loop module. Combined with the developer's evaluation of the generated unit test cases, the evaluation is quantified and used to adjust the generation logic of the multi-agent collaborative generation module in future tasks and the retrieval strategy of the style retrieval module in future tasks.

[0104] It should be understood that the specific details of each step in this intelligent generation method can be found in the relevant content of the first embodiment, and will not be described in detail here.

[0105] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0106] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.

[0107] It should be noted that any reference numerals placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims that enumerate several means, several of these means may be embodied by the same hardware. The use of the terms first, second, third, etc., is merely for convenience of expression and does not indicate any order. These terms can be understood as part of the component names.

[0108] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0109] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0110] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, then this invention should also include these modifications and variations.

Claims

1. An intelligent system for generating unit test cases, characterized in that, include: The structure-aware fine-tuning module is configured to extract historical unit test cases from the historical code of the target project, perform semantic desensitization and structural reconstruction on them to obtain training samples, and use a hierarchical masking enhancement strategy to optimize the training samples to generate a structure-aware model. The style retrieval module is configured to perform deep analysis of the historical code using the structure-aware model, extract style features from multiple dimensions to construct a style knowledge base, and in the generation task, use the structure-aware model to extract query features of the current code to be tested in multiple dimensions, and retrieve style reference samples that match in multiple dimensions from the style knowledge base based on the query features. A multi-agent collaborative generation module is configured to process the style reference sample through multiple agents to generate unit test cases that pass compilation and execution. The feedback and closed-loop module is configured to incrementally update the generated unit test cases to the style knowledge base, and combine the developer's evaluation of the generated unit test cases to quantify it for adjusting the generation logic of the multi-agent collaborative generation module in future tasks and the retrieval strategy of the style retrieval module in future tasks. The structure-aware fine-tuning module employs a layered masking enhancement strategy, which includes dynamically setting hidden points in the code sequence of the training samples to mask key code segments involving simulated object initialization, external dependency declarations, core business call flows, or logical assertions.

2. The intelligent generation system for unit test cases according to claim 1, characterized in that, The multiple dimensions include architectural-level dimensions, logical-level dimensions, and micro-level dimensions.

3. The intelligent generation system for unit test cases according to claim 1, characterized in that, When the structure-aware fine-tuning module performs semantic de-semantic desensitization processing on the historical unit test cases, it is specifically configured to: use static analysis tools to extract the abstract syntax tree of the historical unit test cases, and map the function names, variable names and private identifiers in the historical unit test cases into abstract symbol sequences representing functional role attributes based on the abstract syntax tree; When the structure-aware fine-tuning module performs structured reconstruction of the historical unit test cases, it is specifically configured to: reconstruct the abstract symbol sequence into a standardized structure with a unified format based on the abstract syntax tree.

4. The intelligent generation system for unit test cases according to claim 1 or 3, characterized in that, After obtaining the training samples, the structure-aware fine-tuning module is further configured to: perform data cleaning and enhancement processing on the training samples, including removing logically redundant samples through logic fidelity verification, removing samples that do not conform to engineering best practices or have syntactic defects through static rule scanning, and using the retained samples as high-quality samples; and using test case mutation technology to expand the high-quality samples by parameter perturbation, assertion transformation or logic path reorganization to generate enhanced training samples. The enhanced training samples are used for model training to execute the layered masking enhancement strategy.

5. The intelligent generation system for unit test cases according to claim 1, characterized in that, When constructing the style knowledge base, the style retrieval module is specifically configured to: logically segment the historical code using projects, modules, and functions as basic analysis units; for each analysis unit, extract its architectural style features, logic and control style features, and micro-expression style features, and convert the extracted features at each level into structured feature vectors for storage; wherein, the architectural style features include the organization of projects and modules, directory hierarchy, and global dependencies; the logic and control style features include the internal structure of functions, control flow, and exception handling paradigms; and the micro-expression style features include variable and function naming conventions, comment writing habits, and code format.

6. The intelligent generation system for unit test cases according to claim 5, characterized in that, When the style retrieval module retrieves the style reference sample based on the query features, it is specifically configured as follows: First, the architectural features in the query features are matched with the architectural features of each style entry in the style knowledge base to filter out a set of candidate samples with similar architectural features; then, within the candidate sample set, the logical features in the query features are used to calculate and match the similarity with the logical features of each candidate sample; finally, the candidate results after logical matching are sorted by the micro-features in the query features, and the sample with the highest micro-feature similarity is selected as the style reference sample; wherein, the style entry refers to the three-dimensional style feature vector extracted and stored for each analysis unit after logical segmentation of the historical code.

7. The intelligent generation system for unit test cases according to claim 1, characterized in that, The multiple intelligent agents include a logic generation intelligent agent, a style alignment intelligent agent, and a simulation verification intelligent agent; for the function under test for which test cases need to be generated, the logic generation intelligent agent is configured to analyze the input-output contract, core business logic, and branch paths of the function under test, and construct initial test cases containing normal processes and boundary conditions; The style alignment agent is configured to reconstruct the naming conventions, annotation formats, simulated object injection paradigms, and assertion habits of the initial test cases based on the architectural, logical, and micro-level expression style features in the style reference sample. The simulation verification agent is configured to compile and run the reconstructed test cases in a simulation environment, capture exceptions, extract fault features, and convert them into feedback instructions to drive the logic generation agent or the style alignment agent to make corrections until the test cases pass verification.

8. The intelligent generation system for unit test cases according to claim 1, characterized in that, The evaluation received by the feedback and closed-loop module includes the developer's evaluation of the unit test cases in terms of structural alignment, logical rationality, and code style compliance.

9. A method for intelligently generating unit test cases, characterized in that, An intelligent generation system for unit test cases according to any one of claims 1 to 8, wherein the intelligent generation method comprises: The structure-aware fine-tuning module extracts historical unit test cases from the historical code of the target project, performs semantic desensitization and structural reconstruction on them to obtain training samples, and uses a layered masking enhancement strategy to optimize the training samples to generate a structure-aware model. The style retrieval module uses the structure-aware model to perform deep analysis of the historical code and extracts style features from multiple dimensions to build a style knowledge base. In the generation task, the structure-aware model is used to extract the query features of the current code to be tested in multiple dimensions, and style reference samples that match in multiple dimensions are retrieved from the style knowledge base based on the query features. The style reference sample is received by a multi-agent collaborative generation module, and multiple agents collaboratively process the style reference sample to generate unit test cases that pass compilation and execution. The generated unit test cases are incrementally updated to the style knowledge base through the feedback and closed-loop module. Combined with the evaluation of the generated unit test cases by the developers, the evaluation is quantified and used to adjust the generation logic of the multi-agent collaborative generation module in future tasks and the retrieval strategy of the style retrieval module in future tasks.

Citation Information

Patent Citations

  • Abnormality repairing method and electronic equipment

    CN120973572A

  • Code generation method and system based on waterfall model and multi-agent cooperation

    CN121029145A