WO2015008575A1 - Software inspection device, software inspection method, and software inspection program - Google Patents
Software inspection device, software inspection method, and software inspection program Download PDFInfo
- Publication number
- WO2015008575A1 WO2015008575A1 PCT/JP2014/066318 JP2014066318W WO2015008575A1 WO 2015008575 A1 WO2015008575 A1 WO 2015008575A1 JP 2014066318 W JP2014066318 W JP 2014066318W WO 2015008575 A1 WO2015008575 A1 WO 2015008575A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- unit
- variable
- constant
- conditional statement
- block
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
- G06F11/3608—Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
Definitions
- the present invention relates to a software inspection device, a software inspection method, and a software inspection program.
- Patent Document 1 a static analysis method for analyzing a control flow and a data flow in a source program described in a programming language without executing the source program is known (see Patent Document 1).
- Patent Document 1 According to the static analysis method of Patent Document 1, it is possible to clarify the processing content and the relationship between input and output and visualize the structure of the program. However, in the visualized program structure, it is impossible to make the user aware of a portion where a problem may occur because the constant change is not consistent.
- the present invention has been made in view of the above problems, and its purpose is to identify a portion of a program structure where a problem may occur because the constant change is not consistent. It is to provide a software inspection device, a software inspection method, and a software inspection program that can be noticed.
- the software inspection apparatus extracts constants used in a computer program to be inspected, and detects a conditional statement that refers to the extracted constants. Then, the variable to be compared with the constant in the conditional statement is specified as a base variable, and the constant to be compared is classified and output for each base variable.
- FIG. 1 is a block diagram showing a hardware configuration of the software inspection apparatus according to the first embodiment of the present invention.
- FIG. 2 is a block diagram showing a functional configuration of the CPU 11a according to the first embodiment.
- FIG. 3 is a data flow diagram showing a flow of information processing executed by the software inspection apparatus according to the first to third embodiments of the present invention and intermediate data generated during the information processing.
- FIG. 4 is a data flow diagram showing a continuation of FIG.
- FIGS. 5A and 5B are diagrams showing an example of a computer program described in the C language as the source code D01 to be inspected.
- FIG. 6 is a table showing a “constant list (DO2)” that summarizes the results of the constant extraction process (S01).
- DO2 constant list
- FIG. 7 is a table showing a “conditional sentence list (DO3)” that summarizes the results of the conditional sentence detection process (S02).
- FIG. 8 is a table showing a “base variable list (DO4)” that summarizes the results of the base variable specifying process (S03).
- FIG. 9 is a table showing a “constant group list (DO5)” that summarizes the results of the constant group specifying process (S04).
- FIG. 10 is a diagram showing an example of a program that is compared with the same base variable but is not classified as the same group because the same value is not compared in the written state.
- FIG. 11 is a diagram showing the blocks B01 to B05 specified in the program example of FIG. FIG.
- FIG. 12 is a table showing a “block row number list (DO6)” that summarizes the results of the block specifying process (S05).
- FIG. 13 is a table showing a “variable list (DO7)” that summarizes the results of the variable identification process (S06).
- FIG. 14 is a table showing a “global variable list (DO8)” in which the results of the global variable specifying process (S07) are summarized.
- FIG. 15 is a table showing a “global variable write / read location list (DO9)” that summarizes the results of the global variable write / read location specifying process (S08).
- FIG. 16 is a table showing a “group-specific parameter list (D10)” in which the results of the first global variable writing location specifying process (S09) are summarized.
- FIG. 17 is a block diagram illustrating a functional configuration of the CPU 11b according to the second embodiment.
- FIG. 18 is a table showing a “conditional sentence expansion list (D11)” that summarizes the results of the conditional sentence expansion process (S10).
- FIG. 19 is a table showing a “global variable writing location list (D12)” in which the results of the second global variable writing location specifying process (S11) are summarized.
- FIG. 20 is a table showing a “constant statement constant list (D13)” that summarizes the results of the first constant division process (S12).
- FIG. 21 is a block diagram illustrating a functional configuration of the CPU 11c according to the third embodiment.
- FIG. 22 is a table showing a “variable write / read list (D14)” that summarizes the results of the variable write / read specification process (S13).
- FIG. 23 is a table showing a “group list by variable (D15)” summarizing the results of the above-described group identification processing by variable (S14).
- FIG. 24 is a table showing a “data flow list (D16)” that summarizes the results of the access location specifying process (S15).
- FIG. 25 is a table showing a “constant list by data flow (D17)” in which the results of the second constant division process (S16) are summarized.
- the software inspection apparatus can be applied to a software inspection process of a computer program executed by an electronic control unit (ECU) mounted on a vehicle, for example. In particular, it examines the possibility of the occurrence of a problem relating to two or more constants that must be updated simultaneously according to the conditions of the computer program specifications.
- ECU electronice control unit
- the software inspection device includes an input / output device 12, a storage device 14, a CPU (central processing unit) 11, an input device 13, and a display device 15.
- the input / output device 12 reads the computer program (source code D01) to be inspected from the storage medium.
- the storage device 14 stores the source code D01 read by the input / output device 12 and analysis intermediate data.
- a CPU (Central Processing Unit) 11 executes various calculations and analyzes the source code D01.
- the input device 13 is a device for the user to input information necessary for analysis.
- the display device 15 displays the inspection result output from the CPU 11. The inspection result can also be written to a storage medium using the input / output device 12.
- the software inspection device can be realized as a client-server model.
- a general-purpose personal computer (client) is connected to the server via a computer network.
- a server including the CPU 11 shown in FIG. 1 can be connected to the input / output device 12, the input device 13, the storage device 14, or the display device 15 via a computer network.
- the software inspection device is mainly configured by the CPU 11 (server), and the input / output device 12, the input device 13, the storage device 14, or the display device 15 is not included in the software inspection device.
- CPU11 functions as each information processing part shown below.
- FIG. 1 A computer program (software inspection program) for causing a computer including the CPU 11 to function as a software inspection apparatus is installed in the computer including the CPU 11 and executed.
- CPU11 functions as each information processing part shown below.
- the software inspection device is realized by software is shown here, of course, it is also possible to configure the software inspection device by preparing dedicated hardware for executing each information processing described below. is there.
- the CPU 11a functions as a constant extraction unit 21, a conditional statement detection unit 22, a base variable identification unit 23, and a first constant group output unit 24.
- the constant extraction unit 21 extracts constants used in the computer program to be inspected.
- a constant is a name given to a specific value in programming, and unlike a variable, the value determined at the time of declaration cannot be changed later in the code.
- the constant may be changed at the same time depending on the specification conditions when the specification of the computer program is changed.
- the constant extraction unit 21 specifies the identifier of the declaration defined by “#define” or “const”, and extracts the constant.
- the constant extraction unit 21 holds information on the definition pattern by “#define” and “const” in advance, and detects a constant that matches the definition shown in the definition pattern.
- the conditional statement detection unit 22 detects a conditional statement in which the constant extracted by the constant extraction unit 21 is referred to from the computer program. For example, the conditional statement detection unit 22 compares the constants extracted by the constant extraction unit 21 among if (conditional expression), else (conditional expression), and switch (conditional expression) included in the computer program. Is detected.
- the base variable specifying unit 23 specifies a variable to be compared with the constant extracted by the constant extracting unit 21 among the conditional statements detected by the conditional statement detecting unit 22 as a base variable.
- the first constant group output unit 24 classifies and outputs constants to be compared for each base variable specified by the base variable specifying unit 23. Specifically, when two or more constants extracted by the constant extraction unit 21 are compared with the same base variable, the two or more constants are classified as one group.
- the first constant group output unit 24 performs grouping of the constants for each base variable. Two or more constants compared with the same base variable can be said to be closely related constants in the computer program specification. Therefore, the first constant group output unit 24 displays two or more constants compared with the same base variable as the inspection result output from the CPU 11, for example, on the display device 15 or uses the input / output device 12. Write to the storage medium. This presents the user with the existence of two or more constants that must be updated at the same time according to the conditions of the specification, and informs the user where there is a possibility of malfunctions due to the inconsistency of constant changes. Can be noticed.
- the first constant group output unit 24 may classify the constants for each base variable in which the same value is written. Even if the same variable is compared with two or more constants in a state where different values are written, the relevance of the two or more constants in the specification is low.
- the CPU 11a further functions as a block specifying unit 25, a writing location specifying unit 26, and a writing block specifying unit 28.
- the block specifying unit 25 specifies a block composed of a group of statements that are executed when the conditional statement detected by the conditional statement detecting unit 22 is satisfied.
- a “statement” is a processing unit for each line on the source code.
- the block indicates a range surrounded by brackets “ ⁇ ” and “ ⁇ ” after the condition determination of the if statement or the switch statement.
- the block specifying unit 25 specifies the line number of the portion surrounded by brackets “ ⁇ ” and “ ⁇ ”.
- the writing location specifying unit 26 specifies a location for writing to the global variable in the computer program. Specifically, a global variable defined in the computer program is extracted, and a location (for example, a line number) where writing is performed on the extracted global variable is specified. The place where the global variable is written is the place where the global variable appears on the left side of the arithmetic expression.
- the writing block specifying unit 28 specifies the block to which the location specified by the writing location specifying unit 26 belongs from among the blocks specified by the block specifying unit 25. Specifically, when the line number in which the global variable is written is included between the start point (line number) and the end point (line number) of the block, the block is specified.
- the first constant group output unit 24 classifies and outputs, for each base variable, the global variables to be written when a conditional statement that compares the base variables is established. There are constants that are strongly connected in the specification because of the relationship between the places where global variables are written. Therefore, it is desirable to review whether the processing is performed as specified against the global variables that have been written. Therefore, in the first embodiment, the first constant group output unit 24 is executed not only for classifying constants to be compared with the base variable for each base variable but also by the establishment of a conditional statement to which the constant is referenced. In this block, global variables that are written are also classified and output.
- FIGS. 5A and 5B show an example of a computer program written in the C language as the read source code D01.
- the computer program to be inspected is described across the two files shown in FIGS. 5 (a) and 5 (b).
- the file name in FIG. 5A is “sample1.c”, and the file name in FIG. 5B is “sample2.c”.
- a serial number starting from 1 written at the left end of each file indicates the “line number” of each statement.
- the constant extraction unit 21 executes a “constant extraction” process (S01) shown in FIG.
- the constant extraction unit 21 detects constants that match the definition pattern “#define” and “const” from the source code D01.
- the constants defined by #define, CC1, 2CC2, CC3, and CC4 are detected as constants from the second line to the fifth line of the program.
- the value of each constant definition is also detected.
- the table of FIG. 6 shows a “constant list (DO2)” that summarizes the results of the constant extraction process (S01).
- conditional sentence detection unit 22 executes a “conditional sentence detection” process (S02) shown in FIG. Detects conditional expressions that are compared with constants extracted by the constant extractor 21 from if (conditional expression), else (conditional expression), else if (conditional expression), and switch (conditional expression) included in the computer program To do.
- the conditional sentence detection unit 22 detects a conditional sentence that refers to CC1, CC2, CC3, and CC4 extracted by the constant extraction unit 21 from the source code D01.
- the table in FIG. 7 shows a “conditional sentence list (DO3)” that summarizes the results of the conditional sentence detection process (S02) described above.
- the conditional statement itself and the line number of the conditional statement are extracted.
- the base variable specifying unit 23 executes the “base variable specifying” process (S03) shown in FIG.
- the base variable specifying unit 23 specifies, as a base variable, a variable to be compared with the constant extracted in S01 in the conditional sentence detected in S03.
- the table of FIG. 8 shows a “base variable list (DO4)” that summarizes the results of the above-described base variable specifying process (S03).
- the constants CC1, CC2, CC3, and CC4 are compared with the variable groups of the variables v, v1, and vFlag, so these variables are detected as base variables.
- the conditional statement and a constant to be compared are specified for each base variable.
- the first constant group output unit 24 executes the “constant group identification” process (S04) shown in FIG. 3 based on the base variable identified in S03. Specifically, when two or more constants extracted in S01 are compared with the same base variable, the two or more constants are classified as one group.
- the table of FIG. 9 shows a “constant group list (DO5)” that summarizes the results of the constant group specifying process (S04).
- the constant CC1 is compared with the same variable as the base variable v. Therefore, the constant CC1 is set as one group and “1” is assigned as the first group ID. Since the constants CC2 and CC3 are also compared with the same base variable v1, “2” is assigned as the first group ID.
- the first constant group output unit 24 does not classify as the same group as long as different values are written even if they are the same base variable.
- the value of the base variable “a” is rewritten between the previous conditional statement (line number: 1) and the next conditional statement (line number: 4).
- the relevance of is low. Therefore, CC1 and CC2 are compared with the same base variable “a”, but are not treated as the same group because they are not compared with the base variable “a” in a state where the same value is written.
- the block specifying unit 25 executes a “block specifying” process (S05) shown in FIG.
- the block specifying unit 25 specifies a block to be executed when the conditional sentence detected in S02 is satisfied.
- the line number as the starting point and the line number as the end point of the block are specified.
- FIG. 11 shows the blocks B01 to B05 specified in the program example of FIG.
- the table of FIG. 12 shows a “block row number list (DO6)” in which the results of the block specifying process (S05) are summarized.
- DO6 block row number list
- the row number (block region) of the identified block is added to the constant group list (DO5) shown in FIG.
- the writing location specifying unit 26 executes a “variable specifying” process (S06) shown in FIG. Specifically, variables defined in the source code D01 are extracted.
- the table of FIG. 13 shows a “variable list (DO7)” that summarizes the results of the variable specifying process (S06).
- the writing location specifying unit 26 extracts global variables and local variables as variables. In the program example of FIG. 5, vFlag and vTemp are extracted as global variables, and temp and temp2 are extracted as local variables.
- the writing location specifying unit 26 executes a “global variable specifying” process (S07) shown in FIG. Specifically, global variables are extracted from the variables extracted in S06.
- the table of FIG. 14 shows a “global variable list (DO8)” in which the results of the global variable specifying process (S07) are summarized.
- vFlag and vTemp are extracted as global variables.
- the writing location specifying unit 26 executes a “global variable writing / reading location specification” process (S08) shown in FIG. Specifically, the line number in which writing is performed for the extracted global variable is specified.
- the table of FIG. 15 shows a “global variable write / read location list (DO9)” that summarizes the results of the global variable write / read location specifying process (S08).
- the global variable vFlag is written on the 16th line and read on the 31st line.
- the global variable vTemp is written on the 19th, 23rd and 26th lines, and read on the 33rd line.
- the first constant group output unit 24 executes the “first global variable write location specification” process (S09) shown in FIG. Specifically, for each base variable, global variables to be written are classified and output when a conditional statement that compares the base variables is satisfied.
- the table of FIG. 16 shows a “group-specific parameter list (D10)” in which the results of the first global variable writing location specifying process (S09) are summarized.
- D10 group-specific parameter list
- the row number (block region) of the identified block is added to the “block row number list (DO6)” shown in FIG.
- the group to which this line number belongs is assigned to the block region in the “block line number list (DO6)” in FIG. Search by. As a result, it can be determined that the block region is “18-20”.
- the base variable “v” classified by the first group ID 1 is compared with the constant CC1 in the conditional statements of the line numbers 17 and 21, and in the conditional statement block of the line numbers 17 and 21, It can be seen that 1 and 2 are written to the global variable vTemp. The same applies to the base variable “v1” classified by the first group ID2.
- the base variable “vFlag” classified by the first group ID 3 is compared with the constants CC4 and CC2, but is not written to the global variable.
- configuration parameter settings The necessity of verifying the relevance of constants is shown by taking examples of configuration parameter settings and calibration parameter settings.
- configuration parameters will be described. Essentially, the intelligent key and immobilizer functions must be turned on or off at the same time. However, the designer may not be aware of this, and only one of them has changed. For example, the designer may misunderstand that the specification is independent of the functions of the intelligent key and the immobilizer. In this case, in a downstream test such as a unit test, it can not be found that only one of them has been changed, which leads to a malfunction.
- the software inspection apparatus extracts constants used in the source code D01 to be inspected, and detects a conditional statement that refers to the extracted constants.
- a variable to be compared with a constant in the detected conditional statement is specified as a base variable, and a constant to be compared is classified and output for each specified base variable.
- constants to be compared with the same base variable are classified and output, so that a constant group having high relevance can be specified from the viewpoint of commonality of base variables. Therefore, it is possible to easily review whether the specified constant group is processed as specified. Therefore, by presenting to the user the existence of two or more constants that must be updated simultaneously according to the conditions of the specification, the user notices where there is a possibility of malfunction due to inconsistent constant change. Can be made.
- the software inspection device specifies a block to be executed when the detected conditional statement is satisfied, and specifies a location where a global variable is written in the computer program. Then, from among the identified blocks, identify the block to which the part that writes to the global variable belongs, and for each base variable, classify the global variable that is written by the establishment of a conditional statement that compares the base variable. Output. As a result, as shown in FIG. 16, it is possible to present to the user the existence of a constant having a strong connection in the specification from the relation of the global variable writing location. The user can review whether the processing is performed according to the specification against the written global variable.
- the first constant group output unit 24 classifies the constants for each base variable in which the same value is written. That is, even if the same base variable is in a state where different values are written, it is not classified as the same group. Thereby, a constant group with high relevance can be specified with higher accuracy.
- the functional configuration of the CPU 11b according to the second embodiment will be described with reference to FIG.
- the CPU 11b according to the second embodiment includes a constant extracting unit 21, a conditional sentence detecting unit 22, a block specifying unit 25, a conditional sentence developing unit 27, a writing location specifying unit 26, a writing block specifying unit 28, and a second constant. It functions as a group output unit 29.
- the constant extraction unit 21, the conditional sentence detection unit 22, the block identification unit 25, the writing location identification unit 26, and the writing block identification unit 28 are the same as those in the first embodiment, and a description thereof will be omitted.
- the conditional sentence expansion unit 27 expands the conditional sentence detected by the conditional sentence detection unit 22.
- all the conditions that must be satisfied in order to execute each block specified by the block specifying unit 25 are extracted.
- the condition of the if statement is extracted as it is, and for the else side block, it is interpreted that the reverse condition of the if statement side is satisfied, and the reverse condition of the if statement side is expanded as a new condition.
- Each expanded conditional statement is associated with a block range (block region) that is executed when the conditional statement is satisfied.
- the second constant group output unit 29 specifies a block to which a part to be written to the global variable belongs from among the blocks associated with the expanded conditional statement. Extracts constants referenced in expanded conditional statements. Then, the constants referred to by the conditional statement expanded by the conditional statement expansion unit 27 are classified and output for each portion where the global variable is written.
- conditional statement development unit 27 executes a “conditional statement development” process (S10) shown in FIG. Specifically, all conditional statements are expanded based on the “block row number list (DO6)” shown in FIG.
- the table of FIG. 18 shows a “conditional sentence expansion list (D11)” in which the results of the conditional sentence expansion process (S10) are summarized.
- the if statement is output as it is, and the else statement is represented by “!” indicating that the condition opposite to the if statement is satisfied.
- the blocks in the 22nd to 24th lines in FIG. 5B are interpreted as the false condition in the 17th line.
- the block in the 26th to 27th lines in FIG. 5B is interpreted as false of the two conditions in the 17th and 19th lines.
- the second constant group output unit 29 executes the “second global variable write location specification” process (S11) shown in FIG. Specifically, in the block associated with the expanded conditional statement based on the “conditional statement expansion list (D11)” in FIG. 18 and the “global variable write / read location list (DO9)” in FIG. From this, the block to which the part that writes to the global variable belongs is specified.
- the table of FIG. 19 shows a “global variable write location list (D12)” in which the results of the second global variable write location specifying process (S11) are summarized. For example, it is determined that the 19th line in which 1 is written to vTemp shown in FIG. 15 belongs to the block region (18-20) shown in FIG.
- Blocks for which the line number of the global variable write location has not been retrieved from the blocks shown in the “Conditional statement expansion list (D11)”, such as the block regions (32-34) and (36-38), are excluded. To do. This is because a highly relevant constant cannot be specified based on the commonality of the global variable writing location.
- the second constant group output unit 29 executes the “first constant division” process (S12) shown in FIG. Specifically, the constants included in the conditional statement in the “global variable writing location list (D12)” in FIG. 19 are extracted, and the extracted constants are divided into different lines and displayed.
- the table of FIG. 20 shows a “constant statement constant list (D13)” that summarizes the results of the first constant dividing process (S12).
- the constants are classified by assigning the second group ID to each location where the global variable is written.
- the constants CC1, CC2 are groups of constants that are referred to in the conditional statement necessary for executing the 19th line for writing to the global variable vTemp, and therefore the second group ID. “1” is attached.
- the constants CC1, CC2, and CC3 are groups of constants that are referred to in the conditional statement necessary to execute the 23rd line for writing to the global variable vTemp. ".
- the constants CC1, CC2, and CC3 are groups of constants that are referred to in the conditional statement necessary for execution of the 26th line for writing to the global variable vTemp. ".
- the software inspection device extracts constants used in the source code D01 to be inspected, detects a conditional statement that refers to the extracted constant, and expands the detected conditional statement. Then, as shown in FIG. 20, the block to which the part that writes to the global variable belongs is specified, and the constant that is referred to by the conditional sentence expanded by the conditional sentence expansion unit 27 is set for each part that writes to the global variable. Sort and output. This makes it possible to identify constant groups that are highly relevant from the viewpoint of the commonality of places where global variables are written. Therefore, it is possible to easily review whether the specified constant group is processed as specified. Therefore, by presenting to the user the existence of two or more constants that must be updated simultaneously according to the conditions of the specification, the user notices where there is a possibility of malfunction due to inconsistent constant change. Can be made.
- the functional configuration of the CPU 11c according to the third embodiment will be described with reference to FIG.
- the CPU 11c according to the third embodiment includes a constant extraction unit 21, a conditional sentence detection unit 22, a block identification unit 25, a conditional sentence development unit 27, an access location identification unit 30, an access block identification unit 31, and a third constant group output unit. 32 functions.
- the constant extraction unit 21, the conditional sentence detection unit 22, the block identification unit 25, and the conditional sentence development unit 27 are the same as those in the first embodiment or the second embodiment, and thus the description thereof is omitted.
- the access location specifying unit 30 specifies a variable to be written and read and a location to access the variable in the source code D01. Specifically, the line number for accessing the variable and whether the access type is writing or reading are specified.
- the access block specifying unit 31 specifies the block to which the location specified by the access location specifying unit 30 belongs from among the blocks specified by the block specifying unit 25. Specifically, the block region to which the row number that accesses the variable belongs is searched from among the block regions specified by the block specifying unit 25.
- the third constant group output unit 32 outputs the conditional statement expanded by the conditional statement expansion unit 27 according to the execution order of the location specified by the access location specifying unit 30 for each variable specified by the access location specifying unit 30. Rearrange. Then, for each variable specified by the access location specifying unit 30, the constants referenced in the conditional statement are classified and output.
- the access location specifying unit 30 executes a “variable write / read specification” process (S13) shown in FIG. Specifically, the line number in which the variable is written and read is specified based on the “variable list (DO7)” in FIG.
- the table of FIG. 22 shows a “variable write and read location list (D14)” that summarizes the results of the above-described variable write and read identification process (S13).
- the line number for accessing the variables vFlag, v, vTemp, temp, and temp2 and the type of access (write or read) are specified.
- the variable read location indicates the location where the variable is on the right side of the arithmetic expression, and the location where the variable is written and the left side of the arithmetic expression.
- the access location identification unit 30 executes the “variable group identification” process (S14) shown in FIG. Specifically, variable access locations are classified for each variable for which both writing and reading are performed. Variables that are only written or read are excluded from the classification.
- the table of FIG. 23 shows a “group list by variable (D15)” that summarizes the results of the above-described variable group identification processing (S14).
- the variables vTemp and temp are both written and read, “1” and “2” are assigned as the third group IDs, respectively.
- the variables vFlag, v, and temp2 are excluded because only one of writing and reading is performed.
- the access block specifying unit 31 executes the “access location specifying” process (S15) shown in FIG. More specifically, the block region to which the line number in which the variable is written and read belongs is specified.
- the line number in which the variable is written and read is specified from the “group list by variable (D15)” in FIG. 23, and the block region is specified from the “block line number list (DO6)” in FIG. .
- the table of FIG. 24 shows a “data flow list (D16)” that summarizes the results of the above-described access location specifying process (S15).
- the line number for accessing the variable, the type of access (write or read), the block region to which the variable belongs, and the expanded conditional statement are classified for each variable.
- the third constant group output unit 32 executes the “second constant division” process (S16) shown in FIG.
- the table of FIG. 25 shows a “constant list by data flow (D17)” that summarizes the results of the second constant dividing process (S16).
- the third constant group output unit 32 is specified by the variable-specific write / read specification process (S13) for each variable vTemp and temp assigned the third group ID in the variable-specific group specification process (S14). Rearrange the expanded conditional statements according to the execution order of the variable access points. Further, constants included in each expanded conditional statement are searched, and the line is divided for each constant.
- the path to the place where the variable is read can be analyzed, and the relationship between writing and reading can be determined for every condition.
- the third constant group output unit 32 outputs the “constant list by data flow (D17)” of FIG. 25 to the user.
- the constants related to the writing and reading processes can be output as a list for each variable, and checked against the writing and reading conditions in the specification.
- the software inspection device extracts constants used in the source code D01 to be inspected, detects a conditional statement that refers to the extracted constant, and expands the detected conditional statement.
- a variable to be written and read a location to access the variable, and a block to which the location belongs are specified.
- the expanded conditional statements are rearranged according to the execution order of the variable access locations for each variable, and the constants referenced in the conditional statements are classified and output.
- a group of constants having high relevance is specified based on the execution order of the locations in the source code D01 that access the variables. Therefore, it is possible to easily review whether the specified constant group is processed as specified. Therefore, by presenting to the user the existence of two or more constants that must be updated simultaneously according to the conditions of the specification, the user notices where there is a possibility of malfunction due to inconsistent constant change. Can be made.
Abstract
Description
[ソフトウェア検査装置のハードウェア構成]
本発明の第1実施形態に係わるソフトウェア検査装置は、例えば車両に搭載される電子制御装置(ECU)により実行されるコンピュータプログラムのソフトウェア検査処理に適用することができる。特に、コンピュータプログラムの仕様の条件によって同時に更新しなければいけない2以上の定数に関する不具合が発生する可能性を検査するものである。 (First embodiment)
[Hardware configuration of software inspection device]
The software inspection apparatus according to the first embodiment of the present invention can be applied to a software inspection process of a computer program executed by an electronic control unit (ECU) mounted on a vehicle, for example. In particular, it examines the possibility of the occurrence of a problem relating to two or more constants that must be updated simultaneously according to the conditions of the computer program specifications.
次に、図3~図16を参照して、本発明の第1実施形態に係わるソフトウェア検査方法の一例として、図1及び図2に示すソフトウェア検査装置によって実行される情報処理の手順を説明する。 [Procedure for information processing executed by software inspection device]
Next, with reference to FIG. 3 to FIG. 16, an information processing procedure executed by the software inspection apparatus shown in FIG. 1 and FIG. 2 will be described as an example of the software inspection method according to the first embodiment of the present invention. .
[ソフトウェア検査装置のハードウェア構成]
第1実施形態では、比較対象となるベース変数の共通性に基づいて関連性の高い定数のグループを特定する例を説明した。第2実施形態では、グローバル変数の書込箇所の共通性に基づいて関連性の高い定数のグループを特定する例を説明する。なお、ソフトウェア検査装置のハードウェア構成は、第1実施形態(図1)と同じであり説明を省略する。 (Second Embodiment)
[Hardware configuration of software inspection device]
In the first embodiment, an example in which a group of constants having high relevance is specified based on commonality of base variables to be compared has been described. In the second embodiment, an example will be described in which a group of constants with high relevance is specified based on the commonality of global variable writing locations. The hardware configuration of the software inspection apparatus is the same as that of the first embodiment (FIG. 1), and the description thereof is omitted.
次に、図3、図4、図18~図20を参照して、本発明の第2実施形態に係わるソフトウェア検査方法の一例として、図1及び図17に示すソフトウェア検査装置によって実行される情報処理の手順を説明する。 [Procedure for information processing executed by software inspection device]
Next, referring to FIG. 3, FIG. 4, FIG. 18 to FIG. 20, information executed by the software inspection apparatus shown in FIG. 1 and FIG. 17 as an example of the software inspection method according to the second embodiment of the present invention. A processing procedure will be described.
第3実施形態では、ソースコードD01の中で変数にアクセスする箇所の実行順序に基づいて関連性の高い定数のグループを特定する例を説明する。なお、ソフトウェア検査装置のハードウェア構成は、第1実施形態(図1)と同じであり説明を省略する。 (Third embodiment)
In the third embodiment, an example will be described in which a group of constants with high relevance is specified based on the execution order of locations in the source code D01 that access variables. The hardware configuration of the software inspection apparatus is the same as that of the first embodiment (FIG. 1), and the description thereof is omitted.
次に、図3、図4、図22~図25を参照して、本発明の第3実施形態に係わるソフトウェア検査方法の一例として、図1及び図21に示すソフトウェア検査装置によって実行される情報処理の手順を説明する。 [Procedure for information processing executed by software inspection device]
Next, referring to FIGS. 3, 4, and 22 to 25, information executed by the software inspection apparatus shown in FIGS. 1 and 21 as an example of the software inspection method according to the third embodiment of the present invention. A processing procedure will be described.
22 条件文検出部
23 ベース変数特定部
24 第1の定数グループ出力部
25 ブロック特定部
26 書込箇所特定部
27 条件文展開部
28 書込ブロック特定部
29 第2の定数グループ出力部
30 アクセス箇所特定部
31 アクセスブロック特定部
32 第3の定数グループ出力部 DESCRIPTION OF
Claims (7)
- コンピュータプログラムを検査するソフトウェア検査装置であって、
検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出する定数抽出部と、
前記コンピュータプログラムの中から、前記定数抽出部により抽出された定数が参照される条件文を検出する条件文検出部と、
前記条件文検出部により検出された条件文の中で前記定数と比較される変数をベース変数として特定するベース変数特定部と、
前記ベース変数特定部により特定されたベース変数毎に、比較対象となる前記定数を分類して出力する第1の定数グループ出力部と、
を備えるソフトウェア検査装置。 A software inspection device for inspecting a computer program,
A constant extraction unit that extracts constants used in the computer program to be inspected;
A conditional statement detection unit for detecting a conditional statement in which the constant extracted by the constant extraction unit is referred to from the computer program;
A base variable identifying unit that identifies a variable to be compared with the constant in the conditional statement detected by the conditional statement detecting unit as a base variable;
A first constant group output unit that classifies and outputs the constants to be compared for each base variable specified by the base variable specifying unit;
Software inspection device comprising: - 前記条件文検出部により検出された条件文が成立する場合に実行される一群のステートメントからなるブロックを特定するブロック特定部と、
前記コンピュータプログラムの中で、グローバル変数に書き込みを行う箇所を特定する書込箇所特定部と、
前記ブロック特定部により特定されたブロックの中から、前記書込箇所特定部により特定された箇所が属する前記ブロックを特定する書込ブロック特定部と、を更に備え、
前記第1の定数グループ出力部は、前記ベース変数毎に、ベース変数が比較される条件文の成立により書き込みが行われるグローバル変数を分類して出力する
ことを特徴とする請求項1に記載のソフトウェア検査装置。 A block specifying unit for specifying a block consisting of a group of statements executed when the conditional statement detected by the conditional statement detecting unit is satisfied;
In the computer program, a writing location specifying unit for specifying a location for writing to a global variable,
A writing block specifying unit for specifying the block to which the location specified by the writing location specifying unit belongs from among the blocks specified by the block specifying unit;
The said 1st constant group output part classify | categorizes and outputs the global variable by which writing is performed by the establishment of the conditional statement with which a base variable is compared for every said base variable, The output of Claim 1 characterized by the above-mentioned. Software inspection device. - 前記第1の定数グループ出力部は、同じ値が書き込まれた状態の前記ベース変数毎に、前記定数を分類することを特徴とする請求項1又は2に記載のソフトウェア検査装置。 3. The software inspection apparatus according to claim 1, wherein the first constant group output unit classifies the constants for each base variable in which the same value is written.
- コンピュータプログラムを検査するソフトウェア検査装置であって、
検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出する定数抽出部と、
前記コンピュータプログラムの中から、前記定数抽出部により抽出された定数が参照される条件文を検出する条件文検出部と、
前記条件文検出部により検出された条件文が成立する場合に実行される一群のステートメントからなるブロックを特定するブロック特定部と、
前記条件文検出部により検出された条件文を展開する条件文展開部と、
前記コンピュータプログラムの中で、グローバル変数に書き込みを行う箇所を特定する書込箇所特定部と、
前記ブロック特定部により特定されたブロックの中から、前記書込箇所特定部により特定された箇所が属する前記ブロックを特定する書込ブロック特定部と、
前記グローバル変数に書き込みを行う箇所毎に、前記条件文展開部により展開された条件文で参照される定数を分類して出力する第2の定数グループ出力部と、
を備えるソフトウェア検査装置。 A software inspection device for inspecting a computer program,
A constant extraction unit that extracts constants used in the computer program to be inspected;
A conditional statement detection unit for detecting a conditional statement in which the constant extracted by the constant extraction unit is referred to from the computer program;
A block specifying unit for specifying a block consisting of a group of statements executed when the conditional statement detected by the conditional statement detecting unit is satisfied;
A conditional statement expansion unit that expands the conditional statement detected by the conditional statement detection unit;
In the computer program, a writing location specifying unit for specifying a location for writing to a global variable,
From among the blocks specified by the block specifying unit, a writing block specifying unit for specifying the block to which the location specified by the writing location specifying unit belongs,
A second constant group output unit that categorizes and outputs constants referred to in the conditional statement expanded by the conditional statement expansion unit for each portion where the global variable is written;
Software inspection device comprising: - コンピュータプログラムを検査するソフトウェア検査装置であって、
検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出する定数抽出部と、
前記コンピュータプログラムの中から、前記定数抽出部により抽出された定数が参照される条件文を検出する条件文検出部と、
前記条件文検出部により検出された条件文が成立する場合に実行される一群のステートメントからなるブロックを特定するブロック特定部と、
前記条件文検出部により検出された条件文を展開する条件文展開部と、
前記コンピュータプログラムの中で、書き込み及び読み出しが行われる変数、及び当該変数にアクセスする箇所を特定するアクセス箇所特定部と、
前記ブロック特定部により特定されたブロックの中から、前記アクセス箇所特定部により特定された箇所が属する前記ブロックを特定するアクセスブロック特定部と、
前記アクセス箇所特定部により特定された変数毎に、前記アクセス箇所特定部により特定された箇所の実行順序に従って、前記条件文展開部により展開された条件文を並べ替え、且つ当該条件文の中で参照される定数を分類して出力する第3の定数グループ出力部と、
を備えるソフトウェア検査装置。 A software inspection device for inspecting a computer program,
A constant extraction unit that extracts constants used in the computer program to be inspected;
A conditional statement detection unit for detecting a conditional statement in which the constant extracted by the constant extraction unit is referred to from the computer program;
A block specifying unit for specifying a block consisting of a group of statements executed when the conditional statement detected by the conditional statement detecting unit is satisfied;
A conditional statement expansion unit that expands the conditional statement detected by the conditional statement detection unit;
In the computer program, a variable to be written and read, and an access location identifying unit that identifies a location to access the variable,
An access block identifying unit that identifies the block to which the location identified by the access location identifying unit belongs, among the blocks identified by the block identifying unit;
For each variable specified by the access location specifying unit, the conditional statements expanded by the conditional statement expansion unit are rearranged in accordance with the execution order of the location specified by the access location specifying unit, and in the conditional statement A third constant group output unit for classifying and outputting the referenced constants;
Software inspection device comprising: - コンピュータプログラムを検査するソフトウェア検査方法であって、
検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出し、
前記コンピュータプログラムの中から、抽出された定数が参照される条件文を検出し、
検出された条件文の中で前記定数と比較される変数をベース変数として特定し、
特定されたベース変数毎に、比較対象となる前記定数を分類して出力する
ことを特徴とするソフトウェア検査方法。 A software inspection method for inspecting a computer program,
Extract constants used in the computer program to be inspected,
Detecting a conditional statement in which the extracted constant is referenced from the computer program;
In the detected conditional statement, specify a variable to be compared with the constant as a base variable,
A software inspection method for classifying and outputting the constants to be compared for each specified base variable. - コンピュータプログラムを検査するためのソフトウェア検査プログラムであって、
コンピュータに、
検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出する機能と、
前記コンピュータプログラムの中から、抽出された定数が参照される条件文を検出する機能と、
検出された条件文の中で前記定数と比較される変数をベース変数として特定する機能と、
特定されたベース変数毎に、比較対象となる前記定数を分類して出力する機能と、
を実現させることを特徴とするソフトウェア検査プログラム。 A software inspection program for inspecting a computer program,
On the computer,
A function of extracting constants used in the computer program to be inspected;
A function for detecting a conditional statement in which the extracted constant is referenced from the computer program;
A function for specifying a variable to be compared with the constant in the detected conditional statement as a base variable;
A function for classifying and outputting the constants to be compared for each identified base variable;
A software inspection program characterized by realizing the above.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201480051482.1A CN105556484B (en) | 2013-07-19 | 2014-06-19 | Software check device, software inspection method |
JP2015527227A JP6004110B2 (en) | 2013-07-19 | 2014-06-19 | Software inspection device, software inspection method, software inspection program |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013150225 | 2013-07-19 | ||
JP2013-150225 | 2013-07-19 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015008575A1 true WO2015008575A1 (en) | 2015-01-22 |
Family
ID=52346048
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2014/066318 WO2015008575A1 (en) | 2013-07-19 | 2014-06-19 | Software inspection device, software inspection method, and software inspection program |
Country Status (3)
Country | Link |
---|---|
JP (1) | JP6004110B2 (en) |
CN (1) | CN105556484B (en) |
WO (1) | WO2015008575A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018049565A (en) * | 2016-09-23 | 2018-03-29 | 株式会社東芝 | System for software verification and software verification method |
JP7318516B2 (en) | 2019-03-08 | 2023-08-01 | 富士通株式会社 | Generating input for computer readable program inspection |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03292531A (en) * | 1990-04-11 | 1991-12-24 | Nissan Motor Co Ltd | Back-up device for development of program |
JP2000181700A (en) * | 1998-12-18 | 2000-06-30 | Fujitsu Ltd | Program analyzing device and recording medium |
US6151701A (en) * | 1997-09-30 | 2000-11-21 | Ahpah Software, Inc. | Method for reconstructing debugging information for a decompiled executable file |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3305949B2 (en) * | 1996-02-08 | 2002-07-24 | 富士通株式会社 | Program analyzer |
US7797690B2 (en) * | 2005-03-15 | 2010-09-14 | International Business Machines Corporation | System, method and program product to optimize code during run time |
JP5204300B2 (en) * | 2009-04-28 | 2013-06-05 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Method for converting program code of program operating on multithread to program code with less lock collision, and computer program and computer system thereof |
-
2014
- 2014-06-19 WO PCT/JP2014/066318 patent/WO2015008575A1/en active Application Filing
- 2014-06-19 CN CN201480051482.1A patent/CN105556484B/en active Active
- 2014-06-19 JP JP2015527227A patent/JP6004110B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03292531A (en) * | 1990-04-11 | 1991-12-24 | Nissan Motor Co Ltd | Back-up device for development of program |
US6151701A (en) * | 1997-09-30 | 2000-11-21 | Ahpah Software, Inc. | Method for reconstructing debugging information for a decompiled executable file |
JP2000181700A (en) * | 1998-12-18 | 2000-06-30 | Fujitsu Ltd | Program analyzing device and recording medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018049565A (en) * | 2016-09-23 | 2018-03-29 | 株式会社東芝 | System for software verification and software verification method |
JP7318516B2 (en) | 2019-03-08 | 2023-08-01 | 富士通株式会社 | Generating input for computer readable program inspection |
Also Published As
Publication number | Publication date |
---|---|
CN105556484B (en) | 2018-02-02 |
JP6004110B2 (en) | 2016-10-05 |
JPWO2015008575A1 (en) | 2017-03-02 |
CN105556484A (en) | 2016-05-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9772927B2 (en) | User interface for selecting tracing origins for aggregating classes of trace data | |
Kapser et al. | Toward a taxonomy of clones in source code: A case study | |
US10346292B2 (en) | Software component recommendation based on multiple trace runs | |
CN107766236B (en) | Test task automatic management method, device, equipment and storage medium | |
CN110741354A (en) | Presenting differences between code entity invocations | |
US20080052299A1 (en) | Reverse engineering support system | |
KR101979329B1 (en) | Method and apparatus for tracking security vulnerable input data of executable binaries thereof | |
JP6004110B2 (en) | Software inspection device, software inspection method, software inspection program | |
CN111736865B (en) | Database upgrading method and system | |
CN113312332A (en) | Model training method and system based on block chain and cloud computing | |
US20190354468A1 (en) | Code coverage module with testing function identifier | |
Kamiya | An execution-semantic and content-and-context-based code-clone detection and analysis | |
CN106407246B (en) | SQL execution plan management method and device | |
JP5963312B2 (en) | Information processing apparatus, information processing method, and program | |
Prazina et al. | Methods for Automatic Web Page Layout Testing and Analysis: A Review | |
JP5967225B2 (en) | Data update omission inspection device, data update omission inspection method, data update omission inspection program | |
EP3692456B1 (en) | Binary image stack cookie protection | |
EP3699798A1 (en) | Security design planning support device | |
KR101583133B1 (en) | Method for evaluating software similarity using stack and apparatus therefor | |
WO2014112316A1 (en) | Flag-access-problem review device, flag-access-problem review method, and flag-access-problem review program | |
US9852046B1 (en) | Method and system for automated debugging memory allocation and memory release | |
US10489428B2 (en) | Existing system processing specification extractor | |
JP2015133031A (en) | Program analyzer and program analysis method | |
KR102339498B1 (en) | Method for collecting code context to improve bug detection rules | |
Xu | Using Co-evolution of Artefacts in Git Repository to Establish Test-to-Code Traceability Links on Method-Level |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
WWE | Wipo information: entry into national phase |
Ref document number: 201480051482.1 Country of ref document: CN |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14825743 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2015527227 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 14825743 Country of ref document: EP Kind code of ref document: A1 |