Software development method and device, equipment, medium and product
By using large language models to automatically generate software code and test cases, the time-consuming and error-prone problems of manual design and testing during software development in the existing technology are solved, and the automation and quality improvement of software development is achieved.
Patent Information
- Application Number
- CN202411728455.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-21
AI Technical Summary
Existing codeless/low code platforms still require a lot of manual design, testing and fixing bugs during software development, which makes them time-consuming and error-prone and cause project delays.
By obtaining software design requirements, the UML script is determined using a pre-trained large language model, and software code is generated based on the UML script. At the same time, test cases are automatically generated and tested based on software code and UML scripts, and the code is automatically corrected based on the test results.
It realizes automation of the software development process, reduces manual participation, and improves the productivity, efficiency and quality of software development.
Smart Images

Figure CN119669063A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a software development method, device, equipment, medium and product. Background Art
[0002] Software development is the process of building a software system or software part of a system according to user requirements. The software development life cycle includes planning / requirements analysis, design, implementation / coding, testing, deployment and maintenance. Usually these processes are done manually and take a lot of time and effort.
[0003] There are currently various tools and frameworks to automate certain parts of the software development process. These tools can be integrated into the software development pipeline to automate tasks such as testing and deployment to achieve software development.
[0004] However, existing no-code / low-code platforms for application logic require developers to provide very detailed designs, and still need to perform manual work in providing test scripts and bug fixes. These manual tasks are time-consuming and error-prone, leading to project delays in software development. Summary of the invention
[0005] The present invention provides a software development method, device, equipment, medium and product to realize automation of the software development process and reduce development time.
[0006] According to a first aspect of the present invention, there is provided a software development method, comprising:
[0007] Obtain software design requirements for the software to be developed;
[0008] Determine the Unified Modeling Language software UML script according to the software design requirements and the pre-trained large language model;
[0009] Determine the software code that completes the software design requirements according to the UML script and the large language model;
[0010] According to the software code and the UML script, a test case is generated and tested, and the software code is modified based on the obtained test results to obtain the final software code of the software to be developed.
[0011] According to a second aspect of the present invention, there is provided a software development device, comprising:
[0012] Requirements acquisition module, used to obtain software design requirements for the software to be developed;
[0013] A script determination module, used to determine a Unified Modeling Language software UML script according to the software design requirements and a pre-trained large language model;
[0014] A code generation module, used to determine the software code that completes the software design requirements according to the UML script and the large language model;
[0015] The code correction module is used to generate test cases and perform tests according to the software code and the UML script, and to correct the software code based on the obtained test results to obtain the final software code of the software to be developed.
[0016] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the software development method described in any embodiment of the present invention.
[0020] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for enabling a processor to implement the software development method described in any embodiment of the present invention when the computer instructions are executed.
[0021] According to a fifth aspect of the present invention, an embodiment of the present invention further provides a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the software development method of any embodiment of the present invention is implemented.
[0022] The technical solution of the embodiment of the present invention obtains the software design requirements of the software to be developed; determines the Unified Modeling Language software UML script according to the software design requirements and the pre-trained large language model; determines the software code that completes the software design requirements according to the UML script and the large language model; generates and tests test cases according to the software code and the UML script, and corrects the software code based on the obtained test results to obtain the final software code of the software to be developed. The software design requirements are converted into software code through the large language model, and test cases are automatically generated and tested based on the software code and the UML script, and finally the vulnerabilities are automatically corrected based on the test results. The automation of the software development process is realized, human participation is reduced, and the overall productivity, efficiency and quality of software development are improved.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 is a flowchart of a software development method provided according to Embodiment 1 of the present invention;
[0026] Figure 2 is a flowchart of a software development method provided according to Embodiment 2 of the present invention;
[0027] Figure 3 is an example flow chart of a software development method provided according to Embodiment 2 of the present invention;
[0028] Figure 4 is a structural diagram of a software development device provided according to Embodiment 3 of the present invention;
[0029] Figure 5 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Embodiment 1
[0033] Figure 1 A flowchart of a software development method is provided for the first embodiment of the present invention. This embodiment is applicable to the development of software codes. The method can be executed by a software development device. The software development device can be implemented in the form of hardware and / or software. The software development device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0034] S110. Obtain software design requirements for the software to be developed.
[0035] In this embodiment, the software to be developed can be understood as software that needs to be developed. The software design requirements can be understood as requirements for representing the functions to be implemented by the software.
[0036] Specifically, the processor may obtain software design requirements set by engineers related to the software to be developed.
[0037] S120: Determine a Unified Modeling Language software UML script according to software design requirements and a pre-trained large language model.
[0038] In this embodiment, the pre-trained Large Language Model (LLM) can be understood as a model trained according to the purpose of implementation, used to understand natural language and generate corresponding requirements. The Unified Modeling Language (UML) script can be understood as describing the software system design in an object-oriented diagram manner, for example, including class structures, methods and relationships, such as can be generated by a PlantUML script.
[0039] Specifically, the processor can define the software design requirements as small requirements at the module or class level, create a detailed small requirement description for each small requirement, and create a detailed description of the overall software design requirements to obtain an overall requirement description, analyze the small requirement descriptions and the overall requirement description through a large language model pre-trained according to design principles, generate a detailed UML script in a structured format, and review the generated UML script to determine whether the UML script can meet each requirement description and comply with the design specifications.
[0040] S130: Determine the software code that completes the software design requirements based on the UML script and the large language model.
[0041] In this embodiment, the software code can be understood as a code used to implement the functions of the software.
[0042] Specifically, the processor can generate the basic structure of the code according to the content and structure in the UML script, analyze the UML script through a large language model trained with coding standards and coding styles, and assist in generating the function / method logic in the skeleton code to fill in the detailed implementation of the skeleton code and obtain the software code that meets the software design requirements.
[0043] S140, generating test cases and performing tests according to the software code and the UML script, and modifying the software code based on the obtained test results to obtain the final software code of the software to be developed.
[0044] In this embodiment, the test case can be understood as a description of the test task for the software code. The test result can be understood as a document that records the problems found during the test after the test. The final software code can be understood as the software code that has been successfully tested and can meet the software design requirements corresponding to the software to be developed.
[0045] Specifically, the processor can generate test cases based on the software code and UML script, and test the software code based on the test cases to obtain test results. The processor can locate the problem of test failure based on the obtained test results, repair the located problem, correct the software code, and obtain the final software code of the software to be developed.
[0046] The technical solution of the embodiment of the present invention obtains the software design requirements of the software to be developed; determines the Unified Modeling Language software UML script according to the software design requirements and the pre-trained large language model; determines the software code that completes the software design requirements according to the UML script and the large language model; generates and tests test cases according to the software code and the UML script, and corrects the software code based on the obtained test results to obtain the final software code of the software to be developed. The software design requirements are converted into software code through the large language model, and test cases are automatically generated and tested based on the software code and the UML script, and finally the vulnerabilities are automatically corrected based on the test results. The automation of the software development process is realized, human participation is reduced, and the overall productivity, efficiency and quality of software development are improved.
[0047] As a first optional embodiment of the first embodiment, after determining the unified modeling language software UML script according to the software design requirements and the pre-trained large language model, it also includes:
[0048] Generate a modeling tool based on the UML script, and automatically update the software design archive of the software to be developed based on the modeling tool.
[0049] In this embodiment, the modeling tool can be understood as a method for describing the system design, business logic and operation steps included in the software development process, which can include UML diagrams, flow charts and text descriptions. Software design archiving can be understood as a method for recording and saving software design related content during the software development process.
[0050] Specifically, the processor can generate corresponding UML diagrams, flow charts and text descriptions according to the content and structure in the UML script to obtain a modeling tool. The processor can automatically update the software design archive of the software to be developed based on the modeling tool. The processor can also respond to the update of the UML script, thereby triggering the step of generating a modeling tool based on the updated UML script and automatically updating the software design archive of the software to be developed.
[0051] The first optional embodiment of the first embodiment of the present invention ensures that the software design archive is always synchronized with the actual design of the software through such a setting, which provides a basis for subsequent maintenance and function iteration, and enables developers to improve and expand based on the existing design.
[0052] Embodiment 2
[0053] Figure 2 This is a flowchart of a software development method provided in Embodiment 2 of the present invention. This embodiment is a further refinement of the above embodiment. Figure 2 As shown, the method includes:
[0054] S201. Obtain software design requirements for the software to be developed.
[0055] S202: Split the software design requirements to obtain unit design description information.
[0056] In this embodiment, the unit design description information can be understood as design information used to describe more detailed requirements. For example, the unit design description information can be used to outline the purpose, input, output, and interaction of the module or class corresponding to each requirement unit. They can include natural language descriptions or structured data, such as module A sending a command "m" to module B.
[0057] Specifically, the processor or the corresponding developer can decompose the software design requirements, decompose the overall software design requirements into smaller requirement units, and define module or class level requirement units. For each decomposed requirement unit, the processor or the corresponding developer can create a more detailed description to obtain unit design description information.
[0058] S203. Determine overall design description information according to software design requirements.
[0059] In this embodiment, the overall design description information can be understood as information describing the overall design of the entire software.
[0060] Specifically, the processor or developer may develop an overall software design description based on the software design requirements to provide a high-level view of the entire software.
[0061] S204: Based on the design description information of each unit and the overall design description information, an initial UML script is generated through a pre-trained large language model.
[0062] In this embodiment, the initial UML script may be understood as an unchecked UML script.
[0063] Specifically, the processor can provide unit design description information and overall design description information to the pre-trained large language model, instructing the large language model to generate an initial UML script in a structured format, wherein the large language model has received design principle training and can output design artifacts (ie, UML scripts).
[0064] S205: Improve the design document in the initial UML script to obtain a UML script that meets the requirements.
[0065] In this embodiment, the design document can be understood as a software design description in a document form. The condition can be understood as a specification condition corresponding to the design requirement.
[0066] Specifically, since the large language model may not be able to accurately generate the content required by the software design requirements, the processor can review the initial UML script through the preset software design conditions to determine whether the initial UML script can accurately represent the design and whether the design meets the specifications. If it does not meet the conditions, the review results can be fed back to the relevant personnel to update the description information by refining the description information or providing additional description information to generate a more accurate UML script through the large language model.
[0067] S206: Determine a skeleton code according to the UML script and preset code generation rules, wherein the skeleton code includes a reserved placeholder.
[0068] In this embodiment, the preset code generation rules can be understood as rules set for generating code, which specify how to generate classes, methods and variables in the code. The skeleton code can be understood as being used to represent the basic structure of the code. The reserved placeholder can be understood as a symbol or mark used to mark a position in the code, waiting to be replaced by the actual content.
[0069] Specifically, the processor can generate skeleton code representing the basic structure of the code based on the elements of the UML design diagram in the UML script as input through preset code generation rules, and reserve the position of the content to be filled in the skeleton code in the form of reserved placeholders.
[0070] S207 , context-aware encoding is performed on the UML script according to the large language model to obtain a process code.
[0071] In this embodiment, the process code can be understood as the code used to implement the function / method logic.
[0072] Specifically, since the large language model has also undergone coding standard and coding style training, the processor can perform context-aware encoding of the UML script through the large language model to generate process code that implements each detail content.
[0073] S208. Fill the reserved placeholders based on the process codes to obtain the initial software code that completes the software design requirements.
[0074] In this embodiment, the initial software code may be understood as software code that has not been verified.
[0075] Specifically, the processor may fill in the reserved placeholders at corresponding positions based on each process code to obtain the initial software code that completes the software design requirements.
[0076] S209: Check the initial software code based on the UML script to determine the software code that meets the consistency.
[0077] In this embodiment, consistency can be understood as a term used to characterize whether the output of the initial software code is consistent with the output defined in the UML script.
[0078] Specifically, the processor can check the output of the initial software code based on the output defined in the UML script. If there is inconsistency, the processor can output the location of the inconsistent initial software code, and relevant personnel can change the input to correct the output and obtain software code that meets consistency.
[0079] S210: Generate a test case according to the UML script and the large language model, wherein the test case includes a test script and a test specification.
[0080] In this embodiment, the test script can be understood as a set of instructions or codes for automated software testing, which simulates user operations to verify the functions and performance of the software. The test specification can be understood as a set of standardized documents used to guide software testing activities, which defines the test process, methods, tools and standards to ensure software quality and consistency.
[0081] Specifically, the processor can use the UML script as input to the large language model, which has been trained with coding standards and test frameworks (such as GTest). The large language model generates test cases containing test specifications and test scripts to test the corresponding UML script designs. The test cases contain mappings between test cases, test scripts, and software codes. The processor or relevant personnel can review the generated test scripts to ensure that it covers all input designs. If inconsistencies are found, update the design description information and re-execute the code and test script generation process.
[0082] S211. Set up a test environment and test the software code based on the test case to obtain the test results.
[0083] In this embodiment, the test environment can be understood as a special setting for performing software testing, which simulates the actual conditions under which the software runs in order to discover and fix potential problems.
[0084] Specifically, the processor can set up a test environment according to the actual environment when the software to be developed is running, automatically execute the test code based on the test case in the test environment, and the processor can extract the test results.
[0085] S212: When the test result is a test failure, a test vulnerability report is generated according to the test result.
[0086] In this embodiment, a test vulnerability report can be understood as a summary document that may include detailed information about the failure, related design and code components, and any related log files.
[0087] Specifically, the processor may record specific problems and defects during the test according to the test results and generate a test vulnerability report.
[0088] S213. According to the test vulnerability report and the test script, the software code is modified to obtain the final software code of the software to be developed.
[0089] Specifically, the processor can determine the cause of the test failure based on the test vulnerability report, and locate the failure location and the correction plan according to the failure cause, correct the located location through the correction plan, regenerate the corrected software code, and return to continue generating test cases to test the corrected software code to obtain the test results, repeat the above steps until the test result is a successful test, and obtain the final software code of the software to be developed.
[0090] Further, based on the above embodiment, the software code can be modified according to the test vulnerability report and the test script to obtain the final software code of the software to be developed, which can be refined into:
[0091] Determine the cause of failure based on the test vulnerability report and test script; if the cause of failure is a software design error, update the design description information of the error and return to the generation step of the UML script to obtain the corrected code; if the cause of failure is a code error or a test script error, identify the error script content corresponding to the cause of failure in the UML script; use the large language model to repair the vulnerability of the error script content to obtain the corrected code or the corrected test script; retest based on the corrected code or the test corrected script until the test result is a successful test, and then output the software code of the software to be developed.
[0092] In this embodiment, the failure reason is used to determine the solution to fix the failure. The fixed code can be understood as the code after solving the test vulnerability. The error script content can be understood as the content of the UML script with the vulnerability. The fixed test script can be understood as the UML script after the vulnerability is fixed.
[0093] Specifically, the processor can locate the cause of failure based on the test vulnerability report and the test script, because each test failure can be traced back to the test script, and the test script can be traced back to the design artifact (such as the components, class diagrams or activity diagrams contained therein, etc.). Determine the cause of failure. If the cause of failure is a software design error, the processor can send the updated design description information of the error to the relevant personnel, and the relevant personnel can update the design description information of the error, and re-perform the UML script generation step based on the updated design description information to obtain the corrected code. If the cause of failure is a code error or a test script error, the processor can identify the error script content corresponding to the cause of failure in the UML script based on the test script, and perform vulnerability repair on the error script content through the large language model, and integrate the repair results into the software code to form a corrected code, or integrate the repair results into the test script to form a corrected test script, and re-test based on the corrected code or the test correction script, until the test result obtained is a successful test, the software code of the software to be developed is output.
[0094] The technical solution of the embodiment of the present invention, by splitting the software design requirements, determining the unit design description information for describing each unit requirement in more detail, describing the overall software requirements, determining the overall design description information, analyzing the unit design description information and the overall design description information based on the large language model, determining the initial UML script, and improving the initial UML script to obtain a UML script that meets the conditions, provides a prerequisite for the smooth development of subsequent software, and realizes the automation of software design in the software development process. Through the UML script and the preset code generation rules, the skeleton code is defined, the UML script is context-awarely encoded through the large language model, and the skeleton code is filled to obtain the initial software code and check and correct it, determine the software code that meets the consistency, realize the automation of code generation in the software development process, and ensure the accuracy of the generated software code. Test tests are generated through the UML script and the large language model, and the software code is tested based on the test case to determine the test results, thereby realizing the automation of software testing in the software development process. The failure cause of the test failure is located based on the test result, and the failure cause is classified into software design errors and code errors or test script errors, which provides a basis for subsequent error repair. By updating the incorrect design description information or fixing the bugs in the incorrect script content, the corrected code or corrected test script is obtained, and the generation and testing process is continued until the test is successful, and the software code of the software to be developed is output, thus realizing the automation of vulnerability location and repair in the software development process. The overall productivity, efficiency and quality of software development are improved, and the close integration of software design, code generation and testing is ensured, thereby ensuring the accuracy of the developed software.
[0095] Exemplarily, a specific example is used to demonstrate the software development process. Figure 3 This is an example flow chart of a software development method provided in Embodiment 2 of the present invention, such as Figure 3 As shown, the steps of software development are:
[0096] S301. Obtain software design requirements for the software to be developed;
[0097] S302, split the software design requirements and create unit design description information at the module or class level;
[0098] S303, determining overall design description information according to software design requirements;
[0099] S304, based on the design description information of each unit and the overall design description information, generate an initial UML script through a pre-trained large language model;
[0100] S305, improving the design document in the initial UML script;
[0101] S306: Does the initial UML script need to be updated? If yes, jump to step S302; if no, jump to step S307;
[0102] S307, obtaining a UML script that meets the conditions;
[0103] S308, determining a skeleton code according to the UML script and preset code generation rules, wherein the skeleton code includes a reserved placeholder;
[0104] S309, performing context-aware encoding on the UML script according to the large language model to obtain a process code;
[0105] S310, filling the reserved placeholders based on each process code to obtain the initial software code that completes the software design requirements;
[0106] S311, checking the initial software code based on the UML script to determine the software code that meets the consistency;
[0107] S312: Does the initial software code need to be updated? If yes, jump to step S308; if no, jump to step S313;
[0108] S313, obtaining software code that meets consistency;
[0109] S314, generating a test case according to the UML script and the large language model, wherein the test case includes a test script and a test specification;
[0110] S315: Does the test case need to be updated? If yes, jump to step S314; if no, jump to step S316;
[0111] S316, setting a test environment and testing the software code based on the test case to obtain the test result;
[0112] S317, is the test result successful? If yes, then it is finished. If no, then jump to step S318;
[0113] S318. Generate a test vulnerability report based on the test results and determine the cause of failure;
[0114] S319: Is the failure caused by a software design error? If yes, jump to step S320; if no, jump to step S321;
[0115] S320, updating the erroneous design description information, and returning to step S306;
[0116] S321, identifying error script content;
[0117] S322. Repair the erroneous script content through the large language model to obtain the corrected code / corrected test script, and return to step S315.
[0118] Embodiment 3
[0119] Figure 4 This is a schematic diagram of the structure of a software development device provided by Embodiment 3 of the present invention. Figure 4 As shown, the device comprises:
[0120] The requirement acquisition module 41 is used to acquire the software design requirements of the software to be developed;
[0121] A script determination module 42, for determining a Unified Modeling Language software UML script according to the software design requirements and the pre-trained large language model;
[0122] A code generation module 43, used to determine the software code that completes the software design requirements according to the UML script and the large language model;
[0123] The code correction module 44 is used to generate a test case and perform a test according to the software code and the UML script, and to correct the software code based on the obtained test results to obtain the final software code of the software to be developed.
[0124] The technical solution of the embodiment of the present invention obtains the software design requirements of the software to be developed; determines the Unified Modeling Language software UML script according to the software design requirements and the pre-trained large language model; determines the software code that completes the software design requirements according to the UML script and the large language model; generates and tests test cases according to the software code and the UML script, and corrects the software code based on the obtained test results to obtain the final software code of the software to be developed. The software design requirements are converted into software code through the large language model, and test cases are automatically generated and tested based on the software code and the UML script, and finally the vulnerabilities are automatically corrected based on the test results. The automation of the software development process is realized, human participation is reduced, and the overall productivity, efficiency and quality of software development are improved.
[0125] Furthermore, the script determination module 42 is specifically used for:
[0126] Splitting the software design requirements to obtain unit design description information;
[0127] Determine the overall design description information according to the software design requirements;
[0128] Based on the unit design description information and the overall design description information, an initial UML script is generated through a pre-trained large language model;
[0129] The design document in the initial UML script is improved to obtain a UML script that meets the conditions.
[0130] Furthermore, the code generation module 43 is specifically used for:
[0131] Determine a skeleton code according to the UML script and preset code generation rules, wherein the skeleton code includes a reserved placeholder;
[0132] Performing context-aware encoding on the UML script according to the large language model to obtain a process code;
[0133] Filling the reserved placeholders based on each of the process codes to obtain initial software codes that complete the software design requirements;
[0134] The initial software code is checked based on the UML script to determine the software code that meets the consistency.
[0135] Furthermore, the code correction module 44 includes:
[0136] A case generation unit, used to generate a test case according to the UML script and the large language model, wherein the test case includes a test script and a test specification;
[0137] A result determination unit, used for setting a test environment and testing the software code based on the test case to obtain a test result;
[0138] A report generating unit, configured to generate a test vulnerability report according to the test result when the test result is a test failure;
[0139] A code correction unit is used to correct the software code according to the test vulnerability report and the test script to obtain the final software code of the software to be developed.
[0140] Wherein, the code correction unit is specifically used for:
[0141] Determine the cause of failure based on the test vulnerability report and the test script;
[0142] If the failure reason is a software design error, then updating the design description information of the error and returning to the generation step of the UML script to obtain a correction code;
[0143] If the failure cause is a code error or a test script error, identifying the error script content corresponding to the failure cause in the UML script;
[0144] Repair the vulnerability of the erroneous script content by using the large language model to obtain the correction code or the correction test script;
[0145] The test is re-performed based on the correction code or the test correction script until the test result obtained is that the test is successful, and the software code of the software to be developed is output.
[0146] Optionally, the device further comprises:
[0147] The tool archiving module is used to generate a modeling tool according to the UML script after determining the unified modeling language software UML script according to the software design requirements and the pre-trained large language model, and automatically update the software design archive of the software to be developed based on the modeling tool.
[0148] The software development device provided in the embodiment of the present invention can execute the software development method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0149] Embodiment 4
[0150] Figure 5A schematic diagram of an electronic device 50 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0151] like Figure 5 As shown, the electronic device 50 includes at least one processor 51, and a memory connected to the at least one processor 51 in communication, such as a read-only memory (ROM) 52, a random access memory (RAM) 53, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 51 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 52 or the computer program loaded from the storage unit 58 to the random access memory (RAM) 53. In the RAM 53, various programs and data required for the operation of the electronic device 50 can also be stored. The processor 51, the ROM 52, and the RAM 53 are connected to each other via a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.
[0152] A number of components in the electronic device 50 are connected to the I / O interface 55, including: an input unit 56, such as a keyboard, a mouse, etc.; an output unit 57, such as various types of displays, speakers, etc.; a storage unit 58, such as a disk, an optical disk, etc.; and a communication unit 59, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 59 allows the electronic device 50 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0153] The processor 51 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 51 executes the various methods and processes described above, such as software development methods.
[0154] In some embodiments, the software development method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 58. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 50 via the ROM 52 and / or the communication unit 59. When the computer program is loaded into the RAM 53 and executed by the processor 51, one or more steps of the software development method described above may be performed. Alternatively, in other embodiments, the processor 51 may be configured to execute the software development method in any other appropriate manner (e.g., by means of firmware).
[0155] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0156] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0157] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0158] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0159] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0160] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0161] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the software development method of any embodiment of the present invention when executed by a processor.
[0162] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0163] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0164] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A software development method, characterized in that: include: Obtain software design requirements for the software to be developed; Determine the Unified Modeling Language software UML script according to the software design requirements and the pre-trained large language model; Determine the software code that completes the software design requirements according to the UML script and the large language model; According to the software code and the UML script, a test case is generated and tested, and the software code is modified based on the obtained test results to obtain the final software code of the software to be developed.
2. The method according to claim 1, characterized in that Determining a unified modeling language software UML script according to the software design requirements and the pre-trained large language model includes: Splitting the software design requirements to obtain unit design description information; Determine the overall design description information according to the software design requirements; Based on the unit design description information and the overall design description information, an initial UML script is generated through a pre-trained large language model; The design document in the initial UML script is improved to obtain a UML script that meets the conditions.
3. The method according to claim 1, characterized in that Determining the software code that completes the software design requirements according to the UML script and the large language model includes: Determine a skeleton code according to the UML script and preset code generation rules, wherein the skeleton code includes a reserved placeholder; Performing context-aware encoding on the UML script according to the large language model to obtain a process code; Filling the reserved placeholders based on each of the process codes to obtain initial software codes that complete the software design requirements; The initial software code is checked based on the UML script to determine the software code that meets the consistency.
4. The method according to claim 1, characterized in that The generating of test cases and performing tests according to the software code and the UML script, and modifying the software code based on the obtained test results to obtain the final software code of the software to be developed, includes: Generate a test case according to the UML script and the large language model, wherein the test case includes a test script and a test specification; Setting a test environment and testing the software code based on the test case to obtain a test result; When the test result is a test failure, generating a test vulnerability report according to the test result; The software code is modified according to the test vulnerability report and the test script to obtain the final software code of the software to be developed.
5. The method according to claim 4, characterized in that The step of correcting the software code according to the test vulnerability report and the test script to obtain the final software code of the software to be developed includes: Determine the cause of failure based on the test vulnerability report and the test script; If the failure reason is a software design error, then updating the design description information of the error and returning to the generation step of the UML script to obtain a correction code; If the failure cause is a code error or a test script error, identifying the error script content corresponding to the failure cause in the UML script; Repair the vulnerability of the erroneous script content by using the large language model to obtain the correction code or the correction test script; The test is re-performed based on the correction code or the test correction script until the test result obtained is that the test is successful, and the software code of the software to be developed is output.
6. The method according to claim 1, characterized in that After determining the Unified Modeling Language software UML script according to the software design requirements and the pre-trained large language model, the method further includes: A modeling tool is generated according to the UML script, and the software design archive of the software to be developed is automatically updated based on the modeling tool.
7. A software development device, characterized in that: include: Requirements acquisition module, used to obtain software design requirements for the software to be developed; A script determination module, used to determine a Unified Modeling Language software UML script according to the software design requirements and a pre-trained large language model; A code generation module, used to determine the software code that completes the software design requirements according to the UML script and the large language model; The code correction module is used to generate test cases and perform tests according to the software code and the UML script, and to correct the software code based on the obtained test results to obtain the final software code of the software to be developed.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the software development method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the software development method according to any one of claims 1 to 4 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the software development method according to any one of claims 1 to 4.