Information processing device, method, and program

By extracting and generating common and partial code blocks from selected code blocks using a language model, the method addresses the limitations of processing power in large-scale software refactoring, achieving accurate and efficient software refactoring.

JP2025177567APending Publication Date: 2025-12-05NEC CORP

Patent Information

Application Number
JP2024084521
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Existing large-scale software refactoring using language models faces challenges due to limitations in processing power, which results, and the processing power, which leads to insufficient accuracy in obtaining refactoring results.

Method used

An information processing device and method that extracts code blocks with similar descriptions using a language model to generate a common code block and partial code blocks using a language model to generate a common code block and partial code blocks from selected code blocks, thereby improving the accuracy of software refactoring.

Benefits of technology

The method enables accurate and efficient refactoring of large-scale software by narrowing down the scope of refactoring to specific code blocks, enhancing the maintainability and understandability of the software structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025177567000001_ABST
    Figure 2025177567000001_ABST
Patent Text Reader

Abstract

To support large scale software refactoring by using a language model.SOLUTION: An information processing device is provided with execution control means for extracting a group of a plurality of code blocks including similar description determined by a prescribed language model to have a high similarity of feature information of a program by at least a portion of a set of a plurality of programs constituting prescribed software by using the language mode, and generating a common code block describing common processing based on the similar description and a plurality of partial code blocks corresponding to each code block on the basis of difference between each code block and the similar description from the plurality of code blocks belonging to the group by using the language model.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to an information processing device, a method, and a program. [Background technology]

[0002] Software refactoring refers to rearranging and improving the internal structure of software without changing its functions or behavior. For example, software engineers refactor software by reducing duplicated code or unifying code groups with the same role (function). Patent Document 1 discloses a technology for refactoring software based on the similarity of the source code that makes up the software.

[0003] In recent years, large language models (LLMs), a type of artificial intelligence (AI) model, have become popular. LLMs are pre-trained models that are trained by repeatedly using deep learning with large datasets, in contrast to natural language models. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] Japanese Patent Application Laid-Open No. 2015-179369 Summary of the Invention [Problem to be solved by the invention]

[0005] However, when trying to apply language models such as LLM to the refactoring of large-scale software, there is a problem in that it is difficult to obtain refactoring results with sufficient accuracy due to the limitations of the processing power of the language model.

[0006] In view of the above-mentioned problems, an object of the present disclosure is to provide an information processing device, a method, and a program for supporting the refactoring of large-scale software using a language model. [Means for solving the problem]

[0007] The information processing device according to the present disclosure includes: extracting, from at least a portion of a set of a plurality of programs constituting the predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs; an execution control means for generating, from the plurality of code blocks belonging to the group, a common code block describing a common process based on the similar description, and a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description, using the language model; Equipped with.

[0008] The information processing method according to the present disclosure includes: The computer extracting, from at least a portion of a set of a plurality of programs constituting the predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs; using the language model, generate a common code block describing a common process based on the similar description from the plurality of code blocks belonging to the group, and a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description; The common code block and the plurality of partial code blocks generated from the plurality of code blocks by the language model are obtained.

[0009] The information processing program according to the present disclosure includes: a process of extracting, from at least a portion of a set of a plurality of programs constituting a predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs, using a predetermined language model, and generating, from the plurality of code blocks belonging to the group, a common code block that describes a common process based on the similar descriptions, and a plurality of partial code blocks corresponding to each code block based on the differences between each code block and the similar descriptions; a process of acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks by the language model; to be executed by the computer.

[0010] The information processing device according to the present disclosure includes: an input means for inputting an input text including a plurality of code blocks and an instruction sentence for extracting similar descriptions determined by the language model to have a high degree of similarity in program feature information from a plurality of code blocks included in a set of a plurality of programs constituting a predetermined software, and generating a common code block describing a common process based on the similar descriptions, and a plurality of partial code blocks corresponding to each code block based on differences between each code block and the similar descriptions, to the predetermined language model; an acquisition means for acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks based on the instruction sentence using the language model; Equipped with.

[0011] The information processing device according to the present disclosure includes: a first input means for inputting a first instruction sentence for extracting a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in program feature information from at least a portion of a set of a plurality of programs constituting predetermined software, and a first input text including at least a portion of the set of the plurality of programs, to the predetermined language model; a first acquiring means for acquiring the group of the plurality of code blocks extracted based on the first instruction sentence by the language model; a second input means for inputting a second input text including a common code block describing a common process based on the similar description from the plurality of code blocks belonging to the group, a second instruction sentence for generating a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description, and the plurality of code blocks to the language model; a second acquiring means for acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks based on the second instruction sentence using the language model; Equipped with. [Effects of the Invention]

[0012] The present disclosure enables language models to be used to assist in large-scale software refactoring. [Brief explanation of the drawings]

[0013] [Figure 1] FIG. 1 is a block diagram illustrating a configuration of an information processing device according to the present disclosure. [Figure 2] 1 is a flowchart illustrating a flow of an information processing method according to the present disclosure. [Figure 3] 1 is a block diagram showing the overall configuration of a refactoring support system including an information processing device according to the present disclosure. [Figure 4] FIG. 1 is a block diagram illustrating a configuration of an information processing device according to the present disclosure. [Figure 5] 1 is a flowchart illustrating a flow of a refactoring support method according to the present disclosure. [Figure 6] FIG. 10 is a diagram illustrating an example of a selected target source code group according to the present disclosure. [Figure 7] 10A-10C illustrate examples of prompts input to an LLM according to the present disclosure. [Figure 8]FIG. 10 is a diagram illustrating an example of an output result from an LLM according to the present disclosure. [Figure 9] FIG. 1 is a diagram illustrating an example of a set of source code to be input according to the present disclosure. [Figure 10] FIG. 10 is a diagram illustrating an example of sharing a common code block and a partial code block according to the present disclosure. [Figure 11] FIG. 1 is a diagram illustrating an example of a set of source code to be input according to the present disclosure. [Figure 12] FIG. 10 is a diagram illustrating an example of a higher-level conceptualization of a common code block and a partial code block according to the present disclosure. [Figure 13] FIG. 1 is a diagram for explaining the concept of a refactoring support method according to the present disclosure. [Figure 14] 1 is a flowchart illustrating a flow of a refactoring support method according to the present disclosure. [Figure 15] FIG. 10 illustrates an example of a grouping prompt input to an LLM according to the present disclosure. [Figure 16] FIG. 10 illustrates an example of an output result (group of functions) from an LLM according to the present disclosure. [Figure 17] 10A-10C illustrate example reconfiguration prompts input to an LLM according to the present disclosure. [Figure 18] FIG. 10 is a diagram illustrating an example of an output result (common function and partial function group) from an LLM according to the present disclosure. [Figure 19] FIG. 1 is a block diagram showing a hardware configuration of an information processing device according to the present disclosure. DETAILED DESCRIPTION OF THE INVENTION

[0014] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. In each drawing, the same or corresponding elements are designated by the same reference numerals, and for clarity of explanation, duplicate explanations will be omitted as necessary.

[0015] (Embodiment 1) 1 is a block diagram showing the configuration of an information processing device 1. The information processing device 1 is a computer device that uses a predetermined language model to support the refactoring of predetermined software. Note that the information processing device 1 may also be called a refactoring support device.

[0016] Here, a "language model" refers to a computer program or information system that receives text data (input text) that expresses questions or instructions in natural language as input, and outputs text data that has been generated, converted, processed, summarized, or otherwise processed by a predetermined calculation on the input text. A language model corresponds to a natural language model in an AI model. In particular, the language model used by the information processing device 1 according to the present disclosure is preferably an LLM. Note that the language model is executed inside the information processing device 1 or on an external server connected to the information processing device 1, and is capable of accepting input text.

[0017] The information processing device 1 includes at least an execution control unit 11. The execution control unit 11 may be used as a means for controlling the execution of processing according to a program in which the information processing method according to the present disclosure is implemented.

[0018] The execution control unit 11 uses a predetermined language model to extract, from at least a portion of a set of programs constituting predetermined software, a group of multiple code blocks including similar descriptions that the language model determines to have a high degree of similarity in program feature information. The execution control unit 11 also uses the language model to generate, from the multiple code blocks belonging to the group, a common code block that describes common processing based on the similar descriptions, and multiple partial code blocks corresponding to each code block based on the differences between each code block and the similar descriptions.

[0019] 2 is a flowchart showing the flow of an information processing method. First, the information processing device 1 uses a predetermined language model to extract, from at least a portion of a set of programs constituting predetermined software, a group of multiple code blocks containing similar descriptions that the language model determines to have a high degree of similarity in program feature information (S11). Next, the information processing device 1 uses the language model to generate, from the multiple code blocks belonging to the group, a common code block that describes common processing based on the similar descriptions, and multiple partial code blocks corresponding to each code block based on the differences between each code block and the similar descriptions (S12). Then, the information processing device 1 acquires the common code block and the multiple partial code blocks generated from the multiple code blocks using the language model (S13).

[0020] Here, the common code block and the multiple partial code blocks can be considered to be a group of code blocks refactored from a group of code blocks containing similar statements. If an attempt were made to obtain a group of code blocks refactored from all of the programs constituting a given piece of software using a language model, sufficient accuracy may not be achieved due to limitations in the processing power of the language model. In response to this, the information processing device 1 according to the present disclosure first uses a language model to extract a group of code blocks containing similar statements from at least a portion of the programs constituting the given software. This narrows down the group of code blocks to be subjected to the subsequent refactoring process. The information processing device 1 then inputs the narrowed down group of code blocks from the group of programs into the language model to obtain a group of refactored code blocks. Therefore, the obtained group of code blocks can achieve sufficiently accurate refactoring results. Therefore, the information processing device 1 according to the present disclosure can support the refactoring of large-scale software using a language model such as LLM.

[0021] The information processing device 1 includes a processor, a memory, and a storage device (not shown). The storage device stores a computer program that implements the processing of the information processing method shown in FIG. 2, for example. The processor then loads the computer program from the storage device into the memory and executes the computer program. This allows the processor to realize the functions of the execution control unit 11.

[0022] Alternatively, each component of the information processing device 1 may be realized by dedicated hardware. Furthermore, some or all of the components of each device may be realized by general-purpose or dedicated circuits, processors, etc., or a combination of these. These may be configured by a single chip, or by multiple chips connected via a bus. Some or all of the components of each device may be realized by a combination of the above-mentioned circuits, etc., and programs. Furthermore, a CPU (Central Processing Unit), GPU (Graphics Processing Unit), FPGA (Field-Programmable Gate Array), quantum processor (quantum computer control chip), etc., may be used as the processor.

[0023] Furthermore, when some or all of the components of the information processing device 1 are realized by multiple information processing devices, circuits, etc., the multiple information processing devices, circuits, etc. may be centrally or distributed. For example, the information processing devices, circuits, etc. may be realized as a client-server system, a cloud computing system, or the like, in a form in which each is connected via a communication network. Furthermore, the functions of the information processing device 1 may be provided in a SaaS (Software as a Service) format.

[0024] (Embodiment 2) 3 is a block diagram showing the overall configuration of a refactoring support system 1000 including an information processing device 100. The refactoring support system 1000 is an information system for supporting the refactoring of predetermined software using LLM. The refactoring support system 1000 includes the information processing device 100, an LLM server 200, and a terminal 300. The information processing device 100, the LLM server 200, and the terminal 300 are communicatively connected via a network N. Here, the network N is a wired and wireless communication network.

[0025] The terminal 300 is an information processing device operated by a software engineer who develops, maintains, and modifies (especially refactors) software. The terminal 300 may be a general-purpose PC (Personal Computer) or the like. Therefore, the terminal 300 performs processing in response to keyboard and mouse operations by the engineer, and communicates with the information processing device 100 via the network N as appropriate.

[0026] The LLM server 200 is a server computer on which a predetermined LLM runs. The LLM is an example of the language model in the first embodiment described above. The LLM is a trained model trained by repeatedly performing deep learning on a predetermined natural language model using a large amount of data set. The number of deep learning training runs, the number of data sets used for training, and the number of trained parameters for the LLM are large compared to when AI models first began to be used. For this reason, the LLM is sometimes referred to as a large-scale language model. The LLM is a computer program that receives input text (prompt) written in a specific format, performs processing based on instructions included in the prompt, and outputs the processing results. Here, the prompt includes text data to be processed and instructions written in a specific format for processing the text data. When the LLM server 200 receives input text (prompt) from a requester via the network N, it inputs the prompt to the LLM and returns output data, which is the processing result of the LLM, to the requester via the network N. The requester is, for example, the information processing device 100 or the terminal 300.

[0027] The information processing device 100 is an example of the information processing device 1 described above. The information processing device 100 is a computer device that uses LLM to generate a group of refactored code blocks for at least a portion of a set of multiple programs that constitute predetermined software. Specifically, the information processing device 100 receives an instruction to refactor the target software from a terminal 300 via a network N. The information processing device 100 then selects a group of target source code from a portion of the set of multiple programs that constitute the target software, and generates a common code block and multiple partial code blocks from the source code belonging to the group. At this time, the information processing device 100 communicates with the LLM server 200 to generate the common code block and the multiple partial code blocks. The information processing device 100 also repeatedly communicates with the LLM server 200 to generate the common code block and the multiple partial code blocks multiple times.

[0028] 4 is a block diagram showing the configuration of information processing device 100. Information processing device 100 includes a storage unit 110, a reception unit 121, an execution control unit 122, and an output unit 123. The reception unit 121, the execution control unit 122, and the output unit 123 may be used as a means for receiving information or data, a means for controlling execution, and a means for outputting, respectively. Furthermore, the execution control unit 122 includes a selection unit 1221, a generation unit 1222, an input unit 1223, and an acquisition unit 1224. Furthermore, the selection unit 1221, the generation unit 1222, the input unit 1223, and the acquisition unit 1224 may be used as a means for selecting information or data, a means for generating information, a means for inputting information, and a means for acquiring information.

[0029] The storage unit 110 includes, for example, a non-volatile storage device such as a flash memory and a memory such as a RAM (Random Access Memory), that is, a volatile storage device. The storage unit 110 stores target software 111. The target software 111 may be stored in a storage device external to the information processing device 100. The target software 111 is an example of software that is the target of refactoring. The target software 111 is composed of programs 1111, ..., programs 111n (n is a natural number greater than or equal to 2).

[0030] The receiving unit 121 receives an instruction to refactor the target software from the terminal 300 via the network N. The instruction may include, for example, identification information of the target software 111. Alternatively, if the target software is stored in an external storage device, the instruction may include access information to the storage device where the target software is saved. In this case, the receiving unit 121 may use the access information included in the instruction to appropriately read some or all of the set of multiple programs that make up the target software from the storage device via the network N, thereby receiving the source code of each program.

[0031] The receiving unit 121 may also receive a prompt, which will be described later, from the terminal 300. The receiving unit 121 may also receive an instruction from the terminal 300 as to whether or not to continue the refactoring.

[0032] The execution control unit 122 is an example of the above-mentioned execution control unit 11. Specifically, the execution control unit 122 includes the functions of a selection unit 1221, a generation unit 1222, an input unit 1223, and an acquisition unit 1224.

[0033] The selection unit 1221 selects a target source code group for one refactoring process from the target software. For example, the selection unit 1221 may select an arbitrary set of programs from the multiple programs 1111, etc. included in the target software 111, and set it as the target source code group. Alternatively, the selection unit 1221 may select an arbitrary partial source code block (fragment) from a part of the multiple programs 1111, etc., as the target source code group. Alternatively, the selection unit 1221 may accept, from the terminal 300, a selection of a target source code group for one refactoring process from the target software. It is assumed that each of the selected target source code groups is a processing unit of some kind of function block.

[0034] Alternatively, the selection unit 1221 may use a program in which a predetermined processing logic is implemented to extract a group of multiple code blocks including similar descriptions whose feature information of the programs has a similarity equal to or greater than a threshold value from multiple programs 1111, etc., and select the group as the target source code group. For example, the selection unit 1221 may analyze each of the multiple programs 1111, etc., to generate feature information for each program. Then, the selection unit 1221 may detect similar descriptions among the programs whose feature information has a similarity equal to or greater than a threshold value. Then, the selection unit 1221 may group the programs including the detected similar descriptions, and select the group as the target source code group.

[0035] Note that similar program descriptions are preferably code blocks whose program processing is semantically similar. Furthermore, the program characteristic information preferably includes the logical structure of the program. In other words, the program characteristic information indicates not only the character string-level characteristics or syntax of the written code but also the functional level characteristics of the program. Therefore, similar descriptions refer to programs that are equivalent at the functional level even if they differ at the character string or syntax level of the written code between multiple source codes. Equivalence at the functional level of programs means, for example, that there is a similarity in logical structure between a first source code and a second source code, even if there are differences between for statements, while statements, if statements, and switch-case statements.

[0036] The generation unit 1222 generates a prompt, which is input text to the LLM of the LLM server 200. Specifically, the generation unit 1222 generates, as a prompt, input text including an instruction sentence for generating a common code block and a plurality of partial code blocks, and the target source code group (a plurality of code blocks) selected by the selection unit 1221.

[0037] Here, a common code block is a code block that describes common processing based on similar descriptions included in the selected target source code group. "Common processing based on similar descriptions" refers to processing based on a description that is common among similar descriptions among multiple code blocks. Therefore, similar descriptions among multiple code blocks are not necessarily common descriptions. For example, if similar descriptions among multiple code blocks are different at the syntactic level but have similar logical structures, processing based on a predetermined syntax that has a common logical structure may be considered common processing.

[0038] The partial code blocks are groups of partial code blocks that correspond to each code block based on the difference between each code block and the similar description. In other words, the instruction sentence is a sentence that causes the LLM to generate, from the multiple code blocks belonging to the group, a common code block that describes common processing based on the similar description, and multiple partial code blocks that correspond to each code block based on the difference between each code block and the similar description.

[0039] The input unit 1223 inputs the prompt generated by the generation unit 1222 to the LLM. Specifically, the input unit 1223 inputs the prompt to the LLM by transmitting the prompt to the LLM server 200 via the network N.

[0040] The acquisition unit 1224 acquires the common code block and the partial code blocks generated by the LLM in response to the prompt as output data. That is, the acquisition unit 1224 acquires the common code block and the partial code blocks generated by the LLM from the multiple code blocks based on the instruction sentence.

[0041] From these facts, it can be said that the execution control unit 122 causes the LLM to generate a common code block and a plurality of partial code blocks so that each of the plurality of partial code blocks uses the common code block and has the same functionality as each corresponding code block.

[0042] The selection unit 1221 may use the LLM to group programs including similar descriptions determined by the LLM to have a high degree of similarity in the feature information of the programs from among the multiple programs 1111, etc., and select the group as a target source code group. In this case, the generation unit 1222 may generate an instruction sentence for extracting a group of multiple code blocks including similar descriptions from at least a portion of the multiple programs 1111, etc. Then, the generation unit 1222 may generate input text including the generated instruction sentence and at least a portion of the multiple programs 1111, etc., as a grouping prompt. Then, the input unit 1223 inputs the grouping prompt to the LLM. Then, the acquisition unit 1224 acquires the common code block and multiple partial code blocks generated by the LLM in response to the grouping prompt as output data.

[0043] Furthermore, the execution control unit 122 may use a language model to repeatedly extract groups and generate the common code blocks and the multiple partial code blocks generated by the LLM, together with programs other than the group among a set of multiple programs. In this way, by repeatedly organizing programs locally (commonizing and separating similar processes), it is possible to support restructuring using the LLM to organize software in stages and achieve overall optimization.

[0044] The generation unit 1222 may extract a group of code blocks including similar descriptions from at least a portion of the set of programs, and generate, from the code blocks belonging to the group, an instruction sentence for generating a common code block describing common processing based on the similar description, and a plurality of partial code blocks corresponding to each code block based on differences between each code block and the similar description.The input unit 1223 may input, to the LLM, an input text including the generated instruction sentence and at least a portion of the set of programs.

[0045] The output unit 123 outputs the output data acquired by the acquisition unit 1224. For example, the output unit 125 may display the output data on a display device built into or connected to the information processing device 1. Specifically, the output unit 125 may transmit the output data to the terminal 300 via the network N, thereby causing the terminal 300 to display the output data.

[0046] (Example 1 of a use case for refactoring support processing) 5 is a flowchart showing the flow of the refactoring support method. First, an engineer inputs instructions for refactoring a given piece of software into the terminal 300. Then, in response to an operation by the engineer, the terminal 300 transmits the input instructions to the information processing device 100 via the network N.

[0047] In response to this, the receiving unit 121 receives an instruction to refactor the target software from the terminal (S101). In the following explanation, it is assumed that the target software 111 is specified in the instruction.

[0048] Next, the selection unit 1221 selects a target source code group from the target software 111 (S102). Here, the selection unit 1221 selects a pair of source codes (two code blocks) as the target source code group using any of the various methods described above. This narrows down the target source code group to be processed per LLM run, thereby reducing the processing load on the LLM.

[0049] FIG. 6 shows examples of functions f1a and f1b, which are selected target source code sets. Function f1a corresponds to a code block (source code) representing function "addTaskA." Function f1b corresponds to a code block (source code) representing function "addTaskB." Functions f1a and f1b differ in the following: the function names "addTaskA" and "addTaskB" on line 1, the assigned values ​​"complete" and "end" on line 5, and the assigned values ​​"delete" and "delete" on line 11. In other words, functions f1a and f1b each have 17 lines of code, with a difference of three lines. In other words, functions f1a and f1b are similar in parts of lines 1, 5, and 11 and in other lines. If program features are represented by the descriptions (character strings) of each line of code, the degree of similarity between the program features of functions f1a and f1b is approximately 82%. Furthermore, if the threshold for similar descriptions is set to 70%, then functions f1a and f1b can be said to be a pair of code blocks containing similar descriptions. Furthermore, even if the program features are treated as logical structures and the threshold for similar descriptions is set to 70%, functions f1a and f1b can also be said to be a pair of code blocks containing similar descriptions. In the following explanation, it is assumed that two functions, "addTaskA" and "addTaskB", have been selected as the target source code group.

[0050] Next, the generation unit 1222 generates a prompt for generating a common code block and multiple partial code blocks from the selected target source code group (S103). FIG. 7 is a diagram showing an example of a prompt 41 input to the LLM. The prompt 41 is an example of text data (input text) including an instruction sentence 411 and a target source code group (functions f1a and f1b). The instruction sentence 411 includes instruction sentences 411X and 411Y. The instruction sentence 411X is a sentence for generating a common function "addTaskC" that extracts the common part of the two functions f1a and f1b. The instruction sentence 411Y is a sentence for generating two functions having the same functionality as functions f1a and f1b by extending the common function "addTaskC."

[0051] Next, the input unit 1223 transmits the prompt 41 to the LLM server 200 (S104). In response, the LLM server 200 inputs the received prompt 41 to the LLM. The LLM extracts common processing based on similar processing from functions f1a and f1b in accordance with instruction sentence 411X of instruction sentence 411 included in the prompt 41, and generates a common function "addTaskC" that describes the common processing. Then, the LLM generates functions "addTaskAPlus" and "addTaskBPlus" that have functionality equivalent to functions f1a and f1b by extending the common function in accordance with instruction sentence 411Y of instruction sentence 411 included in the prompt 41. In other words, the LLM generates a common code block and multiple partial code blocks based on instruction sentences 411X and 411Y so that each of multiple partial code blocks uses the common code block to have functionality equivalent to that of the corresponding code block. The LLM server 200 transmits an output message including the common code block and the multiple partial code blocks generated by the LLM to the information processing device 100 via the network N.

[0052] In response to this, the acquisition unit 1224 acquires an output message including a common code block and multiple partial code blocks from the LLM server 200 (S105). Then, the output unit 123 displays the output message on the developer terminal 300. Specifically, the output unit 123 transmits the acquired output message to the developer terminal 300 via the network N. Then, the developer terminal 300 displays the received output message on the screen.

[0053] FIG. 8 is a diagram showing an example of an output result from the LLM. The output data 42 is an example of an output message 421, a common code block f2, an output message 422, partial code blocks f2a and f2b, and an output message 423 displayed on the screen of the terminal 300. The output message 421 is text data added by the LLM when generating the common code block f2. The common code block f2 is an example of the common function "addTaskC." The common function "addTaskC" is a function that implements common processing extracted from functions f1a and f1b. Specifically, the common function "addTaskC" is a code block in which the function name and arguments on the first line of functions f1a and f1b have been modified, and the assignment values ​​on the fifth and eleventh lines have been modified to "completeButtonText" and "deleteButtonText," respectively. The output messages 422 and 423 are text data added by the LLM when generating multiple partial code blocks. Partial code block f2a is a code block in which similar statements are removed from function f1a, the function name on the first line is modified, a common function "addTaskC" is called on the second line, and two assignment values ​​(character strings) that are the differences from function f1b are set as its arguments. Partial code block f2b is a code block in which similar statements are removed from function f1b, the function name on the first line is modified, a common function "addTaskC" is called on the second line, and two assignment values ​​(character strings) that are the differences from function f1a are set as its arguments. Therefore, in the example of Figure 8, the common code block is a function of the program, and each of the multiple partial code blocks can be said to have been generated including the process of calling the common code block.

[0054] Then, the execution control unit 122 determines whether to continue the refactoring (S106). For example, suppose that the engineer checks the output data 42 of FIG. 8 via the terminal 300 and wishes to continue the refactoring, including other code blocks and other common code blocks that have already been refactored. In this case, the terminal 300 transmits an instruction to continue the refactoring via the network N in response to the engineer's operation. Then, the receiving unit 121 receives the instruction to continue the refactoring from the terminal 300. In this case, the execution control unit 122 determines to continue the refactoring. Alternatively, the execution control unit 122 may determine to continue the refactoring if the number of iterations of the refactoring support process (steps S102 to S105) is less than a threshold. Alternatively, the execution control unit 122 may determine to continue the refactoring if there is an unprocessed source code group other than the target source code group selected in step S102 in the program set of the target software.

[0055] If it is determined in step S106 that refactoring should continue, the execution control unit 122 adds the common code block and multiple partial code blocks acquired in step S105 to the unprocessed source code group (S107). Thereafter, the information processing device 100 executes steps S102 to S106 in the same manner as described above. Therefore, the selection unit 1221 may select a pair or set of common code blocks as the target source code group in step S102. In this case, for example, further extension (commonization) of common functions may be possible. Alternatively, the selection unit 1221 may select a pair or set of an unprocessed code block and a common code block as the target source code group in step S102. In this case, the unprocessed code block (function) may be modified into a partial code block so that it calls a common function that has already been commonized. Therefore, local reorganization of the program (commonization and separation of similar processes) can be repeated.

[0056] On the other hand, when the receiving unit 121 receives an instruction not to continue the refactoring from the terminal 300, the execution control unit 122 determines not to continue the refactoring. Alternatively, the execution control unit 122 may determine not to continue the refactoring if the number of iterations of the refactoring support process is equal to or greater than a threshold. Alternatively, the execution control unit 122 may determine not to continue the refactoring if there is no unprocessed source code group in the program set of the target software. If it is determined not to continue the refactoring in step S106, the information processing device 100 terminates the refactoring support process.

[0057] (Example 2 of the refactoring support process use case) For example, suppose a software engineer at a certain company is performing maintenance and modification on a Web application developed more than 10 years ago. This Web application implements various functions, such as user authentication, access to a database (DB), processing for calling an external API (Application Programming Interface), and product search. Furthermore, suppose that the Web application's code has become complex and its maintainability has deteriorated due to the addition and modification of functions over the years. Therefore, the engineer aims to improve the code structure and maintainability by refactoring the Web application using the refactoring support system 1000 according to the present disclosure.

[0058] The following description will focus on the differences between Figure 5 and Figures 6 to 8, and redundant explanations will be omitted where appropriate. Assume that an engineer has specified three functions, login, logout, and changePassword, from a Web application of the target software as the target source code group. Therefore, the receiving unit 121 receives a selection of the three functions along with an instruction to refactor the target Web application from the terminal (S101). Therefore, in step S102 of Figure 5, the selecting unit 1221 selects the three functions as the target source code group (S102). Then, the generating unit 1222 generates a prompt for generating a common code block and multiple partial code blocks from the selected three functions (S103).

[0059] FIG. 9 is a diagram showing an example of a set of source code to be input. Prompt 43 is an example of text data (input text) including instruction sentence 431 and a set of target source code (functions f3a, f3b, and f3c). Instruction sentence 431 includes instruction sentences 431X, 431Y, and 431Z. Instruction sentence 431X is a sentence for extracting a group of functions including similar descriptions from three functions f3a, f3b, and f3c. Instruction sentence 431Y is a sentence for generating a common function that implements the similar descriptions of the functions belonging to the extracted group. Furthermore, instruction sentence 431Z is a sentence for excluding the similar descriptions from each function of the extracted group and generating a set of partial functions that call the common function.

[0060] Next, the input unit 1223 transmits a prompt 43 to the LLM server 200 (S104). In response, the LLM server 200 inputs the received prompt 43 to the LLM. The LLM extracts a group of functions including similar descriptions from the three functions according to the instruction sentence 431X of the instruction sentence 431 included in the prompt 43. In the example of FIG. 9, functions f3a "login", f3b "logout", and f3c "changePassword" include a DB connection process. Furthermore, functions f3a "login" and f3c "changePassword" include a user information acquisition process. Therefore, the LLM extracts functions f3a and f3c of the three functions as a group of functions including similar descriptions whose program feature information similarity is equal to or greater than a threshold value because they include two similar processes, a DB connection process and a user information acquisition process.

[0061] Then, in accordance with instruction sentence 431Y of instruction sentence 431 included in prompt 43, LLM extracts common processing (DB connection processing and user information acquisition processing) based on similar processing from functions f3a and f3c belonging to the extracted group, and generates a common function "connectAndGetUser" that describes the common processing. Then, in accordance with instruction sentence 431Z of instruction sentence 431 included in prompt 41, LLM removes similar descriptions from each function of the extracted group and generates a group of partial functions that call the common functions. LLM server 200 transmits an output message including the common code block and multiple partial code blocks generated by LLM to information processing device 100 via network N.

[0062] 10 is a diagram showing an example of commonality between a common code block and a partial code block. Output data 44 is an example of output messages 441 and 442, common code block f4, output message 443, and partial code blocks f4a and f4c displayed on the screen of terminal 300. Output message 441 is text data added by LLM when extracting a group of functions containing similar descriptions. This example shows that functions f3a "login" and f3c "changePassword" have been extracted as a group.

[0063] Output message 442 is text data added by LLM when generating common code block f4. Common code block f4 is an example of the common function "connectAndGetUser." The common function "connectAndGetUser" is a function that implements common processing extracted from functions f3a and f3c. Specifically, the common function takes a user name as an argument, and after DB connection processing, returns the result of user information acquisition processing with the user name as an argument.

[0064] Output message 443 is text data added by LLM when generating multiple partial code blocks. Partial code blocks f4a and f4c are functions f3a and f3c, respectively, with the DB connection process and user information acquisition process changed to call the common function "connectAndGetUser."

[0065] In this way, in Use Case Example 2, the engineer selects three functions as targets for refactoring, and the LLM groups pairs of two functions as targets for commonality, generating a common function and two partial functions for each pair of grouped functions. Therefore, the engineer narrows down the target source code to a certain extent without inputting the entire source code of the target web application. The LLM then narrows down the three functions selected in the prompt to two groups of functions to be common, and performs commonality and separation (calling the common function) refactoring on these narrowed-down groups of functions. Therefore, it is possible to obtain sufficiently accurate refactoring results, taking into account the constraints of the LLM's processing power.

[0066] For example, multiple functions related to user authentication (e.g., login, password change) are grouped. Next, common processes (database connection process and user information acquisition process) are extracted from the grouped functions, and a function group consisting of the functions responsible for the common processes and the specific parts of each process is generated. Similarly, common processes are extracted from the function group related to product search. Then, by gradually applying these refactoring processes to the entire source code of the target software, an authentication module, a product search module, etc. can ultimately be generated. These can be considered modules reconstructed into an easy-to-understand structure separated from other functions. Furthermore, the reconstructed common code block and the collection of multiple partial code blocks have the same functionality as the original multiple code blocks, but have a more modular structure. Therefore, the target software (source code) is reconstructed into a structure that is easier to understand and more maintainable. As described above, this disclosure makes it possible to automatically organize large-scale software and improve its quality and maintainability by utilizing the language understanding capabilities of LLM. Furthermore, it can be applied to improving productivity in software development and legacy code improvement.

[0067] (Example 3 of the refactoring support process use case) Next, an example of refactoring will be described in which a superclass is generated based on object orientation, which is a higher conceptualization of multiple classes, and each class is modified (generated) as a group of subclasses of the superclass.

[0068] FIG. 11 is a diagram showing an example of a set of source code to be input. Prompt 45 is an example of text data (input text) including instruction sentence 451 and a set of target source code (classes f5a and f5b, etc.). Instruction sentence 451 includes instruction sentences 451X, 451Y, and 451Z. Instruction sentence 451X is a sentence for extracting a group of classes including similar descriptions from multiple classes f5a, f5b, etc. Instruction sentence 451Y is a sentence for generating a superclass that superconceptualizes similar descriptions of classes belonging to the extracted group. Furthermore, instruction sentence 451Z is a sentence for generating subclasses that inherit the superclass from each class in the extracted group.

[0069] Next, the input unit 1223 transmits a prompt 45 to the LLM server 200 (S104). In response, the LLM server 200 inputs the received prompt 45 into the LLM. The LLM extracts a group of classes containing similar descriptions from classes f5a, f5b, etc., in accordance with instruction sentence 451X of instruction sentence 451 included in the prompt 45. In the example of FIG. 11, classes f5a "Client" and f5b "Staff" can be said to have overlapping descriptions in the methods "createAccount," "login," "searchBooks," and "viewBookDetails." If the threshold for the number of overlapping methods is 1, classes f5a and f5b have five overlapping methods, which is greater than the threshold and therefore contains similar descriptions. Therefore, the LLM extracts classes f5a and f5b as a group.

[0070] Then, in accordance with instruction sentence 451Y of instruction sentence 451 included in prompt 45, LLM extracts common processes based on similar processes from classes f5a and f5b belonging to the extracted group, and generates a superclass "User" that conceptualizes classes f5a and f5b as a higher level. Then, in accordance with instruction sentence 451Z of instruction sentence 451 included in prompt 45, LLM removes similar descriptions from each class in the extracted group and generates a group of subclasses that inherit the superclass. LLM server 200 transmits an output message including the common code block and multiple partial code blocks generated by LLM to information processing device 100 via network N.

[0071] 12 is a diagram showing an example of superordinate conceptualization of common code blocks and partial code blocks. Output data 46 is an example of output messages 461 and 462, common code block f6, output message 463, and partial code blocks f6a and f6b displayed on the screen of terminal 300. Output message 461 is text data added by LLM when extracting a group of classes containing similar descriptions. This example shows that classes f5a "Client" and f5b "Staff" have been extracted as a group.

[0072] Output message 462 is text data added by LLM when generating common code block f6. Common code block f6 is an example of superclass "User." Superclass "User" is an abstract class that superconceptualizes the common processing extracted from classes f5a and f5b. Specifically, the superclass is a class that implements the four common methods of classes f5a and f5b.

[0073] Output message 463 is text data added by the LLM when generating multiple partial code blocks. Partial code blocks f6a and f6b are subclasses that inherit the superclass "User" from classes f5a and f5b, respectively, except for the four common methods. Therefore, in the example of Figure 12, the common code block is a class of an object-oriented program, and each of the multiple partial code blocks is generated as a subclass that inherits the common code block.

[0074] In this way, in Use Case Example 3, five classes selected by an engineer are targeted for refactoring, and pairs of two classes are grouped by LLM as targets for superconceptualization. A superclass and two subclasses are generated for each pair of grouped classes. Therefore, superconceptualization can be efficiently and accurately generated for source code in an object-oriented programming language using LLM. It also achieves the same effects as Example 2 above.

[0075] FIG. 13 is a diagram illustrating the concept of a refactoring support method. In the refactoring support method according to the present disclosure, target software SW1 is first assumed to include code blocks C11 to C14. Then, software SW1 is reconstructed into software SW2 through refactoring r1. Specifically, in refactoring r1, the LLM generates a common code block C25 (superclass) by superconceptualizing the code blocks C11 and C12, and generates partial code blocks C21 and C22 from the code blocks C11 and C12 as subclasses that inherit the common code block C25. Similarly, the LLM generates a common code block C26 and partial code blocks C23 and C24 from the code blocks C13 and C14. Furthermore, in refactoring r2, LLM generates a common code block C33 (superclass) by superconceptualizing the common code blocks C25 and C26, and generates partial code blocks C31 and C32 as subclasses that inherit the common code block C33 from the common code blocks C25 and C26.

[0076] However, developing a dedicated refactoring program that implements (hard-codes) the refactoring algorithm is costly and often requires customization according to the characteristics of each programming language.In addition, the dedicated refactoring program needs to be able to respond to changes in the programming language specifications.

[0077] In contrast, the refactoring support system 1000 according to the present disclosure applies LLM to the refactoring of large-scale software, making it easier to obtain information on refactoring candidates with higher accuracy than when using a dedicated refactoring program. Therefore, software engineers can obtain the output results of the information processing device 100 and easily perform minor corrections, degradation checks, and the like. Furthermore, when applied to the refactoring of legacy code, it can assist in organizing source code, thereby streamlining work that would otherwise require a great deal of manpower to perform manually. Therefore, it is possible to support software refactoring using LLM. In addition, this embodiment can achieve various effects similar to those of the first embodiment described above.

[0078] (Embodiment 3) This third embodiment explains the case where the process is applied to a language model in two stages: a process of grouping at least a portion of a set of multiple programs into multiple code blocks containing similar descriptions, and a process of generating a common code block and multiple partial code blocks from the multiple code blocks belonging to the group.

[0079] That is, the information processing device 100 includes a first input unit, a first acquisition unit, a second input unit, and a second acquisition unit. The first input unit inputs a first input text including a first instruction sentence and at least a part of a set of multiple programs to a predetermined language model. The first instruction sentence is a sentence for extracting a group of multiple code blocks including similar descriptions that the language model determines to have a high degree of similarity in program feature information from at least a part of the set of multiple programs that make up the predetermined software.

[0080] The first acquisition unit acquires a group of a plurality of code blocks extracted based on the first instruction sentence using a language model.

[0081] The second input unit inputs a second input text including a second instruction sentence and a plurality of code blocks to the language model. The second instruction sentence is a sentence for generating, from the plurality of code blocks belonging to the group, a common code block describing a common process based on the similar description, and a plurality of partial code blocks corresponding to each code block based on the difference between each code block and the similar description.

[0082] The second acquisition unit acquires a common code block and a plurality of partial code blocks generated from the plurality of code blocks based on the second instruction sentence using the language model.

[0083] The other configurations of the third embodiment are the same as those of the second embodiment, and therefore, overlapping explanations and illustrations will be omitted as appropriate. The following description will focus on the differences from the second embodiment.

[0084] 14 is a flowchart showing the flow of the refactoring support method. First, the receiving unit 121 receives an instruction to refactor the target software from a terminal (S201). Next, the selecting unit 1221 selects a group of target source code from the target software 111 (S202).

[0085] Next, the generation unit 1222 generates a grouping prompt from the selected target source code group (S203). The grouping prompt is an example of the first input text described above. FIG. 15 is a diagram showing an example of a grouping prompt 47 input to the LLM. The grouping prompt 47 is an example of text data (first input text) including an instruction sentence 471 and a target source code group (functions f7a, f7b, and f7c). The instruction sentence 471 is a sentence for extracting a group of functions including similar descriptions from the functions f7a, f7b, and f7c. The functions f7a, f7b, and f7c are similar to the functions f3a, f3b, and f3c in FIG. 9 above.

[0086] Next, the input unit 1223 transmits a grouping prompt 47 to the LLM server 200 (S204). In response, the LLM server 200 inputs the received grouping prompt 47 into the LLM. The LLM extracts a group of functions including similar descriptions from the three functions in accordance with the instruction sentence 471 included in the grouping prompt 47. Here, as in Example 2 of the above-described second embodiment, the LLM extracts functions f7a and f7c from the three functions as a group of functions. The LLM server 200 transmits an output message including the grouped code blocks extracted by the LLM to the information processing device 100 via the network N.

[0087] In response to this, the acquisition unit 1224 acquires an output message including the grouped code blocks from the LLM server 200 (S205). Then, the output unit 123 displays the output message on the developer terminal 300. Specifically, the output unit 123 transmits the acquired output message to the developer terminal 300 via the network N. Then, the developer terminal 300 displays the received output message on the screen.

[0088] 16 is a diagram showing an example of an output result (group of functions) from the LLM. Output data 48 is an example of an output message 481 and functions f8a and f8c displayed on the screen of terminal 300. Output message 481 is text data added by the LLM when extracting a group of functions containing similar descriptions. This example shows that functions f8a "login" and f8c "changePassword" have been extracted as a group.

[0089] Next, the generation unit 1222 generates a reconfiguration prompt from the grouped code blocks (S206). The reconfiguration prompt is an example of the second input text described above. FIG. 17 is a diagram showing an example of a reconfiguration prompt 49 input to the LLM. The reconfiguration prompt 49 is an example of text data (second input text) including an instruction sentence 491 and functions f9a and f9c. The instruction sentence 491 is a sentence for generating a common function that implements similar descriptions of functions f9a and f9c belonging to the extracted group, and for generating a set of partial functions that call the common function by removing the similar descriptions from each function. Note that functions f9a and f9c are similar to functions f8a and f8c in FIG. 16 above.

[0090] Next, the input unit 1223 transmits a reconfiguration prompt 49 to the LLM server 200 (S207). In response, the LLM server 200 inputs the received reconfiguration prompt 49 to the LLM. In accordance with the instruction sentence 491 included in the reconfiguration prompt 49, the LLM extracts common processing (DB connection processing and user information acquisition processing) based on similar processing from functions f9a and f9c belonging to the extracted group, and generates a common function "connectAndGetUser" that describes the common processing. Then, in accordance with the instruction sentence 491 of the instruction sentence 431, the LLM removes similar descriptions from each function of the extracted group and generates a group of partial functions that call the common functions. The LLM server 200 transmits an output message including the common code block and multiple partial code blocks generated by the LLM to the information processing device 100 via the network N.

[0091] In response to this, the acquisition unit 1224 acquires an output message including the common code block and multiple partial code blocks from the LLM server 200 (S205). Then, the output unit 123 displays the output message on the developer terminal 300. Specifically, the output unit 123 transmits the acquired output message to the developer terminal 300 via the network N. Then, the developer terminal 300 displays the received output message on the screen.

[0092] 18 is a diagram showing an example of output results (common functions and partial function groups) from the LLM. Output data 44-2 is an example of an output message 442, common code block f4, output message 443, and partial code blocks f4a and f4c displayed on the screen of terminal 300. These are similar to the configurations denoted by the same reference numerals in FIG. 10 above.

[0093] In this way, in the third embodiment, the process is divided into two stages: a process of grouping at least a portion of a set of multiple programs into multiple code blocks containing similar descriptions, and a process of generating a common code block and multiple partial code blocks from the multiple code blocks belonging to the group. This avoids restrictions on the amount of information input to the language model, and makes effective use of the functions of the LLM. In addition, the present embodiment can achieve various effects similar to those of the first embodiment described above.

[0094] Note that the language models used in the third embodiment do not need to be the same at each stage. The technology according to the present disclosure may use, for example, a first language model that groups at least a portion of a set of multiple programs into multiple code blocks containing similar descriptions, and a second language model that generates a common code block and multiple partial code blocks from the multiple code blocks belonging to the group. In this case, the first language model may be a trained model that inputs at least a portion of a set of multiple programs and outputs a group of multiple code blocks containing similar descriptions. Furthermore, the second language model may be a trained model that inputs multiple code blocks belonging to the group and outputs the generated common code block and multiple partial code blocks. In these cases, instruction sentences in each input text to each language model can be omitted. Furthermore, the first and second language models may have a portion in common.

[0095] (Other embodiments) The information processing device described above may have a built-in language model such as LLM.

[0096] 19 is a block diagram showing the hardware configuration of the above-described information processing device 100, etc. The information processing device 100 includes a memory 101, a processor 102, and a network interface 103.

[0097] The memory 101 is configured by a combination of volatile memory and nonvolatile memory. The volatile memory is, for example, a volatile storage device such as RAM (Random Access Memory), and is a storage area for temporarily holding information when the processor 102 is operating. The nonvolatile memory is, for example, a nonvolatile storage device such as a hard disk or flash memory. The memory 101 stores at least a computer program that implements the processing of the information processing method (refactoring support method) in the information processing device 100 according to the present disclosure. Note that the memory 101 may include storage located away from the processor 102. In this case, the processor 102 may access the memory 101 via an I / O (Input / Output) interface (not shown).

[0098] The processor 102 is a control device that controls each component of the information processing device 100. The processor 102 reads and executes software (computer programs) from the memory 101. As a result, the processor 102 realizes the functions of the reception unit 121, the execution control unit 122 (selection unit 1221, generation unit 1222, input unit 1223, and acquisition unit 1224), and the output unit 123. That is, the processor 102 performs processing of the information processing method in the information processing device 100 according to the present disclosure. The processor 102 may be, for example, a microprocessor, an MPU (Multi Processing Unit), or a CPU (Central Processing Unit). The processor 102 may also include multiple processors.

[0099] The network interface 103 may be used to communicate with a network node. The network interface 103 may include, for example, a network interface card (NIC) conforming to the IEEE 802.3 series. IEEE stands for Institute of Electrical and Electronics Engineers. The network interface 103 may also include a wireless local area network (LAN), a wired LAN, Wi-Fi (registered trademark), Bluetooth (registered trademark), etc.

[0100] Although the present disclosure has been described above with reference to the embodiments, the present disclosure is not limited to the above-described embodiments. Various modifications that can be understood by those skilled in the art can be made to the configuration and details of the present disclosure within the scope of the present disclosure. Furthermore, each embodiment can be combined with other embodiments as appropriate.

[0101] Each drawing is merely an example for describing one or more embodiments. Each drawing may relate not only to one particular embodiment, but also to one or more other embodiments. As will be understood by those skilled in the art, various features or steps described with reference to any one drawing can be combined with features or steps shown in one or more other drawings to create, for example, an embodiment not explicitly shown or described. Not all features or steps shown in any one drawing are necessary to describe an exemplary embodiment, and some features or steps may be omitted. The order of steps described in any drawing may be changed as appropriate.

[0102] A part or all of the above-described embodiments can be described as, but not limited to, the following supplementary notes. (Appendix A1) extracting, from at least a portion of a set of a plurality of programs constituting the predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs; an execution control means for generating, from the plurality of code blocks belonging to the group, a common code block describing a common process based on the similar description, and a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description, using the language model; An information processing device comprising: (Appendix A2) The execution control means Using the language model, the common code block and the plurality of partial code blocks are generated so that each of the plurality of partial code blocks has a function equivalent to that of a corresponding code block using the common code block. 10. The information processing device according to claim 1, (Appendix A3) The group is a pair of code blocks containing the similar description. An information processing device according to appendix A1 or A2. (Appendix A4) The characteristic information includes a logical structure of the program. An information processing device according to any one of Appendix A1 to Appendix A3. (Appendix A5) The execution control means The common code block and the plurality of partial code blocks generated by the language model are used together with programs other than the group among the set of programs, and the group is extracted and the common code block and the plurality of partial code blocks are repeatedly generated using the language model. An information processing device according to any one of appendices A1 to A4. (Appendix A6) the common code block is a function of a program; Each of the plurality of partial code blocks is generated including a process for calling the common code block. An information processing device according to any one of appendices A1 to A5. (Appendix A7) the common code block is a class of an object-oriented program; Each of the plurality of partial code blocks is generated as a subclass that inherits the common code block. An information processing device according to any one of appendices A1 to A5. (Appendix A8) The execution control means a first instruction sentence for extracting a group of a plurality of code blocks including the similar description from at least a portion of the set of the plurality of programs, and for generating, from the plurality of code blocks belonging to the group, a common code block describing a common process based on the similar description and a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description, and a first input text including at least a portion of the set of the plurality of programs, The common code block and the plurality of partial code blocks are obtained by using the language model based on the first instruction sentence and generated from the plurality of code blocks. An information processing device according to any one of Appendix A1 to Appendix A7. (Appendix A9) The execution control means inputting a second input text including a second instruction sentence for extracting the group of the plurality of code blocks including the similar description from at least a portion of the set of the plurality of programs and at least a portion of the set of the plurality of programs to the language model; obtaining the group of the plurality of code blocks extracted based on the second instruction sentence using the language model; inputting a third input text including a common code block describing a common process based on the similar description from the plurality of code blocks belonging to the group, a third instruction sentence for generating a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description, and the plurality of code blocks to the language model; The common code block and the partial code blocks generated from the code blocks based on the third instruction sentence are obtained using the language model. An information processing device according to any one of Appendix A1 to Appendix A7. (Appendix B1) The computer extracting, from at least a portion of a set of a plurality of programs constituting the predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs; using the language model, generate a common code block describing a common process based on the similar description from the plurality of code blocks belonging to the group, and a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description; The common code block and the partial code blocks generated from the code blocks using the language model are obtained. Information processing methods. (Appendix C1) a process of extracting, from at least a portion of a set of a plurality of programs constituting a predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs, using a predetermined language model, and generating, from the plurality of code blocks belonging to the group, a common code block that describes a common process based on the similar descriptions, and a plurality of partial code blocks corresponding to each code block based on the differences between each code block and the similar descriptions; a process of acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks by the language model; An information processing program that causes a computer to execute the above. (Appendix D1) an input means for extracting similar descriptions that a predetermined language model has determined to have a high degree of similarity in program feature information from a plurality of code blocks included in a set of a plurality of programs that constitute a predetermined piece of software, and inputting an input text including the plurality of code blocks and an instruction sentence for generating a common code block describing common processing based on the similar descriptions and a plurality of partial code blocks corresponding to each code block based on differences between each code block and the similar descriptions to the language model; an acquisition means for acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks based on the instruction sentence using the language model; An information processing device comprising: (Appendix E1) a first input means for inputting a first instruction sentence for extracting a group of a plurality of code blocks including similar descriptions that a predetermined language model determines to have a high degree of similarity in program feature information from at least a portion of a set of a plurality of programs constituting predetermined software, and a first input text including at least a portion of the set of the plurality of programs, to the language model; a first acquiring means for acquiring the group of the plurality of code blocks extracted based on the first instruction sentence by the language model; a second input means for inputting a second input text including a common code block describing a common process based on the similar description from the plurality of code blocks belonging to the group, a second instruction sentence for generating a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description, and the plurality of code blocks to the language model; a second acquiring means for acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks based on the second instruction sentence using the language model; An information processing device comprising:

[0103] Some or all of the elements (e.g., configurations and functions) described in Appendix A2 to Appendix A9 that are dependent on Appendix A1 {e.g., device} may also be dependent on Appendix B1 {e.g., method} and Appendix C1 {e.g., program} in the same dependency relationship as Appendix A2 to Appendix A9. Some or all of the elements (e.g., configurations and functions) described in Appendix A2 to Appendix A7 that are dependent on Appendix A1 {e.g., device} may also be dependent on Appendix D1 {e.g., device} and Appendix E1 {e.g., device} in the same dependency relationship as Appendix A2 to Appendix A7. Some or all of the elements described in any appendix may be applied to various hardware, software, recording means for recording software, systems, and methods. [Explanation of symbols]

[0104] 1. Information processing equipment 11 Execution control section 1000 Refactoring Support System N Network 100 Information processing device 110 Storage section 111 Target Software 1111 Program 111n Program 121 Reception 122 Execution control section 1221 Selection Section 1222 Generation part 1223 Input section 1224 Acquisition Department 123 Output section 200 LLM servers 300 devices 41 prompts 411 Instruction text 411X Instruction text 411Y Instruction text f1a function f1b function 42 Output Data 421 Output Message 422 Output Message 423 Output Message f2 common code block f2a Partial code block f2b partial code block 43 prompt 431 Instruction text 431X Instruction text 431Y Instruction text 431Z Instruction text f3a function f3b function f3c Function 44 Output Data 441 Output Message 442 Output Message 443 Output Message f4 common code block f4a partial code block f4c partial code block 45 prompts 451 Instruction text 451X Instruction text 451Y Instruction text 451Z Instruction text f5a class f5b class 46 Output Data 461 Output Message 462 Output Message 463 Output Message f6 common code block f6a Partial code block f6b Partial code block SW1 Software SW2 Software SW3 Software C11 Code Blocks C12 Code Blocks C13 Code Blocks C14 Code Blocks C21 Partial Code Blocks C22 Partial Code Block C23 Partial Code Block C24 Partial Code Block C25 Common Code Block C26 Common Code Block C31 Partial Code Block C32 Partial Code Block C33 Common Code Block r1 Refactoring r2 Refactoring 47 Grouping Prompts 471 Instruction text f7a function f7b function f7c function 48 Output Data 481 Output Message f8a function f8c Function 49 Reconstruction Prompts 491 Instruction text f9a function f9c Function 44-2 Output data 101 Memory 102 processors 103 Network Interface

Claims

1. extracting, from at least a portion of a set of programs constituting the predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs; an execution control means for generating, from the plurality of code blocks belonging to the group, a common code block describing a common process based on the similar description, and a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description, using the language model; An information processing device comprising:

2. The execution control means Using the language model, the common code block and the plurality of partial code blocks are generated so that each of the plurality of partial code blocks has a function equivalent to that of a corresponding code block using the common code block. The information processing device according to claim 1 .

3. The group is a pair of code blocks containing the similar description.

3. The information processing device according to claim 1 or 2.

4. The characteristic information includes a logical structure of the program.

3. The information processing device according to claim 1 or 2.

5. The execution control means The common code block and the plurality of partial code blocks generated by the language model are used together with programs other than the group among the set of programs, and the group is extracted and the common code block and the plurality of partial code blocks are repeatedly generated using the language model.

3. The information processing device according to claim 1 or 2.

6. the common code block is a function of a program; Each of the plurality of partial code blocks is generated including a process for calling the common code block.

3. The information processing device according to claim 1 or 2.

7. The computer extracting, from at least a portion of a set of programs constituting the predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs; using the language model, generate a common code block describing a common process based on the similar description from the plurality of code blocks belonging to the group, and a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description; The common code block and the plurality of partial code blocks generated from the plurality of code blocks by the language model are obtained. Information processing methods.

8. a process of extracting, from at least a portion of a set of a plurality of programs constituting a predetermined software, a group of a plurality of code blocks including similar descriptions that the language model determines to have a high degree of similarity in feature information of the programs, using a predetermined language model, and generating, from the plurality of code blocks belonging to the group, a common code block that describes a common process based on the similar descriptions, and a plurality of partial code blocks corresponding to each code block based on the differences between each code block and the similar descriptions; a process of acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks by the language model; An information processing program that causes a computer to execute the above.

9. an input means for extracting similar descriptions that a predetermined language model has determined to have a high degree of similarity in program feature information from a plurality of code blocks included in a set of a plurality of programs that constitute a predetermined piece of software, and inputting an input text including the plurality of code blocks and an instruction sentence for generating a common code block describing common processing based on the similar descriptions and a plurality of partial code blocks corresponding to each code block based on differences between each code block and the similar descriptions to the language model; an acquisition means for acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks based on the instruction sentence using the language model; An information processing device comprising:

10. a first input means for inputting a first instruction sentence for extracting a group of a plurality of code blocks including similar descriptions that a predetermined language model determines to have a high degree of similarity in program feature information from at least a portion of a set of a plurality of programs constituting predetermined software, and a first input text including at least a portion of the set of the plurality of programs, to the language model; a first acquiring means for acquiring the group of the plurality of code blocks extracted based on the first instruction sentence by the language model; a second input means for inputting a second input text including a common code block describing a common process based on the similar description from the plurality of code blocks belonging to the group, a second instruction sentence for generating a plurality of partial code blocks corresponding to each code block based on a difference between each code block and the similar description, and the plurality of code blocks to the language model; a second acquiring means for acquiring the common code block and the plurality of partial code blocks generated from the plurality of code blocks based on the second instruction sentence using the language model; An information processing device comprising:

Citation Information

Patent Citations

  • Refactoring device and program

    JP2015179369A

Cited By

  • Software design information recovery system, its control method, and program

    JP7900879B1