CN103678121A - Testing case priority ordering method for embedded binary system software - Google Patents

Testing case priority ordering method for embedded binary system software Download PDF

Info

Publication number
CN103678121A
CN103678121A CN201310580933.8A CN201310580933A CN103678121A CN 103678121 A CN103678121 A CN 103678121A CN 201310580933 A CN201310580933 A CN 201310580933A CN 103678121 A CN103678121 A CN 103678121A
Authority
CN
China
Prior art keywords
function
test case
matrix
ordering
call
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
CN201310580933.8A
Other languages
Chinese (zh)
Other versions
CN103678121B (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.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi University
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 Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN201310580933.8A priority Critical patent/CN103678121B/en
Publication of CN103678121A publication Critical patent/CN103678121A/en
Application granted granted Critical
Publication of CN103678121B publication Critical patent/CN103678121B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a testing case priority ordering method for embedded binary system software. A traditional testing case ordering technology is used for carrying out ordering on execution priorities according to certain ordering strategies and is low in detection efficiency. According to the testing case ordering technology based on functional dependence, dependence between testing cases serves as an important factor to be considered. At first, a calling relation between functions is analyzed according to a binary program, then a corresponding adjacent matrix is generated according to the relation, a reachable matrix is further generated according to dynamic programming ideas, and ordering is carried out on the testing cases through the reachable matrix. Accordingly, limitation caused by the fact that little consideration is given to dependency of the testing cases in the traditional testing case ordering technology is overcome, and a testing case order according with the actual operation conditions of programs is generated.

Description

A kind of embedded binary software test case prioritization method
Technical field
The invention belongs to software testing technology field, relate to a kind of embedded binary software test case prioritization method.
Background technology
Software test has extremely important effect for software development, but meanwhile software test is also an expensive process in software development.Tester utilizes test case to carry out performance test to software, but exhaustive testing is unpractical method for the limited construction cycle.Tester can be a test case that Software Create is a large amount of by Software Testing Tool, for software test, how maximum obstacle is to concentrate and to filter out the test case subset that meets this software and make this subset can reduce the expense of software test from huge test case, and good test coverage can be provided.
Researcher both domestic and external has done a large amount of research work for the choice and operation problem of test case, test case reduction technique (Test case reduction) and Test Case Prioritization technology (Test case prioritization) are exactly relative proven technique wherein, and these two kinds of technology have solved the screening problem of test case by less cost.
But these two kinds of technology all have some limitations, and are mainly reflected in: the test use cases of TCR technology after for yojan, may can detect some the test case of software vulnerability originally and delete as redundancy testing use-case.The simpler collection obtaining thus will decline to some extent on error detection capability, has lost the possibility that detects potential leak.Conventional TCP technology is paid attention to according to a certain ordering strategy, test case be sorted, and ignored the restriction relation existing between test case, make final ranking results not meet actual function call, although to a certain degree improving the efficiency of error detection but still having the space of lifting.
Summary of the invention
The present invention is directed to the deficiencies in the prior art, a kind of embedded binary software test case prioritization method is provided.
The inventive method specifically comprises the following steps:
Step 1) analysis of built-in binary software function calling relationship, mapping function table, obtains function representation information, and special function is called to situation and process, and finally obtains whole function calling relationship.
Step 2) analytic function call relation, constructor call relation adjacency matrix, and generate reachability matrix by matrix operation, obtain the dependence between function.
Step 3), according to dependence between function, is utilized reachability matrix, the sequencing of function test is sorted, and according to this order, test case is sorted.
Beneficial effect of the present invention:
1. this technology is considered the relation between modules in software systems, the involved module of test case is more just more easily finds existing mistake in software systems, and therefore the Test Case Prioritization based on functional dependence can be found the mistake existing in software systems more efficiently.
2. this technology is by priority ordering, and the test case of preferential right of execution limit for height, the in the situation that of therefore limited in the test duration, still can be preferentially carried out important test case, thereby cut down software test cost.
Accompanying drawing explanation
Fig. 1 is for analyzing the idiographic flow of binary file function call.
Fig. 2 is for generating the idiographic flow of reachability matrix.
Embodiment
The present invention is a kind of optimized treatment method to test use cases, is intended to test case after making to process by this technology when software is detected, and can play efficient error detection, cuts down the effect of testing cost.
The present invention includes following steps:
Step 1) analysis of built-in binary software function calling relationship, mapping function table, obtains function representation information, and special function is called to situation and process, and finally obtains whole function calling relationship.
Step 2) analytic function call relation, constructor call relation adjacency matrix, and generate reachability matrix by matrix operation, obtain the dependence between function.
Step 3), according to dependence between function, is utilized reachability matrix, the sequencing of function test is sorted, and according to this order, test case is sorted.
Wherein step 1) specifically comprises the steps:
1) binary file is carried out to structure analysis, sprocket bit table, and therefrom extract the information of function, set up function information table.
2) navigate to principal function entry address, from principal function entry address, start every instruction traversal program, and from the instruction of each function entrance address, start to carry out depth-first search in order, collect the recalls information of function.
3) special function is called to situation and process, special function comprises system function and jump instruction; System function for starting with " _ " after compiling, directly filters out; For jump instruction, if redirect order way address is the address of function, according to generic function call instruction, processes, otherwise be considered as statement jump instruction.
Step 2 wherein) specifically comprise the steps:
1) whether the result after utilizing binary program to analyze, there is call relation between analytic function, and call relation constructs the adjacency matrix of N * N according to this.
2) utilize this adjacency matrix, each element in Ergodic Matrices, judges according to its subscript i and j whether corresponding function exists call relation successively.
3) if exist call relation to travel through next element; If not having call relation considers not judge whether to exist path by being included in other nodes in path.
4) all elements of searching loop, finally obtain corresponding reachability matrix.
Wherein step 3) comprises the steps:
1) according to the final adjacency matrix generating, calculate the number that comprises 1 in every a line, and sort by the order of successively decreasing, now can obtain the complex relationship of function call.
2) check the test case that need to carry out program detection, analyze the function of each test case process.
3) according to the ranking results of the 1st step, test case is sorted, give the highest preferential right of execution to the test case that comprises maximum call relations, finally obtain by that analogy Test Case Prioritization result.
Below in conjunction with accompanying drawing, the invention will be further described.
Binary file itself be to store according to certain form, concrete as stored with elf file layout under Linux platform, elf file layout is as shown in table 1, comprise file header, program header table, paragraph header table, symbol table, string table, relocation table, dynamic link table etc., from the different sections of file, we can obtain some functions and call relevant information.
Table 1
Figure 137127DEST_PATH_IMAGE002
The function calling relationship main thought of analyzing in binary file is as follows: each function in traversal program, starts to carry out depth-first scanning from the instruction of each function start address.Process each instruction of function, when instruction that instruction is call subroutine, calculate concrete jump target addresses, the start address of the function in jump address function information table is mated, obtain the information of called function, and its function identification numbering id is joined the team, after complete this function of depth-first traversal, element in team is gone out to team, it is carried out to recurrence traversal.When function identification id is joined the team, do not need to check whether repeat to join the team.Main flow process as shown in Figure 1.
According to the function calling relationship of gained after analyzing, generate corresponding adjacency matrix, then utilize the thought of dynamic programming to generate reachability matrix.Concrete steps are as follows: whether travel through successively each element in adjacency matrix, be 1 to carry out different processing according to corresponding element.If 1 represents to have call relation between function that this element is corresponding, travels through next element; If 0 represents not have call relation between function that this element is corresponding, now consider whether there is call relation in the situation of node by other, if exist call relation also this element to be set to 1 otherwise be just set to 0, loop iteration until all elements be all traversed.Now the matrix of gained is exactly final reachability matrix.Main flow process as shown in Figure 2.
According to the number of element 1 in the every a line of reachability matrix, all functions are carried out to sort descending, what in function, comprise 1 represents that the dependence between this function and other functions is higher more at most, therefore can whether comprise the sequence that this function carries out execution priority according to test case, finally just can obtain the priority ordering result of test case.
The present invention as an integral body, has more fully considered the call relation between function by whole test cases, the practical operation situation that therefore test case after sequence is more in order when error detection, thereby the error detection efficiency of raising test case.

Claims (4)

1. an embedded binary software test case prioritization method, for the effective requirement of embedded binary software, by test case prioritization is improved to defect found efficiency, shortens software issuing time, it is characterized in that comprising the steps:
Step 1) analysis of built-in binary software function calling relationship, mapping function table, obtains function representation information, and special function is called to situation and process, and finally obtains whole function calling relationship;
Step 2) analytic function call relation, constructor call relation adjacency matrix, and generate reachability matrix by matrix operation, obtain the dependence between function;
Step 3), according to dependence between function, is utilized reachability matrix, the sequencing of function test is sorted, and according to this order, test case is sorted.
2. a kind of embedded binary software test case prioritization method according to claim 1, is characterized in that: step 1) specifically comprises the steps:
1) binary file is carried out to structure analysis, sprocket bit table, and therefrom extract the information of function, set up function information table;
2) navigate to principal function entry address, from principal function entry address, start every instruction traversal program, and from the instruction of each function entrance address, start to carry out depth-first search in order, collect the recalls information of function;
3) special function is called to situation and process, special function comprises system function and jump instruction; System function for starting with " _ " after compiling, directly filters out; For jump instruction, if redirect order way address is the address of function, according to generic function call instruction, processes, otherwise be considered as statement jump instruction.
3. a kind of embedded binary software test case prioritization method according to claim 1 is characterized in that: step 2) specifically comprise the steps:
1) whether the result after utilizing binary program to analyze, there is call relation between analytic function, and call relation constructs the adjacency matrix of N * N according to this;
2) utilize this adjacency matrix, each element in Ergodic Matrices, judges according to its subscript i and j whether corresponding function exists call relation successively;
3) if exist call relation to travel through next element; If not having call relation considers not judge whether to exist path by being included in other nodes in path;
4) all elements of searching loop, finally obtain corresponding reachability matrix.
4. a kind of embedded binary software test case prioritization method according to claim 1, is characterized in that: step 3) comprises the steps:
1) according to the final adjacency matrix generating, calculate the number that comprises 1 in every a line, and sort by the order of successively decreasing, now can obtain the complex relationship of function call;
2) check the test case that need to carry out program detection, analyze the function of each test case process;
3) according to the ranking results of the 1st step, test case is sorted, give the highest preferential right of execution to the test case that comprises maximum call relations, finally obtain by that analogy Test Case Prioritization result.
CN201310580933.8A 2013-11-18 2013-11-18 A kind of embedded binary software test case prioritization method Active CN103678121B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310580933.8A CN103678121B (en) 2013-11-18 2013-11-18 A kind of embedded binary software test case prioritization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310580933.8A CN103678121B (en) 2013-11-18 2013-11-18 A kind of embedded binary software test case prioritization method

Publications (2)

Publication Number Publication Date
CN103678121A true CN103678121A (en) 2014-03-26
CN103678121B CN103678121B (en) 2016-03-02

Family

ID=50315756

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310580933.8A Active CN103678121B (en) 2013-11-18 2013-11-18 A kind of embedded binary software test case prioritization method

Country Status (1)

Country Link
CN (1) CN103678121B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105824746A (en) * 2015-01-05 2016-08-03 中国移动(深圳)有限公司 Method and device for automatically generating test scheduling based on use case dependencies
CN108287785A (en) * 2017-01-09 2018-07-17 富士通株式会社 Test case sort method and equipment
CN109086050A (en) * 2018-07-04 2018-12-25 烽火通信科技股份有限公司 A kind of analysis method and system of module dependencies
CN110825621A (en) * 2019-10-16 2020-02-21 四川大学 Regression test case priority calculation method based on dynamic risk
CN116303098A (en) * 2023-05-17 2023-06-23 北京翼辉信息技术有限公司 Application testing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009149815A1 (en) * 2008-05-19 2009-12-17 Johnson Controls Technology Company Method of automatically formulating test cases for verifying at least one part of a piece of software
CN101866317A (en) * 2010-06-29 2010-10-20 南京大学 Regression test case selection method based on cluster analysis
CN102831055A (en) * 2012-07-05 2012-12-19 陈振宇 Test case selection method based on weighting attribute
CN102915271A (en) * 2012-10-31 2013-02-06 北京邮电大学 Method for optimizing unit regression test case set based on control flow diagram

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009149815A1 (en) * 2008-05-19 2009-12-17 Johnson Controls Technology Company Method of automatically formulating test cases for verifying at least one part of a piece of software
CN101866317A (en) * 2010-06-29 2010-10-20 南京大学 Regression test case selection method based on cluster analysis
CN102831055A (en) * 2012-07-05 2012-12-19 陈振宇 Test case selection method based on weighting attribute
CN102915271A (en) * 2012-10-31 2013-02-06 北京邮电大学 Method for optimizing unit regression test case set based on control flow diagram

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈翔;陈继红;鞠小林;顾庆: "回归测试中的测试用例优先排序技术述评", 《软件学报》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105824746A (en) * 2015-01-05 2016-08-03 中国移动(深圳)有限公司 Method and device for automatically generating test scheduling based on use case dependencies
CN105824746B (en) * 2015-01-05 2018-09-25 中移信息技术有限公司 A kind of method and apparatus that test dispatching is automatically generated based on use-case dependence
CN108287785A (en) * 2017-01-09 2018-07-17 富士通株式会社 Test case sort method and equipment
CN108287785B (en) * 2017-01-09 2021-06-22 富士通株式会社 Test case ordering method and device
CN109086050A (en) * 2018-07-04 2018-12-25 烽火通信科技股份有限公司 A kind of analysis method and system of module dependencies
CN109086050B (en) * 2018-07-04 2021-11-30 烽火通信科技股份有限公司 Method and system for analyzing module dependency relationship
CN110825621A (en) * 2019-10-16 2020-02-21 四川大学 Regression test case priority calculation method based on dynamic risk
CN116303098A (en) * 2023-05-17 2023-06-23 北京翼辉信息技术有限公司 Application testing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN103678121B (en) 2016-03-02

Similar Documents

Publication Publication Date Title
CN103678121B (en) A kind of embedded binary software test case prioritization method
CN105022691B (en) A kind of increasingly automated method for testing software based on uml diagram
CN101436128B (en) Software test case automatic generating method and system
CN106126413B (en) The Software Defects Predict Methods of packaging type feature selecting based on the study of class imbalance and genetic algorithm
CN102253889B (en) Method for dividing priorities of test cases in regression test based on distribution
CN102508780B (en) Crossed dynamic software testing method and device
CN104008053B (en) A kind of dynamic symbol executive path search method for vulnerability mining
CN107193745B (en) Automated construction method of the PLC program to NuSMV input model
CN104598383A (en) Mode-based dynamic vulnerability discovery integrated system and mode-based dynamic vulnerability discovery integrated method
CN102368226A (en) Method for automatically generating test cases based on analysis on feasible paths of EFSM (extended finite state machine)
CN102231134A (en) Method for detecting redundant code defects based on static analysis
CN103116493B (en) A kind of automatic mapping method being applied to coarse-grained reconfigurable array
CN103116540A (en) Dynamic symbol execution method and device based on global superblock domination graph
CN102968375B (en) Based on the infeasible paths detection method of association rule mining
CN105528289A (en) Regression test case prioritization method based on branch coverage and similarity
CN105446881A (en) Automatic detection method for program unaccessible paths
CN103714000A (en) Sensitive area-oriented embedded software test case generating method
CN103744415A (en) Subway-CBTC testing method and device
CN106021101A (en) Method and device for testing mobile terminal
CN105487983B (en) Sensitive spot approach method based on intelligent Route guiding
CN103309805A (en) Automatic selection method for test target in object-oriented software under xUnit framework
CN101661409B (en) Extraction method of parallel program communication mode and system
CN104298677A (en) Method and system of identifying dependency relationship of concerns
CN110598417B (en) Software vulnerability detection method based on graph mining
CN108897678B (en) Static code detection method, static code detection system and storage device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20140326

Assignee: Hangzhou Oko Technology Co., Ltd

Assignor: Hangzhou Electronic Science and Technology Univ

Contract record no.: X2019330000040

Denomination of invention: Testing case priority ordering method for embedded binary system software

Granted publication date: 20160302

License type: Common License

Record date: 20191107