Source code analysis support system and method

The source code analysis system uses AI-generated specification data and multiple verifications to accurately decipher and correct discrepancies in legacy systems, providing readable and precise documentation.

JP7810732B2Active Publication Date: 2026-02-03HITACHI SOLUTIONS WEST JAPAN LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024004688
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2026-02-03
Estimated Expiration
2044-01-16

Smart Images

  • Figure 0007810732000001
    Figure 0007810732000001
  • Figure 0007810732000002
    Figure 0007810732000002
  • Figure 0007810732000003
    Figure 0007810732000003
Patent Text Reader

Abstract

To support deciphering of specifications for an information processing system from a source code with sufficient accuracy.SOLUTION: A source code analysis support system comprises: a generation unit for generating specification data from a source code, and generating an evaluation source code and an evaluation test code from the specification data; a verification unit for verifying the source code using a test code; and a reception unit for providing a user interface. The reception unit accepts input of a target source code, the generation unit generates the specification data, the evaluation source code, and the evaluation test code based on the target source code, the verification unit performs a first verification for verifying the evaluation source code using a target test code for verifying the target source code, and a second verification for verifying the target source code using the evaluation test code, and the reception unit outputs information on specifications based on the specification data for which verification results of the first verification and the second verification satisfy prescribed conditions.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to a technology for supporting analysis of source code of an information processing system. [Background technology]

[0002] In recent years, when developing information processing systems (hereafter simply referred to as "systems"), there are many cases where a new system is developed by migrating from an existing system (hereafter also referred to as a "legacy system") that was developed and operated in the past. In such cases, in order to develop a new system that takes into account the processes executed in the legacy system, the first step is to investigate the processes implemented in the legacy system.

[0003] During the investigation, the contents of the design documents of the legacy system are checked. However, because legacy systems undergo repeated process modifications and bug fixes during operation, there are often discrepancies between the design documents and the processes actually implemented.

[0004] Furthermore, in the case of old legacy systems such as host computers, design documents may be created by hand, which can be lost during storage or become illegible due to damage, making it difficult to obtain accurate design information from the design documents.

[0005] Therefore, in addition to checking the contents of the design document, it is often necessary to decipher the actual implemented processing from the source code of the system that is actually in operation and check whether there are any differences between the specifications assumed in the design document and the actually implemented processing.

[0006] The task of deciphering the implemented processes from the source code is a significant burden in system development. In this regard, Patent Document 1 discloses a method for extracting specifications from comments included in source code. [Prior art documents] [Patent documents]

[0007] [Patent Document 1] Japanese Patent Application Laid-Open No. 2002-169692 Summary of the Invention [Problem to be solved by the invention]

[0008] In order to confirm the difference between the specifications assumed in the design document and the processing actually implemented, it is necessary to decipher the processing implemented in the system from the source code with sufficient accuracy. According to the technique of Patent Document 1, specifications can be extracted from comments included in the source code, but accurate and detailed comments are not always written in the source code. As a result, it may not be possible to decipher the processing from the comments with sufficient accuracy.

[0009] One objective of the present disclosure is to provide a technique that supports deciphering the specifications of an information processing system from source code with sufficient accuracy. [Means for solving the problem]

[0010] A source code analysis system according to one aspect included in the present disclosure is a source code analysis support system that supports the analysis of source code of an information processing system, and includes: a generation unit that generates specification data representing the specifications of the source code from the source code, and generates, from the specification data, an evaluation source code that reflects the specifications of the specification data and an evaluation test code for verifying the evaluation source code; a verification unit that verifies the source code using the test code; and a reception unit that provides a user interface, wherein the reception unit receives input of a target source code to be analyzed, the generation unit generates the specification data, the evaluation source code, and the evaluation test code based on the target source code, the verification unit performs a first verification that verifies the evaluation source code using the target test code for verifying the target source code, and a second verification that verifies the target source code using the evaluation test code, and the reception unit outputs specification information based on specification data for which the verification results of the first and second verifications satisfy predetermined conditions. [Effects of the Invention]

[0011] According to one aspect of the present disclosure, it becomes possible to decipher with sufficient accuracy the processes implemented in an information processing system from the source code. [Brief explanation of the drawings]

[0012] [Figure 1] FIG. 1 is a block diagram of a source code analysis support system. [Figure 2] FIG. 1 is a conceptual diagram for explaining an outline of an analysis process performed by a source code analysis support system. [Figure 3] FIG. 1 is a conceptual diagram for explaining fine-tuning of natural language generation artificial intelligence. [Figure 4] FIG. 10 is a conceptual diagram for explaining high-precision fine tuning. [Figure 5] FIG. 10 is a sequence diagram of an analysis process performed by the source code analysis support system. [Figure 6]FIG. 10 is a sequence diagram of an analysis process performed by the source code analysis support system. [Figure 7] FIG. 10 is a sequence diagram of an analysis process performed by the source code analysis support system. [Figure 8] FIG. 10 is a conceptual diagram for explaining a method for identifying an error when execution of a test code is stopped. [Figure 9] FIG. 10 is a conceptual diagram for explaining a method for identifying an error when the test code is executed to the end but the output value is outside a predetermined range. [Figure 10] FIG. 10 is a conceptual diagram for explaining a method for identifying a redundant portion when execution of a test code is stopped. [Figure 11] FIG. 10 is a conceptual diagram for explaining an outline of the analysis process when the target source code OSC is not accompanied by the target test code OTC. DETAILED DESCRIPTION OF THE INVENTION

[0013] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

[0014] FIG. 1 is a block diagram of a source code analysis support system according to this embodiment.

[0015] The source code analysis support system 10 is a system that supports the task of analyzing the source code of an existing information processing system and deciphering its specifications. Hereinafter, the information processing system to be analyzed may be referred to as the target system, and the source code to be analyzed may be referred to as the target source code. The specifications referred to here are the specifications of the software implemented in the information processing system. The level of the specifications is not particularly limited, but the specifications may be, for example, the contents of a program design document that describes functions, variables, classes, constants, detailed flows, etc. at a level that allows them to be actually implemented as a software program.

[0016] Referring to Figure 1, the source code analysis support system 10 includes a receiving server 11, a generation server 12, a formatting server 15, a test execution server 16, and a test environment 17. The generation server 12 includes a specification generation unit 13 and a code generation unit 14. The receiving server 11, the generation server 12, the formatting server 15, the test execution server 16, and the test environment 17 are implemented as hardware computers equipped with a storage device and a processor, and are realized by the processor executing a software program stored in the storage device. The receiving server 11, the generation server 12, the formatting server 15, the test execution server 16, and the test environment 17 may each be configured as separate computers, or some or all of them may be implemented on a single computer.

[0017] The reception server 11 provides a user interface to the user 90, and also provides the user 90 with a function for assisting in the analysis of source code by utilizing other servers.

[0018] The generation server 12 generates specification data representing the specifications of the target source code of the target system from the target source code using the specification generation unit 13, and generates evaluation source code that reflects the specifications of the specification data and evaluation test code for verifying the evaluation source code from the specification data using the code generation unit 14. The evaluation test code is, for example, a coverage test that covers all tests of the evaluation source code that reflects the specification data, and may include test items that execute and evaluate all routes of the evaluation source code, as an example.

[0019] If the generated evaluation source code is equivalent to the original target source code, then the specification data contained therein can be said to describe specifications equivalent to those of the target source code. However, this does not necessarily mean that the evaluation source code will be equivalent to the target source code. First, differences may arise between the target source code and the specification data. For example, errors may occur when generating specification data from the target source code. Furthermore, specifications that do not exist in the target source code may be mixed into the specification data. Similarly, differences may arise between the evaluation source code and the specification data. The source code analysis support system 10 of this embodiment repeatedly regenerates specification data and evaluation source code so that the evaluation source code is equivalent to the target source code, thereby enabling the creation of specification data that accurately reflects the processing of the target source code.

[0020] The generation server 12 is configured to be able to use natural language generation AI, and generates specification data, evaluation source code, and evaluation test code by using the natural language generation AI. Hereinafter, the natural language generation AI may be referred to as generative AI. The generative AI uses a general-purpose model that has been fine-tuned to be suitable for analyzing the target source code.

[0021] Here, as an example, the specification data is intermediate data structured in a predetermined structure, and is not necessarily in a readable format for the user 90 to read and understand. The structure of the intermediate data is not particularly limited. By using the structured intermediate data to remove ambiguity, it becomes possible to ensure subsequent information processing, including the generation of source code and test code. The shaping server 15 shapes the intermediate data, the evaluation results of which satisfy predetermined conditions, into a readable specification document.

[0022] The test execution server 16 uses the test environment 17 to execute tests on the source code using test code. Specifically, the test execution server 16 executes a first verification in which the evaluation source code is verified using test code for verifying the target source code, and a second verification in which the target source code is verified using the evaluation test code. The test code for verifying the target source code is hereinafter referred to as the target test code, meaning test code corresponding to the target source code. In this embodiment, the target test code is, for example, created during the development and / or modification of the target source code and managed as an attachment to the target source code. The target test code may be, for example, a coverage test that covers the entire test of the target source code, and may include test items that execute and evaluate all routes of the target source code.

[0023] The test environment 17 is a hardware and software operating environment for executing the test code to verify whether the information processing system in which the source code is implemented operates correctly. The test environment 17 can provide an environment 18 for a first verification test and an environment 19 for a second verification test.

[0024] FIG. 2 is a conceptual diagram for explaining an outline of the analysis process performed by the source code analysis support system.

[0025] As shown in FIG. 2, the overall analysis process 20 includes a source code analysis process 21, an evaluation code generation process 22, a first verification process 23, and a second verification process 24.

[0026] First, a source code analysis process 21 generates specification data SD from the target source code OSC. Further, an evaluation code generation process 22 generates evaluation source code ESC and evaluation test code ETC from the specification data SD. Then, a first verification process 23 tests the evaluation source code ESC using target test code OTC, which is test code attached to the target source code OSC. If the test result is not normal, the source code analysis process 21, the evaluation code generation process 22, and the first verification process 23 are repeated. If a normal result is obtained in the first verification process 23, the first verification process 23 is terminated and the process proceeds to a second verification process 24. In the second verification process 24, a test of the target source code OSC is performed using the evaluation test code ETC. If the test result is not normal, the user is prompted to determine whether corrections are necessary. If a normal result is also obtained in the second verification process 24, the specification data SD at that time is formatted into a specification document and output. In this way, by mutually verifying the evaluation source code ESC and the target source code OSC through the first verification process 23 and the second verification process 24, even if redundant parts are mixed into the specification data SD due to hallucination, it is possible to detect and remove the redundant parts.

[0027] FIG. 3 is a conceptual diagram for explaining fine-tuning of natural language generation artificial intelligence.

[0028] By fine-tuning a general-purpose generative AI model that is available via APIs (Application Programming Interfaces) and other methods for analyzing source code, it is possible to create a model that exhibits higher accuracy in analyzing source code. Information such as business rules, logical names for databases, and coding examples are collected from each company's business systems, and fine-tuning data for each company is created based on this information. Generative AI technology can also be used to extract this fine-tuning data, making it suitable for each company.

[0029] FIG. 3 illustrates an example of fine tuning for each company. Fine tuning data 32, which serves as learning data for fine tuning, is created based on data 31 extracted from a business system including the target system of a company (Company A) that operates the target system. Then, the fine tuning data 32 is used to fine tune a general-purpose model 33, thereby creating a model 35 for Company A. In this example, a model dedicated to Company A is created, but the present invention is not limited to this. As another example, a highly accurate model may be created for a more limited purpose.

[0030] FIG. 4 is a conceptual diagram for explaining high-precision fine tuning.

[0031] Naming conventions for logical names, etc., may differ depending on the language and project. Therefore, fine-tuning data may be created based on the naming conventions for each language and project, tailored to the target system. Referring to Figure 4, a model for Company A 35 is created by fine-tuning using fine-tuning data extracted from Company A's business system. Similarly, a model for Company B 41 is created by fine-tuning using fine-tuning data extracted from Company B's business system. Furthermore, by limiting the scope to a more specific use, for example, by fine-tuning using fine-tuning data extracted from Project A of Company A, a model for Project A 42 that exhibits high accuracy in Project A of Company A can be created. Similarly, a model for Project B 43 that exhibits high accuracy in Project B of Company A can be created by fine-tuning using fine-tuning data extracted from Project B of Company A.

[0032] 5 to 7 are sequence diagrams of the analysis process performed by the source code analysis support system.

[0033] 5, when the receiving server 11 receives a request from the user 90 to analyze the target source code OSC (S101), it instructs the generating server 12 to generate specification data SD (S102). The generating server 12, having received the instruction, generates the specification data SD and returns it to the receiving server 11 (S103). Next, the receiving server 11 instructs the generating server 12 to generate evaluation source code ESC and evaluation test code ETC (S104). The generating server 12, having received the instruction, generates the evaluation source code ESC and evaluation test code ETC and returns them to the receiving server 11 (S105). The evaluation source code ESC is added with a comment indicating which part of the specification data SD has been reflected, and a code for outputting a log for verification using the evaluation test code ETC.

[0034] 6, the receiving server 11 then instructs the test execution server 16 to perform a first verification, in which the evaluation source code ESC is tested using the target test code OTC (S201). Upon receiving the instruction, the test execution server 16 tests the evaluation source code ESC using the target test code OTC and returns the result to the receiving server 11 as a verification result (S202). The test may or may not be completed successfully.

[0035] The test code has a specified value or range that should be the value that is output as a result of its execution.If an error occurs during the test code execution and the execution stops, or if the test code is executed to the end but the output value is outside the specified range, the test is not considered to have been performed normally and some kind of abnormality is considered to have occurred.

[0036] The verification results include information that enables the user to know whether the test was executed normally or not, whether the test was not executed normally, and if the test was not executed normally, whether execution stopped midway through the test code, whether the test code was executed to the end but the output value was outside the specified range, and if execution stopped, at which step the execution stopped, as well as the logs obtained at each point when the test code was executed.

[0037] The receiving server 11 analyzes the verification results and determines whether the test was completed normally, and if an abnormality is found, identifies the location of the error in the specification data SD and / or the evaluation source code ESC. If the first verification is completed normally, it is confirmed that the evaluation source code ESC correctly includes the processing included in the target source code OSC, and that the specification data SD correctly includes the specifications related to the processing included in the target source code OSC. Therefore, if the test is completed normally, the receiving server 11 ends the first verification and proceeds to step S301. On the other hand, if an abnormality is found in the test, the receiving server 11 performs the process described below to identify the location of the error.

[0038] FIG. 8 is a conceptual diagram for explaining a method for identifying an error when execution of a test code is stopped.

[0039] The receiving server 11 (1) acquires the position in the target test code OTC where an execution stop occurs when an error occurs and execution stops in the target test code OTC during a test that evaluates the evaluation source code ESC using the target test code OTC. Furthermore, the receiving server 11 (3) identifies the error location in the evaluation source code ESC corresponding to the position (hereinafter also referred to as the code error location) from the acquired position in the target test code OTC where the execution stop occurred. Furthermore, the receiving server 11 references the comment written in the code error location in the evaluation source code ESC to identify which part of the specification data SD the code reflects, and identifies that part in the specification data SD as the part where the specification error exists (hereinafter also referred to as the specification error location).

[0040] FIG. 9 is a conceptual diagram for explaining a method for identifying an error when the test code is executed to the end but the output value is outside a predetermined range.

[0041] The receiving server 11 (1) acquires logs of each location in a test that evaluates the evaluation source code ESC using the target test code OTC, where (2) the test code is executed to the end but the output value is outside a predetermined range. (3) Furthermore, the receiving server 11 identifies the location of a code error in the evaluation source code ESC based on the log value of each location. In this case, the receiving server 11 may autonomously identify the location of the code error based on a rule set using predetermined information, or may present the output value and the log of each location to the user 90 and accept the location of the code error as an analysis result from the user 90. In this case, the receiving server 11 may use a coverage tool to assist the user 90 in analyzing the log. Furthermore, the receiving server 11 refers to the comment written in the location of the code error in the evaluation source code ESC, identifies which part of the specification data SD the code at that location reflects, and identifies that part of the specification data SD as the location of the specification error.

[0042] Returning to FIG. 6, when an abnormality occurs in a test and the specification error that caused it is identified, the receiving server 11 instructs the generation server 12 to regenerate the specification data SD (S203). Upon receiving the instruction, the generation server 12 generates the specification data SD and returns it to the receiving server 11 (S204). At this time, the generation server 12 may input a prompt to the generation system AI that includes changes to correct the specification error in the specification data SD and enable the test to be executed normally. Next, the receiving server 11 instructs the generation server 12 to generate evaluation source code ESC and evaluation test code ETC (S205). Upon receiving the instruction, the generation server 12 generates the evaluation source code ESC and evaluation test code ETC based on the new specification data SD and returns them to the receiving server 11 (S206).

[0043] Next, the receiving server 11 instructs the test execution server 16 to test the new evaluation source code ESC using the target test code OTC (S207). Upon receiving the instruction, the test execution server 16 tests the evaluation source code ESC using the target test code OTC and returns the result to the receiving server 11 as the verification result (S208).

[0044] The receiving server 11 analyzes the verification results and determines whether the test was completed normally, and if an abnormality was found, identifies the location of the error in the specification data SD and / or the evaluation source code ESC. If the test was completed normally, the receiving server 11 proceeds to step S301. If an abnormality was found, the receiving server 11 performs the process of identifying the location of the error described above with reference to Figures 8 and 9, returns to step S203, and repeats the processes of steps S203 to S208.

[0045] If the test is not completed normally even after repeating the processes from steps S203 to S208 n times, the reception server 11 presents the verification result to the user 90 to prompt manual analysis and improvement (S209).

[0046] 7, the receiving server 11 then instructs the test execution server 16 to perform a second verification, in which the target source code OSC is tested using the evaluation test code ETC (S301). Upon receiving the instruction, the test execution server 16 tests the target source code OSC using the evaluation test code ETC and returns the results to the receiving server 11 as verification results (S302). The test may or may not be completed successfully.

[0047] In the first verification described above, it has been confirmed that the evaluation source code ESC correctly includes the processing included in the target source code OSC, and that the specification data SD correctly includes the specifications related to the processing included in the target source code OSC. Therefore, if an abnormality occurs in the test in the second verification, it is possible that the specification data SD and the evaluation source code ESC contain redundant parts that are not included in the target source code OSC, and as a result, the evaluation test code ETC contains test code for verifying those redundant parts.

[0048] The receiving server 11 analyzes the verification results to determine whether the test was completed normally, and if an abnormality was found, identifies redundant portions in the specification data SD and the evaluation source code ESC. If the test was completed normally, the receiving server 11 ends the second verification and proceeds to step S304. On the other hand, if an abnormality was found in the test, the receiving server 11 performs processing to identify redundant portions.

[0049] The method for identifying redundant parts is basically the same as the method for identifying error parts shown in Figures 8 and 9. Here, we will explain the case where the execution of the test code has stopped.

[0050] FIG. 10 is a conceptual diagram for explaining a method for identifying redundant portions when execution of test code is stopped.

[0051] The receiving server 11 (1) acquires the position in the evaluation test code ETC where an execution stop occurs when an error occurs and execution stops during a test to evaluate the target source code OSC using the evaluation test code ETC. Furthermore, the receiving server 11 (3) identifies a redundant portion of the evaluation source code ESC (hereinafter also referred to as a redundant code portion) corresponding to the acquired position where execution stopped in the evaluation test code ETC. Furthermore, the receiving server 11 references a comment written in the redundant code portion of the evaluation source code ESC to identify which portion of the specification data SD the code reflects, and identifies that portion of the specification data SD as a redundant portion of the specification (hereinafter also referred to as a redundant specification portion).

[0052] The redundant specification parts in this specification data SD may be deleted manually by the user 90 or by the generation server 12. The specification data SD is not necessarily in a highly readable format, but since the redundant specification parts are identified, the user 90 can easily delete the redundant specification parts as long as the data is readable to a certain extent.

[0053] Furthermore, if execution does not stop but the output value is outside the specified range in the second verification, the receiving server 11 identifies the excess code locations in the evaluation source code ESC based on the log values ​​of each location output in the second verification, and identifies the excess specification locations in the specification data SD based on the comments of the excess code locations.

[0054] Returning to FIG. 7, when an abnormality occurs in the test and the excess specification portion that caused the abnormality is identified, the receiving server 11 presents the test result to the user 90 (S303).

[0055] The reception server 11 instructs the shaping server 15 to format the specification data SD to create a highly readable specification document (S304). Upon receiving the instruction, the shaping server 15 formats the specification data SD into a specification document and returns it to the reception server 11 (S305). The reception server 11 outputs the formatted specification document to the user 90 (S306).

[0056] In the embodiment described above, the target test code OTC is assumed to be attached to and managed by the target source code OSC, but this does not necessarily mean that the test code is attached to and managed by existing source code such as legacy code that is the target of analysis.

[0057] Below, a modified example will be shown in which the target source code OSC does not include the target test code OTC.

[0058] 11 is a conceptual diagram for explaining an outline of the analysis process when the target test code OTC is not attached to the target source code OSC. As shown in FIG. 11, the overall analysis process 20 includes a source code analysis process 21', an evaluation code generation process 22, a first verification process 23', and a second verification process 24. The evaluation code generation process 22 and the second verification process 24 of this modified example are the same processes as those in the above-mentioned embodiment. The source code analysis process 21' and the first verification process 23' of this modified example are different from those in the above-mentioned embodiment. The source code analysis process 21' and the first verification process 23' of this modified example will be described below.

[0059] In this modification, in a source code analysis process 21′ performed in advance, the specification generation unit 13 of the generation server 12 generates, from the target source code OSC, specification data SD and, in addition, target test code OTC′ as test code for verifying the target source code OSC. The target test code OTC′ is, for example, a coverage test that covers the entire test of the target source code OSC, and may include test items that execute and evaluate all routes of the target source code OSC. The target test code OTC′ is generated using the same generation system AI as that used to generate the specification data SD. Then, in a first verification process 23′, the test execution server 16 tests the evaluation source code ESC using the target test code OTC′ generated from the target source code OSC. This enables highly accurate specification interpretation even when the target source code OSC does not include test code.

[0060] The present embodiment and its modifications described above are merely examples for explaining the present invention, and the present invention is not limited to these descriptions. Those skilled in the art can implement the present invention in various other forms without departing from the scope of the present invention. Furthermore, the present embodiment and its modifications include the following. However, the following are not intended to limit the scope of the present embodiment and its modifications.

[0061] [Matter 1] A source code analysis support system for supporting analysis of source code of an information processing system includes: a generation unit that generates, from source code, specification data representing the specifications of the source code; and generates, from the specification data, evaluation source code that reflects the specifications of the specification data and evaluation test code for verifying the evaluation source code; a verification unit that verifies the source code using the test code; and a reception unit that provides a user interface, wherein the reception unit receives input of target source code to be analyzed; the generation unit generates the specification data, the evaluation source code, and the evaluation test code based on the target source code; the verification unit performs a first verification that verifies the evaluation source code using the target test code for verifying the target source code and a second verification that verifies the target source code using the evaluation test code; and the reception unit outputs information on a specification document based on specification data whose verification results satisfy predetermined conditions. In this manner, the specification data generated from the source code is evaluated using the first and second verifications, making it possible to accurately decipher the specifications from the source code.

[0062] [Matter 2] In the source code analysis support system described in item 1, the generation unit adds a comment to the evaluation source code indicating which part of the specification data is reflected in the specification, and when an execution stop occurs in the first verification, the reception unit identifies the part in the evaluation source code where the execution stop occurred as a code error part, and identifies a specification error part in the specification data that is an error part based on the comment of the code error part, and the generation unit regenerates the specification data, the evaluation source code, and the evaluation test code so as to improve the specification error part. According to this, when an execution stop occurs in the first verification, the specification error part in the specification data can be identified and improved by regeneration.

[0063] [Matter 3] In the source code analysis support system described in item 2, the generation unit further adds to the evaluation source code a code that outputs a log for verification using the evaluation test code, and if the first verification does not cause an execution stop but an output value is outside a predetermined range, the reception unit identifies a code error location in the evaluation source code based on the log value of each location output in the first verification and identifies a specification error location in the specification data based on a comment for the code error location, and the generation unit regenerates the specification data, the evaluation source code, and the evaluation test code so as to improve the specification error location. Thus, if the output value is outside an expected range in the first verification, the specification error location in the specification data can be identified and improved by regeneration.

[0064] [Matter 4] In the source code analysis support system described in item 3, when the first verification is completed normally and an execution stop occurs in the second verification, the receiving unit identifies a portion in the evaluation source code corresponding to the portion in the evaluation test code where the execution stop occurred as a surplus code portion, and identifies a surplus specification portion in the specification data, which is a portion with a surplus, based on a comment in the surplus code portion. This makes it possible to identify a surplus specification portion in the specification data when an execution stop occurs in the second verification.

[0065] [Matter 5] In the source code analysis support system described in item 4, if the first verification is completed normally and no execution stop occurs in the second verification but the output value is outside a predetermined range, the receiving unit identifies redundant code portions in the evaluation source code based on log values ​​of each portion output in the second verification, and identifies redundant specification portions in the specification data based on comments for the redundant code portions. Thus, if the output value in the second verification is outside the expected range, the redundant specification portions in the specification data can be identified and improved by regeneration.

[0066] [Matter 6] In the source code analysis support system described in item 1, the generation unit uses a natural language generation AI to generate the specification data from the target source code, and uses the natural language generation AI to generate the evaluation source code and the evaluation test code from the specification data. The natural language generation AI can decipher highly readable specifications from the source code.

[0067] [Matter 7] In the source code analysis support system described in item 6, when the generation unit regenerates the specification data, the evaluation source code, and the evaluation test code, the generation unit applies to the natural language generation artificial intelligence a prompt that has been modified so that the verification result satisfies the condition. This improves the specification data, and regeneration enables highly accurate analysis.

[0068] [Matter 8] In the source code analysis support system described in item 6, the generation unit fine-tunes the natural language generation artificial intelligence in advance using fine-tuning data related to the target source code, thereby improving the accuracy of analysis by the natural language generation artificial intelligence.

[0069] [Matter 9] In the source code analysis support system described in item 1, the generation unit generates the target test code from the target source code in advance. This makes it possible to decipher the specifications with high accuracy even if the target source code does not have test code attached.

[0070] [Matter 10] In the source code analysis support system described in item 1, the specification data is intermediate data structured in a predetermined structure, and the system further includes a formatting unit that formats the intermediate data into a readable specification, and the receiving unit causes the formatting unit to format the intermediate data whose verification results satisfy the conditions into a specification and outputs it. This allows the verification process to be performed using intermediate data suitable for processing, and highly readable specification data to be provided to the user.

[0071] [Matter 11] A source code analysis support method for supporting the analysis of source code of an information processing system, comprising: a generation unit that generates, from source code, specification data representing the specifications of the source code; and, from the specification data, generates, from the specification data, evaluation source code that reflects the specifications of the specification data and evaluation test code for verifying the evaluation source code; a verification unit that verifies the source code using the test code; and a reception unit that provides a user interface; the computer receives input of target source code to be analyzed; generates the specification data, the evaluation source code, and the evaluation test code based on the target source code; performs a first verification that verifies the evaluation source code using the target test code for verifying the target source code; and a second verification that verifies the target source code using the evaluation test code; and outputs specification information based on specification data for which the verification results of the first and second verifications satisfy predetermined conditions. [Explanation of symbols]

[0072] 10...Source code analysis support system, 11...Reception server, 12...Generation server, 13...Specification generation unit, 14...Code generation unit, 15...Formatting server, 16...Test execution server, 17...Test environment, 18...Environment for first verification test, 19...Environment for second verification test, 20...Analysis process, 21...Source code analysis process, 22...Evaluation code generation process, 23...First verification process, 24...Second verification process, 31...Data, 32...Fine tuning data, 33...General-purpose model, 34...Fine tuning, 35...Model for company A, 41...Model for company B, 42...Model for project A, 43...Model for project B, 90...User

Claims

1. A source code analysis support system that supports analysis of source code of an information processing system, comprising: a generation unit that generates, from a source code, specification data that represents a specification of the source code, and generates, from the specification data, an evaluation source code that reflects the specification of the specification data and an evaluation test code for verifying the evaluation source code; a verification unit that verifies the source code using the test code; a reception unit that provides a user interface; and the receiving unit receives input of a target source code to be analyzed; the generation unit generates the specification data, the evaluation source code, and the evaluation test code based on the target source code; the verification unit performs a first verification to verify the evaluation source code using a target test code for verifying the target source code, and a second verification to verify the target source code using the evaluation test code; the receiving unit outputs information about a specification based on specification data for which the verification results of the first verification and the second verification satisfy predetermined conditions. Source code analysis support system.

2. the generation unit adds a comment to the evaluation source code indicating which part of the specification data is reflected in the specification; the receiving unit, when an execution stop occurs in the first verification, identifies a location in the evaluation source code where the execution stop occurred as a code error location, and identifies a specification error location, which is a location where an error exists in the specification data, based on a comment at the code error location; the generation unit regenerates specification data, evaluation source code, and evaluation test code so as to improve the specification error portion; 2. The source code analysis support system according to claim 1.

3. the generation unit further adds, to the evaluation source code, a code for outputting a log for verification by the evaluation test code; the receiving unit, if an execution stop did not occur but an output value was outside a predetermined range in the first verification, identifies a code error location in the evaluation source code based on a log value of each location output in the first verification, and identifies a specification error location in the specification data based on a comment on the code error location; the generation unit regenerates specification data, evaluation source code, and evaluation test code so as to improve the specification error portion; 3. The source code analysis support system according to claim 2.

4. When the first verification is completed normally and an execution stop occurs in the second verification, the receiving unit identifies a portion in the evaluation source code corresponding to a portion in the evaluation test code where the execution stop occurred as a surplus code portion, and identifies a surplus specification portion in the specification data, which is a portion where there is a surplus, based on a comment in the surplus code portion.

4. The source code analysis support system according to claim 3.

5. the receiving unit, if the first verification is completed normally and an execution stop does not occur in the second verification but an output value is outside a predetermined range, identifies redundant code portions of the evaluation source code based on log values ​​of each portion output in the second verification, and identifies redundant specification portions in the specification data based on comments of the redundant code portions; 5. The source code analysis support system according to claim 4.

6. The generation unit generating the specification data from the target source code using a natural language generation system artificial intelligence; generating the evaluation source code and the evaluation test code from the specification data using the natural language generation artificial intelligence; 2. The source code analysis support system according to claim 1.

7. When regenerating the specification data, the evaluation source code, and the evaluation test code, the generation unit applies to the natural language generation artificial intelligence a prompt that has been modified so that the verification result satisfies the condition.

7. The source code analysis support system according to claim 6.

8. the generation unit fine-tunes the natural language generation artificial intelligence in advance using fine-tuning data related to the target source code; 7. The source code analysis support system according to claim 6.

9. the generation unit generates the target test code from the target source code in advance; 2. The source code analysis support system according to claim 1.

10. the specification data is intermediate data structured in a predetermined structure, further comprising a formatting unit that formats the intermediate data into a readable specification; the reception unit causes the formatting unit to format the intermediate data, the verification result of which satisfies the condition, into a specification and output the specification.

2. The source code analysis support system according to claim 1.

11. A source code analysis support method for supporting analysis of source code of an information processing system, comprising: a generating unit that generates, from source code, specification data representing the specification of the source code, and generates, from the specification data, evaluation source code that reflects the specification of the specification data and evaluation test code for verifying the evaluation source code; a verifying unit that verifies the source code using the test code; and a receiving unit that provides a user interface; Accept input of target source code to be analyzed; generating the specification data, the evaluation source code, and the evaluation test code based on the target source code; performing a first verification in which the evaluation source code is verified using a target test code for verifying the target source code, and a second verification in which the target source code is verified using the evaluation test code; outputting information on a specification based on specification data for which the verification results of the first verification and the second verification satisfy a predetermined condition; A method for supporting source code analysis.

Citation Information

Patent Citations

  • Automatic evaluation system for program

    JP2001117794A

  • Specification creating program and computer readable medium stored with the program

    JP2002169692A

  • System and apparatus for analyzing static analysis result

    JP2005202494A

  • Program for debug support

    JP2007004255A