Information processing device
The described solution allows for the easy identification of inputs corresponding to unsatisfactory outputs in a program by using a storage device and arithmetic device to determine and output the relevant input, addressing the limitations of existing techniques.
Patent Information
- Application Number
- JP2023200849
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2025-06-09
AI Technical Summary
Existing techniques fail to specify the input corresponding to an output that does not satisfy the desired characteristics in a program, making it difficult to consider countermeasures for such inputs.
A storage device holding conditions related to the input-output relationship, execution paths, and desired output characteristics, along with an arithmetic device that determines and outputs the corresponding input when the output does not satisfy the characteristics.
Enables easy identification of the input corresponding to an output that does not satisfy the characteristics, allowing for effective countermeasures to be considered.
Smart Images

Figure 2025086679000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an information processing apparatus.
Background Art
[0002] Patent Document 1 discloses a technique capable of easily specifying an access relationship between a program and data by generating an access list table in a table format in which identification information of a program and identification information of data are arranged in a matrix.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] However, in the technique disclosed in Patent Document 1, although the access relationship between a program and data can be specified, the relationship between the input when the program is executed and the output of the program obtained via the data cannot be specified.
[0005] In such a case, if the program can output an output that does not satisfy the characteristics to be satisfied, the input corresponding to such an output cannot be specified. Therefore, there may be cases where it is not possible to consider countermeasures when such an input is input to the program.
[0006] The present invention has been made in view of such problems, and an object thereof is to provide an information processing apparatus capable of easily specifying an input corresponding to an output when the program outputs an output that does not satisfy the characteristics to be satisfied.
Means for Solving the Problems
[0007] One invention for achieving the above object is a storage device that holds a first condition indicating a relationship between an input when a predetermined program is executed and an output corresponding to the input obtained via a database, a second condition regarding an execution path for obtaining the input and the output among a plurality of execution paths included in the program, and a third condition regarding a characteristic that the output should satisfy; an arithmetic device that executes a process of determining the presence or absence of an input corresponding to an output that does not satisfy the characteristic based on the first to third conditions, and a process of outputting at least one input corresponding to an output that does not satisfy the characteristic when the result of the determination is positive. The information processing apparatus includes the above components. Other features of the present invention will be clarified by the description in this specification.
Effect of the Invention
[0008] According to the present invention, when a program can output an output that does not satisfy a characteristic to be satisfied, it becomes possible to easily identify an input corresponding to such an output.
Brief Description of the Drawings
[0009]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Mode for Carrying Out the Invention
[0010] ==Embodiment== <<Property-Based Testing>> The information processing apparatus 10 in the present embodiment described below is an apparatus that executes a so-called property-based test on a program. A property-based test is a test for verifying whether the output of the program to be tested outputs an output that satisfies the characteristics (properties) to be satisfied.
[0011] Here, the "properties to be satisfied" means the characteristics that the numerical values or character strings output by the program should satisfy.
[0012] For example, when the output of the program is a person's name, a constraint such as the number of characters in the name being 1 or more can be cited as a "property to be satisfied". Therefore, when the number of characters in the name output by the program is 0 (blank), it can be said that this output does not satisfy the property.
[0013] As another example, when the output of the program is a person's age, a constraint such as the age being 0 years old or more can be cited. Therefore, when the age output by the program is negative (less than 0), it can be said that this output does not satisfy the property.
[0014] Before explaining the details of the information processing apparatus 10, the outline of the processing of the program P that the information processing apparatus 10 subjects to property-based testing will be described with reference to FIGS. 1 to 3.
[0015] <Outline of the processing of program P> FIG. 1 is a diagram for explaining the outline of the processing of the program P that the information processing apparatus 10 of the present embodiment subjects to property-based testing. In FIG. 1, as the program P, for example, a program P that operates an application AP for managing the inventory of drugs in a drug warehouse (not shown) is illustrated.
[0016] In the application AP, the user can execute operations A and B, the details of which will be described later. In the present embodiment, the program P1 for operation A and the program P2 for operation B are collectively referred to as the program P.
[0017] Note that the program for executing the application AP is not limited to a plurality, and may be a single program.
[0018] The application AP operates on a terminal such as a personal computer, a tablet terminal, or a smartphone. The user performs operations A and B via the operation screen displayed on the terminal.
[0019] In FIG. 1, operation A is an operation for the user to input the usage amount of the drug via the application AP after using the drug stored in the drug warehouse. At the time of operation A, the application presents screen A to the user via a predetermined display.
[0020] FIG. 2 is a diagram for explaining screen A. Screen A is displayed on the user's terminal and is a screen for the user to input the usage amount of the drug. Screen A includes a registration ID input screen 31, a usage amount input screen 32, and a registration button B1.
[0021] The registration ID input screen 31 is a screen for the user to input an ID for identifying the drug used. The usage amount input screen 32 is a screen for the user to input the amount of the drug used. The registration button B1 is a button for registering the inputs on the registration ID input screen 31 and the usage amount input screen 32 to the application AP after the user has completed the inputs.
[0022] In this example, the case where the user inputs 50 ml as the usage amount of a drug with a predetermined ID to the usage amount input screen 32 is illustrated.
[0023] When the user finishes inputting the usage amount via screen A, the program P1 calculates the remaining amount of the drug based on the value input to the usage amount input screen 32. Then, the program P1 accesses the database DB and updates the data in the database DB with the calculated remaining amount of the drug as the new remaining amount.
[0024] On the other hand, in FIG. 1, operation B is an operation for displaying the remaining amount of the drug via the program P2 when the user checks the inventory of the drug. During operation B, the program P2 presents screen B to the user via a predetermined display.
[0025] FIG. 3 is a diagram for explaining screen B. Screen B is a screen for displaying the remaining amount of the drug. Screen B includes a display ID input screen 41, a remaining amount display screen 42, and a display button B2.
[0026] The display ID input screen 41 is a screen for the user to input an ID for identifying the drug whose remaining amount the user wants to display. The remaining amount display screen 42 is a screen on which the remaining amount of the drug is displayed. The display button B2 is a button for displaying the remaining amount of the drug on the remaining amount display screen 42 after the user has completed the input to the display ID input screen 41.
[0027] When the user selects the display button B2, the program P2 accesses the database DB and acquires the data on the remaining quantity of the drug. Then, the program P2 causes the remaining quantity display screen 42 to display the acquired data on the remaining quantity.
[0028] In this example, the case where it is displayed on the remaining quantity display screen 42 that the remaining quantity of the drug with a predetermined ID is 100 ml is illustrated.
[0029] <Whether the output satisfies the property> As described above, the program P is a program that executes a process of updating the database DB in which the remaining quantity of the drug is recorded when the user inputs the usage amount of the drug, and a process of displaying the remaining quantity at that time when the user wants to check the remaining quantity of the drug.
[0030] In this example, the output that does not satisfy the property is defined as an output indicating a value that the remaining quantity of the drug cannot actually take, that is, an output having a numerical value smaller than 0 (zero), that is, a negative numerical value. Therefore, the output that satisfies the property is defined as an output having a value of 0 (zero) or more for the remaining quantity of the drug.
[0031] For example, when there is a defect in the program P, an output that does not satisfy the property may be output.
[0032] The information processing apparatus 10 of the present embodiment is an apparatus that executes a property-based test regarding the pair of operations of the above-described operations A and B. That is, the information processing apparatus 10 is an apparatus capable of easily specifying an input via the screen A corresponding to such an output when the program P can output an output that does not satisfy the property via the screen B.
[0033] Note that, in the present embodiment, the program P that operates the application AP for managing the inventory of drugs is illustrated, but the programs that can be the test targets of the information processing apparatus 10 are not limited to this.
[0034] For example, the information processing apparatus 10 can test a program that outputs a person's name. In this case, it is tested whether the number of characters in the output name satisfies a constraint such as being 1 or more.
[0035] As another example, the information processing apparatus 10 can test a program that outputs a person's age. In this case, it is tested whether the age satisfies a constraint such as being 0 years old or more.
[0036] <<Information processing apparatus 10>> The information processing apparatus 10 of the present embodiment is an apparatus that executes a property-based test on the program P. Here, the program P is executed including processing for accessing the database DB (FIG. 1), such as updating or reading data in the database DB.
[0037] Hereinafter, the hardware configuration of the information processing apparatus 10, the functional blocks of the information processing apparatus 10, and the procedure of the property-based test by the information processing apparatus 10 will be described in this order.
[0038] <Hardware configuration of information processing apparatus 10> The hardware configuration of the information processing apparatus 10 of the present embodiment will be described. FIG. 4 is a diagram for explaining the hardware configuration of the information processing apparatus 10.
[0039] The information processing apparatus 10 includes an arithmetic unit 100, a main memory device 101, an auxiliary storage device 102, a transmission / reception device 103, an output device 104, and an input device 105.
[0040] The arithmetic unit 100 is configured using, for example, a CPU (Central Processing Unit), MPU (Micro Processing Unit), GPU (Graphics Processing Unit), FPGA (Field Programmable Gate Array), ASIC (Application Specific Integrated Circuit), AI (Artificial Intelligence) chip, or the like.
[0041] The main memory device 101 is a device used when the arithmetic unit 100 executes a program, and is, for example, a ROM (Read Only Memory), RAM (Random Access Memory), non-volatile memory (NVRAM (Non Volatile RAM)), or the like. Various functions realized in the information processing apparatus 10 are realized by the arithmetic unit 100 reading out a program or data stored (stored) in the auxiliary storage device 102 into the main memory device 101 and executing it.
[0042] The auxiliary storage device 102 is a device that stores programs and data, and can be configured using, for example, an SSD (Solid State Drive), hard disk drive, optical storage device (CD (Compact Disc), DVD (Digital Versatile Disc), etc.), storage system, IC card, read / write device for non-temporary recording media such as SD cards and optical recording media, non-temporary storage area of a cloud server, or the like. The auxiliary storage device 102 can read programs and data from a non-temporary recording medium or another information processing apparatus equipped with a non-temporary storage device via a recording medium reading device or transceiver 103. Programs and data stored (stored) in the auxiliary storage device 102 are read into the main memory device 101 at any time.
[0043] The transmission / reception device 103 is a device that realizes communication with other devices. The transmission / reception device 103 is a wired or wireless communication interface that realizes communication with other devices via a network, and is, for example, a NIC (Network Interface Card), a wireless communication module, a USB module, etc.
[0044] The output device 104 and the input device 105 constitute a user interface that realizes interactive processing (such as receiving information and providing information) with the user.
[0045] <Functional blocks of the information processing device 10> FIG. 5 is a diagram for explaining the functional blocks of the information processing device 10 and the output device 104. In FIG. 5, the source code input screen 21, the calculation graph input screen 22, the path condition input screen 23, the property input screen 24, and the result display screen 25 are screens displayed via the output device 104. These are screens for input and output in property-based testing, and the details will be described later.
[0046] In the information processing device 10, a calculation graph storage unit 111, a path condition storage unit 112, a property storage unit 113, a data flow analysis unit 114, a calculation graph synthesis unit 115, a calculation graph encoding unit 116, a SAT problem calculation unit 117, and a display processing unit (not shown) are realized. Each will be described.
[0047] [Calculation graph storage unit 111] The calculation graph storage unit 111 holds a condition C1 (corresponding to the "first condition") indicating the relationship between the input when a predetermined program P is executed and the output corresponding to the input obtained via the database DB.
[0048] Specifically, the condition C1 is a condition including the process (corresponding to the "first process") when the database DB is updated based on the input and the process (corresponding to the "second process") when outputting the output corresponding to the input obtained from the updated database DB.
[0049] In this embodiment, the "process of updating the database DB based on the input" corresponds to the operation A shown in Fig. 1. Also, the "process of outputting an output corresponding to an input obtained from the updated database DB" corresponds to the operation B shown in Fig. 1.
[0050] In this embodiment, the condition C1 is stored as a computation graph in the computation graph storage unit 111. A "computation graph" is a graph that expresses the process of a computation in a program by a plurality of nodes and edges connecting two of the plurality of nodes. Here, the plurality of nodes includes an operator and an operand.
[0051] Here, an operator is a command for executing, for example, arithmetic operations, string operations, set operations, function calls, etc. An operand is a variable, a value input via an input screen, a data value in a database DB, etc.
[0052] 6 and 7 are diagrams for explaining an example of a computation graph stored in the computation graph storage unit 111. FIG.
[0053] Fig. 6 is a computation graph G1 (corresponding to the "first computation graph") showing the process when updating the database DB based on an input (the process corresponding to operation A in Fig. 1). Specifically, the computation graph G1 is a graph that expresses the process from when the user inputs the amount of drug used to when the database is updated, using operators and operands.
[0054] A computation graph G1 has a node N 101 ~N 111 where node N 102 , N 105 , N 107 , N 108 and N 110 is an operator. Also, node N 101 , N 103 , N 104 , N 106 , N 109 and N 111 is an operand.
[0055] Node N 101 is the data of the remaining quantity recorded in the database DB (Table.remain 0 ), and is a numerical value indicating the remaining quantity read by the program P during the operation A in FIG. 1.
[0056] Node N 102 is an operator (=) indicating an equal sign, and is an operator for substituting the numerical value of the upstream Node N connected by an edge into the downstream Node N connected by the edge 103 101 .
[0057] Node N 103 is a variable (remain 0 ) indicating the remaining quantity. In this example, the variable of Node N 103 is assigned the numerical value of Node N 102 by Node N 101 .
[0058] Node N 104 is the usage amount input by the user via the screen A (FIG. 2) of the application AP.
[0059] Node N 105 is an operator (=) indicating an equal sign, and is an operator for substituting the numerical value of the upstream Node N connected by an edge into the downstream Node N connected by the edge 106 104 .
[0060] Node N 106 is a variable (used 0 ) indicating the usage amount. In this example, the variable of Node N 106 is assigned the numerical value of Node N 105 by Node N 104 .
[0061] Node N 107 is an operator (-) indicating subtraction, and is the upstream Node N connected by an edge 103 The value obtained by subtracting the value of node N 106 is an operator for calculating the subtracted value.
[0062] Node N 108 is an operator (=) indicating an equal sign, and assigns the value of the upstream node N 109 connected by an edge to the downstream node N 107 connected by the edge.
[0063] Node N 109 is a variable (remain 1 ) indicating the remaining amount after use. In this example, the variable of node N 109 is assigned the subtraction result of node N 108 by node N 107 .
[0064] Node N 110 is an operator (=) indicating an equal sign, and assigns the value of the upstream node N 111 connected by an edge to the downstream node N 109 connected by the edge.
[0065] Node N 111 is the remaining amount data (Table.remain 1 ) recorded in the database DB of FIG. 1. The data of node N 111 is assigned the value of node N 110 by node N 109 .
[0066] Such a computational graph G1 represents the process of the process in operation A shown in FIG. 1.
[0067] FIG. 7 is a computational graph G2 (corresponding to the "second computational graph") showing the process of outputting an output corresponding to an input obtained from the updated database DB (the process corresponding to operation B in FIG. 1). Specifically, the computational graph G2 is a graph representing the process from when the program P reads the remaining data from the database DB until the remaining amount is displayed, using operators and operands.
[0068] The computational graph G2 includes nodes N 201 ~N 203 . Here, the node N 202 is an operator. Also, the nodes N 201 and N 203 are operands.
[0069] The node N 201 is the remaining amount of data recorded in the database DB in FIG. 1 (Table.remain 0 ), which is a numerical value indicating the remaining amount read by the program P during operation B.
[0070] The node N 202 is an operator (=) indicating an equal sign, and is an operator for substituting the numerical value of the upstream node N 203 connected by an edge into the downstream node N 201 connected by an edge.
[0071] The node N 203 is the remaining amount displayed via the screen B of the application AP. Here, as the "remaining amount", the numerical value of the node N 202 is displayed by the node N 201 .
[0072] The computational graphs G1 and G2 representing the calculation process in the program P have been described above, but the computational graphs held by the computational graph storage unit 111 are not limited to these two computational graphs G1 and G2.
[0073] Although details will be described later, the program P includes an execution path for executing processing of processes other than two processes corresponding to the calculation graphs G1 and G2 (the process when updating the database DB based on the input and the process when outputting an output corresponding to the input obtained from the updated database DB).
[0074] The calculation graph storage unit 111 holds calculation graphs corresponding to all execution paths included in the program P. In the above description, only the calculation graphs G1 and G2 have been described for the sake of explanation.
[0075] The calculation graph storage unit 111 holds a calculation graph generated by a data flow analysis unit 114, details of which will be described later. Also, the user may manually generate a calculation graph. In this case, the calculation graph storage unit 111 holds the calculation graph input by the user via a calculation graph input screen 22 (described later).
[0076] [Path condition storage unit 112] The path condition storage unit 112 holds a condition C2 (corresponding to the "second condition") regarding an execution path for obtaining an input and an output among a plurality of execution paths included in the program P.
[0077] The path condition storage unit 112 holds the condition C2 input by the user via a path condition input screen 23 (described later).
[0078] The program P includes an execution path for executing processing of a plurality of processes in addition to the processes of the above-described operations A and B. The plurality of execution paths included in the program P are collected from the source code of the program P by the data flow analysis unit 114.
[0079] The condition C2 is a condition for specifying an execution path for verifying the properties of the target input and output among the execution paths for executing the processing of a plurality of processes included in the program P.
[0080] The execution path related to the property-based test by the information processing apparatus 10 according to the present embodiment is an execution path for executing the processes corresponding to the calculation graphs G1 and G2 among the plurality of execution paths included in the program P.
[0081] That is, the user inputs, as the condition C2, the conditions for executing the processes corresponding to the calculation graphs G1 and G2 among the plurality of execution paths included in the program P via the path condition input screen 23 (details will be described later).
[0082] [Property storage unit 113] The property storage unit 113 holds a condition C3 (corresponding to the "third condition") regarding the property that the output of the program P should satisfy.
[0083] In the present embodiment, the property storage unit 113 holds the condition C3 input by the user via the property input screen 24 (to be described later).
[0084] Here, the "output" is a numerical value indicating the remaining amount corresponding to the node N of the calculation graph G2 shown in FIG. 7. In the present embodiment, the condition C3 is the condition that "the remaining amount is 0 (zero) or more". 203 In the present embodiment, the condition C3 is the condition that "the remaining amount is 0 (zero) or more".
[0085] [Data flow analysis unit 114] The data flow analysis unit 114 generates the condition C1 and extracts the execution paths included in the program P. As described above, the condition C1 is represented by a calculation graph.
[0086] The data flow analysis unit 114 generates the condition C1 and extracts the execution paths included in the program P by statically analyzing the source code of the program P. The source code of the program P is input by the user via the source code input screen 21 (to be described later).
[0087] Hereinafter, first, the static analysis of the source code of the program P will be described, and then the procedure for the data flow analysis unit 114 to generate the condition C1 and the procedure for extracting the execution paths will be described.
[0088] ·Static Analysis of Program P As described above, in this embodiment, the program P1 for operation A in FIG. 1 and the program P2 for operation B are collectively referred to as program P. FIG. 8 is a diagram showing the source code of program P1. The source code of program P1 is composed of the first to ninth lines.
[0089] FIG. 9 is a diagram representing the processing executed by program P1 in a flowchart. The line numbers of the source code of program P1 are shown in each block of the flowchart, and the processing specified in each line is executed.
[0090] As can be seen from FIG. 9, program P1 includes two execution paths (execution paths 1 and 2). Execution paths 1 and 2 branch after the processing of the fourth line.
[0091] As shown in FIG. 8, the fourth line of the source code of program P1 is the first line of the conditional expression by the "if statement". According to this conditional expression, when the database DB does not exist, the processing ends, and when the database DB exists, the processing ends after the processing of the fifth to eighth lines is executed.
[0092] In static analysis, the data flow analysis unit 114 analyzes all the execution paths of program P1, and collects the instructions (for example, assignment statements) executed in the processing of each execution path and the conditions (for example, the conditions of the if statement) under which the processing of each execution path is executed.
[0093] FIG. 10 is a diagram showing the results of performing static analysis on the source code of program P1. In FIG. 10, the static analysis result R1 for execution path 1 and the static analysis result R2 for execution path 2 are shown.
[0094] As shown in the result R1 of FIG. 10, as a condition for the process of execution path 1 to be executed, "(record!==null)==false" is collected. This is based on the fourth line of the source code (FIG. 8).
[0095] Furthermore, as instructions included in execution path 1, (1) and (2) are collected. The instructions (1) and (2) are collected from the second and third lines of the source code, respectively.
[0096] Also, as shown in the result R2 of FIG. 10, as a condition for the process of execution path 2 to be executed, "(record!==null)==true" is collected. This is based on the fourth line of the source code (FIG. 8).
[0097] Furthermore, as instructions included in execution path 2, (1) to (5) are collected. The instructions (1) to (5) are collected from the second, third, fifth, sixth, and seventh lines of the source code, respectively.
[0098] ·Procedure for generating condition C1 As described above, condition C1 is represented by the computation graph G1. The data flow analysis unit 114 generates the computation graph G1 by statically analyzing the source code of program P1 and extracting the operator or operand corresponding to each of the plurality of nodes.
[0099] FIG. 11 is a diagram for explaining the generation of the computation graph. Hereinafter, the computation graph G1 will be exemplified, and the procedure for the data flow analysis unit 114 to generate the computation graph will be described.
[0100] The data flow analysis unit 114 first generates a tree structure by fitting the expressions substituted for the variables appearing in expression (5), which is the last expression shown in the result R2 of FIG. 10.
[0101] FIG. 11 is a diagram for explaining the generation of the tree structure of execution path 2 (FIG. 9). First, as shown in the tree structure T1 of FIG. 11, "remain" on the right side of expression (5) 1The right side of Equation (4) is substituted into "". Further, the right side of Equation (4) "remain" 0 The right side of Equation (3) is substituted into "".
[0102] The data flow analysis unit 114 generates nodes (nodes N 101 , N 103 , N 106 and N 109 ) corresponding to the operands of the computation graph G1 shown in FIG. 6 from the variables or data appearing in the tree structure T2 of FIG. 11.
[0103] At this time, the data flow analysis unit 114 particularly generates a node N 111 (a node corresponding to the data of the updated database DB) of the computation graph G1 shown in FIG. 6 by extracting instructions for updating the database DB.
[0104] Specifically, the data flow analysis unit 114 identifies the correspondence between variables and the data of the database DB based on the format of SQL statements, data types, etc.
[0105] Thereby, the data flow analysis unit 114 replaces "remain" 1 in the uppermost equation (corresponding to Equation (5)) with the data of the database DB (Table.remain 1 ), and replaces "remain" 0 in the lowermost equation (corresponding to Equation (3)) with the data of the database DB (Table.remain 0 ), as shown in the tree structure T2 of FIG. 11.
[0106] Note that for the node N 104 corresponding to the usage amount input via the screen A (FIG. 1) of the application AP, the administrator of the information processing apparatus 10 may set it manually.
[0107] Based on the generated nodes corresponding to the operands and the tree structure T2 shown in FIG. 11, the data flow analysis unit 114 determines nodes corresponding to the operators (nodes N 102 , N 105, N 107 , N 108 and N 110 ) are generated.
[0108] Then, based on the tree structure T2 shown in FIG. 11, the data flow analysis unit 114 determines the connection relationship of the nodes N 101 ~N 111 . Then, based on the determined connection relationship, the data flow analysis unit 114 connects the nodes N 101 ~N 111 with edges.
[0109] Through the above procedure, the data flow analysis unit 114 generates a computation graph G1 that represents the calculation process of the execution path 2. The data flow analysis unit 114 further generates a computation graph G2 by a similar procedure.
[0110] Note that in generating the computation graph G2, the data flow analysis unit 114, in particular, extracts instructions for reading data from the database DB, thereby generating the node N 201 (the node corresponding to the data in the database DB to be read).
[0111] The data flow analysis unit 114 outputs the generated computation graphs including the computation graphs G1 and G2 to the computation graph storage unit 111. Further, the data flow analysis unit 114 can display the computation graphs including the computation graphs G1 and G2 on a predetermined display unit via the output device 104.
[0112] · Procedure for extracting the execution path The data flow analysis unit 114 statically analyzes the source code of the program P1 and extracts the conditions under which the processing of the execution path is executed.
[0113] As shown in FIG. 9, it can be seen by static analysis that the program P1 includes two execution paths (execution paths 1 and 2). The data flow analysis unit 114 collects the conditions under which the processing of each execution path is executed by extracting, for example, if statements from the source code.
[0114] [Calculation Graph Synthesis Unit 115] The calculation graph synthesis unit 115 generates a calculation graph G3 by combining the calculation graph G1 and the calculation graph G2. The calculation graphs G1 and G2 are held in the calculation graph storage unit 111.
[0115] FIG. 12 is a diagram for explaining the calculation graph G3. The calculation graph G3 is a calculation graph obtained by combining the calculation graph G1 and the calculation graph G2 by grouping the node N 111 (FIG. 6) of the calculation graph G1 and the node N 201 (FIG. 7) of the calculation graph G2 into one node.
[0116] In this example, the one node obtained by grouping the node N 111 (FIG. 6) and the node N 201 (FIG. 7) is newly designated as the node N 111 (FIG. 12).
[0117] Here, the node N 111 is a node corresponding to the data in the updated database DB of the calculation graph G1. The node N 201 is a node corresponding to the data in the database DB read by the calculation graph G2.
[0118] The calculation graph synthesis unit 115 acquires the node (node N 111 ) corresponding to the data in the updated database DB from the calculation graph G1, and acquires the node (node N 201 ) corresponding to the data in the database DB read by the calculation graph G2.
[0119] The calculation graph synthesis unit 115 generates a calculation graph G3 by combining the calculation graph G1 and the calculation graph G2 by grouping these nodes together.
[0120] The computation graph synthesis unit 115 outputs the generated computation graph G3 to the computation graph encoding unit 116. Also, the computation graph synthesis unit 115 can display the computation graph G3 on a predetermined display unit via the output device 104.
[0121] [Computation Graph Encoding Unit 116] The computation graph encoding unit 116 encodes the conditions C1 to C3 into a satisfiability problem (SAT problem) for determining the presence or absence of an input corresponding to an output that does not satisfy the property.
[0122] The computation graph encoding unit 116 acquires the condition C1 from the computation graph storage unit 111 via the computation graph synthesis unit 115. Also, the computation graph encoding unit 116 acquires the conditions C1 and C1 from the path condition storage unit 112 and the property storage unit 113, respectively.
[0123] The computation graph encoding unit 116 encodes the conditions C1 to C3 into a satisfiability problem for determining whether the logical product of a logical formula that makes condition C1 true, a logical formula that makes condition C2 true, and a logical formula that makes condition C3 false can be true.
[0124] The satisfiability problem encoded by the computation graph encoding unit 116 is output to the SAT problem calculation unit 117.
[0125] [SAT Problem Calculation Unit 117] The SAT problem calculation unit 117 solves the SAT problem (satisfiability problem) encoded by the computation graph encoding unit 116. Thereby, the SAT problem calculation unit 117 determines the presence or absence of an input corresponding to an output that does not satisfy the property. The SAT problem can be solved using a predetermined algorithm.
[0126] When the result of the determination is positive, the SAT problem calculation unit 117 outputs at least one of the inputs corresponding to the output that does not satisfy the property. The SAT problem calculation unit 117 presents the result of this process to the user via the result display screen 25 (described later).
[0127] [Display processing unit] A display processing unit (not shown) executes a process of causing the calculation graphs G1 to G3 (FIGS. 6, 7, and 12) and an operation screen 2 (FIG. 3) described later to be displayed on a predetermined display unit via the output device 104.
[0128] <Procedure of property-based testing> A procedure of property-based testing using the information processing apparatus 10 of the above-described embodiment will be described.
[0129] FIG. 13 is a diagram for explaining a procedure of property-based testing using the information processing apparatus 10 of the present embodiment, and shows the operation screen 2 at the time of testing.
[0130] The operation screen 2 includes a source code input screen 21, a calculation graph input screen 22, a path condition input screen 23, a property input screen 24, and a result display screen 25.
[0131] The source code input screen 21 is an input screen for the user to specify the source code of the program P to be tested. The user inputs the folder name in which the source code of the program P is stored and the file name of the source code on the source code input screen 21.
[0132] Thereby, the data flow analysis unit 114 described above can analyze the source code specified on the source code input screen 21 and execute processes such as the above-described static analysis.
[0133] The calculation graph input screen 22 is an input screen for storing the calculation graph generated by the user in the calculation graph storage unit 111 when the user manually generates a calculation graph. The user inputs the folder name in which the calculation graph manually generated is stored and the file name of the calculation graph on the calculation graph input screen 22.
[0134] The path condition input screen 23 is a screen for the user to input condition C2. The user inputs the specified execution path condition as condition C2 from the execution path conditions held by the path condition storage unit 112 on the path condition input screen 23.
[0135] Condition C2 in this embodiment is, as described above, a condition for designating the execution path of program P1 shown in FIG. 9 as execution path 2.
[0136] Thereby, the above-described calculation graph encoding unit 116 can encode condition C2 specified on the path condition input screen 23 for the SAT problem.
[0137] The property input screen 24 is a screen for the user to input condition C3. The user inputs the folder name in which the predetermined file in which condition C3 is described is stored and the file name thereof on the property input screen 24.
[0138] Condition C3 of this embodiment is, as described above, a condition that the remaining amount as output is 0 (zero) or more.
[0139] Thereby, the calculation graph encoding unit 116 can encode condition C3 specified from the property input screen 24 for the SAT problem.
[0140] The result display screen 25 is a screen for displaying the result of the SAT problem. When the user selects the analysis button B3 after completing the input via the above screen, the calculation result by the SAT problem calculation unit 117 is displayed on the result display screen 25.
[0141] This example shows that the output may result in an output that does not satisfy the property. Specifically, as described above, an output that does not satisfy the property means that the remaining amount becomes a value smaller than 0 (zero).
[0142] This example shows an example where an output that does not satisfy the property is output. Specifically, as an example, it is shown that when the value of the data in the database DB is 10 (Table.remain = 0) as the initial setting and the usage amount is input as 20 during operation A (Figure 1).
[0143] When such a usage amount is input in such an initial setting, the remaining amount output is -10 (negative value), which does not satisfy the property.
[0144] As described above, when the program P outputs an output that does not satisfy the characteristics to be satisfied, the information processing apparatus 10 can easily identify the input corresponding to such an output.
[0145] From the description in this specification, at least the following is clarified. That is, the information processing apparatus 10 of the present embodiment includes a storage device that holds a condition C1 indicating the relationship between the input when a predetermined program P is executed and the output corresponding to the input obtained via the database DB, a condition C2 regarding the execution path for obtaining the input and output among a plurality of execution paths included in the program, and a condition C3 regarding the characteristics that the output should satisfy, and an arithmetic unit 100 that executes a process of determining the presence or absence of an input corresponding to an output that does not satisfy the characteristics based on conditions C1 to C3, and a process of outputting at least one of the inputs corresponding to the output that does not satisfy the characteristics when the determination result is affirmative.
[0146] According to such a configuration, when the program P can output an output that does not satisfy the characteristics to be satisfied, it becomes possible to easily identify the input corresponding to such an output.
[0147] In the information processing apparatus 10 according to the embodiment, condition C1 is a condition including a first process when updating the database DB based on an input and a second process when outputting an output corresponding to the input obtained from the updated database DB. The arithmetic unit 100 executes a process of causing a predetermined display unit to display a calculation graph G1 indicating the first process and a calculation graph G2 indicating the second process, which are represented by a plurality of nodes including operators and operands and edges connecting two of the plurality of nodes. According to such a configuration, the processes executed in the program P can be visually understood more easily by the user.
[0148] In the information processing apparatus 10 according to the embodiment, the arithmetic unit 100 executes a process of causing a display unit to display a calculation graph G3 obtained by combining the calculation graph G1 and the calculation graph G2. According to such a configuration, the relationship between the input and output of the processes executed in the program P can be visually understood more easily by the user.
[0149] In the information processing apparatus 10 according to the embodiment, the arithmetic unit 100 executes a process of generating the calculation graphs G1 and G2 by statically analyzing the source code of the program P and extracting the operator or operand corresponding to each of the plurality of nodes, and a process of generating the condition C2 by statically analyzing the source code of the program P and extracting the conditions under which the processes of a predetermined execution path are executed. According to such a configuration, the calculation graphs G1 and G2 and the condition C2 can be mechanically generated, so that these processes can be made more efficient.
[0150] In the information processing apparatus 10 according to the embodiment, the arithmetic unit 100 statically analyzes the source code of the program P, extracts instructions for updating the database DB, and thereby generates nodes corresponding to the data in the updated database DB of the computation graph G1, and extracts instructions for reading data from the database, and thereby generates nodes corresponding to the data in the database DB read by the computation graph. With such a configuration, nodes corresponding to the data in the updated database DB of the computation graph G1 and nodes corresponding to the data in the database DB read by the computation graph G2 can be mechanically generated, so that the processes for generating them can be made more efficient.
[0151] In the information processing apparatus 10 according to the embodiment, the arithmetic unit 100 executes a process of determining whether the logical product of a logical formula for which condition C1 is true, a logical formula for which condition C2 is true, and a logical formula for which condition C3 is false can be true by solving a satisfiability problem. With such a configuration, since the satisfiability problem can be solved using an existing solver, the process for making the determination can be made more efficient.
Explanation of Signs
[0152] 10 Information processing apparatus 100 Arithmetic unit 101 Main memory device 102 Auxiliary storage device 103 Transmission / reception device 104 Output device 105 Input device 111 Computation graph storage unit 112 Path condition storage unit 113 Property storage unit 114 Data flow analysis unit 115 Computation graph synthesis unit 116 Computation graph encoding unit 117 SAT problem calculation unit 2 Operation screen 21 Source code input screen 22 Computation graph input screen 23 Pass Condition Input Screen 24 Property Input Screen 25 Result Display Screen 31 Registration ID Input Screen 32 Usage Input Screen B1 Registration Button 41 Display ID Input Screen 42 Remaining Quantity Display Screen B2 Display Button
Claims
1. A storage device that holds a first condition indicating the relationship between an input when a predetermined program is executed and an output corresponding to the input obtained via a database, a second condition regarding an execution path for obtaining the input and the output among a plurality of execution paths included in the program, and a third condition regarding characteristics that the output should satisfy; A process of determining the presence or absence of an input corresponding to an output that does not satisfy the characteristics based on the first to third conditions; A process of outputting at least one input corresponding to an output that does not satisfy the characteristics when the result of the determination is affirmative; An arithmetic unit that executes the above; An information processing apparatus.
2. The information processing apparatus according to Claim 1, wherein the first condition is a condition including a first process when updating the database based on the input and a second process when outputting the output corresponding to the input obtained from the updated database; the arithmetic unit executes a process of causing a first calculation graph representing the first condition, which is represented by a plurality of nodes including operators and operands and edges connecting two of the plurality of nodes, and a second calculation graph representing the second process, to be displayed on a predetermined display unit. An information processing apparatus.
3. The information processing apparatus according to Claim 2, wherein the arithmetic unit executes a process of causing a calculation graph obtained by combining the first calculation graph and the second calculation graph to be displayed on the display unit. An information processing apparatus.
4. The information processing apparatus according to Claim 2, wherein the arithmetic unit executes a process of generating the first and second calculation graphs by statically analyzing the source code of the program and extracting the operator or operand corresponding to each of the plurality of nodes; executes a process of generating the second condition by statically analyzing the source code of the program and extracting the conditions under which the processing of the predetermined execution path is executed. An information processing apparatus.
5. The information processing apparatus according to Claim 4, wherein the arithmetic unit statically analyzes the source code of the program, and executes a process of generating a node corresponding to the data of the updated database in the first calculation graph by extracting an instruction for updating the database. By extracting an instruction for reading data from the database, a process of generating a node corresponding to the data of the database read by the second computation graph is executed. An information processing apparatus. **Claim 6** An information processing apparatus according to any one of claims 1 to 5, wherein the arithmetic unit executes a process of making the determination by solving a satisfiability problem as to whether a logical product of a logical formula that makes the first condition true, a logical formula that makes the second condition true, and a logical formula that makes the third condition false can be true. An information processing apparatus.
Citation Information
Patent Citations
Generation program, generation method and information processing device
JP2019215686A