Apparatus, method and program for generating technical documentation for software
Patent Information
- Application Number
- JP2024107078
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-05-10
AI Technical Summary
【0018】 本発明の一態様によれば、ソースコードが管理されるリポジトリに関するリポジトリ情報からAPIコード、ビジネスロジックコード等の所要の種類のファイルのパスを判定し、それらのファイルの少なくともいずれかについて、当該ファイルに対応する技術文書を生成AIモデルを用いて自動生成することで、ソフトウェア開発とドキュメント作成との間の溝を埋めることができる。
Smart Images

Figure 0007641701000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an apparatus, a method, and a program for generating technical documentation for software. [Background technology]
[0002] There are various methods for developing software. In one method, use cases are first created, then technical documentation is created that describes more technical details, and the necessary coding is then done based on the technical documentation to create source code.
[0003] In recent years, there has been progress in the development of technology for automatically generating source code based on technical documents. For example, the applicant has disclosed a technology for obtaining table definitions and API definitions for multiple tables and APIs required by software, and generating source code in accordance with the table definitions and API definitions (see Patent Document 1). [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2023-031251 A Summary of the Invention [Problem to be solved by the invention]
[0005] Users of services using such automatic source code generation technology generally manage the generated source code in a code management system such as GitHub (registered trademark). If a change or addition of functionality becomes necessary while actually providing software using the source code, the source code is modified. When such modifications occur, the technical documentation held in the source code generation service no longer corresponds to the source code. Therefore, even if users wish to further use the service to expand functionality, the generated source code will be inconsistent with modifications made outside the service.
[0006] Furthermore, for users who wish to modify or add functions to existing software using source code generation services, they are unable to do so because the services do not retain technical documentation for the software in question.
[0007] The present invention has been made in consideration of the above points, and has an object to provide an apparatus, method, or program for generating technical documentation corresponding to source code managed in a code management system. [Means for solving the problem]
[0008] In order to achieve this object, a first aspect of the present invention is a method for generating technical documentation corresponding to source code managed in a code management system, comprising the steps of receiving repository information regarding a repository in which the source code is managed, determining paths of a plurality of API codes and one or more root files from the repository information, and making a first request to a first AI model, which is a generative AI model, to generate API documentation corresponding to at least one of the plurality of API codes, wherein the first request includes code in the one or more root files, and storing the generated one or more API documentation.
[0009] Also, a second aspect of the present invention is a method of the first aspect, wherein the determining step includes a step of making a second request to a second AI model, which is a generative AI model, to determine paths of the plurality of API codes and the one or more root files from the repository information.
[0010] Also, a third aspect of the present invention is the method of the second aspect, wherein the determining step further includes a step of extracting a plurality of API code candidates and one or more root file candidates from the repository information before making the second request.
[0011] A fourth aspect of the present invention is the method according to the first aspect, wherein the determination is made using a directory structure of the repository.
[0012] Furthermore, a fifth aspect of the present invention is a method of any one of the first to fourth aspects, further comprising a step of transmitting API document viewing information to a user terminal for viewing at least one of the one or more API documents.
[0013] In addition, a sixth aspect of the present invention is a method for generating technical documentation corresponding to source code managed in a code management system, comprising the steps of receiving repository information regarding a repository in which the source code is managed, determining paths of a plurality of business logic codes from the repository information, making a first request to a first AI model, which is a generative AI model, to generate business logic corresponding to at least one of the plurality of business logic codes, and storing a plurality of business logic codes corresponding to the plurality of business logic codes.
[0014] Further, a seventh aspect of the present invention is a program for causing a computer to execute a method for generating technical documentation corresponding to source code managed in a code management system, the method including the steps of receiving repository information regarding a repository in which the source code is managed, determining paths of a plurality of API codes and one or more root files from the repository information, and making a first request to a first AI model, which is a generative AI model, to generate API documentation corresponding to at least one of the plurality of API codes, the first request including code in the one or more root files, and storing the generated one or more API documentation.
[0015] Moreover, an eighth aspect of the present invention is an apparatus for generating technical documentation corresponding to source code managed in a code management system, the apparatus being configured to receive repository information regarding a repository in which the source code is managed, determine paths of a plurality of API codes and one or more root files from the repository information, make a first request to a first AI model, which is a generative AI model, to generate API documentation corresponding to at least one of the plurality of API codes, the first request including code in the one or more root files, and store the generated one or more API documents.
[0016] In addition, a ninth aspect of the present invention is a program for causing a computer to execute a method for generating technical documentation corresponding to source code managed in a code management system, the method including the steps of receiving repository information regarding a repository in which the source code is managed, determining paths of a plurality of business logic codes from the repository information, making a first request to a first AI model, which is a generative AI model, to generate business logic corresponding to at least one of the plurality of business logic codes, and storing a plurality of business logic codes corresponding to the generated one or more business logic codes.
[0017] In addition, a tenth aspect of the present invention is an apparatus for generating technical documentation corresponding to source code managed in a code management system, configured to receive repository information regarding a repository in which the source code is managed, determine paths of a plurality of business logic codes from the repository information, make a first request to a first AI model, which is a generative AI model, to generate business logic corresponding to at least one of the plurality of business logic codes, and store the generated business logic or business logics. Effect of the Invention
[0018] According to one aspect of the present invention, the paths of required types of files such as API code and business logic code are determined from repository information regarding the repository in which source code is managed, and technical documentation corresponding to at least one of those files is automatically generated using a generative AI model, thereby bridging the gap between software development and documentation creation. [Brief description of the drawings]
[0019] [Figure 1] FIG. 1 illustrates a system for generating technical documentation according to one embodiment of the present invention. [Diagram 2] FIG. 2 is a flow diagram of a method for generating technical documentation according to an embodiment of the present invention. [Diagram 3] FIG. 13 illustrates an example of a prompt that may be included as part of the code for a request k for determining a path of a technical document in accordance with an embodiment of the present invention. [Figure 4] FIG. 2 is a diagram showing an example of code for creating a prompt that is included as part of the code for a request l to a generative AI model (l) in accordance with one embodiment of the present invention. [Diagram 5] FIG. 5 is a diagram showing an example of a template “BUILD_API_FROM_CODE” used in FIG. 4. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0020] Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
[0021] FIG. 1 shows a system for generating technical documentation according to an embodiment of the present invention. In order to create technical documentation for software, the device 100 communicates with a user terminal 110 used by a user, a code management system 120, and a platform 130 that provides a generative AI model via an IP network such as the Internet. The generative AI model is illustratively provided by the platform 130 that can communicate with the device 100, but it is also possible to run an application for providing the generative AI model on the device 100 so that the device 100 provides the generative AI model. The device 100 can also provide a source code generation service for generating source code corresponding to the technical documentation to a user.
[0022] The device 100 includes a communication unit 101 such as a communication interface, a processing unit 102 such as a processor or CPU, and a storage unit 103 including a storage device or storage medium such as a memory or a hard disk, and can be configured by executing a program for performing each process or operation in the processing unit 102. The device 100 may include one or more devices, computers, or servers. The program may include one or more programs, and may be recorded in a computer-readable storage medium to form a non-transient program product. The program may be stored in a storage device or storage medium such as the storage unit 103 or a database 104 accessible from the device 100 via an IP network, and instructions included in the program may be executed in at least one processor of the processing unit 102. Data described below as being stored in the storage unit 103 may be stored in a storage device or storage medium such as the database 104, and vice versa.
[0023] First, the device 100 receives, from the user terminal 110, a selection of a repository on the code management system 120 that manages software for which technical documentation is to be created (S201). This selection can be made, for example, by displaying to a user who has logged in to a service provided by the device 100 a selection screen for one or more repositories associated with the user, and the user selecting one of them.
[0024] Next, the device 100 requests repository information related to the repository from the code management system 120 (S202) and receives the repository information (S203). The repository information may include all files in the selected repository, or may exclude some files. Here, an example has been described in which the device 100 acquires the repository information in response to a user's selection of a repository, but the device 100 may also detect a change, such as an update of a file in a repository associated with the user, and acquire the repository information related to the repository in response to the detection of the change.
[0025] The device 100 that has acquired the repository information then extracts a plurality of API code candidates and one or more route file candidates from the repository information as necessary (S204). As an example, the extraction can be performed by registering the paths of a plurality of files included in the acquired repository information in a vector database and identifying one or more files whose similarity to a specified term is equal to or greater than a predetermined threshold. When an API document is to be generated, the term may be “API”, “APIs”, “Controller”, “Controllers”, “Route”, “Routes”, etc. When a business logic is to be generated, the term may be “Service”, “Services”, “Business Logic”, “Business Logics”, “Domain Logic”, “Domain Logics”, “Handler”, “Handlers”. The larger the scale of software development, the greater the number of files that are not related to the technical document to be generated. Therefore, by extracting related file candidates and reducing the number of files to be processed thereafter, the generation speed of the technical document can be significantly increased. Here, “API document” refers to a document that describes the function and usage of an API.
[0026] Then, the device 100 requests (also called "request k") the AI model (also called "generative AI model (k)"), which is a generative AI model, to determine the paths of multiple API codes and one or multiple root files using the extracted file candidates if file candidates have been extracted, or using the acquired repository information if no file candidates have been extracted (S205).
[0027] FIG. 3 shows an example of an instruction called a prompt included as a part of the code for request k to a generative AI model (k) according to one embodiment of the present invention. In the prompt, the variable {files} is set to the path of all files or multiple files included in the repository information. The prompt also describes that the business logic code, API code, or root file is specified, and the path of each specified file is output in a predetermined format together with the category name. If the purpose is to generate an API document and the generation of business logic is not required, it is not necessarily necessary to specify the business logic code. Here, "business logic" refers to logic for processing data transmitted or received in communication with a user interface (UI) based on a business request, and "logic" means a series of instructions.
[0028] The example of FIG. 3 is an example of a prompt written in a natural language that is included as part of code written in the programming language TypeScript, and by executing the code, the OpenAI API can be called and the generative AI model (k) provided on the platform 130 can determine a path. The OpenAI API is an example, and other APIs may be used. The programming language TypeScript is an example, and other languages may be used. The code for making request k is stored in the storage unit 103, and the device 100 can acquire the code and make request k by executing the code including instructions obtained by setting required values to variables included in the code.
[0029] After receiving the determined path (S206), the device 100 requests (also referred to as "request l") the AI model (also referred to as "generative AI model (l)"), which is a generative AI model, to generate API documentation corresponding to the API code for each API code (S207). After the generative AI model (l) creates technical documentation (S208), the device 100 receives and stores the technical documentation (S209).
[0030] It is preferable that the request 1 includes all root files whose paths have been determined. It is also possible to determine one or more root files related to each API code and include only the determined root files in the request 1, but since the number of root files is not huge even without such determination, by including all codes included in all root files in the request 1, it is possible to increase the accuracy without significantly slowing down the generation speed of technical documentation.
[0031] FIG. 4 shows an example of code for creating a prompt included as part of the code for request l to a generative AI model (l) according to an embodiment of the present invention. In this example, the API code is set in the variable "code", the code in the route file is set in the variable "route", the format of the response to request l is set in the variable "response_introduction", and the module to which the API provided by the API code belongs is set in the variable "module" in the template "BUILD_API_FROM_CODE". The variables "module" and "response_introduction" are not necessarily required. In addition, the variable "response_introduction" may be set to the format of the response specified by the user. FIG. 5 shows an example of the template "BUILD_API_FROM_CODE" used in FIG. 4.
[0032] In FIG. 2, generative AI model (k) and generative AI model (l) are distinguished, but they may be the same generative AI model. In this specification, "AI model" refers to a machine learning model trained to predict an output for an input, and "generative AI model" refers to a large-scale language model (LLM) trained using text data to generate an output not included in the input. As a generative AI model, an LLM to which a transformer architecture is applied is particularly preferable, but it is expected that the name of the architecture will change with technological advances. Therefore, in this specification, "transformer architecture" includes an architecture that uses one or more features of the transformer architecture or an improvement thereof. In this specification, whether "generative AI models" are the same is determined by whether the type of generative AI model specified by the user is the same. For example, in the case of Open AI API, in the case of GPT-4, if the value of the variable "model" is the same, it is expressed as the same generative AI model. If the first generative AI model and the second generative AI model are not the same, they may be provided on the same platform 130. 2, request k is followed by request l, and if generative AI model (k) and generative AI model (l) are the same generative AI model or are generative AI models provided on the same platform, these requests may be made by a single call to the API. Needless to say, request k and request l may each include multiple requests, and may include one or more processes performed by device 100 other than the request for the generative AI model.
[0033] Then, the device 100 transmits technical document viewing information for viewing at least one of the generated technical documents to the user terminal 110 (S210). The technical document viewing information can be, for example, a file in HTML format, and the user terminal 110 can use this to display a technical document viewing screen on the display screen. Also, an application installed in the user terminal 110 may be operated, and the technical document viewing screen may be displayed within the application using the received technical document viewing information. Note that the "viewing screen" may adopt various formats such as a web page, a modal window, a pop-up window, etc., when displayed on a web browser, and may be one screen of the application when displayed within the application. In any case, a screen that includes an area for displaying the generated technical documents in a viewable manner corresponds to the viewing screen.
[0034] Thus, automatic generation of technical documentation from source code bridges the gap between software development and documentation creation, and can significantly reduce the manual work normally required to create accurate and up-to-date technical documentation. Since the technical documentation to be generated may be duplicated, it is not necessary to generate technical documentation for some files whose paths have been determined.
[0035] It should be noted that in the above-mentioned embodiments, unless there is a statement of "only", such as "based only on", "only in response to", "only in the case of", or "with reference only", it is assumed in this specification that additional information may be taken into consideration. Also, as an example, it should be noted that the statement "do b when a" does not necessarily mean "always do b when a" or "do b immediately after a" unless expressly stated. Also, the statement "each a constituting A" does not necessarily mean that A is composed of multiple components, but includes the case where the component is singular.
[0036] Also, just to be clear, even if there is an aspect of a method, program, terminal, device, server or system (hereinafter referred to as a "method, etc.") that performs an operation different from that described in this specification, each aspect of the present invention is directed to an operation that is the same as any of the operations described in this specification, and the existence of an operation different from that described in this specification does not make the method, etc. outside the scope of each aspect of the present invention.
[0037] It should be noted that the above-described embodiments of the present invention may be combined in any manner within the scope of the disclosure of this specification, provided that they are not mutually inconsistent.
[0038] In this specification, we have explained the flow of making request l after request k, but in cases where the generative AI model is not necessarily used to determine the path, the generative AI model (l) may be referred to as the first generative AI model and request l as the first request. [Explanation of symbols]
[0039] 100 devices 101 Communications Department 102 Processing section 103 Storage section 104 Database 110 User Terminal 120 Source Code Management System 130 Platform
Claims
1. 1. A method for generating technical documentation corresponding to source code managed in a code management system, comprising: receiving, by a computer, repository information regarding a repository in which the source code is managed; The computer determines, from the repository information, paths of a plurality of API codes and one or more root files; A step of the computer making a first request to a first AI model, which is a generative AI model, for at least one of the plurality of API codes to generate API documentation corresponding to the API code, the first request including a code in the one or more root files; storing the generated one or more API documents by the computer; Includes.
2. 2. The method of claim 1 , The determining step includes: The method includes making a second request to a second AI model, which is a generative AI model, to determine paths of the plurality of API codes and the one or more root files from the repository information.
3. 2. The method of claim 1 , The determination is made using the directory structure of the repository.
4. 4. A method according to any one of claims 1 to 3, comprising: The method further includes a step of transmitting API document viewing information to a user terminal for viewing at least one of the one or more API documents.
5. 1. A method for generating technical documentation corresponding to source code managed in a code management system, comprising: receiving, by a computer, repository information regarding a repository in which the source code is managed; determining, by the computer, from the repository information, paths of a plurality of business logic codes; A step of the computer making a first request to a first AI model, which is a generative AI model, for at least one of the plurality of business logic codes to generate business logic corresponding to the business logic code; storing the generated one or more business logics by the computer; Includes.
6. A program for causing a computer to execute a method for generating technical documentation corresponding to source code managed in a code management system, the method comprising: receiving repository information regarding a repository in which the source code is managed; determining a plurality of API codes and paths of one or more root files from the repository information; making a first request to a first AI model, which is a generative AI model, to generate API documentation corresponding to at least one of the API codes, the first request including a code in the one or more root files; storing the generated one or more API documents; Includes.
7. An apparatus for generating technical documentation corresponding to source code managed in a code management system, comprising: receiving repository information regarding a repository in which the source code is managed; determining a plurality of API codes and paths to one or more root files from the repository information; making a first request to a first AI model, which is a generative AI model, to generate API documentation corresponding to at least one of the API codes, the first request including code in the one or more root files; A storage device is configured to store the generated one or more API documents.
8. A program for causing a computer to execute a method for generating technical documentation corresponding to source code managed in a code management system, the method comprising: receiving repository information regarding a repository in which the source code is managed; determining a plurality of business logic code paths from the repository information; making a first request to a first AI model, which is a generative AI model, for at least one of the plurality of business logic codes to generate business logic corresponding to the business logic code; storing the generated one or more business logics; Includes.
9. An apparatus for generating technical documentation corresponding to source code managed in a code management system, comprising: receiving repository information regarding a repository in which the source code is managed; determining a path for a plurality of business logic codes from the repository information; making a first request to a first AI model, which is a generative AI model, for at least one of the plurality of business logic codes to generate business logic corresponding to the business logic code; The system is configured to store a plurality of generated business logics.
Citation Information
Patent Citations
Method for generating system interactive API document from source code based on Internet financial system
CN113094093A
Software multi-terminal collaborative development method
CN116991378A
Information processing device, information processing method, and information processing program
JP2022072664A
Apparatus and method for supporting source code generation of software and program therefor
JP2023031251A
Cited By
Apparatus for providing domain-enhanced coding assistant, and operating method thereof
WO2026192237A1