WO2015008575A1 - Software inspection device, software inspection method, and software inspection program - Google Patents

Software inspection device, software inspection method, and software inspection program Download PDF

Info

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
Application number
PCT/JP2014/066318
Other languages
French (fr)
Japanese (ja)
Inventor
智 市川
Original Assignee
日産自動車株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日産自動車株式会社 filed Critical 日産自動車株式会社
Priority to CN201480051482.1A priority Critical patent/CN105556484B/en
Priority to JP2015527227A priority patent/JP6004110B2/en
Publication of WO2015008575A1 publication Critical patent/WO2015008575A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3608Software 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

A software inspection device extracts a constant which is employed in a computer program which is to be inspected (S01), and detects a conditional expression wherein the extracted constant (S02) is referred to. A variable which is compared with the constant in the conditional expression is specified as a base variable (S03), and the constant to be compared is classified and outputted for each base variable (S04).

Description

ソフトウェア検査装置、ソフトウェア検査方法、ソフトウェア検査プログラムSoftware inspection device, software inspection method, software inspection program
 本発明は、ソフトウェア検査装置、ソフトウェア検査方法、ソフトウェア検査プログラムに関するものである。 The present invention relates to a software inspection device, a software inspection method, and a software inspection program.
 従来から、プログラミング言語で記述されたソースプログラムにおける制御の流れやデータの流れを、そのソースプログラムを実行すること無しに解析する、静的解析方法が知られている(特許文献1参照)。 Conventionally, 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).
特開平09-282173号公報JP 09-282173 A
 ところで、ソフトウェアの処理において仕様の変更が生じた場合、仕様の条件によって同時に更新しなければいけない2以上の定数が存在するケースがある。しかし、ソフトの仕様に関連性のある定数の仕様が記載されていない場合、設計者がその一部の定数しか変更しなかったために不具合に陥るケースが存在する。 By the way, there are cases where there are two or more constants that must be updated at the same time depending on the conditions of the specification when the specification changes in software processing. However, when the specification of the constant related to the software specification is not described, there is a case where the designer falls into trouble because only a part of the constant is changed.
 特許文献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 according to one aspect of the present invention 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.
図1は、本発明の第1実施形態に係わるソフトウェア検査装置のハードウェア構成を示すブロック図である。FIG. 1 is a block diagram showing a hardware configuration of the software inspection apparatus according to the first embodiment of the present invention. 図2は、第1実施形態に係わるCPU11aの機能的構成を示すブロック図である。FIG. 2 is a block diagram showing a functional configuration of the CPU 11a according to the first embodiment. 図3は、本発明の第1~第3の実施形態に係わるソフトウェア検査装置によって実行される情報処理の流れ及び情報処理の途中で生成される中間データを示すデータフロー図である。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. 図4は、図3の続きを示すデータフロー図である。FIG. 4 is a data flow diagram showing a continuation of FIG. 図5(a)、(b)は、検査対象となるソースコードD01として、C言語で記述されたコンピュータプログラムの一例を示す図である。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. 図6は、定数抽出処理(S01)の結果をまとめた「定数一覧(DO2)」を示す表である。FIG. 6 is a table showing a “constant list (DO2)” that summarizes the results of the constant extraction process (S01). 図7は、条件文検出処理(S02)の結果をまとめた「条件文一覧(DO3)」を示す表である。FIG. 7 is a table showing a “conditional sentence list (DO3)” that summarizes the results of the conditional sentence detection process (S02). 図8は、ベース変数特定処理(S03)の結果をまとめた「ベース変数一覧(DO4)」を示す表である。FIG. 8 is a table showing a “base variable list (DO4)” that summarizes the results of the base variable specifying process (S03). 図9は、定数グループ特定処理(S04)の結果をまとめた「定数グループ一覧(DO5)」を示す表である。FIG. 9 is a table showing a “constant group list (DO5)” that summarizes the results of the constant group specifying process (S04). 図10は、同じベース変数と比較されているが、同じ値が書き込まれた状態で比較されていないため、同じグループとして分類しないプログラム例を示す図である。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. 図11は、図5(b)のプログラム例において特定されたブロックB01~B05を示す図である。FIG. 11 is a diagram showing the blocks B01 to B05 specified in the program example of FIG. 図12は、ブロック特定処理(S05)の結果をまとめた「ブロック行数一覧(DO6)」を示す表である。FIG. 12 is a table showing a “block row number list (DO6)” that summarizes the results of the block specifying process (S05). 図13は、変数特定処理(S06)の結果をまとめた「変数一覧(DO7)」を示す表である。FIG. 13 is a table showing a “variable list (DO7)” that summarizes the results of the variable identification process (S06). 図14は、上記したグローバル変数特定処理(S07)の結果をまとめた「グローバル変数一覧(DO8)」を示す表である。FIG. 14 is a table showing a “global variable list (DO8)” in which the results of the global variable specifying process (S07) are summarized. 図15は、グローバル変数書込、読込箇所特定処理(S08)の結果をまとめた「グローバル変数書込、読込箇所一覧(DO9)」を示す表である。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). 図16は、第1のグローバル変数書込箇所特定処理(S09)の結果をまとめた「グループ別パラメータ一覧(D10)」を示す表である。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. 図17は、第2実施形態に係わるCPU11bの機能的構成を示すブロック図である。FIG. 17 is a block diagram illustrating a functional configuration of the CPU 11b according to the second embodiment. 図18は、条件文展開処理(S10)の結果をまとめた「条件文展開一覧(D11)」を示す表である。FIG. 18 is a table showing a “conditional sentence expansion list (D11)” that summarizes the results of the conditional sentence expansion process (S10). 図19は、上記した第2のグローバル変数書込箇所特定処理(S11)の結果をまとめた「グローバル変数書込箇所一覧(D12)」を示す表である。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. 図20は、第1の定数分割処理(S12)の結果をまとめた「条件文内定数一覧(D13)」を示す表である。FIG. 20 is a table showing a “constant statement constant list (D13)” that summarizes the results of the first constant division process (S12). 図21は、第3実施形態に係わるCPU11cの機能的構成を示すブロック図である。FIG. 21 is a block diagram illustrating a functional configuration of the CPU 11c according to the third embodiment. 図22は、変数別書込、読込特定処理(S13)の結果をまとめた「変数別書込、読込箇所一覧(D14)」を示す表である。FIG. 22 is a table showing a “variable write / read list (D14)” that summarizes the results of the variable write / read specification process (S13). 図23は、上記した変数別グループ特定処理(S14)の結果をまとめた「変数別グループ一覧(D15)」を示す表である。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). 図24は、アクセス箇所特定処理(S15)の結果をまとめた「データフロー一覧(D16)」を示す表である。FIG. 24 is a table showing a “data flow list (D16)” that summarizes the results of the access location specifying process (S15). 図25は、上記した第2の定数分割処理(S16)の結果をまとめた「データフロー別定数一覧(D17)」を示す表である。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.
 図面を参照して、本発明の実施形態を説明する。図面の記載において同一部分には同一符号を付し説明を省略する。 Embodiments of the present invention will be described with reference to the drawings. In the description of the drawings, the same parts are denoted by the same reference numerals and description thereof is omitted.
(第1実施形態)
[ソフトウェア検査装置のハードウェア構成]
 本発明の第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.
 図1を参照して、本発明の第1実施形態に係わるソフトウェア検査装置のハードウェア構成を説明する。ソフトウェア検査装置のハードウェア構成として、汎用のコンピュータを用いることができる。例えば、ソフトウェア検査装置は、入出力装置12と、記憶装置14と、CPU(中央処理装置)11と、入力装置13と、表示装置15とを備える。入出力装置12は、記憶媒体から検査対象のコンピュータプログラム(ソースコードD01)を読み込む。記憶装置14は、入出力装置12で読み込んだソースコードD01や解析の中間データを格納する。CPU(中央処理装置)11は、各種演算を実行してソースコードD01を解析する。入力装置13は、ユーザが解析に必要な情報を入力するための装置である。表示装置15は、CPU11から出力される検査結果を表示する。検査結果は、入出力装置12を用いて記憶媒体に書き込むことも可能である。 Referring to FIG. 1, the hardware configuration of the software inspection apparatus according to the first embodiment of the present invention will be described. A general-purpose computer can be used as the hardware configuration of the software inspection apparatus. For example, 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.
 或いは、ソフトウェア検査装置は、クライアントサーバモデルとしても実現可能である。例えば、汎用のパーソナルコンピュータ(クライアント)をコンピュータネットワークを介してサーバに接続する。これにより、図1に示すCPU11を備えるサーバを、コンピュータネットワークを介して、入出力装置12、入力装置13、記憶装置14、或いは表示装置15に接続することができる。この場合、ソフトウェア検査装置は、主にCPU11(サーバ)により構成され、入出力装置12、入力装置13、記憶装置14、或いは表示装置15はソフトウェア検査装置に含まれない。 Alternatively, the software inspection device can be realized as a client-server model. For example, a general-purpose personal computer (client) is connected to the server via a computer network. Accordingly, 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. In this case, 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.
 図2を参照して、図1のCPU11の機能的構成を説明する。CPU11を備えるコンピュータをソフトウェア検査装置として機能させるためのコンピュータプログラム(ソフトウェア検査プログラム)を、CPU11を備えるコンピュータにインストールして実行する。これにより、CPU11は、以下に示す各情報処理部として機能する。なお、ここでは、ソフトウェアによってソフトウェア検査装置を実現する例を示すが、もちろん、以下に示す各情報処理を実行するための専用のハードウェアを用意して、ソフトウェア検査装置を構成することも可能である。 The functional configuration of the CPU 11 in FIG. 1 will be described with reference to FIG. 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. Thereby, CPU11 functions as each information processing part shown below. Although an example in which 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.
 第1実施形態に係わるCPU11aは、定数抽出部21、条件文検出部22、ベース変数特定部23、及び第1の定数グループ出力部24として機能する。 The CPU 11a according to the first embodiment 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.
 定数抽出部21は、検査対象となるコンピュータプログラムの中で用いられる定数を抽出する。定数は、プログラミングにおいて特定の値に名前をつけたものであって、変数と異なり、宣言時に決めた値をコードの中で後から変更することができない。但し、定数は、コンピュータプログラムの仕様が変更した場合、仕様の条件によって同時に変更される場合がある。例えばC言語の場合、定数抽出部21は、「#define」或いは「const」で定義された宣言の識別子を特定して、定数を抽出する。定数抽出部21は、予め、「#define」及び「const」による定義パターンの情報を保持し、定義パターンに示した定義に適合する定数を検出する。 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. However, the constant may be changed at the same time depending on the specification conditions when the specification of the computer program is changed. For example, in the case of C language, 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.
 条件文検出部22は、コンピュータプログラムの中から、定数抽出部21により抽出された定数が参照される条件文を検出する。条件文検出部22は、例えば、コンピュータプログラムに含まれるif(条件式)、else(条件式)、switch(条件式)のうち、定数抽出部21により抽出された定数が比較されている条件式を検出する。 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.
 ベース変数特定部23は、条件文検出部22により検出された条件文の中で、定数抽出部21により抽出された定数と比較される変数をベース変数として特定する。 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.
 第1の定数グループ出力部24は、ベース変数特定部23により特定されたベース変数毎に、比較対象となる定数を分類して出力する。具体的には、定数抽出部21により抽出された2以上の定数が同じベース変数と比較されている場合、この2以上の定数を1つのグループとして分類する。第1の定数グループ出力部24は、この定数のグループ分けを、ベース変数毎に実施する。同じベース変数と比較されている2以上の定数は、コンピュータプログラムの仕様上、関連の深い定数同士といえる。よって、第1の定数グループ出力部24は、同じベース変数と比較されている2以上の定数を、CPU11から出力される検査結果として、例えば表示装置15に表示したり、入出力装置12を用いて記憶媒体に書き込む。これにより、仕様の条件によって同時に更新しなければいけない2以上の定数の存在をユーザに提示して、定数の変更の一貫性が保たれていないために不具合が生じる可能性がある箇所をユーザに気づかせることができる。 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.
 なお、第1の定数グループ出力部24は、同じ値が書き込まれた状態のベース変数毎に、定数を分類してもよい。同じ変数であっても異なる値が書き込まれた状態で2以上の定数と比較されていれば、この2以上の定数の仕様上の関連性は低い。 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.
 CPU11aは、ブロック特定部25、書込箇所特定部26、及び書込ブロック特定部28として更に機能する。 The CPU 11a further functions as a block specifying unit 25, a writing location specifying unit 26, and a writing block specifying unit 28.
 ブロック特定部25は、条件文検出部22により検出された条件文が成立する場合に実行される一群のステートメントからなるブロックを特定する。「ステートメント」とは、ソースコード上の1行ごとの処理単位のことである。ブロックは、例えばC言語の場合、if文又はswitch文の条件判断後のブラケット“{”と“}”で囲まれた範囲を指す。具体的に、ブロック特定部25は、ブラケット“{”と“}”で囲まれた部分の行番号を特定する。 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. For example, in the case of C language, the block indicates a range surrounded by brackets “{” and “}” after the condition determination of the if statement or the switch statement. Specifically, the block specifying unit 25 specifies the line number of the portion surrounded by brackets “{” and “}”.
 書込箇所特定部26は、コンピュータプログラムの中で、グローバル変数に書き込みを行う箇所を特定する。具体的に、コンピュータプログラムの中で定義されているグローバル変数を抽出し、抽出されたグローバル変数に対して書込が行われている箇所(例えば行番号)を特定する。グローバル変数に書き込んでいる箇所とは算術式の左辺にグローバル変数が登場している箇所である。 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.
 書込ブロック特定部28は、ブロック特定部25により特定されたブロックの中から、書込箇所特定部26により特定された箇所が属するブロックを特定する。具体的には、グローバル変数に対して書込が行われている行番号が、ブロックの始点(行番号)から終点(行番号)までの間に含まれている場合、当該ブロックを特定する。 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.
 第1の定数グループ出力部24は、ベース変数毎に、ベース変数が比較される条件文の成立により書き込みが行われるグローバル変数を分類して出力する。グローバル変数の書き込みが行われる箇所の関連から仕様上のつながりの強い定数が存在する。そこで、書き込まれているグローバル変数と照らし合わせて、仕様通りの処理がされているかをレビューすることが望ましい。そこで、第1実施形態では、第1の定数グループ出力部24が、ベース変数毎に、ベース変数と比較される定数を分類するのみならず、当該定数が参照される条件文の成立により実行されるブロックの中で書き込みが行われるグローバル変数をも分類して出力する。 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.
[ソフトウェア検査装置により実行される情報処理の手順]
 次に、図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. .
 先ず、CPU11は、検査対象となるソースコードD01を入出力装置12から読み込む。なお、ソースコードD01は、予め入出力装置12を用いてユーザによりソフトウェア検査装置内に読み込まれ、記憶装置14に格納されていてもよい。図5(a)、(b)は、読み込まれたソースコードD01として、C言語で記述されたコンピュータプログラムの一例を示す。検査対象となるコンピュータプログラムは、図5(a)、(b)に示す2つのファイルに跨って記述されている。図5(a)のファイル名は「sample1.c」であり、図5(b)のファイル名は「sample2.c」である。C言語で記述されたプログラムの一例において、各ファイルの左端部に記載された1から始まる連続番号は、各ステートメントの「行番号」を示す。 First, the CPU 11 reads the source code D01 to be inspected from the input / output device 12. The source code D01 may be read in advance into the software inspection device by the user using the input / output device 12 and stored in the storage device 14. 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”. In an example of a program written in the C language, a serial number starting from 1 written at the left end of each file indicates the “line number” of each statement.
 定数抽出部21は、図3に示す「定数抽出」処理(S01)を実行する。定数抽出部21は、ソースコードD01の中から、「#define」及び「const」による定義パターンに適合する定数を検出する。図5のプログラム例では、プログラムの2行目から5行目までに#defineで定義された定数、CC1, CC2, CC3, CC4があるため、これを定数として検出する。同時に、それぞれの定数の定義の値も検出する。図6の表は、上記した定数抽出処理(S01)の結果をまとめた「定数一覧(DO2)」を示す。 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. In the program example of FIG. 5, 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. At the same time, 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).
 条件文検出部22は、図3に示す「条件文検出」処理(S02)を実行する。コンピュータプログラムに含まれるif(条件式)、else(条件式)、else if(条件式)、switch(条件式)のうち、定数抽出部21により抽出された定数が比較されている条件式を検出する。 The 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.
条件文検出部22は、ソースコードD01の中から、定数抽出部21により抽出されたCC1, CC2, CC3, CC4が参照される条件文を検出する。図7の表は、上記した条件文検出処理(S02)の結果をまとめた「条件文一覧(DO3)」を示す。ここでは、条件文そのもの及び条件文の行番号を抽出する。 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. Here, the conditional statement itself and the line number of the conditional statement are extracted.
 ベース変数特定部23は、図3に示す「ベース変数特定」処理(S03)を実行する。ベース変数特定部23は、S03で検出された条件文の中で、S01で抽出された定数と比較される変数をベース変数として特定する。図8の表は、上記したベース変数特定処理(S03)の結果をまとめた「ベース変数一覧(DO4)」を示す。図5のプログラム例では、定数CC1, CC2, CC3, CC4が変数v, v1, vFlagの変数群と比較されているため、これらの変数をベース変数として検出している。1つの条件文から2以上のベース変数(v, v1)が特定される場合に、ベース変数毎に、条件文及び比較対象となる定数を特定している。 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). In the program example of FIG. 5, 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. When two or more base variables (v, v1) are specified from one conditional statement, the conditional statement and a constant to be compared are specified for each base variable.
 第1の定数グループ出力部24は、S03で特定されたベース変数を元に、図3に示す「定数グループ特定」処理(S04)を実行する。具体的には、S01で抽出された2以上の定数が同じベース変数と比較されている場合、この2以上の定数を1つのグループとして分類する。図9の表は、上記した定数グループ特定処理(S04)の結果をまとめた「定数グループ一覧(DO5)」を示す。図5のプログラム例では、定数CC1はベース変数vと同じ変数で比較されているため、これを一つのグループとして、第1のグループIDとして「1」を付す。また、定数CC2及びCC3も同じベース変数v1と比較されているため、第1のグループIDとして「2」を付す。定数CC4及びCC2も同じベース変数vFlagと比較されているため、第1のグループIDとして「3」を付す。このように同じ第1のグループIDが付された定数は仕様上関連の深い定数同士であることを明示することができる。 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). In the example of the program of FIG. 5, 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. Since the constants CC4 and CC2 are also compared with the same base variable vFlag, “3” is assigned as the first group ID. In this way, it can be clearly shown that the constants assigned with the same first group ID are constants closely related in the specification.
 なお、第1の定数グループ出力部24は、同じベース変数であっても異なる値が書き込まれている状態であれば、同じグループとして分類しない。例えば、図10に示すように、ベース変数“a”の値は前の条件文(行番号:1)から次の条件文(行番号:4)までの間に値が書き換わるため、仕様上の関連性が低い。そのため、CC1とCC2は同じベース変数“a”で比較されているが、同じ値が書き込まれた状態でベース変数“a”と比較されていないため、同じグループとして扱わない。 Note that 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. For example, as shown in FIG. 10, 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.
 次に、ブロック特定部25は、図3に示す「ブロック特定」処理(S05)を実行する。具体的には、ブロック特定部25は、S02で検出された条件文が成立する場合に実行されるブロックを特定する。詳細には、ブロックの始点となる行番号及び終点となる行番号を特定する。図11は、図5(b)のプログラム例において特定されたブロックB01~B05を示す。図12の表は、上記したブロック特定処理(S05)の結果をまとめた「ブロック行数一覧(DO6)」を示す。図12では、図9に示す定数グループ一覧(DO5)に対して、特定されたブロックの行番号(ブロックリージョン)を付加している。 Next, the block specifying unit 25 executes a “block specifying” process (S05) shown in FIG. Specifically, the block specifying unit 25 specifies a block to be executed when the conditional sentence detected in S02 is satisfied. Specifically, 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. In FIG. 12, the row number (block region) of the identified block is added to the constant group list (DO5) shown in FIG.
 書込箇所特定部26は、図3に示す「変数特定」処理(S06)を実行する。具体的には、ソースコードD01の中で定義されている変数を抽出する。図13の表は、上記した変数特定処理(S06)の結果をまとめた「変数一覧(DO7)」を示す。書込箇所特定部26は、変数としてグローバル変数及びローカル変数を抽出する。図5のプログラム例では、グローバル変数としてvFlag, vTemp、ローカル変数としてtemp, temp2が抽出される。 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.
 書込箇所特定部26は、図3に示す「グローバル変数特定」処理(S07)を実行する。具体的には、S06で抽出された変数の中から、グローバル変数を抽出する。図14の表は、上記したグローバル変数特定処理(S07)の結果をまとめた「グローバル変数一覧(DO8)」を示す。図5のプログラム例では、グローバル変数としてvFlag, vTempが抽出される。 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. In the program example of FIG. 5, vFlag and vTemp are extracted as global variables.
 書込箇所特定部26は、図3に示す「グローバル変数書込、読込箇所特定」処理(S08)を実行する。具体的には、抽出されたグローバル変数に対して書込が行われている行番号を特定する。図15の表は、上記したグローバル変数書込、読込箇所特定処理(S08)の結果をまとめた「グローバル変数書込、読込箇所一覧(DO9)」を示す。図5のプログラム例では、グローバル変数vFlagに対して16行目で書込を行い、31行目で読込を行っている。グローバル変数vTempに対して19行目、23行目、26行目で書込を行い、33行目で読込を行っている。 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). In the program example of FIG. 5, 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.
 第1の定数グループ出力部24は、図4に示す「第1のグローバル変数書込箇所特定」処理(S09)を実行する。具体的には、ベース変数毎に、ベース変数が比較される条件文の成立により書き込みが行われるグローバル変数を分類して出力する。図16の表は、上記した第1のグローバル変数書込箇所特定処理(S09)の結果をまとめた「グループ別パラメータ一覧(D10)」を示す。図16では、図12に示す「ブロック行数一覧(DO6)」に対して、特定されたブロックの行番号(ブロックリージョン)を付加している。 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. In FIG. 16, the row number (block region) of the identified block is added to the “block row number list (DO6)” shown in FIG.
 例えば、vTemp = 1;というグローバル変数書込個所はsample1.cファイルの19行目であるため、この行番号が属するグループを図12の「ブロック行数一覧(DO6)」の中のブロックリージョンで検索する。その結果、ブロックリージョン“18-20”に該当すると判断できる。 For example, since the global variable writing location vTemp = 1; is the 19th line of the sample1.c file, 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”.
 図16に示すように、第1のグループID1で分類されるベース変数「v」は、行番号17及び21の条件文において定数CC1と比較され、行番号17及び21の条件文のブロックでは、グローバル変数vTempに1及び2の書込が行われている、ことが分かる。第1のグループID2で分類されるベース変数「v1」についても同様である。一方、第1のグループID3で分類されるベース変数「vFlag」については、定数CC4, CC2と比較されているが、グローバル変数への書込が行われていない。 As shown in FIG. 16, 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. On the other hand, 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.
 以上説明したように、本発明の第1実施形態によれば、以下の作用効果が得られる。 As described above, according to the first embodiment of the present invention, the following operational effects can be obtained.
 コンフィグレーションパラメータの設定や、キャリブレーションパラメータの設定の例に取り、定数の関連性を検証する必要性についてを示す。先ずは、コンフィグレーションパラメータの例について説明する。本来、インテリジェントキーとイモビライザーの機能は同時にオン或いはオフを設定しなければならない。しかし、設計者がそのことに気付いておらず、片方しか変更していない場合がある。例えば、設計者は仕様がそもそもインテリジェントキーとイモビライザーの機能は独立となっていると勘違いしている場合がある。この場合、単体テストなどの下流のテストにおいて、片方しか変更していないことを発見することができず、これによる不具合につながる。 ∙ The necessity of verifying the relevance of constants is shown by taking examples of configuration parameter settings and calibration parameter settings. First, an example of 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.
 次に、キャリブレーションパラメータの例について説明する。外部の光量を検出し、検出値に応じて車両に搭載されたライトのオン或いはオフを制御する場合がある。この場合、通常、外部の光量の検出値にヒステリシスを持たせ、ライトのオン・オフの繰り返しによる煩雑さを軽減している。ヒステリシスを変更する場合は制御対象の特性を考え、上限値と下限値を同時に更新しなければならない。しかし、設計者がそのことに気づいていない場合、片方の値しか変更せずに、不具合を発生させてしまう。 Next, an example of calibration parameters will be described. There is a case where an external light amount is detected and on / off of a light mounted on the vehicle is controlled according to a detected value. In this case, normally, the detected value of the external light quantity is provided with hysteresis to reduce the troublesomeness caused by repeated turning on / off of the light. When changing the hysteresis, the upper and lower limits must be updated at the same time considering the characteristics of the controlled object. However, if the designer is not aware of this, only one value is changed, causing a problem.
 このように、本来は2以上の定数を同時に更新しなければならない仕様であるのに、ソフトウェアの定数は個別に設定はできるため、一部の値しか変更せず、不具合が流出してしまう場合がある。すなわち、定数の関連性を検証が必要となる。 In this way, although it is originally a specification that must update two or more constants at the same time, software constants can be set individually, so only a part of the values can be changed, causing problems to flow out There is. In other words, it is necessary to verify the relevance of constants.
 そこで、第1実施形態に係わるソフトウェア検査装置は、検査対象となるソースコードD01の中で用いられる定数を抽出し、抽出された定数が参照される条件文を検出する。検出された条件文の中で定数と比較される変数をベース変数として特定し、特定されたベース変数毎に、比較対象となる定数を分類して出力する。これにより、図9に示すように、同じベース変数と比較される定数を分類して出力されるので、ベース変数の共通性という観点から関連性が高い定数群を特定できる。よって、特定された定数群について仕様通りの処理がされているかを容易にレビューすることができる。したがって、仕様の条件によって同時に更新しなければいけない2以上の定数の存在をユーザに提示して、定数の変更の一貫性が保たれていないために不具合が生じる可能性がある箇所をユーザに気づかせることができる。 Therefore, the software inspection apparatus according to the first embodiment 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. As a result, as shown in FIG. 9, 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.
 ソフトウェア検査装置は、検出された条件文が成立する場合に実行されるブロックを特定し、コンピュータプログラムの中でグローバル変数に書き込みを行う箇所を特定する。そして、特定されたブロックの中から、グローバル変数に書き込みを行う箇所が属するブロックを特定し、ベース変数毎に、ベース変数が比較される条件文の成立により書き込みが行われるグローバル変数を分類して出力する。これにより、図16に示すように、グローバル変数の書き込み箇所の関連から仕様上のつながりの強い定数の存在をユーザに提示することができる。ユーザは、書き込まれているグローバル変数と照らし合わせて、仕様通りの処理がされているかレビューすることができる。 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.
 第1の定数グループ出力部24は、同じ値が書き込まれた状態のベース変数毎に、定数を分類する。つまり、同じベース変数であっても異なる値が書き込まれている状態であれば、同じグループとして分類しない。これにより、関連性が高い定数群を更に精度良く特定できる。 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.
 このように、設計の段階から仕様として処理が抜けている場合や、仕様に定義されていても、単体テストが実施できないようなプログラムの構造の場合、書込処理抜けの不具合を抑制することができる。また、膨大なソースコードから、人の目で判断できない定数変更の一貫性が保たれていないことをユーザに気づかせることができる。また、ソフトウェアプロセスで使用されているテスト(単体テスト、結合テスト、システムテスト)で見つけられないような定数変更一貫性が保たれていないプログラムのバグを未然に防ぐことができる。更に、従来の静的解析ツールでは特定できなかった定数の変更の一貫性が保たれていない箇所を見つることができる。 In this way, if the process is missing as a specification from the design stage, or if it is a program structure that cannot be unit tested even if it is defined in the specification, it is possible to suppress defects in the writing process. . In addition, it is possible to make the user aware that the consistency of constant changes that cannot be determined by human eyes is not maintained from a huge amount of source code. In addition, it is possible to prevent bugs in programs that do not have constant change consistency that cannot be found in tests (unit tests, integration tests, system tests) used in software processes. Further, it is possible to find a place where the constant change consistency which cannot be specified by the conventional static analysis tool is not maintained.
(第2実施形態)
[ソフトウェア検査装置のハードウェア構成]
 第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.
 図17を参照して、第2実施形態に係わるCPU11bの機能的構成を説明する。第2実施形態に係わるCPU11bは、定数抽出部21、条件文検出部22、ブロック特定部25、条件文展開部27、書込箇所特定部26、書込ブロック特定部28、及び第2の定数グループ出力部29として機能する。なお、定数抽出部21、条件文検出部22、ブロック特定部25、書込箇所特定部26、及び書込ブロック特定部28は、第1実施形態と同じであり説明を省略する。 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. Note that 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.
 条件文展開部27は、条件文検出部22により検出された条件文を展開する。ここでは、ブロック特定部25により特定された各ブロックが実行されるために成立しなければならない条件を全て抽出する。具体的には、if文の条件はそのまま抽出し、else側のブロックについては、if文側の逆の条件が成立したと解釈し、if文側の逆の条件を新たな条件として展開する。展開された各条件文には、条件文が成立する場合に実行されるブロックの範囲(ブロックリージョン)が関連づけられている。 The conditional sentence expansion unit 27 expands the conditional sentence detected by the conditional sentence detection unit 22. Here, all the conditions that must be satisfied in order to execute each block specified by the block specifying unit 25 are extracted. Specifically, 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.
 第2の定数グループ出力部29は、展開された条件文に関連付けられたブロックの中から、グローバル変数に書き込みを行う箇所が属するブロックを特定する。展開された条件文の中で参照される定数を抽出する。そして、グローバル変数に書き込みを行う箇所毎に、条件文展開部27により展開された条件文で参照される定数を分類して出力する。 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.
[ソフトウェア検査装置により実行される情報処理の手順]
 次に、図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.
 先ず、条件文展開部27は、図4に示す「条件文展開」処理(S10)を実行する。具体的には、図12に示す「ブロック行数一覧(DO6)」に基づいて、総ての条件文を展開する。図18の表は、上記した条件文展開処理(S10)の結果をまとめた「条件文展開一覧(D11)」を示す。if文はそのまま出力し、else文はif文と逆の条件が成立した場合を示す「!」で表記する。例えば、図5(b)の22行目~24行目のブロックは、17行目の条件の偽と解釈する。図5(b)の26行目~27行目のブロックは、17行目及び19行目の2つの条件の偽と解釈する。 First, the 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. For example, 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.
 第2の定数グループ出力部29は、図4に示す「第2のグローバル変数書込箇所特定」処理(S11)を実行する。具体的には、図18の「条件文展開一覧(D11)」及び図15の「グローバル変数書込、読込箇所一覧(DO9)」に基づいて、展開された条件文に関連付けられたブロックの中から、グローバル変数に書き込みを行う箇所が属するブロックを特定する。図19の表は、上記した第2のグローバル変数書込箇所特定処理(S11)の結果をまとめた「グローバル変数書込箇所一覧(D12)」を示す。例えば、図15に示すvTempに1を書き込む19行目は、図18に示すブロックリージョン(18-20)に属すると判断する。ブロックリージョン(32-34)及び(36-38)のように、「条件文展開一覧(D11)」に示すブロックのうち、グローバル変数の書込箇所の行番号が検索されなかったブロックは、除外する。なぜなら、グローバル変数の書込箇所の共通性に基づいて関連性の高い定数を特定できないからである。 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.
 第2の定数グループ出力部29は、図4に示す「第1の定数分割」処理(S12)を実行する。具体的には、図19の「グローバル変数書込箇所一覧(D12)」における条件文に含まれる定数を抽出して、抽出された定数毎に異なる行に分割して表示する。図20の表は、上記した第1の定数分割処理(S12)の結果をまとめた「条件文内定数一覧(D13)」を示す。ここでは、グローバル変数に書き込みを行う箇所毎に、第2のグループIDを付して定数を分類している。具体的には、定数CC1, CC2は、グローバル変数vTempに書込を行う19行目が実行されるために必要な条件文の中で参照された定数のグループであるため、第2のグループIDとして「1」を付す。定数CC1, CC2, CC3は、グローバル変数vTempに書込を行う23行目が実行されるために必要な条件文の中で参照された定数のグループであるため、第2のグループIDとして「2」を付す。定数CC1, CC2, CC3は、グローバル変数vTempに書込を行う26行目が実行されるために必要な条件文の中で参照された定数のグループであるため、第2のグループIDとして「3」を付す。 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). Here, the constants are classified by assigning the second group ID to each location where the global variable is written. Specifically, 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. ".
 以上説明したように、本発明の第2実施形態によれば、以下の作用効果が得られる。 As described above, according to the second embodiment of the present invention, the following operational effects can be obtained.
 ソフトウェア検査装置は、検査対象となるソースコードD01の中で用いられる定数を抽出し、抽出された定数が参照される条件文を検出して、検出された条件文を展開する。そして、図20に示すように、グローバル変数に書き込みを行う箇所が属するブロックを特定し、グローバル変数に書き込みを行う箇所毎に、条件文展開部27により展開された条件文で参照される定数を分類して出力する。これにより、グローバル変数に書き込みを行う箇所の共通性という観点から関連性が高い定数群を特定できる。よって、特定された定数群について仕様通りの処理がされているかを容易にレビューすることができる。したがって、仕様の条件によって同時に更新しなければいけない2以上の定数の存在をユーザに提示して、定数の変更の一貫性が保たれていないために不具合が生じる可能性がある箇所をユーザに気づかせることができる。 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.
(第3実施形態)
 第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.
 図21を参照して、第3実施形態に係わるCPU11cの機能的構成を説明する。第3実施形態に係わるCPU11cは、定数抽出部21、条件文検出部22、ブロック特定部25、条件文展開部27、アクセス箇所特定部30、アクセスブロック特定部31及び第3の定数グループ出力部32として機能する。なお、定数抽出部21、条件文検出部22、ブロック特定部25、条件文展開部27は、第1実施形態或いは第2実施形態と同じであり説明を省略する。 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.
 アクセス箇所特定部30は、ソースコードD01の中で、書き込み及び読み出しが行われる変数、及び当該変数にアクセスする箇所を特定する。具体的には、当該変数にアクセスする行番号、及びアクセスの種類が書込であるか読込であるかを特定する。 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.
 アクセスブロック特定部31は、ブロック特定部25により特定されたブロックの中から、アクセス箇所特定部30により特定された箇所が属するブロックを特定する。具体的には、ブロック特定部25により特定されたブロックリージョンのうち、変数にアクセスする行番号が属するブロックリージョンを検索する。 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.
 第3の定数グループ出力部32は、アクセス箇所特定部30により特定された変数毎に、アクセス箇所特定部30により特定された箇所の実行順序に従って、条件文展開部27により展開された条件文を並べ替える。そして、アクセス箇所特定部30により特定された変数毎に、当該条件文の中で参照される定数を分類して出力する。 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.
[ソフトウェア検査装置により実行される情報処理の手順]
 次に、図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.
 先ず、アクセス箇所特定部30は、図3に示す「変数別書込、読込特定」処理(S13)を実行する。具体的には、図13の「変数一覧(DO7)」に基づいて、変数に書込及び読込を行っている行番号を特定する。図22の表は、上記した変数別書込、読込特定処理(S13)の結果をまとめた「変数別書込、読込箇所一覧(D14)」を示す。ここでは、変数vFlag, v, vTemp, temp, temp2にアクセスする行番号、及びアクセスの種類(書込又は読込)を特定している。なお、変数の読込箇所は、変数が算術式の右辺にある箇所を示し、及び変数の書込個所と算術式の左辺にある箇所を示す。 First, 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). Here, 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.
 アクセス箇所特定部30は、図4に示す「変数別グループ特定」処理(S14)を実行する。具体的には、書込及び読込の両方が行われている変数毎に、変数アクセス箇所を分類する。書込及び読込の一方のみが行われている変数は分類から除外する。図23の表は、上記した変数別グループ特定処理(S14)の結果をまとめた「変数別グループ一覧(D15)」を示す。ここでは、変数vTemp, tempは、書込及び読込の両方が行われているため、それぞれ、第3のグループIDとして「1」及び「2」が付される。一方、変数vFlag, v, temp2は、書込及び読込の一方のみが行われているため、除外される。 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). Here, since the variables vTemp and temp are both written and read, “1” and “2” are assigned as the third group IDs, respectively. On the other hand, the variables vFlag, v, and temp2 are excluded because only one of writing and reading is performed.
 アクセスブロック特定部31は、図4に示す「アクセス箇所特定」処理(S15)を実行する。具体的には、変数に書込及び読込を行っている行番号が属するブロックリージョンを特定する。変数に書込及び読込を行っている行番号は、図23の「変数別グループ一覧(D15)」から特定し、ブロックリージョンは、図12の「ブロック行数一覧(DO6)」から特定する。図24の表は、上記したアクセス箇所特定処理(S15)の結果をまとめた「データフロー一覧(D16)」を示す。ここでは、変数にアクセスする行番号、アクセスの種類(書込又は読込)、属するブロックリージョン、及び展開された条件文が、変数毎に分類されている。 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). Here, 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.
 第3の定数グループ出力部32は、図4に示す「第2の定数分割」処理(S16)を実行する。図25の表は、上記した第2の定数分割処理(S16)の結果をまとめた「データフロー別定数一覧(D17)」を示す。第3の定数グループ出力部32は、変数別グループ特定処理(S14)で第3のグループIDが付された変数vTemp, temp毎に、変数別書込、読込特定処理(S13)で特定された変数アクセス箇所の実行順序にしたがって、展開された条件文を並べ替える。更に、展開された各条件文に含まれる定数を検索し、定数ごとに行を分割する。S16の処理により、変数の読込が行われる個所までのパスを分析して、総ての条件ごとに、書込及び読込の関係を洗い出すことができる。第3の定数グループ出力部32は、図25の「データフロー別定数一覧(D17)」をユーザに対して出力する。これにより、変数毎に、書込及び読込の処理に関わっている定数を一覧として出力することができ、仕様上の書込及び読込の条件と照らし合わせてチェックすることができる。 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. By the process of S16, 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. As a result, 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.
 以上説明したように、本発明の第3実施形態によれば、以下の作用効果が得られる。 As described above, according to the third embodiment of the present invention, the following operational effects can be obtained.
 ソフトウェア検査装置は、検査対象となるソースコードD01の中で用いられる定数を抽出し、抽出された定数が参照される条件文を検出して、検出された条件文を展開する。ソースコードD01の中で書き込み及び読み出しが行われる変数、当該変数にアクセスする箇所、当該箇所が属するブロックを特定する。そして、図25に示すように、変数毎に、変数アクセス箇所の実行順序に従って、展開された条件文を並べ替え、且つ当該条件文の中で参照される定数を分類して出力する。これにより、ソースコードD01の中で変数にアクセスする箇所の実行順序に基づいて関連性の高い定数のグループを特定する。よって、特定された定数群について仕様通りの処理がされているかを容易にレビューすることができる。したがって、仕様の条件によって同時に更新しなければいけない2以上の定数の存在をユーザに提示して、定数の変更の一貫性が保たれていないために不具合が生じる可能性がある箇所をユーザに気づかせることができる。 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. In the source code D01, a variable to be written and read, a location to access the variable, and a block to which the location belongs are specified. Then, as shown in FIG. 25, 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. As a result, 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.
 上記のように、本発明の実施形態を記載したが、この開示の一部をなす論述及び図面はこの発明を限定するものであると理解すべきではない。この開示から当業者には様々な代替実施の形態、実施例及び運用技術が明らかとなろう。 As described above, the embodiments of the present invention have been described. However, it should not be understood that the descriptions and drawings constituting a part of this disclosure limit the present invention. From this disclosure, various alternative embodiments, examples and operational techniques will be apparent to those skilled in the art.
 特願2013-150225号(出願日:2013年7月19日)の全内容は、ここに援用される。 The entire contents of Japanese Patent Application No. 2013-150225 (filing date: July 19, 2013) are incorporated herein by reference.
 21 定数抽出部
 22 条件文検出部
 23 ベース変数特定部
 24 第1の定数グループ出力部
 25 ブロック特定部
 26 書込箇所特定部
 27 条件文展開部
 28 書込ブロック特定部
 29 第2の定数グループ出力部
 30 アクセス箇所特定部
 31 アクセスブロック特定部
 32 第3の定数グループ出力部
DESCRIPTION OF SYMBOLS 21 Constant extraction part 22 Condition sentence detection part 23 Base variable specific | specification part 24 1st constant group output part 25 Block specific part 26 Writing location specific part 27 Conditional sentence expansion part 28 Write block specific part 29 2nd constant group output Section 30 Access location identification section 31 Access block identification section 32 Third constant group output section

Claims (7)

  1.  コンピュータプログラムを検査するソフトウェア検査装置であって、
     検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出する定数抽出部と、
     前記コンピュータプログラムの中から、前記定数抽出部により抽出された定数が参照される条件文を検出する条件文検出部と、
     前記条件文検出部により検出された条件文の中で前記定数と比較される変数をベース変数として特定するベース変数特定部と、
     前記ベース変数特定部により特定されたベース変数毎に、比較対象となる前記定数を分類して出力する第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:
  2.  前記条件文検出部により検出された条件文が成立する場合に実行される一群のステートメントからなるブロックを特定するブロック特定部と、
     前記コンピュータプログラムの中で、グローバル変数に書き込みを行う箇所を特定する書込箇所特定部と、
     前記ブロック特定部により特定されたブロックの中から、前記書込箇所特定部により特定された箇所が属する前記ブロックを特定する書込ブロック特定部と、を更に備え、
     前記第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.
  3.  前記第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.
  4.  コンピュータプログラムを検査するソフトウェア検査装置であって、
     検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出する定数抽出部と、
     前記コンピュータプログラムの中から、前記定数抽出部により抽出された定数が参照される条件文を検出する条件文検出部と、
     前記条件文検出部により検出された条件文が成立する場合に実行される一群のステートメントからなるブロックを特定するブロック特定部と、
     前記条件文検出部により検出された条件文を展開する条件文展開部と、
     前記コンピュータプログラムの中で、グローバル変数に書き込みを行う箇所を特定する書込箇所特定部と、
     前記ブロック特定部により特定されたブロックの中から、前記書込箇所特定部により特定された箇所が属する前記ブロックを特定する書込ブロック特定部と、
     前記グローバル変数に書き込みを行う箇所毎に、前記条件文展開部により展開された条件文で参照される定数を分類して出力する第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:
  5.  コンピュータプログラムを検査するソフトウェア検査装置であって、
     検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出する定数抽出部と、
     前記コンピュータプログラムの中から、前記定数抽出部により抽出された定数が参照される条件文を検出する条件文検出部と、
     前記条件文検出部により検出された条件文が成立する場合に実行される一群のステートメントからなるブロックを特定するブロック特定部と、
     前記条件文検出部により検出された条件文を展開する条件文展開部と、
     前記コンピュータプログラムの中で、書き込み及び読み出しが行われる変数、及び当該変数にアクセスする箇所を特定するアクセス箇所特定部と、
     前記ブロック特定部により特定されたブロックの中から、前記アクセス箇所特定部により特定された箇所が属する前記ブロックを特定するアクセスブロック特定部と、
     前記アクセス箇所特定部により特定された変数毎に、前記アクセス箇所特定部により特定された箇所の実行順序に従って、前記条件文展開部により展開された条件文を並べ替え、且つ当該条件文の中で参照される定数を分類して出力する第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:
  6.  コンピュータプログラムを検査するソフトウェア検査方法であって、
     検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出し、
     前記コンピュータプログラムの中から、抽出された定数が参照される条件文を検出し、
     検出された条件文の中で前記定数と比較される変数をベース変数として特定し、
     特定されたベース変数毎に、比較対象となる前記定数を分類して出力する
    ことを特徴とするソフトウェア検査方法。
    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.
  7.  コンピュータプログラムを検査するためのソフトウェア検査プログラムであって、
     コンピュータに、
     検査対象となる前記コンピュータプログラムの中で用いられる定数を抽出する機能と、
     前記コンピュータプログラムの中から、抽出された定数が参照される条件文を検出する機能と、
     検出された条件文の中で前記定数と比較される変数をベース変数として特定する機能と、
     特定されたベース変数毎に、比較対象となる前記定数を分類して出力する機能と、
    を実現させることを特徴とするソフトウェア検査プログラム。
    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.
PCT/JP2014/066318 2013-07-19 2014-06-19 Software inspection device, software inspection method, and software inspection program WO2015008575A1 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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