CN103136103A - Test case reduction method for error locating demand - Google Patents

Test case reduction method for error locating demand Download PDF

Info

Publication number
CN103136103A
CN103136103A CN 201310099877 CN201310099877A CN103136103A CN 103136103 A CN103136103 A CN 103136103A CN 201310099877 CN201310099877 CN 201310099877 CN 201310099877 A CN201310099877 A CN 201310099877A CN 103136103 A CN103136103 A CN 103136103A
Authority
CN
China
Prior art keywords
test case
location
vector
mistake
statement
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.)
Pending
Application number
CN 201310099877
Other languages
Chinese (zh)
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.)
Harbin Institute of Technology
Original Assignee
Harbin Institute of Technology
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 Harbin Institute of Technology filed Critical Harbin Institute of Technology
Priority to CN 201310099877 priority Critical patent/CN103136103A/en
Publication of CN103136103A publication Critical patent/CN103136103A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a test case reduction method for an error locating demand, and belongs to the field of software dynamic testing, and achieves the purposes of providing effective test cases for software error automatic locating, and further improving accuracy of the error locating. The test case reduction method includes the steps of carrying out data preprocessing, carrying out test case reduction based on statement coverage vectors and error locating requirement vectors, carrying out test case reduction based on execution path information, and obtaining a test case set after reduction. The test case reduction method can provide the effective test cases for a C program and a Java program, and improves accuracy of error locating.

Description

A kind of test case reduction method towards the location of mistake demand
Technical field
The present invention relates to a kind of test case reduction method towards the location of mistake demand, belong to the software dynamic testing field.
Background technology
Traditional software error localization method adopts the method that the manual analyses such as breakpoint are set mostly, and not only difficulty is large manually to locate mistake, and extremely consuming time.The software error purpose of location automatically is the run time behaviour that produces by in computer analysis program source code or program operation process, the abnormal conditions in trace routine, and the auxiliary development personnel are the positioning software mistake fast and effeciently.
Existing few test case reduction method towards location of mistake, the statement coverage condition when all only having studied the program operation, the impact on location of mistake of the routing information when having ignored the program operation and error checking use-case.The people such as Hao Dan such as Peking University have studied the test case reduction method that covers based on statement, have proposed different test case yojan strategies, and the test set of high statement covering is provided for the localization of fault based on test case.The author points out, the precision of the redundancy of test case or similar reduction location of mistake.But it has only considered the statement covering, does not consider that the path covers.Yu etc. are used for the test case yojan with relative redundancy thought, propose the test case reduction method based on vector.Proof, compare with the test case reduction method that covers based on statement by experiment, more is conducive to location of mistake based on the test case reduction method of vector.Present test case reduction method, the coverage condition when all only having studied the program operation, the impact on location of mistake of the routing information when having ignored the program operation and error checking use-case.Therefore, these methods have only reached the purpose of yojan test case, and the test case after yojan is also not obvious to the raising effect of location of mistake precision.
Summary of the invention
The objective of the invention is to be intended to solve for software error provides effective test case in the location automatically, and then improve the problem of location of mistake precision, thereby a kind of test case reduction method towards the location of mistake demand is provided.
A kind of test case reduction method towards the location of mistake demand, it comprises the steps:
Step 1: be used for the pretreated step of data;
Step 2: the step that is used for the test case yojan that covers vector sum location of mistake requirement vector based on statement;
Step 3: based on the step that is used for the test case yojan of execution path information;
Step 4: obtain the test use cases after yojan.
Described step 1: be used for the pretreated step of data and be by instrumenter probe insertion program, and catch the step of plug-in mounting information by the Dynamic Execution test case.
Described plug-in mounting information comprises statement coverage information and execution path information.
Described step 2: the step that is used for the test case yojan that covers vector sum location of mistake requirement vector based on statement comprises the steps:
Step 21: the statement corresponding according to the error checking use-case covers vector, miscount location requirement vector: if the location of mistake demand of program is only to locate a mistake, the computing method of location of mistake requirement vector are asked friendship for the covering vector that all error checking use-cases are corresponding; If the location of mistake demand of program is a plurality of mistakes in location, the computing method of location of mistake requirement vector are asked also for the covering vector that all error checking use-cases are corresponding;
Step 22: will cover the statement of all being carried out by all test cases deletion in vector, the residue statement that obtains each test case covers vector sum location of mistake demand residual vector;
Step 23: the residue statement covering vector of each correct test case is asked friendship with location of mistake demand residual vector, if result is 0, should correct test case deletion.
Described step 3: the step that is used for the test case yojan based on execution path information comprises the steps:
Step 31: test case is classified according to execution path information, obtain to have the test case that same sentence covers vector;
Step 32: search execution path information corresponding to test case with same sentence covering vector, with the identical test case deletion of execution route;
Step 33: with the standardization that circulates of remaining path.
Test case reduction method towards the location of mistake demand of the present invention, due to towards the location of mistake demand, deleted correct test case irrelevant with the error checking use-case and that relation is less, and statement covers and the identical test case of execution route, thereby can automatically provide more effective test case in the location for software error, help to improve the software error precision of location automatically.The method can improve 20% with the automatic bearing accuracy of software error, and is applicable to the location of mistake technical field of extensive program code.
The test case reduction method towards the location of mistake demand that the present invention proposes can be C, and java applet provides effective test case, to improve the precision of location of mistake.
Description of drawings
Fig. 1 is the schematic flow sheet of a kind of test case reduction method towards the location of mistake demand of the present invention;
Fig. 2 is based on the test case reduction model schematic diagram that statement covers vector sum location of mistake requirement vector;
Fig. 3 is based on approximately example process schematic diagram of test case that statement covers vector sum location of mistake requirement vector;
Fig. 4 is that the described residue of obtaining of embodiment four covers vectorial schematic diagram;
Fig. 5 is based on the test case yojan example schematic that statement covers vector sum location of mistake requirement vector;
Fig. 6 is based on the test case reduction model schematic diagram of execution path information;
Fig. 7 is based on the test case yojan example schematic of execution path information.
Embodiment
Embodiment one, in conjunction with this embodiment of Fig. 1-7 explanation.A kind of test case reduction method towards the location of mistake demand, it comprises the steps:
Step 1: be used for the pretreated step of data;
Step 2: the step that is used for the test case yojan that covers vector sum location of mistake requirement vector based on statement;
Step 3: based on the step that is used for the test case yojan of execution path information;
Step 4: obtain the test use cases after yojan.
Described test use cases reduces the complexity of location of mistake, improves simultaneously the precision of location of mistake.
What embodiment two, this embodiment were different from embodiment one is described step 1: be used for the pretreated step of data for by instrumenter with probe insertion program, and catch the step of plug-in mounting information by the Dynamic Execution test case.
What embodiment three, this embodiment were different from embodiment one or two is that described plug-in mounting information comprises that statement covers the vector sum execution path information.
What embodiment four, this embodiment were different from embodiment one is described step 2: the step that is used for the test case yojan that covers vector sum location of mistake requirement vector based on statement comprises the steps:
Step 21: the statement corresponding according to the error checking use-case covers vector, miscount location requirement vector: if the location of mistake demand of program is only to locate a mistake, the computing method of location of mistake requirement vector are asked friendship for the covering vector that all error checking use-cases are corresponding; If the location of mistake demand of program is a plurality of mistakes in location, the computing method of location of mistake requirement vector are asked also for the covering vector that all error checking use-cases are corresponding;
Compare with the statement of not carried out by the error checking use-case, the statement of being carried out by the error checking use-case is more likely wrong.And the statement that all correct test cases and error checking use-case are all carried out (as function entrance etc.), the possibility of makeing mistakes is smaller.Based on this thought, we have defined two class location of mistake demands.One class is towards the location of mistake demand that contains the single error program.At this moment, by the statement that all error checking use-cases are all carried out, the possibility of makeing mistakes is larger, and these statements more help to locate mistake, the test case after yojan should be carried out these statements, so the location of mistake requirement vector is used covering vector corresponding to all test cases asked to hand over and obtained.Another kind of is towards the location of mistake demand that comprises a plurality of erroneous procedures, this moment, each error checking use-case may only be carried out one of them or several wrong statement, the statement that each error checking use-case is carried out may be wrong statement, all statements of being carried out by the error checking use-case all will be conducive to locate mistake, so the location of mistake requirement vector is used covering vector corresponding to all error checking use-cases asked and obtained.
Step 22: will cover the statement of all being carried out by all test cases deletion in vector, the residue statement that obtains each test case covers vector sum location of mistake demand residual vector;
By the statement that all correct test cases and error checking use-case are all carried out, little to the contribution of location of mistake.Therefore, with the statement of all being carried out by all test cases deletion that covers in vector, the residue statement that obtains each test case covers vector sum location of mistake demand residual vector;
Step 23: the residue statement covering vector of each correct test case is asked friendship with location of mistake demand residual vector, if result is 0, show that this correct test case and location of mistake demand are irrelevant or relation is less, should correct test case deletion.
What embodiment five, this embodiment were different from embodiment 1 or 3 is described step 3: the step that is used for the test case yojan based on execution path information comprises the steps:
Step 31: test case is classified according to execution path information, obtain to have the test case that same sentence covers vector;
Step 32: search execution path information corresponding to test case with same sentence covering vector, with the identical test case deletion of execution route;
Step 33: with the standardization that circulates of remaining path.
The standardized method that circulates is: by implementation of test cases, obtain the corresponding execution route of each test case, record repeated fragment and multiplicity in execution route, and repeated fragment is deleted.
Basic conception of the present invention is: because the error checking use-case more is conducive to the positioning software mistake than correct test case, therefore a test case reduction method that helps to improve the software error bearing accuracy must preferentially be selected the more effective test case of location of mistake, the test case that deletion is irrelevant with location of mistake or relation is less.At first, take into full account the error checking use-case to the impact of location of mistake, carry out the test case yojan based on statement covering and location of mistake requirement vector.Secondly, carry out the test case yojan based on execution path information, by the circulation standardization, the too much test case of cycle index in the deletion execution route, the coverage rate of balanced each statement.Finally obtain the more effective test use cases of location of mistake, as the input of location of mistake, to improve the precision of location of mistake.
Embodiment:
In conjunction with Fig. 2, Fig. 4, Fig. 5 and Fig. 7, this specific embodiment is described.
Loading routine mid () and test use cases { t 1, t 2..., t 8; During representative operation test case, statement is performed; P and F represent that execution result is correct (Pass) and wrong (Fail).In statement covered vector, the statement that is performed represented with 1, and the statement that is not performed represents with 0.Statement and execution order of statement that execution route vector record is performed, after namely program being carried out plug-in mounting, implementation of test cases t 1, can get statement and cover vector { 1,1,1,1,0,1,1,0,0,0,0,0,1}, execution route vector { 1,2,3,4,6,7,13}.
Implementation of test cases collection { t 1, t 2..., t 8After the whole statements that obtain cover vectors and carry out yojan: in Fig. 4, statement 1,2,3,13 are all carried out by all test cases, all test cases are perform statement 12 not all, therefore, statement 1,2,3,12,13 are irrelevant statement.The covering Definition of Vector that the present invention will delete after irrelevant statement is residual vector, and for test case t, residual vector is designated as RCOV (t).
The residue statement covering vector of each correct test case is asked friendship with location of mistake demand residual vector, if result is 0, should correct test case deletion.In Fig. 5, RCOV (t req) be the residual vector of location of mistake requirement vector, RCOV (t 1), RCOV (t 2) ..., RCOV (t 6) be residual vector corresponding to correct test case.RCOV (t 3) ∩ RCOV (t reqTest case t is deleted in)=0 therefore 3Obtain based on the test use cases { t after the test case yojan of statement covering and location of mistake requirement vector 1, t 2, t 5, t 7, t 8.
Carry out the process that is used for the test case yojan based on execution path information, the corresponding execution route vector of test case t is designated as PATH (t), and the execution route vector after the circulation standardization is designated as PATH ' (t).For example for test case t 1, cycle region series is 4,5,6,7, cycle index is 2 times.PATH (t 1) and PATH (t 3) path vector after the circulation standardization is identical, i.e. PATH ' (t 1) and PATH ' (t 3) identical, in the present invention, same paths after the circulation standardization is defined as Similar Track (similar paths).For Similar Track, delete other identical test cases, only keep one of them test case.PATH (t 4) and PATH (t 5) path is identical, is designated as same paths (identical paths), for same paths, deletes other identical test cases, only keeps one of them test case.

Claims (5)

1. the test case reduction method towards the location of mistake demand, is characterized in that it comprises the steps:
Step 1: be used for the pretreated step of data;
Step 2: the step that is used for the test case yojan that covers vector sum location of mistake requirement vector based on statement;
Step 3: based on the step that is used for the test case yojan of execution path information;
Step 4: obtain the test use cases after yojan.
2. a kind of test case reduction method towards the location of mistake demand according to claim 1, the detailed process that it is characterized in that described step 1 for by instrumenter with in probe insertion program, and catch the step of plug-in mounting information by the Dynamic Execution test case.
3. a kind of test case reduction method towards the location of mistake demand according to claim 2, is characterized in that described plug-in mounting information comprises that statement covers the vector sum execution path information.
4. according to claim 1,2 or 3 described a kind of test case reduction methods towards the location of mistake demand is characterized in that described step 2: the step that is used for the test case yojan that covers vector sum location of mistake requirement vector based on statement comprises the steps:
Step 21: the statement corresponding according to the error checking use-case covers vector, miscount location requirement vector: if the location of mistake demand of program is only to locate a mistake, the computing method of location of mistake requirement vector are asked friendship for the covering vector that all error checking use-cases are corresponding; If the location of mistake demand of program is a plurality of mistakes in location, the computing method of location of mistake requirement vector are asked also for the covering vector that all error checking use-cases are corresponding;
Step 22: will cover the statement of all being carried out by all test cases deletion in vector, the residue statement that obtains each test case covers vector sum location of mistake demand residual vector;
Step 23: the residue statement covering vector of each correct test case is asked friendship with location of mistake demand residual vector, if result is 0, should correct test case deletion.
5. a kind of test case reduction method towards the location of mistake demand according to claim 4 is characterized in that described step 3: the step that is used for the test case yojan based on execution path information comprises the steps:
Step 31: test case is classified according to execution path information, obtain to have the test case that same sentence covers vector;
Step 32: search execution path information corresponding to test case with same sentence covering vector, with the identical test case deletion of execution route;
Step 33: with the standardization that circulates of remaining path.
CN 201310099877 2013-03-26 2013-03-26 Test case reduction method for error locating demand Pending CN103136103A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201310099877 CN103136103A (en) 2013-03-26 2013-03-26 Test case reduction method for error locating demand

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201310099877 CN103136103A (en) 2013-03-26 2013-03-26 Test case reduction method for error locating demand

Publications (1)

Publication Number Publication Date
CN103136103A true CN103136103A (en) 2013-06-05

Family

ID=48495953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201310099877 Pending CN103136103A (en) 2013-03-26 2013-03-26 Test case reduction method for error locating demand

Country Status (1)

Country Link
CN (1) CN103136103A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995780A (en) * 2014-05-30 2014-08-20 浙江理工大学 Program error positioning method based on statement frequency statistics
CN104008051A (en) * 2014-05-16 2014-08-27 南京邮电大学 Method for positioning software defects by redundancy removing and optimizing of frequency spectrum information
CN104252408A (en) * 2013-06-26 2014-12-31 国际商业机器公司 Method and device for providing test case
CN105426312A (en) * 2015-12-31 2016-03-23 北京经纬恒润科技有限公司 Test suite generation method and device for smoke tests
CN105468517A (en) * 2015-11-10 2016-04-06 中国矿业大学 Statistical error positioning method based on reduction of black-box test case
US9910763B1 (en) 2016-08-18 2018-03-06 International Business Machines Corporation Test case reduction in application binary interface (ABI) compatibility testing
CN111949549A (en) * 2020-08-31 2020-11-17 携程计算机技术(上海)有限公司 Test request screening method, system, electronic device and storage medium

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252408A (en) * 2013-06-26 2014-12-31 国际商业机器公司 Method and device for providing test case
US9811446B2 (en) 2013-06-26 2017-11-07 International Business Machines Corporation Method and apparatus for providing test cases
CN104252408B (en) * 2013-06-26 2017-04-12 国际商业机器公司 Method and device for providing test case
CN104008051B (en) * 2014-05-16 2017-04-26 南京邮电大学 Method for positioning software defects by redundancy removing and optimizing of frequency spectrum information
CN104008051A (en) * 2014-05-16 2014-08-27 南京邮电大学 Method for positioning software defects by redundancy removing and optimizing of frequency spectrum information
CN103995780A (en) * 2014-05-30 2014-08-20 浙江理工大学 Program error positioning method based on statement frequency statistics
CN103995780B (en) * 2014-05-30 2017-01-04 浙江理工大学 A kind of program error localization method based on sentence frequency statistics
CN105468517B (en) * 2015-11-10 2018-03-02 中国矿业大学 A kind of mistake of statistics localization method based on Black-box testing Cases yojan
CN105468517A (en) * 2015-11-10 2016-04-06 中国矿业大学 Statistical error positioning method based on reduction of black-box test case
CN105426312A (en) * 2015-12-31 2016-03-23 北京经纬恒润科技有限公司 Test suite generation method and device for smoke tests
US9910763B1 (en) 2016-08-18 2018-03-06 International Business Machines Corporation Test case reduction in application binary interface (ABI) compatibility testing
CN111949549A (en) * 2020-08-31 2020-11-17 携程计算机技术(上海)有限公司 Test request screening method, system, electronic device and storage medium
CN111949549B (en) * 2020-08-31 2024-02-27 携程计算机技术(上海)有限公司 Test request screening method, system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN103136103A (en) Test case reduction method for error locating demand
US10108536B2 (en) Integrated automated test case generation for safety-critical software
Herzig et al. Empirically detecting false test alarms using association rules
CN105721193B (en) System information monitoring method and device
Bissyandé et al. Empirical evaluation of bug linking
US8151248B1 (en) Method and system for software defect management
US20190171549A1 (en) Extraction of problem diagnostic knowledge from test cases
CN104732152B (en) Buffer-overflow vulnerability automatic testing method based on the beta pruning of semiology analysis path
CN110515826A (en) A kind of software defect positioning method based on number frequency spectrum and neural network algorithm
CN103294596B (en) A kind of contract software fault method for early warning based on program invariants
CN105468517B (en) A kind of mistake of statistics localization method based on Black-box testing Cases yojan
CN103294594A (en) Test based static analysis misinformation eliminating method
CN107862327B (en) Security defect identification system and method based on multiple features
CN106776339A (en) Automated testing method and device
CN103198016B (en) Based on combining the software error localization method relying on probabilistic Modeling
CN111400505A (en) Method and system for matching fault elimination scheme of power consumption information acquisition system
CN104216825A (en) Problem locating method and system
CN106529304B (en) A kind of Android applies concurrent leakage location
CN106681909A (en) Online transaction fault locating method and device
CN111752833B (en) Software quality system approval method, device, server and storage medium
CN104598375A (en) Failure prediction method for software development
CN107291622A (en) C25 assembly code Static Analysis Methods
CN103150254B (en) Error locating method for software based on state-dependent probabilistic modeling
CN108984402B (en) Software fault positioning system for removing perfect understanding hypothesis
Siddique et al. Hybrid Framework To Exclude Similar and Faulty Test Cases In Regression Testing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20130605