Information processing device, information processing method, and program

JP7927801B2Active Publication Date: 2026-10-01NS SOLUTIONS CORPORATION
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024146713
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2026-10-01
Estimated Expiration
2044-08-28

AI Technical Summary

Benefits of technology

【0008】 本発明によれば、生成AIを利用して、対象となるソースコードに規定されたメソッドのコメントをより好適な態様で生成することが可能となる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007927801000001
    Figure 0007927801000001
  • Figure 0007927801000002
    Figure 0007927801000002
  • Figure 0007927801000003
    Figure 0007927801000003
Patent Text Reader

Abstract

To generate a description of a method defined in a target source code in a more suitable form by using a generated AI.SOLUTION: Adding, to a source code of a first method, an explanatory text of a second method called from the first method as a comment; and inputting, to a generated AI, the source code of the first method to which the explanatory text of the second method is added as the comment. And a control unit configured to control an order in which each of the series of methods is set as a processing target so that the comment addition unit and the generation unit sequentially set each of the series of methods as a first method from an end side toward a root side of a call graph indicating a call relationship between each of the series of methods, and cause the generation AI to generate a description of the first method.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[[Technical Field]]

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

[0002] In some cases, various types of content are added as comments to the source code of a developed system, such as descriptions of the processing content of the source code, intentions that are difficult to grasp directly from the source code, and precautions. However, in systems that have been constructed, operated, maintained, replaced, etc. in the past, insufficient comments added to the source code may make it difficult for workers to grasp the intentions indicated by the source code. Furthermore, even when documents related to the target source code remain, the documents are not organized, and it may be difficult to extract information related to the target source code. Against this background, research is being conducted on techniques for generating descriptive text for target source code based on the target source code. Patent Document 1 discloses an example of a technique for generating descriptive text for source code (for example, descriptive text added as a comment) based on the source code. Furthermore, in recent years, with the development of AI technology, it has become possible to generate various contents using AI (learning models) trained by so-called machine learning. Against this background, research is also being conducted on techniques for generating descriptive text to be added as comments from source code using AI. Non-Patent Document 1 discloses an example of a technique that uses AI to generate, from source code, descriptive text indicating the content of processing defined in the source code (for example, the processing content of a method). Particularly in recent years, so-called generative AI technology, which generates content according to various instructions by inputting the instructions as prompts, such as ChatGPT (registered trademark), has been attracting attention. [[Prior Art Documents]] [[Patent Documents]]

[0003] [Patent Document 1] Japanese Patent Publication No. 2001-5650 [Non-patent literature]

[0004] [Non-Patent Document 1] Akiyoshi Takahashi, et al., "Automatic Generation of Program Comments Based on Problem Statements," JSiSE Research Report vol.33, no.7, Japan Society for Educational Systems Information, March 2019, pp. 51-55. [Overview of the Initiative] [Problems that the invention aims to solve]

[0005] On the other hand, when using a generation AI to generate explanatory text from source code that describes the processing defined in that source code, conventional methods often find it difficult to create a sufficient explanation from the source code of the target method alone. In some cases, it is difficult to generate a sufficient explanation without also considering the content of methods called from that method. Furthermore, even if the generation AI is made to generate comments including the source code of the called methods, the number of tokens increases, exceeding the limit of the number of tokens that the generation AI can handle, which can make it difficult to generate comments.

[0006] In view of the above-mentioned problems, the present invention aims to enable the generation of a more suitable description of a method defined in the target source code using a generation AI. [Means for solving the problem]

[0007] The information processing device according to the present invention includes: a comment adding means for adding a descriptive text for a second method called from a first method as a comment to the source code of a first method of a series of methods defined in a series of source codes to be analyzed; a generation means for inputting the source code of the first method to a generation AI that analyzes the meaning of a method defined in an input source code and generates a descriptive text for that method, thereby causing the generation AI to generate a descriptive text for the first method; and a control means for controlling the order in which the comment adding means and the generation means process each of the methods in the series, so as to cause the generation AI to generate a descriptive text for each of the methods in the series, sequentially from the end to the root of a call graph showing the call relationships between each of the methods in the series, as the first method. [Effects of the Invention]

[0008] According to the present invention, it is possible to generate comments for methods defined in the target source code in a more suitable manner by using generation AI. [Brief explanation of the drawing]

[0009] [Figure 1] This diagram illustrates an example of a method for generating method descriptions using generative AI. [Figure 2] This figure shows an example of the method description generated by the AI. [Figure 3] This is a diagram showing an example of a call graph. [Figure 4] This figure shows an example of a prompt related to the generation of explanatory text. [Figure 5] This diagram shows an example of the hardware configuration of an information processing device. [Figure 6] This is a functional block diagram showing an example of the functional configuration of an information processing device. [Figure 7]It is a flowchart illustrating an example of processing by an information processing apparatus. [Figure 8] It is a diagram illustrating an example of a prompt related to description text generation and a generation result. [Figure 9] It is a diagram illustrating an example of a prompt related to description text generation and a generation result. [Figure 10] It is a diagram illustrating an example of a prompt related to description text generation and a generation result. [Figure 11] It is a diagram illustrating an example of a prompt related to description text generation and a generation result. [Figure 12] It is a diagram illustrating an example of a prompt related to description text generation and a generation result. [Figure 13] It is a diagram illustrating an example of a prompt related to description text generation. [Figure 14] It is a diagram illustrating an example of source code and a description text. [Figure 15] It is a diagram illustrating an example of a prompt related to description text integration and an integration result. [Figure 16] It is a diagram illustrating an example of the relationship between source code and a call graph. [Figure 17] It is a diagram illustrating an example of source code specified in a prompt. [Figure 18] It is a diagram illustrating an example of a call graph when recursive call is included. [Figure 19] It is a diagram illustrating an example of a processing flow related to polishing a description text. [Figure 20] It is a diagram illustrating an example of source code of a method that is a target for description text generation. [Figure 21] It is a diagram illustrating an example of source code of a series of methods to be analyzed. DETAILED DESCRIPTION OF THE INVENTION

[0010] Preferred embodiments of this disclosure will be described in detail below with reference to the attached drawings. In this specification and the drawings, components having substantially the same functional configuration are denoted by the same reference numerals, and redundant descriptions will be omitted.

[0011] <Overview> Referring to Figures 1 to 4, the features of an information processing apparatus according to one embodiment of this disclosure will be outlined. The information processing device according to this embodiment generates explanatory text for methods defined in the target source code by utilizing a learning model, such as a neural network, that has been trained based on deep learning or machine learning, and in particular a model called Generative AI. Generative AI is an AI (model) that learns data patterns and relationships and generates new content such as text and images. Therefore, in order to make the features of the information processing device according to this embodiment easier to understand, we will first refer to Figure 1 and describe an example of a method that uses Generative AI to generate explanatory text that takes into account the meaning of the methods defined in the target source code (for example, the processing content defined as a method).

[0012] In the example shown in Figure 1, the target source code C100 is designated as the target for analysis, and prompt D200, which instructs the generation of comments for the source code C100, is input to the generation AI 500. The generation AI 500 follows the instructions given in prompt D200, analyzes the meaning of the source code C100 specified in prompt D200 (e.g., processing content), and generates and outputs a descriptive text D300 for the source code C100 based on the results. The generated descriptive text D300 may, for example, be added as a comment (feedback) to the source code C100 being analyzed. For the generation AI 500, one built on existing technology may be used. As mentioned above, an example of a generation AI that accepts a prompt indicating the content of the instructions as input and generates and outputs text according to the content of the instructions is ChatGPT. Furthermore, an example of a technology that automatically generates comments for target source code using an AI (model) trained based on machine learning is disclosed in Non-Patent Document 1.

[0013] On the other hand, as illustrated in Figure 1, simply using the same method as before, where the source code to be analyzed is specified as a prompt and used as input to the generating AI, may not provide a sufficient explanation. For example, Figure 2 shows an example of the result of generating a description of a method defined in source code by a generation AI. In the example shown in Figure 2, the source code for which the description is to be generated defines a process that sequentially calls the methods of three objects a, b, and c, which are received as input. In such a situation, even if the target source code is analyzed, only the fact that the methods of each object are being called can be identified, so a description that only indicates that the individual methods are being called may be generated, as illustrated in Figure 2. One way to address these challenges is to have the generating AI generate explanatory text not only for the target source code but also for the source code of the methods that are called. However, generating AIs generally have limitations on the number of tokens they can handle, and as the scale of the target system increases, it can become difficult to input a series of related source codes into the generating AI. Furthermore, some programming languages ​​have specifications such as inheritance and override that cause code to be reinterpreted depending on the conditions. In such situations, it is not always possible for the generating AI to accurately recognize the call relationships between source codes based on the specifications of the target programming language and analyze the series of source codes. In light of the above circumstances, this disclosure describes an example of a technology that uses so-called generative AI to generate a more suitable description of the target source code. In this embodiment, for convenience, the applied generative AI (model) is assumed to be constructed by learning based on so-called machine learning. However, as long as it is possible to construct such a generative AI, the method is not limited to machine learning.

[0014] Figures 3 and 4 illustrate the basic technical concept of the function related to generating explanatory text for methods defined in source code to be analyzed using generation AI in the information processing device according to this embodiment. The information processing device according to this embodiment generates a descriptive text for each of a series of methods defined in a series of source code to be analyzed, based on information (e.g., a call graph) that shows the analysis results of the call relationships of each of the series of methods defined in the series of source code to be analyzed. For example, Figure 3 shows an example of a call graph that illustrates the call relationships of each of the series of methods for which explanatory text is generated. In the example shown in Figure 3, nodes N110 to N160, each associated with one of the six methods, are connected according to the call relationships of each of the six methods to form a call graph N100. Furthermore, since publicly known techniques can be applied to analyze the call relationships of each method defined in the series of source code being analyzed, and to generate a call graph based on the analysis results, a detailed explanation will be omitted. Furthermore, for convenience, in this disclosure, the caller side of the connection relationships between nodes corresponding to each method shown as a call graph will be referred to as the root side, and the called side will be referred to as the end side. As a specific example, if we focus on the relationship between node N130 associated with method "B.process()" and node N140 associated with method "E.process()", node N130 will be located on the root side, and node N140 will be located on the end side.

[0015] The information processing device 100 according to this embodiment sequentially processes a series of target methods (methods associated with nodes N110 to N160) from the ends of the call graph N100 towards the root, and causes the generating AI to generate a description of the method. This determination of the processing order can be achieved, for example, by performing a topological sort on the call graph N100 to assign an order to the series of nodes in the call graph N100, and then reversing that order. In the example shown in Figure 3, the methods associated with each node are processed in the order of nodes N140, N130, N150, N160, N120, and N110, and the generating AI generates a description of the method.

[0016] Figure 4 shows an example of prompts used when generating a description of a method with the generation AI. In the example shown in Figure 4, the method "Processor.process()" associated with node N120 in the example shown in Figure 3 is targeted, and the generation AI 500 is instructed to generate a description of that method. The source code C110 shown in Figure 4 is an example of the source code for a method corresponding to node N120, which is specified as the target of analysis in prompt D210, the input to the generated AI500. Source code C110 defines the codes C1101, C1102, and C1103, which call the methods corresponding to nodes N130, N150, and N160 shown in Figure 3. If the information processing device 100 has already generated descriptions for other methods called by the target method, it adds those descriptions as comments associated with those other methods. For example, in the example shown in Figure 3, when the method corresponding to node N120 is being processed, descriptions for the methods corresponding to nodes N130, N150, and N160 have already been generated. Therefore, in the example shown in Figure 4, the information processing device 100 adds the corresponding method descriptions C1104, C1105, and C1106 as comments to the source code C110, associated with the method codes C1101, C1102, and C1103 corresponding to nodes N130, N150, and N160, respectively. In the example shown in Figure 4, the method that generates the explanatory text, as indicated by code C110, is an example of a "first method." Furthermore, other methods called from the method that generates the explanatory text, such as the methods indicated by codes C1101, C1102, and C1103, are examples of "second methods."

[0017] Then, the information processing device 100 adds the source code C110 of the target method as the code to be processed to prompt D210, which instructs the generation AI 500 to generate an explanatory text. In the example shown in Figure 4, the source code of the method to be analyzed is specified in the area indicated by the tag "#Code" in prompt D210. In addition, the rules for outputting the explanatory text are specified in the area indicated by the tag "#Rule" in prompt D210, and the output format of the explanatory text is specified in the area indicated by the tag "#Output format". As described above, the information processing device 100 generates prompt D210 and inputs prompt D210 to the generation AI 500, causing the generation AI 500 to generate a description of the method shown as source code C110, D310. Alternatively, as shown in the example described with reference to Figure 1, the information processing device 100 may add the description D310 generated by the generation AI 500 as a comment (feedback) to the target source code (the source code from which source code C110 is generated).

[0018] The features of an information processing apparatus according to one embodiment of this disclosure have been outlined above with reference to Figures 1 to 4. The configuration and processing of the information processing apparatus according to this embodiment will be described in more detail below.

[0019] <Hardware Configuration> Referring to Figure 5, an example of the hardware configuration of an information processing device 900 applicable as the information processing device 100 according to this embodiment will be described. As shown in Figure 5, the information processing device 900 includes a CPU (Central Processing Unit) 910, a ROM (Read Only Memory) 920, and a RAM (Random Access Memory) 930. The information processing device 900 also includes an auxiliary storage device 940 and a network interface 970. The information processing device 900 may also include at least one of an output device 950 and an input device 960. The CPU 910, ROM 920, RAM 930, auxiliary storage device 940, output device 950, input device 960, and network interface 970 are interconnected via a bus 980.

[0020] The CPU 910 is a central processing unit that controls various operations of the information processing unit 900. For example, the CPU 910 may control the operation of the entire information processing unit 900. The ROM 920 stores control programs, boot programs, and other programs that can be executed by the CPU 910. The RAM 930 is the main memory of the CPU 910 and is used as a work area or a temporary storage area for deploying various programs.

[0021] The auxiliary storage device 940 stores various data and programs. The auxiliary storage device 940 is implemented by a storage device capable of temporarily or permanently storing various data, such as an HDD (Hard Disk Drive) or non-volatile memory such as an SSD (Solid State Drive).

[0022] The output device 950 is a device that outputs various types of information and is used to present various types of information to the user. For example, the output device 950 may be implemented by a display device such as a display. In this case, the output device 950 presents information to the user by displaying various types of display information. As another example, the output device 950 may be implemented by an acoustic output device that outputs sounds such as voice or electronic sounds. In this case, the output device 950 presents information to the user by outputting sounds such as voice or electronic sounds. Furthermore, the device to which the output device 950 is applied may be appropriately changed depending on the medium used to present information to the user.

[0023] The input device 960 is used to receive various instructions from the user. In this embodiment, the input device 960 includes input devices such as a mouse, keyboard, and touch panel. As another example, the input device 960 may also include a sound collection device such as a microphone to collect the voice spoken by the user. In this case, various analysis processes such as acoustic analysis and natural language processing are applied to the collected voice so that the content of the voice is recognized as an instruction from the user. Furthermore, the device applied as the input device 960 may be changed as appropriate depending on the method of recognizing the user's instructions. In addition, multiple types of devices may be applied as the input device 960.

[0024] The network interface 970 is used for communication with external devices via a network. The device used as the network interface 970 may be changed as appropriate depending on the type of communication path and the applicable communication method.

[0025] The CPU 910 loads the program stored in the ROM 920 or auxiliary storage device 940 into the RAM 930 and executes this program, thereby realizing the functional configuration of the information processing device shown in Figure 6, and the processing of the information processing device described later with reference to Figure 7.

[0026] The above describes an example of the hardware configuration of an information processing device 900 applicable as the information processing device 100 according to this embodiment, with reference to Figure 5.

[0027] <Functional Configuration> Referring to Figure 6, an example of the functional configuration of the information processing device 100 according to this embodiment will be explained, with particular attention to the part related to the generation of explanatory texts for each of the series of methods defined in the series of source code to be analyzed. As shown in Figure 6, the information processing device 100 includes a call relationship analysis unit 101, a control unit 110, a code extraction unit 102, a comment addition processing unit 103, a prompt generation unit 104, an explanation text generation unit 105, a storage unit 106, and an explanation text reflection unit 107.

[0028] The call relationship analysis unit 101 analyzes the call relationships of each of the series of methods defined in the series of source code C100 to be analyzed, and generates a call graph based on the results of the analysis. As mentioned above, known techniques can be applied to the analysis of the call relationships of each of the series of methods and the generation of a call graph according to the results of the analysis, so a detailed explanation will be omitted. Also, for convenience, the other components will be explained assuming that the call graph N100 exemplified in Figure 3 has been generated. The control unit 110 determines the processing order of each method in a series of methods to be processed based on the call graph N100 generated by the call relationship analysis unit 101. Specifically, as described above with reference to Figure 3, the control unit 110 determines the processing order of each method in a series of methods so that each method in the series of methods to be processed sequentially from the ends of the call graph N100 towards the root. Then, the control unit 110 controls the operation of the code extraction unit 102, the comment addition processing unit 103, and the explanatory text generation unit 105, etc., which will be described later, so that each method is processed sequentially according to the determined processing order.

[0029] The code extraction unit 102, in accordance with instructions from the control unit 110, extracts source code from the series of source code C100 to be analyzed that defines the method to be processed.

[0030] The comment addition processing unit 103 reads the code of the method to be processed from the source code extracted by the code extraction unit 102, and if the method calls other methods, it adds a description of those other methods as a comment to the code. As mentioned above with reference to Figures 3 and 4, if the target method calls other methods, those other methods have been previously targeted for processing, and a description of those other methods has already been generated. In this case, the code extraction unit 102 only needs to read the description of the other method that was previously generated and stored in a predetermined storage area (for example, the storage unit 106 described later) and add it as a comment to the code of the target method. Alternatively, the control unit 110 may identify the call relationship between the target method and other methods based on the call graph N100 and notify the comment addition processing unit 103.

[0031] The prompt generation unit 104 generates prompt D210 to instruct the generation AI 500 to generate a description of the method, for which the code of the method to be processed has been designated as the analysis target. At this time, if the comment addition processing unit 103 has added a comment to the code of the method to be processed, the prompt generation unit 104 generates prompt D210 so that the code to which the comment has been added is designated as the analysis target. The method for generating prompt D210 has been described above with reference to Figure 4, so a detailed explanation is omitted here.

[0032] The description generation unit 105 inputs the prompt D210 generated by the prompt generation unit 104 to the generation AI 500, causing the generation AI 500 to generate a description D310 for the target method. The description generation unit 105 then associates the description D310 generated by the generation AI 500 with the target method and stores it in a predetermined memory area (for example, the memory unit 106).

[0033] The memory unit 106 is a memory area for storing various types of data. In this embodiment, the memory unit 106 is used as a memory area for holding the explanatory text D310 generated by the generation AI 500 in the explanatory text generation unit 105.

[0034] As described above, based on the control by the control unit 110, each of the series of methods defined in the series of source code C100 to be analyzed is sequentially processed according to the call graph N100 shown in Figure 3, and the generation AI 500 generates the explanatory text D310, which is then stored in the storage unit 106.

[0035] When a description D310 is generated for each of the series of methods defined in the series of source code C100 to be analyzed, the description reflection unit 107 reads the description D310 corresponding to each method from the storage unit 106. Then, the description reflection unit 107 reflects the description D310 read for each method as a comment in the source code in which that method is defined.

[0036] The above explanation, with reference to Figure 6, describes an example of the functional configuration of the information processing device 100 according to this embodiment, with particular attention to the part related to the generation of explanatory texts for each of the series of methods defined in the series of source code to be analyzed. Note that the configuration shown in Figure 6 is merely an example and does not limit the functional configuration of the information processing device 100 according to this embodiment. For example, the series of components shown in Figure 6 may be realized by the cooperation of multiple devices. As a specific example, the functions of some of the components of the series of components shown in Figure 6 may be realized by external devices different from the information processing device 100 or by so-called network services such as cloud services. As another example, the processing load of at least some of the components of the series of components shown in Figure 6 may be distributed among multiple devices.

[0037] <Processing> Referring to Figure 7, an example of the processing of the information processing device 100 according to this embodiment will be explained, with particular attention to the part related to the generation of explanatory texts for each of the series of methods defined in the series of source code to be analyzed.

[0038] In S101, the call relationship analysis unit 101 analyzes the call relationships of each of the series of methods defined in the series of source code C100 to be analyzed, and generates a call graph based on the results of the analysis. The control unit 110 then determines the processing order of each of the series of methods to be processed based on the call graph N100 generated by the call relationship analysis unit 101.

[0039] In S102, the code extraction unit 102, in accordance with instructions from the control unit 110, extracts source code from the series of source code C100 to be analyzed that defines the method to be processed. In S103, the comment addition processing unit 103 reads the code of the method to be processed from the source code extracted in S102. Furthermore, if the method calls other methods, the comment addition processing unit 103 adds a description of those other methods as a comment to the read code. Note that if no description of the other method has been generated, the comment addition processing unit 103 does not need to add a comment to the target code. In S104, the prompt generation unit 104 generates a prompt D210 to instruct the generation AI 500, which has been designated as the analysis target for the code of the method to be processed, to generate a description of the method, based on the processing result of S103. In S105, the description generation unit 105 inputs the prompt D210 generated in S104 to the generation AI 500, causing the generation AI 500 to generate a description D310 for the target method. The description generation unit 105 then associates the description D310 generated by the generation AI 500 with the target method and stores it in the storage unit 106.

[0040] In S106, the control unit 110 determines whether or not the generation of explanatory text has been completed for each of the series of methods defined in the series of source code to be analyzed. If the control unit 110 determines in S106 that the generation of explanatory text has not been completed for each of the series of methods defined in the series of source code to be analyzed, it proceeds to S102. In this case, the control unit 110 controls the process so that the processing from S102 onward is executed again for the methods that have not yet been processed. Then, if the control unit 110 determines in S106 that it has completed generating explanatory text for each of the series of methods defined in the series of source code to be analyzed, it terminates the series of processes shown in Figure 7.

[0041] The above explanation, with reference to Figure 7, describes an example of the processing of the information processing device 100 according to this embodiment, with particular attention to the part related to the generation of explanatory texts for each of the series of methods defined in the series of source code to be analyzed.

[0042] <Examples> As an example of the information processing device 100 according to this embodiment, an example of a prompt to be input to the generating AI 500 and an explanatory text generated by the generating AI 500 in response to the input of the prompt will be described with reference to Figures 8 to 12 and Figure 21. In this embodiment, an example will be described in which each method shown in the call graph N100 illustrated in Figure 3 is the target of processing.

[0043] First, as a reference, we will briefly explain an example of the source code that generates the call graph N100 shown in Figure 3, i.e., the source code of the series of methods to be analyzed, referring to Figure 21. The series of source code shown in Figure 21 specifies the process of reading the contents of the target file, replacing the target string contained in the contents, and then writing the result to a file. Class E inherits from Class D, and in Class E, the method D.process() defined in Class D is overridden as E.process(). Specifically, while method D.process() is defined to return a list of directories, method E.process() is defined to return the contents of a file. Furthermore, in class B, the variable d is defined as an object of class D, and it is defined to call method D.process(), but due to the definition of Main class, method E.process() will actually be called.

[0044] Next, we will explain the processing involved in the analysis of each method. In the example shown in Figure 3, the first processing target is the method "E.process()" indicated as node N140. Figure 8 shows an example of the prompt D211 generated for the method indicated as node N140, and the explanatory text D311 output from the generated AI500 with prompt D211 as input. Specifically, Figure 8(a) shows an example of prompt D211. Code C111 corresponds to the code of the method specified as the target of analysis (the target for generating a description). Note that, as shown in Figure 3, the method indicated as node N140 does not call the method for which the description is to be generated. Therefore, as shown by code C111, no additional comments have been added to the code of the method indicated as node N140. Instruction D2111 is an instruction that specifies the conditions related to the generation of the description of the method to be analyzed. Instruction D2112 is an instruction that specifies the output format of the description of the method to be analyzed. Figure 8(b) shows an example of the explanatory text D311 output by the generation AI500 with prompt D211 as input.

[0045] As the second target of processing, the method "B.process()" shown as node N130 in Figure 3 is applied. Figure 9 shows an example of prompt D212 generated for the method shown as node N130, and explanatory text D312 output from generated AI500 which takes prompt D212 as input. Specifically, Figure 9(a) shows an example of prompt D212. Code C112 corresponds to the code of the method specified as the target of analysis. As shown in Figure 3, the method indicated as node N130 calls the method indicated as node N140. Therefore, in prompt D212, the description D311a of the method indicated as node N140 is added as a comment in association with code C112. The description D311a shown in Figure 9(a) is a description that has been edited as follows, based on the description D311 shown in Figure 8(b). The class E that defines the method shown as node N150, which is called in code C112, inherits from class D, and in code C112, the method shown as node N150 is called as a method of the inheriting class D. In this way, due to inheritance (extends) and implementation, the type of the method that is actually called may differ from the type of the method defined in the code, and in such cases, information indicating this may be added in the comments. For example, in the example shown in Figure 9(a), the explanatory text D311, which is added as a comment, is edited to add a supplementary explanation D311b that indicates that the class that defines the method in question inherits from another class (class D), thereby forming the explanatory text D311a. Alternatively, instead of a supplementary explanation, the content of the method's explanatory text added as a comment may be modified to match the type of the method defined in the code. Figure 9(b) shows an example of the explanatory text D312 output by the generation AI500 with prompt D212 as input. In the example shown in Figure 9(a), a class that inherits from class D, such as class E, is an example of a "first class," while a class that inherits from class D, such as class D, is an example of a "second class."

[0046] As the third target of processing, the method "A.process()" shown as node N150 in Figure 3 is applied. Figure 10 shows an example of prompt D213 generated for the method shown as node N150, and explanatory text D313 output from generated AI500 which takes prompt D213 as input. Specifically, Figure 10(a) shows an example of prompt D213. Code C113 corresponds to the code of the method specified as the target of analysis. Note that, as shown in Figure 3, the method shown as node N150 does not call the method being explained. Therefore, as shown by code C113, no additional comments have been added to the code of the method shown as node N150. Figure 10(b) shows an example of the explanatory text D313 output by the generation AI500 with prompt D213 as input.

[0047] As the fourth processing target, the method "C.process()" shown as node N160 in Figure 3 is applied. Figure 11 shows an example of prompt D214 generated for the method shown as node N160, and explanatory text D314 output from generated AI500 which takes prompt D214 as input. Specifically, Figure 11(a) shows an example of prompt D214. Code C114 corresponds to the code of the method specified for analysis. Note that, as shown in Figure 3, no other methods are called from the method shown as node N160. Therefore, no additional comments have been added to the code of the method shown as node N160, as shown by code C114. Figure 11(b) shows an example of the explanatory text D314 output by the generation AI500 with prompt D214 as input.

[0048] As the fifth processing target, the method "Processor.process()" shown as node N120 in Figure 3 is applied. Figure 12 shows an example of prompt D215 generated for the method shown as node N120, and explanatory text D315 output from generated AI500 which takes prompt D215 as input. Specifically, Figure 12(a) shows an example of prompt D215. Codes C1151, C1152, and C1153 correspond to the codes of the methods specified for analysis. As shown in Figure 3, the method indicated as node N120 sequentially calls the methods indicated as nodes N130, N150, and N150, and codes C1151, C1152, and C1153 correspond to the codes related to the calls of each method. Therefore, in prompt D215, the descriptive texts D312, D313, and D314 of the methods indicated as nodes N130, N150, and N150 are added as comments in association with codes C1151, C1152, and C1153. The explanatory texts D312, D313, and D314 shown in Figure 12(a) correspond to explanatory text D312 shown in Figure 9(b), explanatory text D313 shown in Figure 10(b), and explanatory text D314 shown in Figure 11(b). Figure 10(b) shows an example of the explanatory text D315 output by the generation AI500 with prompt D215 as input.

[0049] In summary, as an embodiment of the information processing device 100 according to this embodiment, an example of a prompt to be input to the generating AI 500 and an explanatory text generated by the generating AI 500 in response to the input of the prompt have been described with reference to Figures 8 to 12.

[0050] <Variation> Modified examples of the information processing device 100 according to this embodiment are described below.

[0051] (Variation 1: When multiple methods are called in a single line of code) As an example of variation 1, we will describe an example of how to add explanatory text as a comment to the code specified in the prompt when multiple method calls are made in a single line of code. For example, Figure 13 shows an example of a prompt when multiple method calls are made in a single line of code, and shows an excerpt of the specified part of the code to be analyzed. Specifically, at prompt D221, the methods "m()", "n()", "s()", and "t()" are called sequentially in a single line of code. In such cases, as shown in Figure 13, the explanatory text generated for each of the multiple methods being called should be added sequentially in the order in which the methods are called.

[0052] (Variation 2: When a single method call results in multiple method calls) As a second variation, we will describe an example of how to add explanatory text as a comment to the code specified in the prompt when a single method call results in multiple method calls. For example, Figure 14 shows an example of a description generated for the source code being analyzed and other methods that are called from the methods defined in that source code. Specifically, in source code C131 shown in Figure 14(a), the method "foo" to be analyzed, shown as code C1311, is called, and this call also calls the method "foo" of class A1, shown as code C1312, and the method "foo" of class A2, shown as code C1313. The explanatory text D231 shown in Figure 14(b) is an example of an explanatory text generated for the method "foo" of class A1, shown as code C1312. Similarly, the explanatory text D232 shown in Figure 14(c) is an example of an explanatory text generated for the method "foo" of class A2, shown as code C1313. As shown in the example in Figure 14(a), when a single method call effectively results in multiple method calls, it is advisable to add a single comment to that single method call that combines the descriptions of each of the multiple methods that are effectively called. Furthermore, a generative AI may be used to integrate these multiple descriptions.

[0053] For example, Figure 15 shows an example of a prompt D233 that serves as input to a generation AI and a description D234 that is output by the generation AI, when the generation AI is instructed to integrate (e.g., merge) the descriptions of multiple methods to output a single description. Specifically, Figure 15(a) shows an example of prompt D233. In prompt D233, multiple descriptive texts to be merged are specified in the area indicated by the "#Input" tag. For example, in the example shown in Figure 15(a), the descriptive text D231 for the method "foo" of class A1 shown in Figure 14(b) and the descriptive text D232 for the method "foo" of class A2 shown in Figure 14(c) are specified to be merged. In addition, in prompt D233, the output format of the descriptive texts is specified in the area indicated by the "#Output format" tag. Instruction D2331 is an instruction related to specifying the output format of the merged descriptive texts. Figure 15(b) shows an example of the integrated description D234 output by the generating AI with prompt D233 as input. Furthermore, there are no particular limitations on the generation AI used to integrate multiple explanatory texts. Therefore, prompt D233 shown in Figure 15(a) is merely an example, and the format of the input prompt may be changed as appropriate depending on the generation AI applied.

[0054] Furthermore, as shown in the example in Figure 14(a), it can be difficult to distinguish from the call graph whether a single method call results in multiple method calls or whether multiple method calls are made individually. In such cases, it is preferable to determine which case applies based on information indicating the call relationships between the methods that generate the call graph (in other words, information corresponding to the analysis results of the call relationships between methods).

[0055] For example, Figure 16 illustrates an example of the difference between a case where multiple methods are called by a single method call and a case where multiple methods are called individually. Although not shown in the source code in Figures 16(a) and 16(d), it is assumed that the definitions of classes A1 and A2, shown as codes C1312 and C1313 in Figure 14(a), are made in each figure.

[0056] Specifically, Source Code 1 shown in Figure 16(a) illustrates an example of a case where a single method call results in multiple method calls. In Source Code 1, the method "bar" calls the method "foo," which in turn calls the method "foo" of class A1 and the method "foo" of class A2. Figure 16(b) shows an example of a call graph generated for Source Code 1 shown in Figure 16(a). Figure 16(c) shows information indicating the call relationships between a series of methods defined in Source Code 1 shown in Figure 16(a), which is the source from which the call graph shown in Figure 16(b) is generated. In contrast, source code 2 shown in Figure 16(d) illustrates an example where multiple methods are called individually. In source code 1, the method "bar" calls the method "foo" of class A1 and the method "foo" of class A2 individually. Figure 16(e) shows an example of a call graph generated for source code 2 shown in Figure 16(d). Figure 16(f) is information showing the call relationships between a series of methods defined in source code 2 shown in Figure 16(d), which is the source from which the call graph shown in Figure 16(e) is generated.

[0057] As can be seen by comparing Figure 16(b) and Figure 16(e), source code 1 shown in Figure 16(a) and source code 2 shown in Figure 16(d) may generate similar call graphs. In such cases, it can be difficult to mechanically determine which source code corresponds to which source code from the call graph alone. On the other hand, as can be seen by comparing Figure 16(c) and Figure 16(f), source code 1 and source code 2 have different information indicating the call relationships between the series of methods that generate the call graph. Therefore, when multiple methods are called from one method in the call graph, it is possible to mechanically determine whether it corresponds to source code 1 or source code 2 by analyzing the information indicating the call relationships between the methods that generate the call graph.

[0058] (Variation 3: When the parent class constructor is not explicitly called) As a third variation, we will describe an example of the code to specify in the prompt when the call to the parent class constructor is not explicitly shown. For example, Figure 17(a) shows an example of source code in which the call to the parent class constructor is not explicitly shown. Specifically, in the example shown in Figure 17(a), a definition of class A and a definition of class B that inherits from class A are given. Although no processing is written in the constructor of class B, the constructor of class A is actually called. In cases where processing is implicitly called in this way, the source code in question may be edited to explicitly indicate that processing. For example, Figure 17(b) shows an example of code related to the definition of class B, in which code has been added so that the code for a process implicitly called by the edit is explicitly specified. In the example shown in Figure 17(a), the source code specified in the prompt should be edited so that code calling the constructor of the parent class (i.e., class A) is added to the constructor of class B, as shown in Figure 17(b). By making such edits, it becomes possible to have the generating AI500 generate an explanatory text that takes into account the code that was implicit in the original source code.

[0059] (Modification 4: Processing order when a recursive call is made) As a fourth variation, we will explain an example of how to determine the processing order of each method in a series of methods that are the subject of explanatory text generation, when a portion of that series of methods includes a recursive call. For example, Figure 18 shows an example of a call graph illustrating the call relationships of a series of methods that include some recursive calls. In the example shown in Figure 18, a loop occurs in the call relationships between methods "b", "c", and "d" due to recursive calls. In such cases, a call graph is first generated in which the series of nodes in the target call graph that are making recursive calls (in other words, the series of nodes that correspond to the strongly connected components in the call graph) are grouped together as a single node, and then an ordering is assigned to the series of nodes in that call graph for processing.

[0060] As a concrete example, in the case shown in Figure 18, a call graph is generated by combining the nodes of methods "b", "c", and "d" into a single node. In the example shown in Figure 18, methods "b", "c", and "d" are treated as a single method "B", and the nodes of methods "b", "c", and "d" are combined into nodes of method "B". Then, the order in which the nodes of the call graph are processed is determined using the same method as explained with reference to Figure 3 (for example, a method using topological sort). In the case shown in Figure 18, the processing order is determined as follows: methods "f", "e", "B (recursive call portion)", and "a". Furthermore, the series of methods "b", "c", and "d", which are recursively called and grouped together as a strongly connected component in a single node, are expanded. In this case, the part grouped as a strongly connected component is expanded so that each of the series of methods "b", "c", and "d", which form a loop through recursive calls, is called at least twice. That is, in the example shown in Figure 18, the methods to be processed are ordered as follows: "f", "e", "b", "c", "d", "b", "c", "d", "a".

[0061] In this way, the system is controlled so that each method in a loop formed by recursive calls is processed at least twice. As a result, while some of the explanatory text for the recursive methods may not be generated during the first call, it will be generated during the second call. This makes it possible for AI500 to generate explanatory text that also takes into account calls between methods made by recursion.

[0062] (Variation 5: Handling of existing comments) As a fifth variation, we will describe an example of how to handle existing comments when they are included in the source code of the method for which the explanatory text is to be generated. If the source code of the method for which the explanatory text is to be generated contains existing comments, one of the following examples of how to handle those existing comments should be applied. (Solution 1) Have the AI ​​generate an explanatory text for the code from which existing comments have been deleted. (Solution 2) Have the AI ​​generate explanatory text for the code that includes existing comments. (Solution 3) For the code from which existing comments have been deleted, have the AI ​​generate an explanatory text, and then edit (refine) that explanatory text based on the existing comments.

[0063] Furthermore, when applying Solution 3, if the explanatory text generated by the generation AI is to be refined with existing comments, the generation AI may be allowed to perform the refinement. Therefore, referring to Figure 19, we will explain an example of the general processing flow when Solution 3 is applied, focusing on the case where the generation AI is used to refine the explanatory text. The source code C161 shown in Figure 19 represents source code that includes existing comments. By removing the existing comments from source code C161, source code C162 without the existing comments is generated. Then, prompt D261, which specifies source code C162 as the target of analysis, is input to the generating AI (for example, the generating AI 500 mentioned above), and the generating AI generates a description of the method defined in source code C162, D262. Next, prompt D263 is input to the generating AI, instructing it to edit (brush up) the description D262 using existing comments contained in source code C161. The AI ​​then generates the edited description D264. The type of generating AI used in this case is not particularly limited. Furthermore, the format of prompt D263 may be modified as appropriate depending on the generating AI being used. Furthermore, when editing (refine) the explanatory text, the input to the generating AI is not limited to textual information such as existing comments. Other types of data, such as documents and images related to the source code in question, may also be applied. In other words, as long as the generating AI that edits the explanatory text can accept various types of data as input, a wide range of data, not just textual information, can be used to edit (refine) the explanatory text.

[0064] The above explains an example of how to handle existing comments when they are present in the source code of a method for which explanatory text is to be generated.

[0065] <Supplement> The following is a summary of supplementary explanations regarding the application of the technology related to this disclosure. As described above, the information processing device 100 according to one embodiment of this disclosure utilizes the descriptions of other methods called from a given method when generating descriptions of some methods, and does not apply to the descriptions of the calling methods. As a concrete example, consider a scenario where a call graph is generated so that methods "As()", "Bt()", and "Cu()" are called in that order, and a description for method "Bt()" is generated. In this case, the description for method "Cu()" is used when generating the description for method "Bt()", but the description and code for the calling method "As()" are not used. Applying this kind of control prevents situations where the generated description becomes overly complex or its volume increases.

[0066] On the other hand, since pointer analysis is performed when generating the call graph, it is possible to reflect the influence of the caller based on the call graph. Here, with reference to Figure 20, we will explain the overview of the process related to generating a descriptive text that takes the influence of the caller into account. Figure 20 shows an example of the source code of a method for which a descriptive text is to be generated. In the example shown in Figure 20, an object of class C is passed to the method "Bt()" in the method "As()". In contrast, the definition of the method "Bt()" specifies that the method "Du()" of class D, which class C inherits from, should be called as input. In this case, in practice, the method "Cu()" of class C will be called when the method "Bt()" is called in the method "As()". Even in situations like this, using a call graph makes it possible to mechanically determine that the method "Cu()" of class C should be called, rather than the method "Du()" of class D.

[0067] Furthermore, it is conceivable that existing libraries (e.g., standard libraries) may be used when implementing various functions. In such circumstances, it may be desirable to generate explanatory texts only for newly created or custom-created methods, excluding methods defined in existing libraries from the analysis. In such cases, for example, when generating a call graph used to determine the order of processes related to explanatory text generation, methods defined in existing libraries should be excluded from the generation target, and newly created or custom-created methods should be specified as the generation target. Control of the methods targeted for call graph generation can be achieved, for example, by filtering using package names. Furthermore, the methods excluded from call graph generation can be modified as appropriate depending on the use case. For example, not only the standard libraries mentioned above, but also major libraries and frameworks may have information reflected in them as they are used as training data when building the generating AI. Since such methods tend to have little impact on the accuracy of the output (the description of the generated code) even if they are not included in the analysis, they may be excluded from call graph generation.

[0068] <Conclusion> As described above, the information processing device according to this embodiment adds a comment describing the second method called from the first method to the source code of the first method, which is one of a series of methods defined in the series of source code to be analyzed. The information processing device also inputs the source code of the first method, to which the comment describing the second method has been added, to a model that has been trained based on machine learning to analyze the meaning of the input source code and generate a description of the source code, thereby causing the model to generate a description of the first method. Furthermore, the information processing device controls the order in which the processes related to adding comments and generating descriptions target each of the series of methods, so that the model sequentially processes each of the series of methods as the first method, moving from the end to the root of the call graph that shows the call relationships between each of the series of methods, and generates a description of the first method.

[0069] With the above configuration, it becomes possible to have the model (generating AI) generate a description of each method, taking into account the call relationships of each method defined in the series of source code to be analyzed. Furthermore, it is expected that this will reduce the increase in the number of tokens used when the model generates the target methods. In other words, the information processing device according to this embodiment makes it possible to generate a more suitable description of the target source code using a model that has been trained based on machine learning. In the embodiments described above, we have explained an example in which a generative AI (model) trained primarily based on machine learning is applied. However, the method of constructing the components corresponding to the generative AI is not particularly limited, as long as it is possible to achieve similar functionality.

[0070] Furthermore, the following configurations also fall within the technical scope of this disclosure. (1) An information processing device comprising: a comment adding means for adding a description of a second method called from a first method as a comment to the source code of a first method defined in a series of methods defined in a series of source code to be analyzed; a generation means for causing a generation AI to generate a description of the first method by inputting the source code of the first method to which the description of the second method has been added as a comment; and a control means for controlling the order in which the comment adding means and the generation means process each of the methods in the series, so that the generation AI processes each of the methods in the series sequentially as the first method, from the end to the root of a call graph showing the call relationships between each of the methods in the series, and generates a description of the first method. (2) The information processing device according to (1), wherein, if there are multiple methods as the second method called from the first method, the comment-adding means adds a descriptive text for each of the multiple methods as a comment to the source code of the first method. (3) The information processing device according to (1), wherein, when multiple methods are called by calling the second method, the comment-adding means integrates the descriptions of each of the multiple methods into a single description and adds the single description as a comment to the source code of the first method. (4) The information processing device according to (3), wherein the comment-adding means identifies that the multiple methods are called by calling the second method, based on the call graph or information indicating the call relationships between each of the series of methods that generate the call graph. (5) The information processing device according to any one of paragraphs (1) to (4), wherein the comment-adding means adds information to the descriptive text of the second method to be added as a comment to the source code of the first method, indicating that the method called as the second method is a method defined in the second class or interface, when the method called as the second method is a method defined in the second class inherited by the first class in which the second method is defined, or in an interface implemented in the first class. (6) The information processing device according to (5), wherein the comment-adding means identifies that the method called as the second method is a method defined in the second class or the interface, based on the call graph or information indicating the call relationships between each of the series of methods that generate the call graph. (7) The information processing apparatus according to any one of (1) to (6), wherein the control means determines the order in which the comment addition means and the generation means will be processed by the comment addition means and the generation means, based on a call graph which groups the multiple methods subject to the recursive call into a single node, and then expands the single node such that each of the multiple methods subject to the recursive call is called at least twice. (8) The information processing apparatus according to any one of (1) to (7), wherein the comment adding means, if the source code of the first method contains existing comments, deletes the existing comments and adds a description of the second method as a comment to the source code, and the generation means inputs the source code of the first method, in which the existing comments have been deleted and the description of the second method has been added as a comment, to the generation AI, thereby causing the generation AI to generate a description of the first method. (9) The information processing device according to (8), wherein the generation means edits the description of the first method generated by the generation AI based on the existing comments. (10) The information processing apparatus according to any one of (1) to (7), wherein the comment adding means adds a description of the second method as a comment to the source code of the first method if the source code of the first method contains an existing comment, and the generation means inputs the source code of the first method containing the existing comment and to which the description of the second method has been added as a comment to the generation AI, thereby causing the generation AI to generate a description of the first method. (11) An information processing method executed by an information processing device, comprising: a comment addition step of adding a comment to the source code of a first method among a series of methods defined in a series of source code to be analyzed, a comment describing a second method called from the first method; a generation step of inputting the source code of the first method on which the comment describing the second method has been added as a comment to a generation AI that analyzes the meaning of a method defined in input source code and generates a comment describing the method, thereby causing the generation AI to generate a comment describing the first method; and a control step of controlling the order in which the comment addition step and the generation step target each of the series of methods to be processed by the comment addition step and the generation step, such that the generation AI generates a comment describing the first method for each of the series of methods sequentially, from the end side to the root side of a call graph showing the call relationships between each of the series of methods, as the first method. (12) A program that causes a computer to execute: a comment addition step of adding a comment to the source code of a first method among a series of methods defined in a series of source code to be analyzed, a comment describing a second method called from the first method; a generation step of inputting the source code of the first method with the comment describing the second method added as a comment to a generating AI that analyzes the meaning of a method defined in input source code and generates a description of the method, thereby causing the generating AI to generate a description of the first method; and a control step of controlling the order in which the comment addition step and the generation step target each of the series of methods to be processed by the comment addition step and the generation step, such that the generating AI generates a description of the first method for each of the series of methods sequentially as the first method, from the end to the root of a call graph showing the call relationships between each of the series of methods. [Explanation of Symbols]

[0071] 100 Information Processing Devices 101 Call Relationship Analysis Unit 102 Code Extraction Unit 103 Comment Addition Processing Unit 104 Prompt generation unit 105 Description Generation Unit 106 Storage section 107 Explanation Reflection Section 110 Control Unit

Claims

1. A comment-adding means for adding a comment to the source code of a first method, which is one of a series of methods defined in a series of source code to be analyzed, which adds a description of a second method called from the first method as a comment, A generation means provides a generation AI that analyzes the meaning of a method defined in input source code and generates a description of the method, and by inputting the source code of the first method to which the description of the second method has been added as a comment, the generation means causes the generation AI to generate a description of the first method. The comment adding means and the generation means control the order in which each of the series of methods is processed by the comment adding means and the generation means, so that each of the series of methods is sequentially treated as the first method, from the end side to the root side of the call graph showing the call relationships between each of the series of methods, and the generation AI generates a description of the first method. An information processing device having

2. The comment-adding means, if there are multiple methods as the second method called from the first method, adds a descriptive text for each of those multiple methods as a comment to the source code of the first method. The information processing apparatus according to claim 1.

3. The comment-adding means, when multiple methods are called by calling the second method, integrates the descriptions of each of the multiple methods into a single description and adds that single description as a comment to the source code of the first method. The information processing apparatus according to claim 1.

4. The comment-adding means identifies that the multiple methods are called by calling the second method, based on the call graph, or information indicating the call relationships between each of the series of methods that generate the call graph. The information processing apparatus according to claim 3.

5. The comment-adding means adds information to the descriptive text of the second method, which is added as a comment to the source code of the first method, indicating that the method called as the second method is a method defined in the second class or interface, when the second method is a method defined in the second class inherited by the first class in which the second method is defined, or in an interface implemented in the first class. The information processing apparatus according to claim 1.

6. The comment-adding means identifies that the method called as the second method is a method defined in the second class or the interface, based on the call graph or information indicating the call relationships between each of the series of methods that generate the call graph. The information processing apparatus according to claim 5.

7. The control means is If the series of methods includes a recursive call, then, based on a call graph that groups the multiple methods subject to the recursive call into a single node, the order in which the comment addition means and the generation means will be processed among the methods corresponding to each node in the series of nodes of the call graph is determined, The order in which each of the multiple methods subject to the recursive call is processed by the comment-adding means and the generation means is determined by expanding the aforementioned single node such that each of the multiple methods subject to the recursive call is called at least twice. The information processing apparatus according to claim 1.

8. The comment-adding means, if the source code of the first method contains existing comments, deletes those existing comments and then adds a description of the second method as a comment to the source code. The generation means inputs the source code of the first method, in which the existing comments have been deleted and the description of the second method has been added as a comment, into the generation AI, thereby causing the generation AI to generate the description of the first method. The information processing apparatus according to claim 1.

9. The generation means edits the description of the first method generated by the generation AI based on the existing comments. The information processing apparatus according to claim 8.

10. The comment-adding means, if the source code of the first method contains existing comments, adds a description of the second method as a comment to the source code, including the existing comments. The generation means inputs the source code of the first method, which includes the existing comments and to which the description of the second method has been added as a comment, into the generation AI, thereby causing the generation AI to generate the description of the first method. The information processing apparatus according to claim 1.

11. An information processing method performed by an information processing device, A comment addition step is to add a comment to the source code of the first method, which is one of a series of methods defined in the series of source code to be analyzed, which describes the second method called from the first method. A generation step involves inputting the source code of the first method to a generation AI that analyzes the meaning of a method defined in the input source code and generates a description of the method, thereby causing the generation AI to generate a description of the first method, wherein the description of the second method has been added as a comment. A control step controls the order in which each of the methods in the series is processed by the comment addition step and the generation step, such that each of the methods in the series is sequentially treated as the first method, and the generation AI generates a description of the first method, moving from the end to the root of the call graph showing the call relationships between each of the series of methods, Information processing methods, including those mentioned above.

12. On the computer, A comment addition step is to add a comment to the source code of the first method, which is one of a series of methods defined in the series of source code to be analyzed, which describes the second method called from the first method. A generation step involves inputting the source code of the first method to a generation AI that analyzes the meaning of a method defined in the input source code and generates a description of the method, thereby causing the generation AI to generate a description of the first method, wherein the description of the second method has been added as a comment. A control step controls the order in which each of the methods in the series is processed by the comment addition step and the generation step, such that each of the methods in the series is sequentially treated as the first method, and the generation AI generates a description of the first method, moving from the end to the root of the call graph showing the call relationships between each of the series of methods, A program that executes something.

Citation Information

Patent Citations

  • Program comprehension supporting method

    JP1998293685A

  • Method and device for generating comment sentence of computer program

    JP2001005650A

  • Software manual generation system in two or more natural languages

    JP2007034813A

  • Specification creating program, device therefor, and method thereof

    JP2009230618A