Specification generation device, specification generation method, and specification generation program

The specification generation device addresses the challenge of generating detailed software specifications by creating test code and data, executing it, and producing specifications based on execution results, enhancing program creation efficiency and quality.

JP2026003205APending Publication Date: 2026-01-13NEC CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024101039
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing technologies face challenges in generating detailed software specifications, especially when using open-source software where specifications are not publicly available, leading to increased workloads in program creation.

Method used

A specification generation device that generates test code and test data based on software source code, executes the test code using the test data, and produces software specifications based on the execution results, utilizing a language model to facilitate detailed specification generation.

Benefits of technology

Enables efficient and detailed software specification generation, improving the quality of program creation by providing clear constraints and error understanding for software operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026003205000001_ABST
    Figure 2026003205000001_ABST
Patent Text Reader

Abstract

To provide a specification generation device capable of easily generating detailed specifications of software.SOLUTION: The specification generation device 10 includes a generation unit 12, an execution unit 13, a specification generation unit 14, and an output unit 15. The generating unit 12 generates a test code and a test data based on a source code of software. The execution unit 13 executes the test code using the test data. The specification generation unit 14 generates the specification of the software based on the execution result of the test code. The output unit 15 outputs the generated specification.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to a specification generation device and the like. [Background technology]

[0002] Open source software is sometimes used in system development and program creation. While open source software is easy to use, the detailed specifications of the software are not always publicly available. When using software whose detailed specifications are unknown, the person creating the program must, for example, check the program's operation while creating it. Therefore, when using software whose detailed specifications are unknown, the amount of work required to create the program can increase.

[0003] The computer in Patent Document 1 generates specifications for multiple programming languages ​​based on a common specification. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] Special Publication No. 2024-501045 Summary of the Invention [Problem to be solved by the invention]

[0005] With the technology described in Patent Document 1, it may be difficult to generate detailed software specifications.

[0006] In order to solve the above-mentioned problems, the present disclosure aims to provide a specification generation device and the like that can easily generate detailed software specifications. [Means for solving the problem]

[0007] In order to solve the above problems, the specification generation device of the present disclosure includes a generation means for generating test code and test data based on the source code of the software, an execution means for executing the test code using the test data, a specification generation means for generating software specifications based on the execution results of the test code, and an output means for outputting the generated specifications.

[0008] The specification generation method disclosed herein generates test code and test data based on software source code, executes the test code using the test data, generates software specifications based on the results of executing the test code, and outputs the generated specifications.

[0009] The specification generation program disclosed herein causes a computer to perform the following processes: generating test code and test data based on software source code; executing the test code using the test data; generating software specifications based on the results of executing the test code; and outputting the generated specifications. [Effects of the Invention]

[0010] According to the present disclosure, detailed software specifications can be easily generated. [Brief explanation of the drawings]

[0011] [Figure 1] FIG. 1 illustrates an example of a configuration of a specification generation system according to an embodiment of the present disclosure. [Figure 2] FIG. 1 illustrates an example of a configuration of a specification generating device according to an embodiment of the present disclosure. [Figure 3] FIG. 10 is a diagram illustrating an example of source code according to an embodiment of the present disclosure. [Figure 4] FIG. 10 is a diagram illustrating an example of a test code according to an embodiment of the present disclosure. [Figure 5] FIG. 10 is a diagram illustrating an example of test data according to an embodiment of the present disclosure. [Figure 6]FIG. 10 is a diagram illustrating an example of an execution result of a test code according to an embodiment of the present disclosure. [Figure 7] FIG. 10 illustrates an example of a prompt according to an embodiment of the present disclosure. [Figure 8] FIG. 10 is a diagram illustrating an example of an output of a language model according to an embodiment of the present disclosure. [Figure 9] FIG. 10 is a diagram illustrating an example of specifications according to an embodiment of the present disclosure. [Figure 10] FIG. 1 illustrates an example of a configuration of a specification generation system according to an embodiment of the present disclosure. [Figure 11] FIG. 10 is a diagram illustrating an example of an operation flow of a specification generating device according to an embodiment of the present disclosure. [Figure 12] FIG. 1 is a diagram illustrating an example of a hardware configuration according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE INVENTION

[0012] Embodiments of the present disclosure will be described in detail with reference to the drawings. FIG. 1 is a diagram illustrating an example of the configuration of a specification generation system. The specification generation system includes, for example, a specification generation device 10 and a terminal device 20. The specification generation device 10 is connected to the terminal device 20 via, for example, a network. There may be multiple terminal devices 20. The number of terminal devices 20 can be set as appropriate.

[0013] The specification generation system generates specifications for software, for example. For example, software specifications are information that indicates the operation of the software and the format of input and output data. Furthermore, software specifications may also be information that indicates the circumstances under which an error occurs when the software is executed and the content of the error.

[0014] The information indicating the operation of the software is, for example, information indicating what kind of processing the software will perform. For example, when the software sorts data, the information indicating the operation of the software is information indicating that the software will sort the data. Furthermore, when the software sorts data, the information indicating the operation of the software may be information indicating what kind of sorting will be performed. For example, when the data to be sorted includes data in a format that is not targeted for processing, the information indicating the operation of the software is information indicating whether to generate an error or to sort the data while excluding the data in the format that is not targeted for processing.

[0015] Furthermore, the information indicating the operation of the software may be information indicating a process that the software cannot perform. A process that the software cannot perform is also referred to as, for example, a software constraint. For example, the information indicating a process that the software cannot perform is information indicating a situation in which an error occurs. A situation in which an error occurs is, for example, a situation in which the software cannot perform a process normally. In other words, a situation in which an error occurs is, for example, information regarding a software constraint. Furthermore, the information indicating the operation of the software may be information indicating the content of an error message.

[0016] The information indicating the behavior of the software may be information indicating the behavior in a corner case. A corner case is, for example, a situation that occurs infrequently in the behavior of the software. For example, the behavior in a corner case is the behavior of the software in processing infrequently used data, processing that occurs infrequently, or a combination thereof. Furthermore, the information indicating the behavior of the software is not limited to the above.

[0017] The format of input / output data is, for example, the data structure and data type. For example, when data in a matrix array structure is used, the data structure is the number of rows and columns. The data structure is not limited to the above. Furthermore, the data type is, for example, information indicating data that can be processed by software. The data type is, for example, information indicating whether a numeric value or a character string is to be processed. The data type is not limited to the above. Furthermore, the format of input / output data is not limited to the above.

[0018] For example, in software whose source code is provided as open source, information indicating the specifications may not exist. Furthermore, for example, when an operating system or hardware is updated, it may be unclear how the software will operate after the update. In such cases, for example, a person creating a program that operates based on the software may need to confirm the operation by, for example, repeatedly creating and running test code. Therefore, when using software whose detailed specifications are not publicly available, the efficiency of program creation may decrease. A specification generation system, for example, generates specifications for such software for which no information indicating the specifications exists. The absence of information indicating the specifications may include, for example, information indicating part of the specifications exists, but detailed information on the specifications does not exist. For example, when specifications for normal processing are known but processing in corner cases is unknown, the specification generation system generates a specification for the processing in the corner case. The absence of information indicating the specifications may also include information indicating part or all of the specifications exists, but the person creating the program does not have access to that information.

[0019] Here, an example of the configuration of the specification generating device 10 will be described. Fig. 2 is a diagram showing an example of the configuration of the specification generating device 10. The specification generating device 10 basically includes a generating unit 12, an executing unit 13, a specification generating unit 14, and an output unit 15. The specification generating device 10 may further include, for example, an acquiring unit 11 and a storage unit 16.

[0020] The acquisition unit 11 acquires, for example, information related to the generation of specifications. The acquisition unit 11 acquires, for example, the source code of the software for which specifications are to be generated as information related to the generation of specifications. The source code of the software for which specifications are to be generated may be stored in the storage unit 16. The acquisition unit 11 acquires, for example, identification information of the software for which specifications are to be generated as information related to the generation of specifications. The identification information of the software for which specifications are to be generated is, for example, the name of the software. For example, when the source code of the software for which specifications are to be generated is stored in a storage means external to the specification generation device 10 and can be referenced from the specification generation device 10, the acquisition unit 11 acquires the identification information of the software for which specifications are to be generated.

[0021] The acquisition unit 11 acquires, for example, information related to the generation of specifications. The acquisition unit 11 acquires, for example, information indicating the content of the specifications to be generated as the information related to the generation of specifications. For example, when generating specifications for the operation of software, the acquisition unit 11 acquires information indicating that specifications related to the operation of the software will be generated. When generating specifications for the operation of software, the acquisition unit 11 may acquire the operation of the software for which specifications are to be generated. Furthermore, for example, when generating specifications for the format of input / output data of software, the acquisition unit 11 acquires information indicating that specifications for the input / output data will be generated. Furthermore, for example, when generating specifications for a situation in which an error occurs, the acquisition unit 11 acquires information indicating that specifications related to an error that occurs in the software will be generated. When generating specifications for a situation in which an error occurs, the acquisition unit 11 may acquire information indicating the content of the error for which specifications are to be generated.

[0022] The acquiring unit 11 may acquire, as information related to the generation of specifications, information related to the contents of test code and test data generated by the generating unit 12. For example, when the generating unit 12 generates test code and test data for corner cases, the acquiring unit 11 acquires information indicating the corner cases for which test code and test data are to be generated. The information indicating the contents of the specifications to be generated is not limited to the above.

[0023] The acquiring unit 11 may acquire criteria for generating test data as information related to the generation of specifications. The criteria for generating test data is, for example, information indicating criteria for how to modify already-generated data to generate test data. For example, the criteria for generating test data is information indicating one or more items among the position and number of test data to be modified in the test data and the method for modifying the modified test data. The method for modifying the test data is, for example, information indicating how to replace data or modify a numerical value or a character string. The method for modifying data is not limited to the above. Furthermore, the criteria for generating test data is not limited to the above.

[0024] Furthermore, when the generation unit 12 generates test code and test data based on a scenario, the acquisition unit 11 may acquire the scenario as information related to the generation of the specification. The scenario is, for example, data in which the content of the specification to be generated and the generation criteria for the test code and test data are associated. The scenario may include information indicating the format of the specification to be generated. The scenario may also include a prompt to be input to the language model. Furthermore, when the test code and test data are generated based on a scenario selected from multiple scenarios, the acquisition unit 11 may acquire the result of the scenario selection as information related to the specification to be generated.

[0025] Furthermore, when the generation unit 12 generates test code and test data using a language model, the acquisition unit 11 acquires, for example, a prompt used to input the language model as information about the specifications to be generated. The acquisition unit 11 acquires, for example, a prompt indicating the content of the test code. The acquisition unit 11 may also acquire a prompt indicating the content of the test data. The acquisition unit 11 may also acquire a prompt indicating the content of the test code and the test data. The acquisition unit 11 may also acquire, for example, a prompt indicating the content of an error to be generated. The acquisition unit 11 also acquires, from the terminal device 20, information about the specifications to be generated. The information about the specifications to be generated is input, for example, to the terminal device 20 by a person in charge of generating the specifications.

[0026] The generation unit 12 generates test code and test data based on the source code of the software. The generation unit 12 generates, for example, normal test code and test data and abnormal test code and test data. The generation unit 12 may generate either normal or abnormal test code and test data. The normal test code and test data are, for example, test code and test data that cause the software to operate normally. The normal test code and test data are used, for example, to check the basic operation of the software. The abnormal test code and test data are, for example, test code and test data that may cause an error during execution. The abnormal test code and test data are used, for example, to check the constraints of the software.

[0027] The generation unit 12 generates test code and test data based on, for example, information that needs to be confirmed when generating specifications. For example, the generation unit 12 generates test code and test data for confirming what processing the software performs. The test data may be written within the test code. Alternatively, the test data may be data that is read from a file different from the test code during execution of the test code.

[0028] The information that needs to be confirmed when generating the specifications is, for example, information that needs to be confirmed as to what kind of processing the software will perform. For example, in software that performs sorting, when generating specifications for processing when numbers and character strings are mixed, the generation unit 12 generates test data that includes a mixture of numbers and character strings and test code that sorts the test data. The information that needs to be confirmed when generating the specifications is, for example, set according to the specifications to be generated. For example, the information that needs to be confirmed when generating the specifications is set by the person in charge of generating the specifications.

[0029] Figure 3 is an example of software source code. The example source code in Figure 3 is software that sorts array data. Figure 4 is an example of test code for the software shown in Figure 3. The example test code in Figure 3 includes test data within the code. The example test code in Figure 4 is code that outputs sorted data. The example test code in Figure 4 includes the array data "64, 34, X, 12, apple, 11, 90" as test data. The example test code in Figure 4 is test code for checking output data when processing test data that contains a mixture of numbers and strings in sorting software, for example.

[0030] The generation unit 12 may generate test code and test data that cause an error when executed. The type of error to be generated is set, for example, by a person who generates the specifications. The generation unit 12 may also generate test code and test data that check whether an error occurs when executed. The test data that causes an error may include test data for corner cases.

[0031] The generation unit 12 generates the test code and the test data, for example, by using a prompt instructing the generation of the test code and the test data and source code as inputs to a language model. The source code may be included in the prompt. The generation unit 12 may generate the test code and the test data using the language model based on the prompt indicating the content of at least one of the test code and the test data.

[0032] The generation unit 12 may generate test code and test data by using, for example, a prompt based on information that needs to be confirmed when generating specifications as input to a language model. For example, the generation unit 12 may generate test code and test data by using, as input to a language model, a prompt that includes, as content of the test code, information indicating an operation to be verified using the test code. Alternatively, the generation unit 12 may generate test code and test data by using, as input to a language model, a prompt that includes, as content of the test data, information indicating an operation to be verified using the test data.

[0033] For example, suppose that in software A that processes array data, a specification is generated by checking the operation regarding access to data outside the boundary. In this case, the generation unit 12 generates test code and test data using a prompt, "In software A, please generate test code and test data for accessing outside the boundary," as input to the language model. Also, suppose that in software A, a specification is generated by verifying the operation in a corner case. In this case, the generation unit 12 generates test code and test data using a prompt, "In software A, please generate test code and test data for checking the specification regarding the corner case," as input to the language model.

[0034] The generation unit 12 may generate test code and test data using a language model based on, for example, a prompt indicating the type of error to be generated. For example, the generation unit 12 generates test code and test data using a prompt such as "Please create test code and test data that will cause an array bounds reference error" as input to the language model. An array bounds reference error is an error that occurs when, for example, data outside the bounds is referenced during execution of code that processes array data.

[0035] The language model is, for example, a natural language model that generates text based on a prompt. For example, a machine learning model also known as a large-scale language model is used as the language model. For example, the language model may be, for example, GPT-2 (Generative Pre-trained Transformer-2), GPT-3, GPT-3.5, or GPT-4. Furthermore, the language model may be, for example, Claude3, T5 (Text-to-Text Transfer Transformer), BERT (Bidirectional Encoder Representations from Transformers), RoBERTa (Robustly optimized BERT approach), or ELECTRA (Efficiently Learning an Encoder that Classifies Token Replacements Accurately). The language model is not limited to the above.

[0036] Furthermore, the process of generating test code and test data using a language model may be performed in a device external to the specification generation device 10. When the process of generating test code and test data is performed in a device external to the specification generation device 10, the generation unit 12 outputs, for example, a prompt indicating the content of the test code and test data to be generated and the source code of the software for which specifications are to be generated to an information processing device on which a language model that performs the process of generating test code and test data based on the prompt operates. Then, the generation unit 12 acquires the generated test code and test data from, for example, the information processing device that generated the test code and test data.

[0037] The generation unit 12 may generate test code and test data based on a scenario. A scenario is, for example, information associating items included in the specifications to be generated with information that needs to be checked to generate each item. A scenario is set, for example, for each type of software. The type of software is classified based on, for example, at least one of the processing performed by the software, the programming language used to create the software, and the operating environment of the software. The operating environment of the software is, for example, at least one of the operating system and hardware configuration on which the software runs. The operating environment of the software is not limited to the above. The classification of the types of software is not limited to the above. A scenario is created, for example, by a person in charge of generating the specifications. A scenario may be created using a language model. For example, a scenario is created by using a prompt such as, "Please generate the check items required to generate specifications for software A that sorts data," as input to the language model.

[0038] The generation unit 12 generates test code and test data by, for example, using a prompt including information that needs to be confirmed for generation, which is included in the selected scenario, as input to the language model. The scenario may also include a sentence used as the prompt. For example, if the scenario includes checking the output when a boundary reference error occurs, the scenario may include a sentence as a prompt, such as, "Please generate test code and test data that will cause a boundary reference error." If the scenario includes a sentence to be used as the prompt, the generation unit 12 generates test code and test data by, for example, using a prompt including a sentence included in the scenario as input to the language model. The scenario used to generate the test code and test data is selected, for example, by a person in charge of generating the specifications.

[0039] The generation unit 12 may generate test data by changing at least a portion of the generated data. For example, the generation unit 12 generates test data by changing a portion of normal data. For example, the generation unit 12 generates test data by changing at least one of the data array and the data type. For example, when data has a matrix structure, the generation unit 12 generates test data by changing at least one of the rows and columns. The generation unit 12 may also generate test data by changing the number of data. For example, the generation unit 12 generates test data by changing the number of array data. The generation unit 12 may also generate test data in which data does not exist in some or all of the locations in the array data where data is to be stored. The generation unit 12 may also generate test data by interchanging character data and numeric data. The generation unit 12 may also generate test data by randomly changing the positions of the character data and numeric data. How a portion of the data is changed is not limited to the above. The data before the change may be generated, for example, by a person generating the specifications. The generation unit 12 may further generate test data by changing a portion of the test data generated using a language model.

[0040] Figure 5 shows an example of test data generated by changing part of the data. The example of test data in Figure 5 shows an example of test data in which part of the numerical data, which is array data, has been changed to "Null." In the example of test data in Figure 5, "No Nulls" indicates that the test data is "12, 8, 2, 3, 6, 12." In addition, in the example of test data in Figure 5, "One Null" indicates that "8" in "12, 8, 2, 3, 6, 12" has been converted to "Null." In addition, in the example of test data in Figure 5, "Two Nulls" indicates that "8" and "6" in "12, 8, 2, 3, 6, 12" have been converted to "Null." In addition, in the example of test data in Figure 5, "All Nulls" indicates that all of the data "12, 8, 2, 3, 6, 12" has been converted to "Null." In the example of test data in Fig. 5, for example, the generation unit 12 generates test data by changing some or all of the numerical data to "Null." In the example of test data in Fig. 5, some of the data is replaced with "Null," but the generation unit 12 may generate test data by, for example, inserting a character string into "Null."

[0041] The generation unit 12 may generate multiple pieces of test data for the same test code. For example, when generating test data for test code for software that performs sorting, the generation unit 12 generates multiple pieces of test data that are different from each other in at least one of the position where data is changed in the array data, the number of pieces of data to be changed, and the content of the data after the change. When test data is included in the test code and multiple pieces of test data are generated, the generation unit 12 generates test code in which, for example, each piece of test data is different.

[0042] The execution unit 13 executes the test code using the test data. The execution unit 13 performs, for example, processing related to the execution of the test code. The test data may be included in the test code. The processing related to the execution of the test code is, for example, executing the test code and outputting the results. If the test data is a separate file, the execution unit 13 reads the test data as processing related to the execution of the test code. The processing related to the execution of the test code may include compilation. The processing related to the execution of the test code is not limited to the above.

[0043] The execution unit 13, for example, executes test code and obtains output data when test data is used as input data. Furthermore, if an error occurs when the test code is executed, the execution unit 13 extracts the details of the error. The execution unit 13 may extract an error message as the details of the error.

[0044] Figure 6 shows an example of the execution result when the test code shown in the example of Figure 4 is executed on the software shown in the example of Figure 3. The example of the execution result in Figure 6 shows that the result of sorting the array data "64, 34, X, 12, apple, 11, 90" is "11, 12, 34, 64, 90". In the example of the execution result in Figure 6, the strings "X" and "apple" are excluded from the array data contained in the test data, and the numerical data is sorted in ascending order. The example of the execution result in Figure 6 shows that when the software shown in the example of Figure 3 contains character data in the array data, it excludes character strings from the sorting and sorts only the numerical data.

[0045] The specification generation unit 14 generates software specifications based on the execution results of the test code. For example, the specification generation unit 14 generates a sentence indicating the software specifications as the specification using a language model based on the execution results of the test code. For example, the specification generation unit 14 generates a prompt including input / output data during execution of the test code and a sentence instructing the generation of the specification. Then, for example, the specification generation unit 14 generates the specification using the generated prompt as input to the language model. The specification generation unit 14 may also generate the specification using a prompt that further includes source code as input to the language model.

[0046] Figure 7 shows an example of a prompt to be input to a language model to generate a specification. The example prompt in Figure 7 is a prompt for generating a specification based on the execution result when the test code shown in the example of Figure 4 is executed in the software shown in the example of Figure 3 and the execution result shown in the example of Figure 6 is output.

[0047] Figure 8 shows an example of the output of the language model when the prompt shown in the example of Figure 7 is input to the language model. In the example output of Figure 8, for example, a sentence is generated showing an error that occurred in the execution of the test code, the cause of the error, and the constraints of the sorting program.

[0048] The language model is, for example, a natural language model that generates text based on a prompt. For example, a machine learning model also known as a large-scale language model is used as the language model. For example, GPT-2, GPT-3, GPT-3.5, or GPT-4 is used as the language model. Claude3, T5, BERT, RoBERTa, or ELECTRA may also be used as the language model. The language model is not limited to the above. Furthermore, the language model used by the generation unit 12 to generate test code and test data and the language model used by the specification generation unit 14 to generate specifications may be the same language model or different language models.

[0049] The specification generation unit 14 may generate a specification based on the content of an error that occurs during execution of the test code. The specification generation unit 14 generates, for example, a prompt including the content of the error or an error message and a sentence instructing the generation of a specification. Then, the specification generation unit 14 generates a specification based on the content of the error or the error message, for example, using the generated prompt as input to a language model. For example, assume that test code that sorts numerical data is executed using test data that contains a mixture of numerical data and character data. In this case, for example, when data in which only the numerical data has been sorted and the character data has been excluded is output, the specification generation unit 14 generates, as a software specification, information indicating that the character data will be excluded before processing. Furthermore, when the test code is executed using test data that contains a mixture of numerical data and character data, for example, and an error message is output, the specification generation unit 14 generates, as a software specification, information indicating that the error message will be output.

[0050] The specification generation unit 14 generates software specifications based on, for example, the results of multiple executions of the software. The specification generation unit 14 generates program specifications by summarizing specifications based on the execution results of each of the multiple executions of the software. For example, the specification generation unit 14 uses a language model to generate program specifications by summarizing specifications based on the execution results of each of the multiple executions.

[0051] The specification generation unit 14 may generate software specifications based on the execution results of test codes executed for each item that needs to be checked when generating the specifications. For example, in order to check the conditions under which different types of errors occur, the specification generation unit 14 may generate software specifications based on the execution results of test codes executed for each item that needs to be checked when generating the specifications. When the test code to be checked is executed, the specification generation unit 14 generates a specification that associates the type of error with the condition under which each error occurs. The specification generation unit 14 may also generate the software specification by using a language model to summarize sentences generated based on the execution results of the test code executed for each item that needs to be checked in generating the specification.

[0052] FIG. 9 shows an example of software specifications. The example specification in FIG. 9 is a sentence that extracts the specification-related portions from the errors that occurred in the execution of the test code shown in the example of FIG. 8, the causes of the errors, and the constraints of the sort program. The specification generation unit 14 generates, for example, sentences such as those shown in FIG. 9 as software specifications. The specification generation unit 14 may generate, for example, sentences such as those shown in FIG. 8 as software specifications.

[0053] The process of generating specifications may be performed in a device external to the specification generation device 10. When the process of generating specifications is performed in a device external to the specification generation device 10, the specification generation unit 14 outputs, for example, a prompt instructing the generation of specifications, test code and test data contents, and execution results to an information processing device on which a language model that performs the process of generating specifications operates. Then, the specification generation unit 14 acquires the generated specifications from, for example, the information processing device.

[0054] FIG. 10 shows an example of the configuration of a specification generation system in which a generation device 30, which is an external device to the specification generation device 10, performs processing to generate specifications. In the example of FIG. 10, the specification generation device 10 is connected to the generation device 30, for example, via a network. The generation device 30 is an information processing device that generates specifications from input execution results using, for example, a language model. The specification generation unit 14 outputs, for example, to the generation device 30, a prompt including a statement instructing the generation of a specification, test code, test data, and the execution result of the test code. The generation device 30 generates a specification using, for example, the prompt including the statement instructing the generation of a specification, the test code, test data, and the execution result of the test code as inputs to the language model. Then, the specification generation unit 14 acquires the specification generated by the generation device 30 from, for example, the generation device 30.

[0055] The output unit 15 outputs the specifications generated by the specification generation unit 14. The output unit 15 may output the generated specifications in association with the test code and test data used to generate the specifications. The output unit 15 may also output the generated specifications in association with the scenario used to generate the test data.

[0056] The output unit 15 may output multiple specifications as candidate software specifications. Each of the multiple specifications may be generated based on, for example, an execution result when test code is executed using different test data. The output unit 15 may output the multiple specifications in a state in which parts of the specifications that differ in content are visible. A part of the specifications that differs in content means, for example, that the sentences indicating the specifications are not identical. Identical may include similarity. The output unit 15 outputs the multiple specifications in such a way that parts of the specifications that differ in content are displayed in a different color from parts of the specifications that have the same content.

[0057] The output unit 15 may output a hierarchical specification. A hierarchical specification is a specification that is structured so that the lower the level, the more detailed information that is classified. For example, in a hierarchical specification, the higher the level, the software is classified by function. Furthermore, for example, in a level below the level classified by function, classification is performed according to the operation of the software, such as the format of input data and the format of output data. Then, in an even lower level, classification is performed according to the constraints on each operation of the software. Classification according to constraints is, for example, classification according to the conditions under which an error occurs. The method of dividing the levels when outputting a hierarchical specification is not limited to the above.

[0058] The output unit 15 outputs the specifications generated by the specification generation unit 14 to, for example, a terminal device 20. The output unit 15 may also output the specifications generated by the specification generation unit 14 to an information management device (not shown) that manages software specifications.

[0059] The storage unit 16 stores, for example, data related to the process of generating software specifications. The storage unit 16 stores, for example, test code and test data. The storage unit 16 also stores, for example, execution results of test code. The storage unit 16 also stores, for example, generated specifications. The storage unit 16 also stores, for example, a language model used to generate specifications. The language model used to generate specifications may be stored in a storage means external to the specification generation device 10.

[0060] The terminal device 20 is, for example, a terminal device used by a user of the specification generation device 10. The user of the specification generation device 10 is, for example, a person in charge of generating specifications. The person in charge of generating specifications is, for example, a person in charge of creating software code. The person in charge of generating specifications may also be a person in charge of building a system using software.

[0061] The terminal device 20 acquires information related to the generation of specifications, for example, input by a user's operation. Then, the terminal device 20 outputs the information related to the generation of specifications to, for example, the acquisition unit 11 of the specification generation device 10. The information related to the generation of specifications is, for example, the source code of the software for which specifications are to be generated. The information related to the generation of specifications is information related to the content of the specifications to be generated. Furthermore, the terminal device 20 acquires the software specifications from, for example, the output unit 15 of the specification generation device 10. Then, the terminal device 20 outputs the software specifications to, for example, a display device (not shown). The terminal device 20 may be, for example, a notebook personal computer or a desktop personal computer. Furthermore, the terminal device 20 is not limited to the above.

[0062] The following describes the operation of generating software specifications in the specification generating device 10. Fig. 11 shows an example of the operational flow of processing in the specification generating device 10 to generate software specifications.

[0063] The acquisition unit 11 acquires, for example, the source code of the software (step S11). The acquisition unit 11 acquires, for example, the source code of the software from the terminal device 20.

[0064] When the source code of the software is acquired, the generation unit 12 generates test code and test data based on the source code of the software (step S12).

[0065] When the test code and test data are generated, the execution unit 13 executes the test code using the test data (step S13).

[0066] When the execution of the test code is completed (Yes in step S14), the specification generating unit 14 generates the software specifications based on the execution results of the test code (step S15).

[0067] Once the software specifications are generated, the output unit 15 outputs the generated specifications (step S16).

[0068] In step S14, if there is test code whose execution has not been completed (No in step S14), the process returns to step S13, and the execution unit 13 executes, for example, the test code whose execution has not been completed.

[0069] The specification generation device 10 generates test code and test data based on the source code of the software. The specification generation device 10 also executes the test code using the generated test data. The specification generation device 10 then generates software specifications based on the execution results of the test code. By generating specifications based on the execution results of the test code in this way, the specification generation device 10 can easily generate software specifications.

[0070] For example, for software for which no specifications exist, the specification generation device 10 can generate specifications for the software for which no specifications exist by executing test code using test data generated based on the source code. Therefore, for example, a person in charge of creating program code for software for which no specifications exist can create the code efficiently by referring to the generated specifications. For example, the specification generation device 10 generates specifications based on the results of executing test code using test data that generates errors, so that a person in charge of creating code for the software for which no specifications exist can create the code while understanding the constraints related to the software. Therefore, by using the specification generation device 10, for example, the quality of the code for the created program can be improved.

[0071] Each process in the specification generation device 10 can be realized by executing a computer program on a computer. Fig. 12 shows an example of the configuration of a computer 100 that executes a computer program that performs each process in the specification generation device. The computer 100 includes a CPU (Central Processing Unit) 101, a memory 102, a storage device 103, an input / output I / F (Interface) 104, and a communication I / F 105.

[0072] The CPU 101 reads and executes computer programs for performing each process from the storage device 103. The CPU 101 may be configured by a combination of multiple CPUs. Furthermore, the CPU 101 may be configured by a combination of a CPU and another type of processor. For example, the CPU 101 may be configured by a combination of a CPU and a GPU. The memory 102 is configured by a dynamic random access memory (DRAM) or the like, and temporarily stores the computer programs executed by the CPU 101 and data being processed. The storage device 103 stores the computer programs executed by the CPU 101. The storage device 103 is configured by, for example, a non-volatile semiconductor storage device. Other storage devices such as a hard disk drive may also be used for the storage device 103. The input / output I / F 104 is an interface that receives input from an operator and outputs display data, etc. The communication I / F 105 is an interface that transmits and receives data between the terminal device 20, the generation device 30, and other information processing devices. Furthermore, the terminal device 20 and the generation device 30 may have the same configuration as the computer 100.

[0073] The computer program used to execute each process can also be stored and distributed on a computer-readable recording medium that non-temporarily stores data. Examples of recording media that can be used include magnetic tapes for recording data and magnetic disks such as hard disks. Optical disks such as CD-ROMs (Compact Disc Read Only Memory) can also be used as recording media. Non-volatile semiconductor storage devices can also be used as recording media.

[0074] A part or all of the above-described embodiments can be described as, but not limited to, the following supplementary notes.

[0075] [Appendix 1] generating means for generating test code and test data based on source code of the software; an execution means for executing the test code using the test data; a specification generating means for generating a specification of the software based on the execution result of the test code; an output means for outputting the generated specifications; A specification generating device comprising:

[0076] [Appendix 2] the generation means generates the test code and the test data that cause an error when the software is executed. 2. A specification generation apparatus as described in claim 1.

[0077] [Appendix 3] the generating means generates the test code and the test data using a language model based on a prompt indicating the content of the error to be generated. 10. A specification generation apparatus as defined in claim 2.

[0078] [Appendix 4] the specification generation means generates the specification based on the content of an error that occurs when the software is executed. 4. A specification generation device according to any one of appendices 1 to 3.

[0079] [Appendix 5] the specification generation means generates the specifications of the software based on results of multiple executions of the software. 4. A specification generation device according to any one of appendices 1 to 3.

[0080] [Appendix 6] the specification generation means generates the specifications of the software by summarizing specifications based on execution results of each execution of the software when the software is executed multiple times; 6. The specification generation apparatus of claim 5.

[0081] [Appendix 7] the generating means generates the test code and the test data using a language model based on a prompt indicating the content of at least one of the test code and the test data. 4. A specification generation device according to any one of appendices 1 to 3.

[0082] [Appendix 8] the generating means generates the test code and the test data by modifying at least a part of normal data. 4. A specification generation device according to any one of appendices 1 to 3.

[0083] [Appendix 9] generating test code and test data based on the source code of the software; Executing the test code using the test data; generating a specification of the software based on the execution result of the test code; outputting the generated specification; Specification generation method.

[0084] [Appendix 10] generating test code and test data based on the source code of the software; Executing the test code using the test data; A process of generating specifications of the software based on the execution results of the test code; A process of outputting the generated specifications. A specification generation program that causes a computer to execute the above.

[0085] Furthermore, some or all of the configurations described in Supplementary Notes 2 to 8, which are dependent on Supplementary Note 1, may also be dependent on Supplementary Notes 9 and 10 in the same dependent relationship as Supplementary Notes 2 to 8. Furthermore, not limited to Supplementary Notes 1, 9, and 10, but within the scope of each of the above-mentioned embodiments, some or all of the configurations described as Supplements may also be dependent on various hardware, software, various recording means for recording software, or systems.

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

[0087] 10 Specification generator 11 Acquisition Department 12 Generation part 13 Executive Department 14 Specification Generation Unit 15 Output section 16 Memory section 20 Terminal equipment 30 Generator 100 computers 101 CPU 102 memory 103 Storage device 104 Input / Output Interface 105 Communication I / F

Claims

1. generating means for generating test code and test data based on source code of the software; an execution means for executing the test code using the test data; a specification generating means for generating a specification of the software based on the execution result of the test code; an output means for outputting the generated specifications; A specification generating device comprising:

2. the generation means generates the test code and the test data that cause an error when the software is executed. The specification generating device according to claim 1 .

3. the generating means generates the test code and the test data using a language model based on a prompt indicating the content of the error to be generated.

3. The specification generating device according to claim 2.

4. the specification generation means generates the specification based on the content of an error that occurs when the software is executed.

4. The specification generating device according to claim 1.

5. the specification generation means generates the specifications of the software based on results of multiple executions of the software.

4. The specification generating device according to claim 1.

6. the specification generation means generates the software specifications by summarizing specifications based on execution results of each execution of the software multiple times; 6. The specification generating device according to claim 5.

7. the generating means generates the test code and the test data using a language model based on a prompt indicating content of at least one of the test code and the test data.

4. The specification generating device according to claim 1.

8. the generating means generates the test code and the test data by modifying at least a part of normal data.

4. The specification generating device according to claim 1.

9. generating test code and test data based on the source code of the software; Executing the test code using the test data; generating a specification of the software based on the execution result of the test code; outputting the generated specification; Specification generation method.

10. generating test code and test data based on the source code of the software; Executing the test code using the test data; A process of generating specifications of the software based on the execution results of the test code; A process of outputting the generated specifications. A specification generation program that causes a computer to execute the above.

Citation Information

Patent Citations

  • Producing idiomatic software documentation for multiple programming languages ​​from a common specification.

    JP2024501045A