Method, system, and program for assisting in prompt generation in programs developed by generative AI.
The system addresses the issue of inconsistent AI-generated code by using rule-based source code generation and knowledge databases to ensure high-quality and maintainable code through systematic design processes.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-25
AI Technical Summary
Conventional AI coding assistance tools lack the ability to ensure overall system consistency and design quality, often generating complex and unmaintainable code due to the absence of an upstream design process and synchronization with design documents.
A system and method that involves generating rule source code, registering it in a memory database, identifying parameter values for modification using knowledge databases, and generating prompts for AI to ensure high-quality and maintainable code generation.
Enables efficient generation of high-quality and maintainable code by integrating AI assistance with systematic design processes.
Smart Images

Figure 0007835490000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a technology for assisting software development by utilizing artificial intelligence (AI).
Background Art
[0002] In recent years, with the development of AI technologies such as large language models (LLMs), technologies for automatically generating program code (e.g., GitHub Copilot, etc.) have become widespread. These tools can complement the subsequent code or generate an entire function based on natural language instructions (prompts) entered by the user or existing code fragments.
[0003] On the other hand, the inventor of the present application has developed a technology for analyzing existing source code such as COBOL and visualizing its processing content in the migration of legacy systems. Patent Document 1 is a patent publication regarding that technology. In the technology of Patent Document 1, data for generating a flowchart is generated from the source code, enabling accurate understanding of the processing flow.
Prior Art Documents
Patent Documents
[0004]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0005] Conventional AI coding assistance tools mainly assist the "implementation (coding)" process locally and do not guarantee the overall system consistency and design quality. Therefore, for example, when a user gives an abstract instruction such as "create a shopping site", if the AI immediately generates source code, it becomes difficult to verify whether the code generated by the black-boxed internal processing meets the intended specifications.
[0006] Furthermore, if the generated code contains bugs, AI tends to make stopgap fixes (patchwork-like corrections), resulting in complex code (spaghetti code) and a significant decrease in maintainability. This stems from the absence of an upstream "design" process, or a lack of synchronization between the design documents and the code.
[0007] This invention has been made in view of the above problems, and aims to provide a system development environment that enables the efficient generation of high-quality and maintainable code with the assistance of AI. [Means for solving the problem]
[0008] The present invention provides a method comprising: a phase of generating rule source code with functional information added by completing omitted parts of source code and expanding compound syntax, and registering it as memory data in a memory database; a phase of registering modification method data generated based on the rule source code before and after modification as knowledge data in a knowledge database; and a phase of identifying parameter values for modification based on memory data and knowledge data related to the source code to be modified, generating a prompt including the identified parameter values, and obtaining the modified source code by inputting the generated prompt into a generation AI; a system for executing the method; and a program for causing a computer to function as a system for executing the method. [Effects of the Invention]
[0009] According to the present invention, high-quality and maintainable code can be efficiently generated with the assistance of AI. [Brief explanation of the drawing]
[0010] [Figure 1] This is an overall system configuration diagram relating to one embodiment of the present invention. [Figure 2]This figure shows an example of existing source code (COBOL) that will be subject to modification. [Figure 3A] This figure shows an example of the rule source code generated in Phase 1. [Figure 3B] This figure shows an example of the rule source code generated in Phase 1. [Figure 3C] This figure shows an example of the rule source code generated in Phase 1. [Figure 3D] This figure shows an example of the rule source code generated in Phase 1. [Figure 4] This figure shows an example of a control instruction statement summary generated based on the rule source code. [Figure 5] This figure shows an example of a relationship diagram illustrating dependencies between sections. [Figure 6] This figure shows an example of a CALL list, which illustrates the call relationships between programs. [Figure 7] This figure shows an example of a hierarchical diagram illustrating the hierarchical relationships between processes. [Figure 8] This figure shows an example of a natural language flowchart generated based on annotations. [Figure 9] This figure shows a list of COPY clauses used in the program. [Figure 10A] This figure shows an example of a source code comparison table (source code before changes) generated in Phase 2. [Figure 10B] This figure shows an example of a source code comparison table (modified source code) generated in Phase 2. [Figure 11] This figure shows an example of a comparison table of control instruction summary generated in Phase 2. [Figure 12A] This figure shows an example of a natural language flowchart comparison diagram generated in Phase 2 (corresponding to the source code before modification). [Figure 12B] This figure shows an example of a natural language flowchart comparison diagram generated in Phase 2 (corresponding to the modified source code). [Figure 13] It is a diagram showing an example of a change pattern list registered in the knowledge DB. [Figure 14] It is a diagram showing an example of change method data registered in the knowledge DB. [Figure 15] It is a diagram showing an example of a prompt creation screen displayed in Phase 3. [Figure 16] It is a diagram showing a part of the source code to be changed in Phase 3. [Figure 17] It is a diagram showing an example of a content confirmation screen before prompt generation. [Figure 18] It is a diagram showing an example of a change instruction prompt automatically generated by the system. [Figure 19] It is a diagram showing an example of the AI-generated source code after change output from the generation AI. [Figure 20] It is a diagram showing an example of the difference information output from the generation AI. [Figure 21] It is a diagram showing an example of the walkthrough confirmation information output from the generation AI. [Figure 22] It is a diagram showing an example of a confirmation analysis document (source code comparison table) generated for verification in Phase 3. [Figure 23A] It is a diagram showing an example of a confirmation analysis document (natural language flowchart comparison diagram, corresponding to the source code before change) generated for verification in Phase 3. [Figure 23B] It is a diagram showing an example of a confirmation analysis document (natural language flowchart comparison diagram, corresponding to the AI-generated source code after change) generated for verification in Phase 3.
Mode for Carrying Out the Invention
[0011] Hereinafter, the system 1 according to an embodiment of the present invention will be described. The system 1 is a system that supports change work for an existing computer program (hereinafter simply referred to as "program").
[0012] Figure 1 shows the configuration of System 1. However, in addition to System 1, Figure 1 also depicts a generation AI server device 2 with which System 1 communicates via a communication network.
[0013] The system 1 illustrated in Figure 1 consists of a terminal device 11 and a server device 12, but system 1 may also consist of a single computer. Furthermore, the server device 12 may consist of multiple server devices that operate in coordination with each other.
[0014] The generation AI server device 2 is a server device that provides an external AI platform (for example, a large-scale language model such as the GPT series provided by OpenAI).
[0015] The support processing by System 1 is broadly composed of three stages (phases). The first stage (Phase 1) is the phase in which an engineer or System 1 analyzes the structure of the source code that has been updated to the latest state and registers the analysis results as memory data in the memory database (hereinafter, "Memory DB"). The second stage (Phase 2) is the phase in which an engineer or System 1 identifies the method of change made to the source code in the past and registers the change method data indicating the identified change method as knowledge data in the knowledge database (hereinafter, "Knowledge DB"). The third stage (Phase 3) is the operation phase in which a prompt is generated to instruct the generation AI to perform the change work on the source code to be changed using the information from the Memory DB and Knowledge DB, and the modified source code generated by the generation AI according to the prompt is verified. Parameter values included in the prompt used in Phase 3 are registered in the Knowledge DB.
[0016] System 1 is realized by one or more computers executing data processing according to the application program of this embodiment. That is, the application program of this embodiment is a program that causes one or more computers to execute the data processing that System 1 performs, as described below.
[0017] [Phase 1] In Phase 1, the engineer or System 1 analyzes the source code of the program, which has been updated to the latest version, and stores the analysis results in a database called the Storage DB.
[0018] System 1 always manages the latest source code information through the memory database, which is updated in Phase 1.
[0019] Figure 2 shows an example of the source code of an existing program that will be modified by System 1. In the example shown in Figure 2, the source code is written in COBOL (Common Business Oriented Language).
[0020] (Generating rule source code) The engineer or System 1 generates rule source code from the source code. Figures 3A to 3D show examples of rule source code. When System 1 generates rule source code, it may do so using a rule-based method, or it may input the new source code into a trained model (AI) that has been machine learning using rule source code previously generated by the engineer as training data, and obtain the rule source code output from the trained model.
[0021] The following points are particularly important when an engineer or System 1 generates rule source code from source code:
[0022] The engineer or system 1 identifies the function (e.g., output statement, call statement, etc.) of each line of code written in the source code and enters the identified function into the "Syntax" field of the rule source code.
[0023] Furthermore, if there are any instances in the source code where the description is omitted (for example, control structures that the compiler implicitly interprets, such as THEN and ELSE), the engineer or System 1 will add those omitted lines of code.
[0024] Furthermore, if a syntax contains multiple functions, the engineer or system 1 expands those syntaxes into multiple lines of code corresponding to each function.
[0025] Furthermore, the engineer or System 1 enters a note in the "Notes" field for each line of code, indicating its meaning in natural language (for example, Japanese).
[0026] (Generating a control instruction summary) System 1 generates a control instruction summary based on the rule source code. Figure 4 shows an example of a control instruction summary. The control instruction summary lists the start line, end line, step number, maximum nesting level, and usage count of major control statements for each section.
[0027] (Generating relationship tables and diagrams) System 1 identifies dependencies and interoperability between sections based on the rule source code and generates relationship tables and diagrams illustrating these relationships. Figure 5 shows an example of a relationship diagram.
[0028] (Generating a CALL list) System 1 generates a CALL list based on the rule source code. Figure 6 shows an example of a CALL list (data structure). The CALL list is a list that shows the relationship between the caller and the called in a CALL statement, and the arguments passed between them.
[0029] (Generating a hierarchical diagram) System 1 organizes the hierarchical structure of sections based on the rule source code and generates a hierarchical diagram showing the hierarchical relationships of the processes. Figure 7 shows an example of a hierarchical diagram.
[0030] (Generating natural language flowcharts) System 1 generates a natural language flowchart that shows the execution order of the program based on the rule source code. The natural language flowchart is designed to clearly communicate the execution order of the process to the user by using annotations written in natural language (e.g., Japanese) that explain the meaning of the code, either in place of or in addition to the code itself. Figure 8 shows an example of a natural language flowchart.
[0031] (Generating a list of COPY clauses) System 1 generates a COPY clause list based on the rule source code. Figure 9 shows an example of a COPY clause list (data structure). The COPY clause list is a list that shows the code line, COPY clause file name, whether it has been expanded or not, and the source code for each COPY clause used in the program.
[0032] (Registration to the memory database) System 1 registers the generated information described above into the memory database. The memory database is generated for each source code, each time a change is made, for each new version. The memory database thus accumulated is used to generate the knowledge database in Phase 2, which will be described next.
[0033] [Phase 2] Phase 2 is the phase in which an engineer or System 1 identifies the method of change made to the source code in the past and registers the change method data, which shows the identified change method, as knowledge data in the knowledge database.
[0034] In Phase 2, knowledge data is generated using memory databases for each of the adjacent versions of the same source code (for example, Ver. 1.1 and Ver. 1.2 of source code A). Hereafter, the older of two adjacent versions of the same source code will be referred to as the "pre-modification source code," and the newer one as the "post-modification source code."
[0035] <Work process 1> System 1 first performs the first work step by comparing the information of the source code before the change and the information of the source code after the change, both of which are registered in the memory DB, to identify the parts of the program that have been changed and what those changes are.
[0036] (Generating a source code comparison table) System 1 compares the rule source code of the source code before the change with the rule source code of the source code after the change to identify the differences and generates a source code comparison table that highlights the identified differences. Figures 10A and 10B show examples of source code comparison tables. Figure 10A is the source code before the change, and Figure 10B is the source code after the change.
[0037] (Comparison of analysis data) System 1 compares various analysis materials of the source code before the change (e.g., control instruction summary) with various analysis materials of the source code after the change.
[0038] System 1 identifies the differences between the two based on this comparison and generates an analysis data comparison table or analysis data comparison diagram that highlights the identified differences.
[0039] Figure 11 shows an example of a control instruction summary comparison table, which is one of the analysis data comparison tables. Figures 12A and 12B show examples of natural language flowchart comparison tables, which are also one of the analysis data comparison tables. Figure 12A is a natural language flowchart corresponding to the source code before modification, and Figure 12B is a natural language flowchart corresponding to the source code after modification.
[0040] The information generated in step 1 is registered in the knowledge database.
[0041] <Work process 2> Next, a skilled engineer (user) or System 1, as part of work step 2, identifies the content of the change and generates change method data indicating the content of the identified change. The information generated in work step 1 is referenced in work step 2. Work step 2 may be performed in any of the following ways: (1) by an engineer, (2) by an engineer with the assistance of a generation AI, etc., or (3) by System 1 using a generation AI, etc. However, during the training period until the AI can perform work step 2 with sufficient accuracy, form (1) or (2) will be adopted.
[0042] In process 2, the following information is identified: (a) Natural language expression describing the changes (b) Patterns of change (c) Source code name (d) Name of the section to be addressed (e) Changes
[0043] (a) The natural language representation of the changes is information used to identify individual knowledge data, such as "Added a process to prompt the user for confirmation when deleting XX." This information is generated using natural language (such as Japanese) written in the "Notes" section of the rule source code.
[0044] (b) Change patterns are information (hereinafter referred to as "change pattern data") that indicates the scope, basic operation, and maintenance conditions for each of the various change patterns.
[0045] Change pattern data is sequentially registered in the change pattern list within the knowledge database. Figure 13 shows an example of the change pattern list. The change pattern data included in the change pattern list is data that indicates the method of modification, which is an essential requirement for generating prompts that instruct the generating AI to make the correct changes to the source code.
[0046] In work process 2, the engineer or system 1, while referring to the change pattern data already registered in the change pattern list, generates change pattern data corresponding to the change pattern in the source code before and after the target change, and adds it to the change pattern list.
[0047] (c) The source code name is the name of the source code before and after the change being addressed.
[0048] (d) The name of the section to be changed is the name of the section that was changed.
[0049] (e) The change is indicated by the line number of the modified code.
[0050] The information identified as described above is registered in the knowledge database as change method data. Figure 14 shows an example of change method data registered in the knowledge database in this way. In Figure 14, "Change Location 1" is an example of change method data related to "process insertion," and "Change Location 2" is an example of change method data related to "replacement processing."
[0051] [Phase 3] Phase 3 is an operational phase in which information from the knowledge database is used to generate prompts that instruct the generation AI to perform changes to the source code that needs to be modified, and the modified source code generated by the generation AI in accordance with those prompts is verified.
[0052] First, the engineer or System 1 identifies the content of the changes to be made to the source code before the change, based on the analysis results (for example, a natural language flowchart (Figure 8), etc.) indicated by the stored data regarding the source code to be changed (the source code before the change during operation) registered in the storage DB.
[0053] Next, the engineer or system 1 generates change method data for the changes to be made to the source code before the changes, referring to the change method data registered in the knowledge database, which indicates past change methods (Figure 14).
[0054] Next, System 1 displays the prompt creation screen. Figure 15 shows an example of the prompt creation screen.
[0055] On the prompt creation screen, the parameter values for the changes indicated by the change method data generated for the source code before the changes, as described above, are automatically entered into the input fields corresponding to those parameter values and displayed. Figure 15 shows, as an example, the prompt creation screen that appears when a new change related to "Inserting a process," as exemplified as "Change 1" in Figure 14, is made to the source code before the changes, a portion of which is shown in Figure 16.
[0056] On the prompt creation screen (Figure 15), the engineer clicks the "Template" button, etc., to display the change pattern list (Figure 13) registered in the knowledge database in Phase 2. Using the information shown in the displayed change pattern list as a reference, the engineer makes the necessary modifications to the various parameter values displayed on the prompt creation screen. If the engineer clicks the "Confirmation Screen" button shown to the right of each parameter value input field (such as the "Defect Details" field), the parameter values entered in the input field will be displayed in a large window.
[0057] Furthermore, the change patterns registered in the change pattern list may have associated parameter values (data entered in fields such as corresponding algorithm and Japanese prompt) entered in the prompt creation screen during the modification work of that change pattern performed in Phase 3, or prompts generated using those parameter values (see Figure 18 below). Engineers modify the parameter values on the prompt creation screen while referring to these parameter values or prompts displayed in the change pattern list.
[0058] Once the technician has finished checking the parameter values and making all necessary corrections on the prompt creation screen, they perform an action such as clicking the "Start Prompt Creation" button.
[0059] In response to this operation, System 1 displays a confirmation screen. Figure 17 shows an example of the confirmation screen. The technician checks the contents displayed on the confirmation screen, and if there are no problems, they click the "Yes (Continue)" button or perform other actions.
[0060] In response to this operation, System 1 generates a prompt (change instruction prompt) by inserting the information entered on the prompt creation screen into the corresponding location in a pre-stored prompt template. Figure 18 shows an example of a prompt generated by System 1.
[0061] Next, System 1 inputs the prompt generated as described above into the Generating AI. This input of the prompt from System 1 to the Generating AI is performed, for example, by sending a prompt from Terminal Device 11 to Generating AI Server Device 2.
[0062] Upon receiving a prompt from System 1, the Generating AI (Generating AI Server Device 2) retrieves memory data and knowledge data related to the source code before modification from the memory DB and knowledge DB stored in Server Device 12, in accordance with the prompt. Specifically, the Generating AI retrieves data from the API provided by System 1 via a mechanism such as RAG (Search and Extended Generation). Alternatively, instead of retrieving memory data and knowledge data from Server Device 12, the Generating AI may retrieve memory data and knowledge data from the system (for example, Terminal Device 11), for example, as part of a prompt.
[0063] The generating AI uses the memory data and knowledge data acquired as described above to generate the modified source code (hereinafter referred to as "AI-generated modified source code"), the difference information between the original source code and the AI-generated modified source code, and walkthrough test information showing the content of the walkthrough test performed by the generating AI, in accordance with the prompt. In response to the prompt, the generating AI sends the AI-generated modified source code, the difference information, and the walkthrough test information generated as described above to the terminal device 11.
[0064] Figure 19 is an example of a portion of the modified source code generated by the terminal device 11 from the generated AI. Figure 20 is an example of the differential information received by the terminal device 11 from the generated AI. Figure 21 is an example of the walkthrough test information received by the terminal device 11 from the generated AI.
[0065] When System 1 receives the above information from the generated AI, the engineer or System 1 generates memory data with respect to the AI-generated source code after modification, following the same procedure as in Phase 1 described above, and registers the generated memory data in the memory DB.
[0066] Next, System 1 generates various analysis information based on the newly registered data in the memory DB regarding the AI-generated source code after modification and the memory data registered in the memory DB regarding the source code before modification, following the same procedure as in Phase 2 described above. Figure 22 shows an example of a source code comparison table, which is one of the analysis information generated by System 1 regarding the AI-generated source code after modification. Figures 23A and 23B show examples of natural language flowchart comparison diagrams, which are one of the analysis information generated by System 1. Figure 23A is a natural language flowchart corresponding to the source code before modification, and Figure 23B is a natural language flowchart corresponding to the AI-generated source code after modification.
[0067] System 1 displays the AI-generated source code after the changes, the difference information, and the walkthrough test information returned from the generating AI, along with the generated analysis information, on the screen. Based on the information displayed by System 1, the engineer verifies whether the intended changes have been correctly made to the source code before the changes.
[0068] If the verification reveals that the intended changes were not made correctly, the technician will have System 1 redisplay the prompt creation screen (Figure 15). The technician will then make the necessary corrections on the prompt creation screen and perform an action such as clicking the "Start Prompt Creation" button again. As a result, System 1 will repeat the subsequent processing based on the corrected content.
[0069] On the other hand, if the verification confirms that the intended changes have been made correctly, the engineer performs an operation such as clicking the "Register" button on the screen displayed by System 1. In response to this operation, System 1 registers the information used to generate the successfully created prompt—that is, the parameter values entered in each input field displayed on the prompt creation screen (Figure 15) at the end (or the entire prompt including those parameter values)—as part of the knowledge data in the change pattern list (Figure 13) of the knowledge database. Thus, the data added to the change pattern list in Phase 3 includes fields such as "Scope" to "Remarks" as shown in Figure 13, as well as fields corresponding to the input fields displayed on the prompt creation screen, such as "Defect Details" and "Corresponding Algorithm," and the parameter values that were actually used in the past are entered into these fields.
[0070] The verification process of the AI-generated source code after modification (the process of confirming whether the intended changes have been correctly implemented in the AI-generated source code after modification) may be performed by System 1 using AI instead of a human engineer.
[0071] In addition, some or all of the tasks that were to be performed by the engineer in the above-described embodiment may be performed by System 1. In that case, System 1 will perform data processing corresponding to those tasks on behalf of the engineer, using rule-based systems, trained models (AI), etc.
[0072] According to System 1 as described above, engineers can easily and reliably perform modification work on the source code. [Explanation of symbols]
[0073] 1...System, 11...Terminal device, 12...Server device, 2...Generating AI server device
Claims
1. A method for a computer to generate a knowledge database, which is a database, The steps include: obtaining the rule source code for the source code before the change and the source code after the change from a storage database, which is a database that stores the rule source code for the source code before the change and the source code after the change, where, if there are parts in the source code where the description is omitted, the omitted code lines are added to the omitted parts, and if the source code contains syntax that has multiple functions in one syntax, the code lines corresponding to that syntax are expanded into code lines corresponding to each of those multiple functions, and for each of the multiple code lines contained in the source code in which the omitted code lines have been added and the code lines corresponding to the syntax with multiple functions have been expanded, information indicating the function of that code line is added, and obtaining the rule source code for the source code before the change and the source code after the change from a storage database, which is a database that stores the rule source code for the source code before the change and the source code after the change as stored data; A step of generating change method data that indicates how to change from the source code before the change to the source code after the change, based on the rule source code obtained with respect to the source code before the change and the rule source code obtained with respect to the source code after the change, The steps include generating the knowledge database in which the aforementioned modification method data is registered as knowledge data, and generating the knowledge database in which the aforementioned modification method data is registered as knowledge data. A method for providing this.
2. A computer, For each of the multiple source code files, if there are parts where the description is omitted in the source code, the omitted code lines are added to the omitted parts, and if the source code contains syntax that has multiple functions in one syntax, the code lines corresponding to that syntax are expanded into code lines corresponding to each of the multiple functions, and for each of the multiple code lines contained in the source code in which the omitted code lines have been added and the code lines corresponding to the syntax with multiple functions have been expanded, information indicating the function of that code line is added, and the storage data relating to the source code to be modified is obtained from a storage database, which is a database that stores the rule source code corresponding to the source code to be modified as storage data, and the knowledge data relating to the source code to be modified is obtained from a knowledge database generated by the method of claim 1, The steps include identifying parameter values for the changes to be made to the source code to be modified based on the acquired storage data and knowledge data, The steps include generating a prompt that includes the identified parameter value and instructs the generating AI to make changes to the source code to be modified according to the parameter value, The steps include inputting the generated prompt to the generating AI, and obtaining the source code output from the generating AI as a response to the input as the source code after AI generation modification. A method for providing this.
3. A computer, The method for claim 1 is to perform all the steps of the method for claim 1, using the AI-generated modified source code obtained by the method for claim 2 as the source code, and if there are parts in the source code where the description is omitted, the omitted code lines are added to the omitted parts, and if the source code contains syntax that has multiple functions in one syntax, the code lines corresponding to the syntax are expanded into code lines corresponding to each of the multiple functions, and for each of the multiple code lines contained in the source code in which the omitted code lines have been added and the code lines corresponding to the syntax with multiple functions have been expanded, information indicating the function of the code line is added, and from the storage database in which the rule source code corresponding to the source code is registered, the source code to be modified in the method for claim 2 is used as the source code before modification, and the AI-generated modified source code in the method for claim 2 is used as the modified source code. When performing the step of registering the knowledge data provided by the method of claim 1 in the knowledge database with respect to the source code to be modified and the AI-generated modified source code in the method of claim 2, the step of registering the parameter values used to generate the prompt used in the method of claim 2 as knowledge data in the knowledge database, A method for providing this.
4. With respect to the source code, if there is a part in the source code where the description is omitted, the omitted code line is added to the omitted part, If the source code contains syntax that has multiple functions in a single syntax, the code lines corresponding to that syntax are expanded into code lines corresponding to each of those multiple functions. For each of the multiple lines of code included in the source code, in which omitted lines of code have been added and lines of code corresponding to syntax with multiple functions have been expanded, information indicating the function of the line of code is added to generate a rule source code corresponding to the source code. The rule source code is registered as stored data in the storage database. From the aforementioned storage database, obtain the rule source code for both the source code before the change and the source code after the change. Based on the rule source code obtained for the source code before the change and the rule source code obtained for the source code after the change, change method data indicating how to change from the source code before the change to the source code after the change is generated. The aforementioned modification method data is registered as knowledge data in the knowledge database. system.
5. From the aforementioned storage database, retrieve storage data relating to the source code to be modified; from the aforementioned knowledge database, retrieve knowledge data relating to the source code to be modified; Based on the acquired storage data and knowledge data, the parameter values of the changes to be made to the source code to be modified are identified. The system generates a prompt that includes the identified parameter values and instructs the AI to make changes to the source code to be modified according to those parameter values. The generated prompt is input to the generating AI, and the source code output from the generating AI as a response to that input is obtained as the AI-generated modified source code. The system according to claim 4.
6. With respect to the AI-generated source code after modification, if there are any parts in the AI-generated source code after modification where the description is omitted, the omitted code lines shall be added to those omitted parts. If the AI-generated source code after modification contains a syntax that has multiple functions in a single syntax, the code lines corresponding to that syntax are expanded into code lines corresponding to each of those multiple functions. For each of the multiple lines of code included in the AI-generated modified source code, in which omitted lines of code have been added and lines of code corresponding to syntax with multiple functions have been expanded, information indicating the function of the line of code is added, and a rule source code corresponding to the AI-generated modified source code is generated. The rule source code generated with respect to the AI-generated modified source code is registered as stored data in the aforementioned storage database. From the aforementioned storage database, the rule source code for the source code to be modified and the AI-generated modified source code are obtained, Based on the rule source code obtained with respect to the source code to be modified and the rule source code obtained with respect to the AI-generated modified source code, modification method data indicating how to modify the source code to be modified into the AI-generated modified source code is generated. The knowledge database is used to register, as knowledge data, the modification method data generated with respect to the source code to be modified and the AI-generated modified source code, and the parameter values used to generate the prompt. The system according to claim 5.
7. A computer, The process of obtaining the rule source code for the source code, for each of the source code before and after the change, from a storage database, which is a database where rule source code corresponding to the source code is registered as storage data, wherein, for each of the source code before and after the change, if there are places in the source code where the description is omitted, the omitted code lines are added to the places where the omitted places are omitted, and if the source code contains a syntax that has multiple functions in one syntax, the code lines corresponding to that syntax are expanded into code lines corresponding to each of those multiple functions, the omitted code lines are added, and for each of the multiple code lines contained in the source code that has been expanded to include information indicating the function of that code line, the rule source code corresponding to the source code is added, A process to generate change method data indicating how to change from the source code before the change to the source code after the change, based on the rule source code obtained with respect to the source code before the change and the rule source code obtained with respect to the source code after the change, The process involves registering the aforementioned change method data as knowledge data in the knowledge database. A program to execute.
8. To the aforementioned computer, The process involves obtaining stored data related to the source code to be modified from the storage database, and obtaining knowledge data related to the source code to be modified from the knowledge database. A process to identify the parameter values of the changes to be made to the source code to be modified, based on the acquired storage data and the knowledge data, A process that includes the identified parameter value and generates a prompt instructing the AI to make changes to the source code to be modified according to the parameter value, The process involves inputting the generated prompt to the generating AI, and obtaining the source code output from the generating AI as a response to that input as the source code after AI generation modification. The program according to claim 7 for causing execution.
9. To the aforementioned computer, Regarding the AI-generated source code after modification, if there are any parts in the AI-generated source code after modification where the description is omitted, the process of adding the omitted code lines to those parts, If the AI-generated source code after modification contains a syntax that has multiple functions in a single syntax, the process involves expanding the code lines corresponding to that syntax into code lines corresponding to each of those multiple functions. The process involves adding omitted code lines and expanding code lines corresponding to syntax with multiple functions to each of the multiple code lines included in the AI-generated modified source code, thereby adding information indicating the function of the code line, and generating rule source code corresponding to the AI-generated modified source code. The process of registering the rule source code generated with respect to the AI-generated modified source code as stored data in the aforementioned storage database, The process of obtaining rule source codes from the aforementioned storage database for the source code to be modified and the AI-generated modified source code, respectively, A process to generate modification method data indicating how to modify the source code to be modified from the source code to be modified to the source code to be modified by the AI, based on the rule source code obtained with respect to the source code to be modified and the rule source code obtained with respect to the source code after modification generated by the AI, The process involves registering the source code to be modified, the modification method data generated with respect to the AI-generated modified source code, and the parameter values used to generate the prompt as knowledge data in the aforementioned knowledge database. A program according to claim 8 for causing execution.
Citation Information
Patent Citations
Structure analyzer and program
JP2013218507A
Cobol source code converting program
JP2017058733A
Source code conversion device, source code conversion program and source code conversion method
JP2018180678A
Determination apparatus, determination method, and determination program
JP2023167588A
Program and method for generating data for generating flowcharts from source code
JP7531254B1