CN105556484A - 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
CN105556484A
CN105556484A CN201480051482.1A CN201480051482A CN105556484A CN 105556484 A CN105556484 A CN 105556484A CN 201480051482 A CN201480051482 A CN 201480051482A CN 105556484 A CN105556484 A CN 105556484A
Authority
CN
China
Prior art keywords
constant
conditional clause
determination portion
program block
program
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201480051482.1A
Other languages
Chinese (zh)
Other versions
CN105556484B (en
Inventor
市川智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nissan Motor Co Ltd
Original Assignee
Nissan Motor Co Ltd
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 Nissan Motor Co Ltd filed Critical Nissan Motor Co Ltd
Publication of CN105556484A publication Critical patent/CN105556484A/en
Application granted granted Critical
Publication of CN105556484B publication Critical patent/CN105556484B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

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 testing fixture, software inspection method, software scrutiny program
Technical field
The present invention relates to a kind of software testing fixture, software inspection method, software scrutiny program.
Background technology
Current, for the control flow check in the source program described by programming language, data stream, knownly do not perform this source program and the steady-state solution analysis method (with reference to patent documentation 1) that carries out resolving.
Patent documentation 1: Japanese Unexamined Patent Publication 09-282173 publication
Summary of the invention
But, in the process of software, produce specification when changing, there is the condition according to specification sometimes and the constant being more than or equal to 2 that must simultaneously upgrade.But, when do not record with the specification of software, there is the specification of the constant of relevance, go wrong because deviser has only carried out changing to its a part of constant sometimes.
According to the steady-state solution analysis method of patent documentation 1, the structure of program can be made visual by the relation of clear and definite contents processing and input and output.But, user cannot be made to notice the position likely had problems because the consistance of constant change is not maintained in the structure of visual program.
The present invention proposes in view of above-mentioned problem, its object is to provide a kind of software testing fixture, software inspection method, software scrutiny program, user can be made to notice the position likely had problems because the consistance of constant change is not maintained in the structure of program.
Software testing fixture involved by a mode of the present invention extracts the constant used in the computer program becoming check object, detects the conditional clause extracted constant being carried out to reference.Further, the variable compared with constant in conditional clause is defined as basic underlying variables, for each basic underlying variables, the constant becoming comparison other is classified and exports.
Accompanying drawing explanation
Fig. 1 is the block diagram of the hardware configuration of the software testing fixture represented involved by the 1st embodiment of the present invention.
Fig. 2 is the block diagram of the functional structure of the CPU11a represented involved by the 1st embodiment.
Fig. 3 is the data flow diagram of the flow process representing the information processing utilizing the software testing fixture involved by the 1st ~ 3rd embodiment of the present invention to perform and the intermediate data generated in the midway of information processing.
Fig. 4 is the data flow diagram then carrying out representing after Fig. 3.
Fig. 5 (a), (b) illustrate the figure of an example of the computer program described by C language as the source code D01 becoming check object.
Fig. 6 is the table representing " constant guide look (DO2) " after the result of constant extraction process (S01) being gathered.
Fig. 7 is the table representing " conditional clause guide look (DO3) " after the result of conditional clause check processing (S02) being gathered.
Fig. 8 be represent basic underlying variables are determined the result processing (S03) gather after the table of " basic underlying variables guide look (DO4) ".
Fig. 9 be represent constant group determined the result processing (S04) gather after the table of " constant group guide look (DO5) ".
Figure 10 represents to compare with identical basic underlying variables but not compare under the state writing identical value, and therefore unfiled is the figure of the program example of same group.
Figure 11 is the figure representing the program block B01 ~ B05 determined in the program example of Fig. 5 (b).
Figure 12 be represent program block determined the result processing (S05) gather after the table of " program block line number guide look (DO6) ".
Figure 13 be represent variable determined the result processing (S06) gather after the table of " variable guide look (DO7) ".
Figure 14 be represent above-mentioned global variable determined the result processing (S07) gather after the table of " global variable guide look (DO8) ".
Global variable writes, reads in the table that " global variable write, read in position guide look (DO9) " after processing the result of (S08) gathers is determined in position by Figure 15.
Figure 16 be represent the 1st global variable writing position determined the result processing (S09) gather after the table of " having a guide look of (D10) by the parameter of group differentiation ".
Figure 17 is the block diagram of the functional structure of the CPU11b represented involved by the 2nd embodiment.
Figure 18 is the table representing " conditional clause launches guide look (D11) " after the result of conditional clause expansion process (S10) being gathered.
Figure 19 be represent the 2nd above-mentioned global variable writing position determined the result processing (S11) gather after the table of " global variable writing position guide look (D12) ".
Figure 20 represents " in conditional clause constant guide look (D13) " after the result of the 1st constant dividing processing (S12) being gathered.
Figure 21 is the block diagram of the functional structure of the CPU11c represented involved by the 3rd embodiment.
Figure 22 be represent by by variable write, read in the table determining " by variable write, reading in position guide look (D14) " after processing the result of (S13) gathers.
Figure 23 is the table representing " group guide look (D15) distinguished by variable " after the above-mentioned result determining to organize process (S14) by variable being gathered.
Figure 24 be represent access location determined the result processing (S15) gather after the table of " data stream guide look (D16) ".
Figure 25 is the table representing " constant guide look (D17) distinguished by data stream " after the result of the 2nd above-mentioned constant dividing processing (S16) being gathered.
Embodiment
With reference to accompanying drawing, embodiments of the present invention are described.In the record of accompanying drawing, to marking same label with a part and explanation being omitted.
(the 1st embodiment 1)
[hardware configuration of software testing fixture]
Software testing fixture involved by 1st embodiment of the present invention, such as, can be applied to the software check processing of the computer program performed by the electronic-controlled installation being equipped on vehicle (ECU).Particularly to producing and the condition of the specification according to computer program and the possibility gone wrong being more than or equal to the constant of 2 relevant that must upgrade checks simultaneously.
With reference to Fig. 1, the hardware configuration of the software testing fixture involved by the 1st embodiment of the present invention is described.As the hardware configuration of software testing fixture, general computing machine can be used.Such as, software testing fixture has input-output unit 12, memory storage 14, CPU (central processing unit) 11, input media 13 and display device 15.Input-output unit 12 reads in the computer program (source code D01) of check object from storage medium.The intermediate data of memory storage 14 to the source code D01 read in by input-output unit 12, parsing stores.CPU (central processing unit) 11 performs various computing and resolves source code D01.Input media 13 is the devices for being inputted the information needed for parsing by user.Display device 15 shows the check result exported from CPU11.Can also utilize input-output unit 12 that check result is write storage medium.
Or software testing fixture can also realize as Client/Server.Such as via computer network, general personal computer (client) is connected with server.Thereby, it is possible to the server with the CPU11 shown in Fig. 1 is connected with input-output unit 12, input media 13, memory storage 14 or display device 15 via computer network.In this case, software testing fixture is formed primarily of CPU11 (server), and input-output unit 12, input media 13, memory storage 14 or display device 15 are not contained in software testing fixture.
With reference to Fig. 2, the functional structure of the CPU11 of Fig. 1 is described.For the computer program (software scrutiny program) for making the computing machine with CPU11 work as software testing fixture, to be installed in the computing machine with CPU11 and to be performed.Thus, CPU11 works as each information treatment part shown below.In addition, illustrate by the example of software simulating software testing fixture here, but certainly also can prepare for the special hardware of each information processing shown in below performing and form software testing fixture.
CPU11a involved by 1st embodiment works as constant extraction unit 21, conditional clause test section 22, basic underlying variables determination portion 23 and the 1st constant group efferent 24.
Constant extraction unit 21 is extracted the constant used in the computer program becoming check object.Constant gives name to specific value in programming, different from variable, cannot change from behind in code to the value determined during statement.But, when the specification of computer program changes, sometimes constant is changed according to the condition of specification simultaneously.Such as when C language, constant extraction unit 21 is determined the identifier of the statement defined by " #define " or " const " and is extracted constant.Constant extraction unit 21 possesses the information of the defining mode defined by " #define " and " const " in advance, detects the constant of the definition met represented by defining mode.
Conditional clause test section 22 detects the conditional clause with reference to the constant extracted by constant extraction unit 21 from computer program.Conditional clause test section 22 detects following conditional, that is, the conditional in the if (conditional) such as, contained in computer program, else (conditional), switch (conditional), the constant extracted by constant extraction unit 21 is compared.
The variable compared with the constant extracted by constant extraction unit 21 in the conditional clause detected by conditional clause test section 22 is defined as basic underlying variables by basic underlying variables determination portion 23.
1st constant group efferent 24 is classified to the constant becoming comparison other for each basic underlying variables determined by basic underlying variables determination portion 23 and exports.Specifically, when to extracted by constant extraction unit 21 be more than or equal to the constant of 2 and same foundation variable compare, the constant this being more than or equal to 2 is categorized as 1 group.1st constant group efferent 24 implements the grouping of this constant for each basic underlying variables.For the constant being more than or equal to 2 compared with same foundation variable, they can be called each other the constant that correlation degree in the specification of computer program is dark.Thus, 1st constant group efferent 24 is more than or equal to the constant of 2 as the check result exported from CPU11 using what compare with same foundation variable, such as, to show it in display device 15 or utilize input-output unit 12 to be write storage medium.Thereby, it is possible to the existence being more than or equal to the constant of 2 that must upgrade according to the condition of specification to user's prompting simultaneously, user is noticed, and the consistance changed due to constant is not kept and the position that likely has problems.
In addition, the 1st constant group efferent 24 can be classified to constant for each basic underlying variables under the state being written into identical value.Even if compared with the constant being more than or equal to 2 under the state being also written into different value at identical variable, then this constant relevance in specification being more than or equal to 2 is low.
CPU11a also works as program block determination portion 25, writing position determination portion 26 and write-in program block determination portion 28.
Program block determination portion 25 determines the program block be made up of the one group of statement performed when the conditional clause utilizing conditional clause test section 22 to detect is set up." statement " refers to the process unit of every 1 row in source code.Such as when C language, program block refers to the scope that the bracket " { " and " } " after by the condition judgment of if statement or switch statement surrounds.Specifically, program block determination portion 25 determines the line number of the part of being surrounded by bracket " { " and " } ".
Writing position determination portion 26 is determined in computer program the position that global variable writes.Specifically, the global variable defined in computer program is extracted, determine the position (such as line number) that the global variable extracted is write.The position that global variable occurs on the left side of Arithmetic Expressions Using is referred to the position of global variable write.
Write-in program block determination portion 28 determines the program block belonging to position determined by writing position determination portion 26 from the program block determined by program block determination portion 25.Specifically, be contained in from the starting point (line number) of program block is to terminal between (line number) in the line number write global variable, determine this program block.
1st constant group efferent 24 for each basic underlying variables, to the establishment of the conditional clause because basic underlying variables are compared and the global variable write classify and export.There is the association of position because writing global variable and the strong constant of the relevance in specification.Therefore, verify whether process according to specification preferably by carrying out contrasting with the global variable of write.Therefore, in the 1st embodiment, 1st constant group efferent 24 is not only classified for each basic underlying variables pair constant compared with basic underlying variables, but also classifies to the global variable write in the program block performed in the establishment because of the conditional clause with reference to this constant and export.
[order of the information processing performed by software testing fixture]
Below, with reference to Fig. 3 ~ Figure 16, as an example of the software inspection method involved by the 1st embodiment of the present invention, the order of the information processing performed by the software testing fixture shown in Fig. 1 and Fig. 2 is described.
First, CPU11 reads in the source code D01 becoming check object from input-output unit 12.In addition, source code D01 can utilize input-output unit 12 to be read in software testing fixture by user in advance, and is stored in memory storage 14.As the source code D01 read in, Fig. 5 (a), (b) illustrate an example of the computer program described by C language.The computer program becoming check object is crossed over the file of 2 shown in Fig. 5 (a), (b) and is described.The file " sample1.c " by name of Fig. 5 (a), the file " sample2.c " by name of Fig. 5 (b).In an example of the program described by C language, the serial number from 1 described in the left part of each file represents " line number " of each statement.
Constant extraction unit 21 performs " constant extraction " process (S01) shown in Fig. 3.Constant extraction unit 21 detects the constant of the defining mode meeting " #define " and " const " from source code D01.In the program example of Fig. 5, walk to from the 2nd of program constant CC1, CC2, CC3, CC4 of existing the 5th row and being defined by #define, therefore they are detected as constant.Meanwhile, also the definition value of each constant is detected.The table of Fig. 6 represents " constant guide look (DO2) " after the result of above-mentioned constant extraction process (S01) being gathered.
Conditional clause test section 22 performs " conditional clause detection " process (S02) shown in Fig. 3.In the if (conditional) contained in computer program, else (conditional), elseif (conditional), switch (conditional), detect the conditional that the constant extracted by constant extraction unit 21 is compared.
Conditional clause test section 22 detects the conditional clause with reference to CC1, CC2, CC3, CC4 of being extracted by constant extraction unit 21 from source code D01.The table of Fig. 7 represents " conditional clause guide look (DO3) " after the result of above-mentioned conditional clause check processing (S02) being gathered.Here, the line number of conditional clause itself and conditional clause is extracted.
Basic underlying variables determination portion 23 performs " basic underlying variables are determined " process (S03) shown in Fig. 3.The variable compared with the constant extracted by S01, in the conditional clause detected by S03, is defined as basic underlying variables by basic underlying variables determination portion 23." basic underlying variables guide look (DO4) " after the result determining that above-mentioned basic underlying variables process (S03) that represents the table of Fig. 8 gathers.In the program example of Fig. 5, the set of variables of constant CC1, CC2, CC3, CC4 and variable v, v1, vFlag is compared, therefore variable based on these variablees is detected.When determining from 1 conditional clause basic underlying variables (v, the v1) being more than or equal to 2, determining conditional clause for each basic underlying variables and becoming the constant of comparison other.
1st constant group efferent 24, based on the basic underlying variables determined by S03, performs " the constant group is determined " process (S04) shown in Fig. 3.Specifically, when comparing with identical basic underlying variables the constant being more than or equal to 2 extracted by S01, the constant this being more than or equal to 2 is categorized as 1 group." constant group guide look (DO5) " after the result determining that above-mentioned constant group process (S04) that represents the table of Fig. 9 gathers.In the program example of Fig. 5, utilize the variable identical with basic underlying variables v to compare constant CC1, therefore it can be used as one group, mark " 1 " as the 1st group of ID.In addition, constant CC2 and CC3 is also compared with identical basic underlying variables v1, therefore mark " 2 " as the 1st group of ID.Constant CC4 and CC2 is also compared with identical basic underlying variables vFlag, therefore marks " 3 " as the 1st group of ID.Clearly can represent that the constant having marked the 1st group of identical ID is the dark constant of the correlation degree of specification aspect each other like this.
In addition, if even if under the state being also written into different value for identical basic underlying variables, then they are not categorized as same group by the 1st constant group efferent 24.Such as, as shown in Figure 10, the value for basic underlying variables " a " is rewritten between from conditional clause (line number is 1) formerly to posterior conditional clause (line number is 4), and therefore the relevance of specification aspect is low.Therefore, utilize identical basic underlying variables " a " to compare CC1 and CC2, but do not compare with basic underlying variables " a " under the state being written into identical value, therefore do not treat as same group.
Next, program block determination portion 25 performs " program block is determined " process (S05) shown in Fig. 3.Specifically, program block determination portion 25 determines the program block that performs when the conditional clause that detected by S02 is set up.Specifically, be determined to become the line number of the starting point of program block and become the line number of terminal.Figure 11 illustrates determined program block B01 ~ B05 in the program example of Fig. 5 (b)." program block line number guide look (DO6) " after the result determining that above-mentioned program block process (S05) that represents the table of Figure 12 gathers.In fig. 12, constant group guide look (DO5) shown in Fig. 9 is added to the line number (program block region) of determined program block.
Writing position determination portion 26 performs " variable is determined " process (S06) shown in Fig. 3.Specifically, the variable defined in source code D01 is extracted." variable guide look (DO7) " after the result determining that above-mentioned variable process (S06) that represents the table of Figure 13 gathers.Writing position determination portion 26 extracts global variable and local variable as variable.In the program example of Fig. 5, extract vFlag, vTemp as global variable, extract temp, temp2 as local variable.
Writing position determination portion 26 performs " global variable is determined " process (S07) shown in Fig. 3.Specifically, from the variable extracted by S06, global variable is extracted." global variable guide look (DO8) " after the result determining that above-mentioned global variable process (S07) that represents the table of Figure 14 gathers.In the program example of Fig. 5, extract vFlag, vTemp as global variable.
Writing position determination portion 26 performs " global variable writes, the read in position determines " process (S08) shown in Fig. 3.Specifically, the line number that the global variable extracted is write is determined.The table of Figure 15 represent above-mentioned global variable is write, read in the result determining to process (S08) in position gather after " global variable write, read in position guide look (DO9) ".In the program example of Fig. 5, global variable vFlag is write at the 16th row, read at the 31st row.Global variable vTemp is write at the 19th row, the 23rd row, the 26th row, reads at the 33rd row.
1st constant group efferent 24 performs " the 1st global variable writing position is determined " process (S09) shown in Fig. 4.Specifically, for each basic underlying variables, to the establishment of the conditional clause because comparing with basic underlying variables and the global variable write classify and export." having a guide look of (D10) by the parameter of group differentiation " after the result determining that the 1st above-mentioned global variable writing position process (S09) that represents the table of Figure 16 gathers.In figure 16, " program block line number guide look (DO6) " shown in Figure 12 is added to the line number (program block region) of determined program block.
Such as, vTemp=1; Such global variable writing position is the 19th row of sample1.c file, and the program block region therefore in " program block line number guide look (DO6) " of Figure 12 is retrieved the group belonging to this line number.Its result, can be judged as belonging to program block region " 18-20 ".
Known as shown in figure 16, be compare with constant CC1 with the 1st group of basic underlying variables that ID1 is classified " v " in the conditional clause of 17 and 21 in line number, be in the program block of the conditional clause of 17 and 21 in line number, global variable vTemp carried out to the write of 1 and 2.For with the 1st group of basic underlying variables that ID2 is classified " v1 " too.On the other hand, for the 1st group of basic underlying variables that ID3 is classified " vFlag ", compare with constant CC4, CC2, but do not carry out the write to global variable.
As described above, according to the 1st embodiment of the present invention, action effect below can be obtained.
Choose the example of the setting of configuration parameter, the setting of calibration parameter, the necessity verified the relevance of constant is shown.First, the example of configuration parameter is described.Originally must be open simultaneously or close by the function setting of Intelligent key and anti-theft locking system of engine (immobilizer).But deviser not to be noted this point, only change one sometimes.Such as, deviser is misinterpreted as the functional independence that specification is exactly Intelligent key and anti-theft locking system of engine originally sometimes.In this case, in the test in the downstream of monomer test etc., cannot find only to change one, cause thus going wrong.
Below, the example of calibration parameter is described.Sometimes the light quantity of outside detected and according to detected value, the unlatching of lamp or closedown being equipped on vehicle controlled.In this case, usually make the detected value of outside light quantity have hysteresis, alleviate the triviality caused by the open and close repeatedly of lamp.When changing hysteresis, the characteristic of control object must be considered and higher limit and lower limit are upgraded simultaneously.But, when deviser not to be noted this point, only the value of one is changed, thus has problems.
Like this, the specification originally for must upgrade the constant being more than or equal to 2 simultaneously, but can individually the constant of software be set, therefore sometimes only the value of a part is changed, thus have problems.That is, need to verify the relevance of constant.
Therefore, the software testing fixture involved by the 1st embodiment extracts the constant used in the source code D01 becoming check object, detects the conditional clause constant extracted being carried out to reference.The variable compared with constant in the conditional clause detected is defined as basic underlying variables, for determined each basic underlying variables, the constant becoming comparison other is classified and exports.Thus, as shown in Figure 9, classify to the constant that identical basic underlying variables compare and exported, therefore, it is possible to determine according to the viewpoint of the intercommunity of basic underlying variables the constant group that relevance is high.Thus, easily can verify and whether determined constant group is processed according to specification.Therefore, it is possible to the existence being more than or equal to the constant of 2 that must upgrade according to the condition of specification to user's prompting simultaneously, user can be made to notice, and the consistance changed because of constant is not maintained and the position that likely has problems.
The program block performed when the conditional clause detected is set up determined by software testing fixture, and determine in computer program the position that global variable writes.Further, from determined program block, determine the program block belonging to position that global variable is write, for each basic underlying variables, to the establishment of the conditional clause because comparing with basic underlying variables and the global variable write classify and export.Thus, as shown in figure 16, the existence of the constant that the relevance in specification is strong can be pointed out to user according to the association of the writing position of global variable.Whether user can verify by carrying out contrasting with write global variable and process according to specification.
1st constant group efferent 24 is classified to constant for each basic underlying variables under the state being written into identical value.Even if under the state that is, being yet written into different value at identical basic underlying variables, be not then categorized as same group.Thereby, it is possible to the high constant group of higher precision determination relevance.
Like this, even if be defined in specification when missing process from the design phase as specification but also fail to implement monomer when testing the structure of such program, can suppress to write the problem that process is omitted.In addition, the consistance that the constant that user can be made to notice from huge source code cannot be judged by human eye is changed is not maintained.In addition, undiscovered constant the mistake of the program that consistance is not maintained can be changed in the test (monomer test, combine test, system testing) that uses in software development process of advance preventing.In addition, the position that the consistance of the change of the constant utilizing static analytical tool in the past to determine is not maintained can be found.
(the 2nd embodiment)
[hardware configuration of software testing fixture]
In the 1st embodiment, to based on become comparison other basic underlying variables intercommunity and determine that the example of the group of the constant that relevance is high is illustrated.In the 2nd embodiment, the intercommunity of the writing position based on global variable is determined that the example of the group of the constant that relevance is high is described.In addition, the hardware configuration of software testing fixture is identical with the 1st embodiment (Fig. 1), explanation is omitted.
With reference to Figure 17, the functional structure of the CPU11b involved by the 2nd embodiment is described.CPU11b involved by 2nd embodiment is as constant extraction unit 21, conditional clause test section 22, program block determination portion 25, conditional clause expanding unit 27, writing position determination portion 26, write-in program block determination portion the 28 and the 2nd constant group efferent 29 and working.In addition, constant extraction unit 21, conditional clause test section 22, program block determination portion 25, writing position determination portion 26 and write-in program block determination portion 28 are identical with the 1st embodiment, explanation are omitted.
The conditional clause detected by conditional clause test section 22 launches by conditional clause expanding unit 27.Here, in order to perform each program block determined by program block determination portion 25, all conditions that must set up extracts.Specifically, directly extract the condition of if statement, for the program block of else side, the contrary condition being interpreted as if statement side is set up, and the contrary condition of if statement side is launched as new condition.The scope (program block region) of the program block performed when conditional clause is set up is associated with launched each conditional clause.
2nd constant group efferent 29 determines the program block belonging to position write global variable from the program block be associated with the conditional clause launched.The constant of reference in launched conditional clause is extracted.Further, for each position write global variable, the constant of reference in the conditional clause launched by conditional clause expanding unit 27 is classified and exports.
[order of the information processing performed by software testing fixture]
Below, with reference to Fig. 3, Fig. 4, Figure 18 ~ Figure 20, as an example of the software inspection method involved by the 2nd embodiment of the present invention, the order of the information processing performed by the software testing fixture shown in Fig. 1 and Figure 17 is described.
First, conditional clause expanding unit 27 performs " conditional clause expansion " process (S10) shown in Fig. 4.Specifically, based on " program block line number guide look (DO6) " shown in Figure 12, all conditions sentence is launched.The table of Figure 18 represents " conditional clause launches guide look (D11) " after the result of above-mentioned conditional clause expansion process (S10) being gathered.If statement is directly exported, the situation that else statement utilizes the expression condition contrary with if statement to set up "! " mark.Such as, the program block of the 22nd row in Fig. 5 (b) ~ the 24th row is interpreted as the condition of the 17th row for pseudo-.2 conditions of the 17th row and the 19th row that are interpreted as by the program block of the 26th row in Fig. 5 (b) ~ the 27th row are for pseudo-.
2nd constant group efferent 29 performs " the 2nd global variable writing position is determined " process (S11) shown in Fig. 4.Specifically, based on " conditional clause launches guide look (D11) " of Figure 18 and " global variable writes, read in position guide look (DO9) " of Figure 15, from the program block be associated with the conditional clause launched, determine the program block belonging to position that global variable is write." global variable writing position guide look (D12) " after the result determining that the 2nd above-mentioned global variable writing position process (S11) that represents the table of Figure 19 gathers.Such as, the program block region (18-20) being judged as belonging to shown in Figure 18 to the 19th row of the vTemp write 1 shown in Figure 15.As shown in program block region (32-34) and (36-38), in the program block shown in " conditional clause launches guide look (D11) ", the program block of the line number not retrieving the writing position of global variable is foreclosed.Its reason is, cannot determine the constant that relevance is high based on the intercommunity of the writing position of global variable.
2nd constant group efferent 29 performs " the 1st constant segmentation " process (S12) shown in Fig. 4.Specifically, the constant comprised in the conditional clause in " global variable writing position guide look (D12) " of Figure 19 is extracted, is divided into different the going and show for extracted each constant.The table of Figure 20 represents " in conditional clause constant guide look (D13) " after the result of the 1st above-mentioned constant dividing processing (S12) being gathered.Here, for each position write global variable, mark the 2nd group of ID and constant is classified.Specifically, constant CC1, CC2 are in the group of the constant be referenced in the conditional clause in order to perform needed for the 19th row that writes global variable vTemp, therefore mark " 1 " as the 2nd group of ID.Constant CC1, CC2, CC3 are in the group of the constant be referenced in the conditional clause in order to perform needed for the 23rd row that writes global variable vTemp, therefore mark " 2 " as the 2nd group of ID.Constant CC1, CC2, CC3 are in the group of the constant be referenced in the conditional clause in order to perform needed for the 26th row that writes global variable vTemp, therefore mark " 3 " as the 2nd group of ID.
As described above, according to the 2nd embodiment of the present invention, action effect below can be obtained.
Software testing fixture extracts the constant used in the source code D01 becoming check object, detects the conditional clause extracted constant being carried out to reference, is launched by the conditional clause detected.Further, as shown in figure 20, determine the program block belonging to position that global variable is write, for each position write global variable, the constant of institute's reference in the conditional clause launched by conditional clause expanding unit 27 is classified and exported.Thereby, it is possible to the viewpoint of intercommunity according to the position write global variable, determine the constant group that relevance is high.Thus, easily can verify and whether determined constant group is processed according to specification.Therefore, it is possible to the existence being more than or equal to the constant of 2 that must upgrade according to the condition of specification to user's prompting simultaneously, user can be made to notice, and the consistance changed because of constant is not maintained and the position that likely has problems.
(the 3rd embodiment)
In the 3rd embodiment, the execution sequence based on the position of access variable in source code D01 is determined that the example of the group of the constant that relevance is high is described.In addition, the hardware configuration of software testing fixture is identical with the 1st embodiment (Fig. 1), explanation is omitted.
With reference to Figure 21, the functional structure of the CPU11c involved by the 3rd embodiment is described.CPU11c involved by 3rd embodiment is as constant extraction unit 21, conditional clause test section 22, program block determination portion 25, conditional clause expanding unit 27, access location determination portion 30, access program block determination portion the 31 and the 3rd constant group efferent 32 and working.In addition, constant extraction unit 21, conditional clause test section 22, program block determination portion 25, conditional clause expanding unit 27 are identical with the 1st embodiment or the 2nd embodiment, explanation are omitted.
Access location determination portion 30 determines the variable carrying out writing and reading in source code D01 and the position conducted interviews to this variable.Specifically, determine that the kind of line number and the access conduct interviews to this variable is write or reads in.
Access program block determination portion 31 determines the program block belonging to position determined by access location determination portion 30 from the program block determined by program block determination portion 25.Specifically, in the program block region determined by program block determination portion 25, retrieve the program block region belonging to line number that variable is conducted interviews.
3rd constant group efferent 32, for each variable determined by access location determination portion 30, rearranges the conditional clause launched by conditional clause expanding unit 27 according to the execution sequence of the position determined by access location determination portion 30.Further, for each variable determined by access location determination portion 30, the constant of reference in conditional clause is classified and exports.
[order of the information processing performed by software testing fixture]
Below, with reference to Fig. 3, Fig. 4, Figure 22 ~ Figure 25, as an example of the software inspection method involved by the 3rd embodiment of the present invention, the order of the information processing performed by the software testing fixture shown in Fig. 1 and Figure 21 is described.
First, access location determination portion 30 performs " by variable write, read in and the determine " process (S13) shown in Fig. 3.Specifically, based on Figure 13 " variable guide look (DO7) " and determine the line number that variable write and reads in.The table of Figure 22 represent by above-mentioned by variable write, read in determine the result processing (S13) gather after " by variable write, reading in position guide look (D14) ".Here, the kind (write or read in) of line number and the access that variable vFlag, v, vTemp, temp, temp2 are conducted interviews is determined.In addition, variable read in the position that positional representation variable is in the right of Arithmetic Expressions Using, and the writing position of variable represents the position on the left side being in Arithmetic Expressions Using.
Access location determination portion 30 performs " determining group by the variable " process (S14) shown in Fig. 4.Specifically, for carrying out each variable writing and read in both, classified in variables access position.The variable only carrying out the one writing and read in is foreclosed from classification.The table of Figure 23 represents " group guide look (D15) distinguished by variable " after the above-mentioned result determining to organize process (S14) by variable being gathered.Here, variable vTemp, temp are write and read in both, therefore marks " 1 " and " 2 " respectively as the 3rd group of ID.On the other hand, to the one that variable vFlag, v, temp2 only write and read in, therefore they are foreclosed.
Access program block determination portion 31 performs " access location is determined " process (S15) shown in Fig. 4.Specifically, the program block region belonging to line number variable being write and reads in is determined.The line number write variable and read in is determined according to " group guide look (D15) distinguished by variable " of Figure 23, and program block region is determined according to " program block line number guide look (DO6) " of Figure 12." data stream guide look (D16) " after the result determining that above-mentioned access location process (S15) that represents the table of Figure 24 gathers.Here, for each variable, classified in the kind (write or read in) of the line number of access variable, access, corresponding programme block region and the conditional clause that launches.
3rd constant group efferent 32 performs " the 2nd constant segmentation " process (S16) shown in Fig. 4.The table of Figure 25 represents " constant guide look (D17) distinguished by data stream " after the result of the 2nd above-mentioned constant dividing processing (S16) being gathered.3rd constant group efferent 32 is for each variable vTemp, temp of having marked the 3rd group of ID by determining by variable to organize process (S14), according to by by variable write, read in and determine to process (S13) and the execution sequence of variables access position determined, launched conditional clause is rearranged.Further, the constant comprised in launched each conditional clause is retrieved, for each constant, row is split.By the process of S16, the path till the position of reading in of carrying out variable is analyzed, can according to all conditions, make write and the relation of reading in become clear and definite.3rd constant group efferent, 32 couples of users export " constant guide look (D17) distinguished by data stream " of Figure 25.Thereby, it is possible to the constant relevant to write and the process of reading in is exported as guide look for each variable, can check by carrying out contrasting with the write of specification aspect and the condition of reading in.
As described above, according to the 3rd embodiment of the present invention, action effect below can be obtained.
Software testing fixture extracts the constant used in the source code D01 becoming check object, detects the conditional clause constant extracted being carried out to reference, is launched by the conditional clause detected.The variable determining to carry out writing and reading in source code D01, the position that this variable is conducted interviews, program block belonging to this position.Further, as shown in figure 25, according to the execution sequence of variables access position for each variable, launched conditional clause is rearranged, and the constant of institute's reference in this conditional clause is classified and exported.Thus, based on the group execution sequence of the position that variable conducts interviews being determined to the constant that relevance is high in source code D01.Thus, easily can verify and whether determined constant group is processed according to specification.Therefore, it is possible to the existence being more than or equal to the constant of 2 that must upgrade according to the condition of specification to user's prompting simultaneously, user is noticed, and the consistance changed because of constant is not maintained and the position that likely has problems.
As mentioned above, embodiments of the present invention are recorded, but not should be understood to form the discussion of a part of this disclosure and accompanying drawing limits the present invention.According to the disclosure, to those skilled in the art, various alternate embodiments, embodiment and application technology are apparent.
Here the full content of No. 2013-150225, Japanese Patent Application (applying date is on July 19th, 2013) is quoted.
The explanation of label
21 constant extraction units
22 conditional clause test sections
23 basic underlying variables determination portions
24 the 1st constant group efferents
25 program block determination portions
26 writing position determination portions
27 conditional clause expanding units
28 write-in program block determination portions
29 the 2nd constant group efferents
30 access location determination portions
31 access program block determination portions
32 the 3rd constant group efferents

Claims (7)

1. a software testing fixture, it checks computer program,
This software testing fixture has:
Constant extraction unit, it extracts the constant used in the described computer program becoming check object;
Conditional clause test section, it is from described computer program, detects the conditional clause with reference to the constant extracted by described constant extraction unit;
Basic underlying variables determination portion, the variable compared with described constant in the conditional clause detected by described conditional clause test section is defined as basic underlying variables by it; And
1st constant group efferent, it is classified for each basic underlying variables determined by described basic underlying variables determination portion to the described constant becoming comparison other and exports.
2. software testing fixture according to claim 1, is characterized in that,
Also have:
Program block determination portion, it determines the program block be made up of one group of statement performed when the conditional clause utilizing described conditional clause test section to detect is set up;
Writing position determination portion, it is determined in described computer program the position that global variable writes; And
Write-in program block determination portion, it determines from the program block determined by described program block determination portion the described program block belonging to position determined by said write position determining portions,
Described 1st constant group efferent for each described basic underlying variables, for the establishment of the conditional clause because comparing basic underlying variables and the global variable write classify and export.
3. software testing fixture according to claim 1 and 2, is characterized in that,
Described 1st constant group efferent, for each described basic underlying variables under the state being written into identical value, is classified to described constant.
4. a software testing fixture, it checks computer program,
This software testing fixture has:
Constant extraction unit, it extracts the constant used in the described computer program becoming check object;
Conditional clause test section, it is from described computer program, detects the conditional clause with reference to the constant extracted by described constant extraction unit;
Program block determination portion, it determines the program block be made up of one group of statement performed when the conditional clause utilizing described conditional clause test section to detect is set up;
Conditional clause expanding unit, the conditional clause detected by described conditional clause test section launches by it;
Writing position determination portion, it is determined in described computer program the position that global variable writes;
Write-in program block determination portion, it determines from the program block determined by described program block determination portion the described program block belonging to position determined by said write position determining portions; And
2nd constant group efferent, it is for each position write described global variable, classifies to the constant of reference in the conditional clause launched by described conditional clause expanding unit and exports.
5. a software testing fixture, it checks computer program,
This software testing fixture has:
Constant extraction unit, it extracts the constant used in the described computer program becoming check object;
Conditional clause test section, it is from described computer program, detects the conditional clause with reference to the constant extracted by described constant extraction unit;
Program block determination portion, it determines the program block be made up of one group of statement performed when the conditional clause utilizing described conditional clause test section to detect is set up;
Conditional clause expanding unit, the conditional clause detected by described conditional clause test section launches by it;
Access location determination portion, it determines the variable carrying out writing and reading in described computer program and the position conducted interviews to this variable;
Access program block determination portion, it determines from the program block determined by described program block determination portion the described program block belonging to position determined by described access location determination portion; And
3rd constant group efferent, it is for each variable determined by described access location determination portion, according to the execution sequence of the position determined by described access location determination portion, the conditional clause launched by described conditional clause expanding unit is rearranged, and the constant of reference in this conditional clause is classified and exports.
6. a software inspection method, it checks computer program,
The feature of this software inspection method is,
The constant used in the described computer program becoming check object is extracted,
From described computer program, detect the conditional clause extracted constant being carried out to reference, the variable compared with described constant in the conditional clause detected be defined as basic underlying variables,
For determined each basic underlying variables, the described constant becoming comparison other is classified and exported.
7. a software scrutiny program, it is for checking computer program,
The feature of this software scrutiny program is,
Computing machine is made to realize following functions:
The constant used in the described computer program becoming check object is extracted;
The conditional clause extracted constant being carried out to reference is detected from described computer program;
The variable compared with described constant in the conditional clause detected is defined as basic underlying variables; And
For determined each basic underlying variables, the described constant becoming comparison other is classified and exported.
CN201480051482.1A 2013-07-19 2014-06-19 Software check device, software inspection method Active CN105556484B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2013-150225 2013-07-19
JP2013150225 2013-07-19
PCT/JP2014/066318 WO2015008575A1 (en) 2013-07-19 2014-06-19 Software inspection device, software inspection method, and software inspection program

Publications (2)

Publication Number Publication Date
CN105556484A true CN105556484A (en) 2016-05-04
CN105556484B CN105556484B (en) 2018-02-02

Family

ID=52346048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201480051482.1A Active CN105556484B (en) 2013-07-19 2014-06-19 Software check device, software inspection method

Country Status (3)

Country Link
JP (1) JP6004110B2 (en)
CN (1) CN105556484B (en)
WO (1) WO2015008575A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6572190B2 (en) * 2016-09-23 2019-09-04 株式会社東芝 Software verification system and software verification method
US11237943B2 (en) 2019-03-08 2022-02-01 Fujitsu Limited Generating inputs for computer-program testing

Citations (5)

* 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
CN1834907A (en) * 2005-03-15 2006-09-20 国际商业机器公司 System, method and program product to optimize code during run time
CN102292709A (en) * 2009-04-28 2011-12-21 国际商业机器公司 Method of converting program code of program running in multi-thread to program code causing less lock collisions, computer program and computer system for the same

Family Cites Families (1)

* 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

Patent Citations (5)

* 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
CN1834907A (en) * 2005-03-15 2006-09-20 国际商业机器公司 System, method and program product to optimize code during run time
CN102292709A (en) * 2009-04-28 2011-12-21 国际商业机器公司 Method of converting program code of program running in multi-thread to program code causing less lock collisions, computer program and computer system for the same

Also Published As

Publication number Publication date
JP6004110B2 (en) 2016-10-05
WO2015008575A1 (en) 2015-01-22
JPWO2015008575A1 (en) 2017-03-02
CN105556484B (en) 2018-02-02

Similar Documents

Publication Publication Date Title
Arroyo et al. Automatic derivation of qualitative plant simulation models from legacy piping and instrumentation diagrams
CN101964036B (en) Leak detection method and device
CN102317940B (en) Information processing apparatus, information processing method, and program
CN102804147A (en) Code inspection executing system for performing a code inspection of ABAP source codes
Jiang et al. A framework for studying clones in large software systems
CN103034676A (en) Associative memory visual evaluation tool
Rahman et al. On the relationships between stability and bug-proneness of code clones: An empirical study
WO2015160351A1 (en) Cascading style sheet meta language performance
CN107272441A (en) For monitoring the method for mistake and for monitoring wrong data processing equipment
CN114461534A (en) Software performance testing method and system, electronic equipment and readable storage medium
Li et al. Guiding log revisions by learning from software evolution history
CN102214142A (en) Instrumentation method for traceless manageable source code manually-defined mark
CN108804332A (en) A kind of c program memory overflow intellectualized detection method based on machine learning
CN105556484A (en) Software inspection device, software inspection method, and software inspection program
CN103617122B (en) A kind of comparison method of source code
CN103365772B (en) Software test automatic evaluation device and method
Prazina et al. Methods for Automatic Web Page Layout Testing and Analysis: A Review
Jiang et al. Visualizing clone cohesion and coupling
CN106845228A (en) A kind of method and apparatus for detecting rogue program
Moin et al. Bug localization using revision log analysis and open bug repository text categorization
CN109491882B (en) Case data processing method and system, equipment case and readable storage medium
WO2014112303A1 (en) Missed-data-update review device, missed-data-update review method, and missed-data-update review program
Imazato et al. Finding extract method refactoring opportunities by analyzing development history
CN104937559B (en) Mark accesses flaw detection apparatus and mark accesses defect detecting method
CN115658551B (en) Code testing method, storage medium, electronic device and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant