Software engineering agent construction method and device based on data expansion

By generating code repair test cases for structured Gherkin scenarios and combining rejection sampling fine-tuning with offline reinforcement learning methods, the problem of insufficient data quality for large language models in software engineering is solved, achieving efficient model performance and generalization performance improvements.

CN120631323APending Publication Date: 2025-09-12TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510754209.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

When existing large language models are applied in software engineering, they face problems such as insufficient data quality, lack of training data, and limited generalization performance, which limits the improvement of model performance.

Method used

By acquiring software engineering datasets, a large language model is used to generate code repair test cases for structured Gherkin scenarios. Hybrid training is performed by combining rejection sampling fine-tuning and offline reinforcement learning methods, and iterative expansion technology is used to optimize model performance to generate software engineering intelligent agents.

Benefits of technology

Building an efficient data generation pipeline to generate high-quality test cases significantly improves the performance and generalization ability of the model in software engineering tasks, and solves the problems of lack of test cases and difficulty in reproduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631323A_ABST
    Figure CN120631323A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network information, in particular to a software engineering agent construction method and device based on data expansion, and the method comprises the steps: obtaining a software engineering data set, and inputting the software engineering data set into a target large language model to generate a code repair test case corresponding to a structured Gherkin scene; performing mixed training on a preset offline reinforcement learning method by utilizing the code repair test case to obtain a repair strategy model based on offline data; and performing iterative extension reasoning on the repair strategy model based on the offline data according to the target task to generate a software engineering agent. Therefore, the problems of insufficient data quality, insufficient training data, limited generalization performance and the like when the current large language model is applied to the automatic repair task of the software engineering are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network information technology, and in particular to a method and device for constructing a software engineering intelligent body based on data expansion. Background Art

[0002] With the rapid development of large language models, their ability to solve coding problems has garnered widespread attention. Beyond solving traditional competition problems, their applications in software engineering (SWE) have expanded from simple code snippet generation to more complex software problem fixes, such as the automatic resolution of real-world GitHub issues. Existing methods typically rely on closed-source models or specific agent frameworks. For example, the OpenHands framework effectively implements model-environment interaction by defining an interface between the model and the computing environment; some frameworks attempt to remove specific agent structures and explore generalized solutions. However, these methods generally face the problem of a lack of high-quality software engineering data, which significantly limits the improvement of model performance.

[0003] Existing dataset construction methods primarily involve large-scale screening and manual annotation. For example, public datasets such as SWE-bench are typically obtained by screening or manually annotating a large number of GitHub projects. While these datasets are rich, they suffer from uneven data quality, high cost, and low efficiency of manual annotation. Furthermore, some datasets achieve high-quality data construction through manual annotation, but this is difficult to scale due to the significant manual effort required, and cannot meet the demands of rapid, iterative model development. Existing methods also have shortcomings in verification, often lacking systematic, automated test case generation and verification tools. This makes it difficult to objectively and efficiently evaluate the generated solutions, further restricting the generalization performance of the model. Although institutions such as OpenAI have proposed some verification methods, they are still limited to specific scenarios, making it difficult to form widely applicable verification standards. Summary of the Invention

[0004] The present invention provides a method and device for constructing a software engineering intelligent agent based on data expansion, so as to solve the problems of insufficient data quality, lack of training data and limited generalization performance when the current large language model is applied to software engineering automatic repair tasks.

[0005] An embodiment of the first aspect of the present invention provides a method for constructing a software engineering agent based on data expansion, comprising the following steps: obtaining a software engineering dataset, and inputting the software engineering dataset into a target large language model to generate code repair test cases corresponding to structured Gherkin scenarios; using the code repair test cases to perform hybrid training on a preset offline reinforcement learning method to obtain a repair strategy model based on offline data; and iteratively extending and reasoning the repair strategy model based on offline data according to a target task to generate a software engineering agent.

[0006] Optionally, obtaining a software engineering dataset and inputting the software engineering dataset into a target large language model to generate a code repair test case corresponding to a structured Gherkin scenario includes: crawling software project data containing a high-star GitHub repository link in a PyPI repository; screening the software project data containing a high-star GitHub repository link to obtain the software engineering dataset; inputting the software engineering dataset into a target large language model to generate the structured Gherkin scenario, and converting the structured Gherkin scenario into its corresponding code repair test case.

[0007] Optionally, the hybrid training of a preset offline reinforcement learning method using the code repair test cases to obtain a repair strategy model based on offline data includes: using a rejection sampling fine-tuning method to perform quality screening on the code repair test cases to obtain screened code repair test cases; and optimizing the preset offline reinforcement learning method using the screened code repair test cases to obtain the repair strategy model based on offline data.

[0008] Optionally, the iterative extended reasoning of the offline data-based repair strategy model according to the target task to generate a software engineering agent includes: setting an initial reasoning round of the offline data-based repair strategy model; based on the ring attention mechanism, during the iterative reasoning of the offline data-based repair strategy model, dynamically extending the initial reasoning round according to the target task to increase the number of interactions between the offline data-based repair strategy model and the environment, thereby generating the software engineering agent.

[0009] The second aspect of the present invention provides a software engineering agent construction device based on data expansion, including: a use case acquisition module, used to acquire a software engineering data set and input the software engineering data set into a target large language model to generate a code repair test case corresponding to a structured Gherkin scenario; a hybrid training module, used to use the code repair test case to perform hybrid training on a preset offline reinforcement learning method to obtain a repair strategy model based on offline data; an extension generation module, used to iteratively extend the repair strategy model based on offline data according to the target task to generate a software engineering agent.

[0010] Optionally, the use case acquisition module includes: a crawling unit, used to crawl software project data containing high-star GitHub repository links in the PyPI repository; a screening unit, used to screen the software project data containing high-star GitHub repository links to obtain the software engineering dataset; a generation and conversion unit, used to input the software engineering dataset into the target large language model to generate the structured Gherkin scenario, and convert the structured Gherkin scenario into its corresponding code repair test case.

[0011] Optionally, the hybrid training module includes:

[0012] a quality screening unit, configured to perform quality screening on the code repair test cases by using a rejection sampling fine-tuning method to obtain screened code repair test cases;

[0013] The optimization training unit is used to optimize the training of the preset offline reinforcement learning method using the screened code repair test cases to obtain the repair strategy model based on offline data.

[0014] Optionally, the extension generation module includes:

[0015] A setting unit, configured to set an initial reasoning round of the offline data-based repair strategy model;

[0016] An expansion unit is configured to dynamically expand the initial reasoning round according to the target task during the iterative reasoning of the offline data-based repair strategy model based on the ring attention mechanism, so as to increase the number of interactions between the offline data-based repair strategy model and the environment, thereby generating the software engineering intelligent agent.

[0017] The third aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for constructing a software engineering intelligent agent based on data extension as described in the above embodiment.

[0018] A fourth aspect of the present invention provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned method for constructing a software engineering intelligent agent based on data extension.

[0019] The data expansion-based software engineering intelligent agent construction method and device proposed in the embodiment of the present invention construct an efficient data generation pipeline, generate high-quality test cases through structured Gherkin descriptions, optimize model performance using hybrid offline reinforcement learning methods such as rejection sampling fine-tuning, and innovatively introduce "iterative expansion" technology, so that while achieving the automatic generation of high-quality data, the performance and generalization ability of the model in software engineering tasks are significantly improved.

[0020] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0022] Figure 1 A flowchart of a method for constructing a software engineering agent based on data expansion provided by an embodiment of the present invention;

[0023] Figure 2 A schematic diagram of a specific execution of a method for constructing a software engineering agent based on data extension provided by an embodiment of the present invention;

[0024] Figure 3 A comparison chart of the results of the embodiment of the present invention and the existing software engineering automatic repair method;

[0025] Figure 4 A block diagram of a software engineering agent construction device based on data expansion provided by an embodiment of the present invention;

[0026] Figure 5 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION

[0027] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.

[0028] The following describes a method and apparatus for constructing a software engineering agent based on data extension according to an embodiment of the present invention with reference to the accompanying drawings.

[0029] Figure 1 A flowchart of a method for constructing a software engineering intelligent agent based on data extension provided by an embodiment of the present invention.

[0030] like Figure 1 As shown, the method for constructing a software engineering agent based on data expansion includes the following steps:

[0031] In step S101 , a software engineering dataset is obtained and input into a target large language model to generate code repair test cases corresponding to structured Gherkin scenarios.

[0032] In some embodiments, obtaining a software engineering dataset and inputting the software engineering dataset into a target large language model to generate code repair test cases corresponding to structured Gherkin scenarios includes:

[0033] Crawl software project data from PyPI repositories that contain links to high-star GitHub repositories;

[0034] We screened the software project data containing high-star GitHub repository links to obtain the software engineering dataset;

[0035] The software engineering dataset is input into the target large language model to generate structured Gherkin scenarios, and the structured Gherkin scenarios are converted into their corresponding code repair test cases.

[0036] like Figure 2 As shown in the example, in the actual implementation process, the PyPI repository is first automatically crawled to obtain software project data containing links to high-star GitHub repositories. Active projects are screened by setting thresholds of Stars ≥ 5 and PRs ≥ 3. A rule-based filtering method is then used to remove code patches that are too short or too long, resulting in a real software engineering dataset to ensure data diversity and quality. Subsequently, project-related contextual information (including relevant code snippets, metadata, project structure, etc.) is extracted as a basis, and large-scale language models (such as LlaMA and Qwen-Coder) are used to generate structured Gherkin scenario descriptions. This process includes clearly defined preconditions (Given), triggering events (When), and expected results (Then). The generated Gherkin scenarios are then further converted into detailed and specific test code, namely, code repair test cases corresponding to the structured Gherkin scenarios, to automatically verify whether these test cases can successfully reproduce and solve real problems in a Docker environment.

[0037] During implementation, this embodiment of the present invention performs a multi-stage verification process on generated test cases. The first stage uses Gherkin to describe preliminary test scenarios. The second stage utilizes LLM technology to automatically generate Python unit test code and run it in a Docker container environment to verify its accuracy and effectiveness. In the event of failure, this embodiment of the present invention also incorporates a backtracking correction mechanism, utilizing error information returned by Docker to feed back to the large language model, enabling further iteration to generate more accurate test cases.

[0038] In step S102, a code repair test case is used to perform hybrid training on a preset offline reinforcement learning method to obtain a repair strategy model based on offline data.

[0039] In some embodiments, a code repair test case is used to perform hybrid training on a preset offline reinforcement learning method to obtain a repair strategy model based on offline data, including:

[0040] The rejection sampling fine-tuning method is used to screen the quality of code repair test cases to obtain screened code repair test cases;

[0041] The screened code repair test cases are optimized and trained on the preset offline reinforcement learning method to obtain a repair strategy model based on offline data.

[0042] During the actual implementation process, based on the rejection sampling fine-tuning method, a large number of generated candidate code repair patches (i.e., code repair test cases corresponding to structured Gherkin scenarios) are input into large language models (such as LlaMA and DeepSeek-V3) for automatic evaluation to screen out samples with highly consistent functional implementation and high quality. By setting strict standards of "identical" or "mostly identical", only about 65% of high-quality data (i.e., screened code repair test cases) are retained for subsequent training.

[0043] In the post-training phase, embodiments of the present invention combine offline reinforcement learning methods, including KTO (Knowledge Transfer Optimization) and OREO (Offline Reasoning Optimization), to further enhance the model's generalization capabilities. The KTO method aims to adjust the model's decision boundary so that its decision path is closer to the optimal solution path. The OREO method focuses on optimizing the model's reward distribution. By fine-tuning the reward signal, it helps the model more accurately learn which repair paths are more effective. This hybrid optimization training method yields a repair strategy model based on offline data, capable of accurately handling more complex decisions and problems in actual software development environments.

[0044] In step S103, the repair strategy model based on offline data is iteratively extended and reasoned according to the target task to generate a software engineering agent.

[0045] In some embodiments, iteratively extending reasoning on a repair strategy model based on offline data according to a target task to generate a software engineering agent includes:

[0046] Set the initial inference round of the repair strategy model based on offline data;

[0047] Based on the ring attention mechanism, during the iterative reasoning process of the repair strategy model based on offline data, the initial reasoning rounds are dynamically expanded according to the target task to increase the number of interactions between the repair strategy model based on offline data and the environment, thereby generating a software engineering agent.

[0048] During the actual execution process, based on the "iterative expansion" technology that dynamically increases the number of model interactions, the embodiment of the present invention first sets the initial reasoning rounds of the offline data-based repair strategy model to 30 rounds, and then gradually increases it to a maximum of 75 rounds according to specific task requirements. During each round of interaction, the offline data-based repair strategy model will adjust and optimize its own reasoning according to the feedback information of the previous round of reasoning.

[0049] To support longer reasoning chains and contextual information, embodiments of the present invention employ ring-attention, a long-context processing technique. This technique allows the model to effectively handle context lengths ranging from 32k to 160k, significantly expanding the amount of historical information the model can reference and avoiding the information loss common during long-context reasoning. This approach enables the offline data-based repair strategy model to iteratively repair problems more accurately and efficiently when handling complex software engineering tasks, improving overall reasoning success rate and task completion quality.

[0050] The method for constructing a software engineering agent based on data expansion proposed by the present invention is further described below through a specific embodiment.

[0051] The experimental task setting of the embodiment of the present invention is mainly based on the public SWE-bench-Verified benchmark dataset, which selects 500 real and high-quality GitHub issues for evaluating the actual software engineering problem repair capabilities of the offline data-based repair strategy model proposed in the embodiment of the present invention and multiple existing repair strategy models. The models used in the evaluation include 7B and 32B scale language models, and are evaluated using the public OpenHands interactive reasoning framework. The reasoning process of each model sets the initial number of interactions to 30 rounds, and then gradually increases to a maximum of 75 rounds to test the performance improvement effect of the iterative expansion technology. In addition, the accuracy rate (Resolve Rate) is used as the core evaluation indicator in the evaluation, that is, the proportion of unit tests provided by developers that have successfully passed, reflecting the real ability of the model to repair problems in a real environment, Figure 3 It can be seen that the offline data-based repair strategy model constructed in the embodiment of the present invention has a higher resolution rate than multiple existing repair strategy models.

[0052] In summary, the method for constructing a software engineering agent based on data expansion proposed in an embodiment of the present invention has the following effects:

[0053] (1) Build an efficient data generation pipeline that uses a large language model to generate structured test scenario descriptions and corresponding high-quality test cases. This approach effectively solves the problem of lack of test cases or difficulty in reproducing them in existing technologies.

[0054] (2) We adopted a hybrid strategy of rejection sampling fine-tuning and offline reinforcement learning to further optimize the training process and significantly improve the model's performance on software engineering tasks.

[0055] (3) By innovatively proposing the “iterative expansion” technology, the number of interaction rounds is gradually increased during the reasoning process, effectively improving the generalization performance of the model and its ability to solve complex problems.

[0056] Next, a software engineering agent construction device based on data extension proposed in accordance with an embodiment of the present invention will be described with reference to the accompanying drawings.

[0057] Figure 4 It is a block diagram of a software engineering intelligent agent construction device based on data extension according to an embodiment of the present invention.

[0058] like Figure 4 As shown, the software engineering intelligent agent construction device 40 based on data extension includes: a use case acquisition module 401, a hybrid training module 402 and an extension generation module 403.

[0059] The use case acquisition module 401 is used to acquire a software engineering dataset and input it into the target large language model to generate code repair test cases corresponding to structured Gherkin scenarios. The hybrid training module 402 is used to perform hybrid training on a pre-set offline reinforcement learning method using the code repair test cases to obtain a repair strategy model based on offline data. The extended generation module 403 is used to iteratively extend the repair strategy model based on offline data according to the target task to generate a software engineering agent.

[0060] In some embodiments, the use case acquisition module 401 includes: a crawling unit for crawling software project data containing high-star GitHub repository links in the PyPI repository; a screening unit for screening software project data containing high-star GitHub repository links to obtain a software engineering dataset; and a generation conversion unit for inputting the software engineering dataset into the target large language model to generate a structured Gherkin scenario, and converting the structured Gherkin scenario into its corresponding code repair test case.

[0061] In some embodiments, the hybrid training module 402 includes:

[0062] A quality screening unit, configured to perform quality screening on the code repair test cases by adopting a rejection sampling fine-tuning method to obtain screened code repair test cases;

[0063] The optimization training unit is used to optimize the training of the screened code repair test cases using a preset offline reinforcement learning method to obtain a repair strategy model based on offline data.

[0064] In some embodiments, the extension generation module 403 includes:

[0065] A setting unit, used to set the initial inference round of the repair strategy model based on offline data;

[0066] The extension unit is used to dynamically expand the initial reasoning rounds according to the target task during the iterative reasoning process of the repair strategy model based on offline data based on the ring attention mechanism, so as to increase the number of interactions between the repair strategy model based on offline data and the environment, and generate a software engineering intelligent agent.

[0067] It should be noted that the above explanation of the embodiment of the method for constructing a software engineering intelligent agent based on data extension is also applicable to the device for constructing a software engineering intelligent agent based on data extension in this embodiment, and will not be repeated here.

[0068] The software engineering agent construction device based on data expansion proposed in an embodiment of the present invention has the following effects:

[0069] (1) Build an efficient data generation pipeline that uses a large language model to generate structured test scenario descriptions and corresponding high-quality test cases. This approach effectively solves the problem of lack of test cases or difficulty in reproducing them in existing technologies.

[0070] (2) We adopted a hybrid strategy of rejection sampling fine-tuning and offline reinforcement learning to further optimize the training process and significantly improve the model's performance on software engineering tasks.

[0071] (3) By innovatively proposing the “iterative expansion” technology, the number of interaction rounds is gradually increased during the reasoning process, effectively improving the generalization performance of the model and its ability to solve complex problems.

[0072] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device may include:

[0073] Memory 501 , processor 502 , and computer programs stored in the memory 501 and executable on the processor 502 .

[0074] When the processor 502 executes the program, the method for constructing a software engineering agent based on data extension provided in the above embodiment is implemented.

[0075] Furthermore, the electronic device further includes:

[0076] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0077] The memory 501 is used to store computer programs that can be run on the processor 502 .

[0078] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0079] If the memory 501, processor 502, and communication interface 503 are implemented independently, the communication interface 503, memory 501, and processor 502 can be connected to each other via a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0080] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0081] The processor 502 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0082] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for constructing a software engineering intelligent agent based on data extension.

[0083] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.

[0084] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "N" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0085] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or N executable instructions for implementing a custom logical function or step of a process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.

[0086] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or N wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program can be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing it in other suitable ways as necessary, and then storing it in a computer memory.

[0087] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0088] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0089] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.

[0090] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and are not to be construed as limiting the present invention. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for constructing a software engineering agent based on data expansion, characterized in that: The following steps are involved: Obtain a software engineering dataset and input the software engineering dataset into a target large language model to generate code repair test cases corresponding to structured Gherkin scenarios; Using the code repair test case to perform hybrid training on a preset offline reinforcement learning method to obtain a repair strategy model based on offline data; The offline data-based repair strategy model is iteratively extended and reasoned according to the target task to generate a software engineering agent.

2. The method for constructing a software engineering agent based on data expansion according to claim 1, characterized in that: The step of obtaining a software engineering dataset and inputting the software engineering dataset into a target large language model to generate code repair test cases corresponding to structured Gherkin scenarios includes: Crawl software project data from PyPI repositories that contain links to high-star GitHub repositories; Filter the software project data containing the Gaoxing GitHub repository link to obtain the software engineering dataset; The software engineering dataset is input into a target large language model to generate the structured Gherkin scenario, and the structured Gherkin scenario is converted into its corresponding code repair test case.

3. The method for constructing a software engineering agent based on data expansion according to claim 1, characterized in that: The method of hybrid training a preset offline reinforcement learning method using the code repair test case to obtain a repair strategy model based on offline data includes: Using a rejection sampling fine-tuning method to perform quality screening on the code repair test cases to obtain screened code repair test cases; The preset offline reinforcement learning method is optimized and trained using the screened code repair test cases to obtain the repair strategy model based on offline data.

4. The method for constructing a software engineering agent based on data expansion according to claim 1, characterized in that: The iteratively extending reasoning of the offline data-based repair strategy model according to the target task to generate a software engineering agent includes: Setting an initial reasoning round of the offline data-based repair strategy model; Based on the ring attention mechanism, during the iterative reasoning process of the offline data-based repair strategy model, the initial reasoning round is dynamically expanded according to the target task to increase the number of interactions between the offline data-based repair strategy model and the environment, thereby generating the software engineering agent.

5. A software engineering agent construction device based on data expansion, characterized in that: include: A use case acquisition module is used to acquire a software engineering dataset and input the software engineering dataset into a target large language model to generate code repair test cases corresponding to structured Gherkin scenarios; A hybrid training module, configured to perform hybrid training on a preset offline reinforcement learning method using the code repair test case to obtain a repair strategy model based on offline data; The extended generation module is used to iteratively extend the reasoning of the offline data-based repair strategy model according to the target task to generate a software engineering agent.

6. The software engineering agent construction device based on data expansion according to claim 5, characterized in that: The acquisition use case module includes: The crawler unit is used to crawl the software project data in the PyPI repository that contains the high-star GitHub repository link; A screening unit, configured to screen the software project data containing the Gaoxing GitHub repository link to obtain the software engineering dataset; A conversion unit is generated, which is used to input the software engineering dataset into a target large language model to generate the structured Gherkin scenario, and convert the structured Gherkin scenario into its corresponding code repair test case.

7. The software engineering agent construction device based on data expansion according to claim 5, characterized in that: The hybrid training module includes: a quality screening unit, configured to perform quality screening on the code repair test cases by using a rejection sampling fine-tuning method to obtain screened code repair test cases; The optimization training unit is used to optimize the training of the preset offline reinforcement learning method using the screened code repair test cases to obtain the repair strategy model based on offline data.

8. The software engineering agent construction device based on data expansion according to claim 5, characterized in that: The extension generation module includes: A setting unit, configured to set an initial reasoning round of the offline data-based repair strategy model; An expansion unit is configured to dynamically expand the initial reasoning round according to the target task during the iterative reasoning of the offline data-based repair strategy model based on the ring attention mechanism, so as to increase the number of interactions between the offline data-based repair strategy model and the environment, thereby generating the software engineering intelligent agent.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for constructing a software engineering intelligent agent based on data extension as described in any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method for constructing a software engineering intelligent agent based on data extension as described in any one of claims 1 to 4.