CN101859276B - Regression testing case selection method based on hierarchical slicing - Google Patents

Regression testing case selection method based on hierarchical slicing Download PDF

Info

Publication number
CN101859276B
CN101859276B CN2010101737873A CN201010173787A CN101859276B CN 101859276 B CN101859276 B CN 101859276B CN 2010101737873 A CN2010101737873 A CN 2010101737873A CN 201010173787 A CN201010173787 A CN 201010173787A CN 101859276 B CN101859276 B CN 101859276B
Authority
CN
China
Prior art keywords
level
statement
hierarchical
test case
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.)
Expired - Fee Related
Application number
CN2010101737873A
Other languages
Chinese (zh)
Other versions
CN101859276A (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.)
Southeast University
Original Assignee
Southeast 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 Southeast University filed Critical Southeast University
Priority to CN2010101737873A priority Critical patent/CN101859276B/en
Publication of CN101859276A publication Critical patent/CN101859276A/en
Application granted granted Critical
Publication of CN101859276B publication Critical patent/CN101859276B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a regression testing case selection method based on hierarchical slicing, which adopts the hierarchical slicing technology based on the effect of the slicing technology in program decomposition, the advantages of the hierarchical slicing technology in object-oriented programs, and the characteristics of regression testing case selection. The hierarchical slicing criteria are extracted from version modification information. The method comprises the following steps: at the packet level, acquiring packet-level coverage of an original testing case, and selecting testing cases capable of covering a packet-level slice set; at the class level, acquiring class-level coverage of the packet-level testing cases, and selecting testing cases capable of covering a class-level slice set from the packet-level testing cases; at the method level, acquiring method-level coverage of the class-level testing cases, and selecting testing cases capable of covering a method-level slice set from the class-level testing cases; and at the statement level, acquiring statement-level coverage of the method-level testing cases, and selecting testing cases capable of covering a statement-level slice set from the method-level testing cases.

Description

A kind of regression test case selection method based on hierarchical slicing
Technical field
The present invention proposes a kind of regression test case selection method based on hierarchical slicing, mainly is to utilize the thought of level to solve the selection problem of reusing of regression test case in the object-oriented program, belongs to the technical field that regression test case is selected in the software test.
Background technology
Regression test is the stage of expending cost in the software maintenance most, and how effectively reusing regression test case is an important research task.Main regression test case reuse technology is that test case is selected and test case priority at present.It is the major technique that regression test case is reused that test case is selected, and it is according to original program and existing regression test case, and the test case that analysis need be reruned therefrom selects the partial test use-case to move amended program then.Regression test case is selected problem mainly to be summed up as and is revised analysis and test covering analyzing.Revise and analyze exactly according to being revised the part that influences in the modification of program point analysis program.How the test covering analyzing utilizes test case that modification of program point and influenced part thereof are covered.The main method that regression test case is selected comprises linear equation, symbol execution, path analysis, control stream, data stream, program dependency graph, system dependence graph, fire wall, bunch identification, program slicing technique etc.
Section is an effective program decomposition technique, also is a kind of important regression test case selection method.Utilize microtomy to calculate section, can effectively identify and revised the program part that influences revising point.The early stage main means of using microtomy to carry out the regression test case selection are; Calculate the section of test case input to program output; Such as Dynamic Slicing, execution section, relevant section etc.,, then select corresponding test case if comprise the modification statement in the section that calculates.A kind of in addition dicing method that uses data stream is that " definition-use " relation of utilizing data-flow analysis to be revised to influence is right, select then should " definition-use relation " correspondence test case.
Because exist a lot of complex properties such as polymorphic, dynamic binding in the object-oriented program, the influence that makes modification of program produce is complicated more and hidden, thereby very difficultly effectively carry out the selection of regression test case.Microtomy effectively routine analyzer is revised the influence that produces, but traditional section can not be satisfied the part demand of object-oriented program.And some object-oriented section more complicated, also out of true.Therefore, need a kind of novel section means to support the regression test case under the object-oriented program to select.
Summary of the invention
Technical matters: the objective of the invention is to use the regression test case of hierarchical slicing technical support object-oriented program to select.This method can be according to the logical level of object-oriented program itself; From the coarseness to the fine granularity; Progressively refinement select regression test case, also can on different grain size, select test case simultaneously, the granularity problem of selecting for actual regression test provides Selection Framework flexibly.
Technical matters: the present invention adopts following technical scheme for realizing above-mentioned purpose:
A kind of regression test case selection method based on hierarchical slicing of the present invention comprises the steps:
Step 1). Version Control is obtained the modification point m that need carry out the regression test program;
Step 2). utilize hierarchical slicing instrument JHSA to calculate the hierarchical slicing collection of revising some m, identify the part that influenced by modification of program, its section result is bag grade pet chip collection, type grade pet chip collection, method grade pet chip collection and statement level section collection;
Step 3). carry out the level regression test case from the bag level to statement level and select;
A) on package level, select it the test use cases T and coat and cover energy collecting and enough cover the test use cases T that wraps the grade pet chip collection from waiting to reuse p
B) on class hierarchy, from test use cases T pIn select enough test use cases T of type of covering grade pet chip collection of its type covering energy collecting c
C) on the method level, from test use cases T cIn select the test use cases T that its method covers the enough covering method grade pet chip collection of energy collecting m
D) on the statement level, from test use cases T mIn select its statement and cover the test use cases T that energy collecting enough covers statement level section collection s
Beneficial effect: the inventive method has proposed a kind of level regression test case selection method of progressively refinement; Through utilizing microtomy identification in regression test is selected to revise the effect and the advantage of hierarchical slicing method in object-oriented program of influence, be mainly used in accuracy and the level problem that regression test case is selected that solve.Mainly contain following advantages:
(1) utilizes microtomy to carry out Program Change Analysis, can more accurately identify and revised the program part that influences.Utilize microtomy can effectively identify and revise other parts of program of spot correlation.These parts all might make calling program change or lead to errors.Traditional service routine dicing method has only used the partial data stream technology, and does not carry out effective program slice to revising point.Our microtomy is based on system dependence graph, so taken all factors into consideration data stream and control stream.Can guarantee greatly that like this regression test case of selecting can cover the program part that is influenced.
(2) utilize the advantage of hierarchical slicing in the object-oriented program section, improved the accuracy that regression test is selected.Hierarchical slicing is a kind of microtomy to object-oriented program, and section is compared with tradition, and it can be according to the programmed logic hierarchy, and progressively refinement calculates section.Especially in having complicated program such as polymorphism and dynamic binding, utilize hierarchical slicing and to have deleted and program part that the section criterion has nothing to do in the high-level accurate recognition part relevant with the section criterion.So just guaranteed the accuracy that regression test is selected, reduced the selection of unnecessary test case, thereby reduced the regression test cost.
(3) utilize the level of hierarchical slicing to provide optional regression test to select granularity.Modification is analyzed and the test covering need be carried out on same granularity.The character of test case, modification of program point position and the characteristics of program own have all influenced the regression test selection to a great extent.In the reality test, according to realities such as cost analyses, we possibly select in the enterprising line retrace test of thicker relatively granularity.Our method can be carried out the regression test selection from package level to the statement level, for the reality test provides Selection Framework flexibly.
Description of drawings
Fig. 1 is the abstract graph that is directed against the hierarchical slicing model of java applet used in the present invention.
Fig. 2 is the bright hierarchical slicing instrument general frame figure that realizes of this law.
Fig. 3 is the process synoptic diagram that general regression test case that the present invention adopts is selected.This selection course is divided into test covering analyzing part and analyzes two parts with revising, and makes the test case of selecting can reflect modification of program and influence thereof.
Fig. 4 is an architecture of the present invention.The main examples of components that expression the inventive method comprises.
Fig. 5 is a process flow diagram of the present invention.The flow process signal of expression the inventive method.
Embodiment
Be elaborated below in conjunction with the technical scheme of accompanying drawing to invention:
Hierarchical slicing is a kind of dicing method to object-oriented program, and it progressively calculates to refinement section at all levels according to the object-oriented program characteristics according to logical level.Such as in java applet, utilize hierarchical slicing to obtain section at all levels to statement level from bag level, last also progressively refinement calculated the section of fine granularity statement level.
The present invention utilizes effect and hierarchical slicing technology the advantage in object-oriented program of microtomy in program is decomposed; And characteristics in conjunction with the regression test case selection; With the hierarchical slicing technical application wherein, stress accuracy and the level that regression test case is selected.
Fig. 3 has provided the general process synoptic diagram that the regression test that we adopted is selected.The regression test is here selected to mainly contain two parts and is formed: revise and analyze and the test covering analyzing.Revise to analyze and revised the part that influences according to revising in the point analysis program.Under the situation that modification of program information is not known, usually original program and amended program are compared, utilize grammer, semanteme or control stream etc. to carry out variance analysis.In the present invention, modification of program information is as known conditions, and in actual software was safeguarded, modification information also can be known through means such as Version Control.The test covering analyzing considers how the program of repairing to be changed the time and influenced part covers.If the modification of program information that we identify is statement, will carry out covering analyzing to corresponding statement so, just can obtain the test case that need rerun.Except statement, revise and analyze higher level entities such as also can obtaining affected method body or class, so just need on same level, carry out covering analyzing to test case.So just produce regression test and selected level problem.
One, architecture
Fig. 4 has provided the level regression test and has selected design architecture.Provide specifying of several main parts below.1 hierarchical slicing device
We hierarchical slicing and the application tool of exploitation are JHSA.This instrument mainly is based on the hierarchical slicing model development.The hierarchical slicing model is the hierarchical structure that takes out object-oriented program (such as Java) from the angle of programmed logic layering; And further obtain the hierarchical slicing model, the section of on the hierarchical slicing model based, adopting the figure accessibility algorithm based on dependency graph to calculate object-oriented program then.
Fig. 1 is a kind of abstract graph that is directed against the hierarchical slicing model of java applet that we adopt.
This hierarchical slicing model mainly is made up of three parts: hierarchical slicing criterion, level dependency graph and accessibility algorithm.The hierarchical slicing criterion is respectively bag grade pet chip criterion from the bag level to statement level, type grade pet chip criterion, method grade pet chip criterion and statement level section criterion.The level dependency graph comprises package level dependency graph PLDG (package level dependencegraph); Class hierarchy dependency graph CLDG (class level dependence graph), method level dependency graph MLDG (method level dependence graph) and statement level dependency graph SLDG (statement level dependencegraph).Bag level dependency graph mainly comprises adduction relationship and member relation; A class level dependency graph mainly comprises inheritance, realizes relation, member relation and interactive relation; Method level dependency graph mainly comprises call relation, parameter transmission (parameter-in and parameter-out) relation and summary relation; The statement level dependency graph comprises data dependence relation and control dependence.Figure accessibility algorithm is based on the traditional algorithm of dependency graph.We will wrap grade pet chip, type grade pet chip, method grade pet chip and statement level section and be expressed as PLS (package level slice), CLS (class level slice), MLS (method levelslice) and SLS (statement level slice).
Fig. 2 is our the Java hierarchical slicing instrument developed and the overall framework figure that uses JHSA.Be the brief account of various piece below:
(1) code section: the input object of instrument is a Java project file, perhaps java applet code.
(2) code converting section: be responsible for the conversion of code, convert source code program to a kind of intermediate representation commonly used---abstract syntax tree (AST).
(3) level dependency graph structure part: be responsible for the foundation of various dependency graphs; Dependency graph from package level to the statement level is set up and mainly on the AST basis, is constructed; This part also is the core of instrument; In case various level dependency graphs are set up, the program slice part of back, perhaps applying portion can carry out on dependency graph to accomplish corresponding task effectively.
(4) hierarchical slicing part: hierarchical slicing, given section standard just can be fallen into a trap at dependency graph and calculated the section result corresponding to certain section standard.
(5) figure part: this part is the output of various level dependency graphs, and the user comes into plain view to the dependence between each entity in the program like this, has alleviated the burden of comprehension source code.
(6) regression test applying portion: we are applied to hierarchical slicing in the regression test.
2 test cases cover device
A lot of testing tools all possess the function of calculating the test case covering.What in the present invention, we adopted is the level covering of test case.So-called level covers; The covering of exactly that test case is relevant with it program entity level is mapped; Just be meant that here the test case from covering to the statement layer covers, promptly package level covers, class hierarchy covers, the method level covers and the statement level covers.Test case covers device and produces set at all levels, set, the set of method and the set of statement of the set that obtains wrapping, class.
3 regression test case selector switchs
Selector switch is mainly carried out simple locating function, the level of test case is covered and the object that needs to cover is mapped, thereby select the regression test case collection of different levels.
Two, method flow
This method calculation procedure is revised the hierarchical slicing collection of some m, and then the level covering of calculating test case collects and revise the common factor of some hierarchical slicing collection on different levels, is not sky if be somebody's turn to do common factor, then selects this test case.The concrete regression test case based on hierarchical slicing selects step following:
(1) obtain the modification information of current version program in the software maintenance, this information generally can be known.
(2) utilize the hierarchical slicing instrument from covering to the statement layer progressively refinement select regression test case.
1) on package level; We have confirmed the bag relevant with comprising n and v; Deleted and the unallied bag of the bag that comprises n and v, obtained package level section collection PLS (m), obtained then and wait that the package level of reusing test use cases T covers collection PLC (T); If the common factor Set (p) of PLS (m) and PLC (T) is not empty, then in the test case pond, select the test case T relevant with these bags p, and satisfy
Figure GSA00000123386500061
2) on class hierarchy, at first calculate the class hierarchy section collection CLS (m) that revises statement and obtain test use cases T pClass hierarchy cover collection CLC (T p), then calculate CLC (T p) and the common factor Set (c) of CLS (m), be empty if should occur simultaneously, we just select and such corresponding test case T cThereby, obtain the regression test case choice set T of class hierarchy c, and satisfy
Figure GSA00000123386500062
3) on the method level, at first calculate the method hierarchical slicing collection MLS (m) that revises statement and obtain test use cases T cThe method level cover collection MLC (T c), then calculate MLC (T c) and the common factor of MLS (m), if common factor Set (m) is not empty, we just select and the corresponding test case T of this method layer mThereby, obtain the regression test case choice set T of method layer m, and satisfy
Figure GSA00000123386500063
4) on the statement level, at first calculate the statement hierarchical slicing collection SLS (m) that revises statement and obtain test use cases T mThe statement level cover collection SLC (T m), then calculate SLC (T m) and the common factor of SLS (m), if common factor Set (s) is not empty, we just select and the corresponding test case T of this statement sThereby, obtain the regression test case choice set T of statement layer s, and satisfy
Like this, we are through calculating the hierarchical slicing of revising point, and the level of test case covers; Utilize level to cover the common factor of collection and hierarchical slicing collection; Select relevant test case, thus from package level to the statement level, progressively selected to refinement regression test case.
Embodiment:
Describe for ease, our supposition has the application example of following simplification:
Supposing has bag P1, P2 among the program P, type C1, C2, C3, C4, C5, C6, and method M1, M2, M3, M4, M5, M6, M7, M8, statement are S1-S100, and test use cases T comprises t1-t8 totally eight test cases, and our modification point is statement s5.
According to our above-mentioned regression test case selection method based on hierarchical slicing, suppose that the first step obtains the package level of t1-t8 and cover PLC (T), the result is following:
T t1 t2 t3 t4 t5 t6 t7 t8
PLC(T) P1 P1 P1 P1 P1 P1 P2 P2
Suppose to calculate about revising the package level section PLS (m) of statement S5, the result is { P1}
Calculate the common factor Set (p) of PLC (T) and PLS (m) then, Set (p)=PLC (T) ∩ PLS (m), the result does
Figure GSA00000123386500071
So at package level, the test use cases T that we select p={ t1t2t3t4t5t6}.
In second step, obtain T pClass hierarchy cover CLC (T p), suppose that the result is following:
T p t1 t2 t3 t4 t5 t6
CLC(T p) {C1,C2} {C1,C3} {C1} {C2,C3} {C2} {C4,C5}
Suppose to calculate the class hierarchy section CLS (m) that revises statement S5, the result is { C1, C2, C3}
Calculate CLC (T then p) and the common factor Set (c) of CLS (m), Set (c)=CLC (T p) ∩ CLS (m), the result is:
So at class hierarchy, the test use cases T that we select c={ t1t2t3t4t5}.
In the 3rd step, obtain T cThe method level cover MLC (T c), suppose that the result is following:
T c t1 t2 t3 t4 t5
MLC(T c) {M1,M2,M3} {M3,M5} {M2,M3} {M3,M4,M5} {M6}
Suppose to calculate the method hierarchical slicing MLS (m) that revises statement S5, the result is { M1, M2, M3}
Calculate MLC (t then c) and the common factor Set (m) of MLS (m), Set (m)=MLC (T c) ∩ MLS (m), the result is:
Figure GSA00000123386500073
So on the method level, the test use cases T that we select m={ t1t2t3t4}
In the 4th step, obtain T mThe statement level cover SLC (T m), suppose that the result is following:
T m t1 t2 t3 t4
SLC(T m ) {S1-S16} {S17-S50} {S1-S12} {S16-S30}
Suppose to calculate the statement hierarchical slicing SLS (m) that revises statement S5, the result is { S8-S16}.
Calculate SLC (T then m) and the common factor Set (s) of SLS (m), Set (s)=SLC (T m) ∩ SLS (m), the result is:
Figure GSA00000123386500081
So on the statement level, the test use cases T of selection s={ t1t3t4}
Like this through hierarchical slicing from covering to the statement layer progressively having calculated of refinement need the test case T that selects s

Claims (1)

1. the regression test case selection method based on hierarchical slicing is characterized in that comprising the steps:
Step 1). Version Control is obtained the modification point m that need carry out the regression test program;
Step 2). utilize hierarchical slicing instrument JHSA to calculate the hierarchical slicing collection of revising some m, identify the part that influenced by modification of program, progressively obtain to wrap grade pet chip collection, type grade pet chip collection, method grade pet chip collection and statement level section collection successively according to logical level; Wherein, Instrument JHSA is according to the hierarchical slicing model development; Take out the hierarchical structure of object-oriented program from the angle of programmed logic layering; And further obtain the hierarchical slicing model, on the hierarchical slicing model based, adopt the section collection that calculates object-oriented program based on the accessibility algorithm of dependency graph then;
Step 3). carry out the level regression test case from the bag level to statement level and select;
A) on package level, select it the test use cases T and coat and cover energy collecting and enough cover the test use cases T that wraps the grade pet chip collection from waiting to reuse p
B) on class hierarchy, from test use cases T pIn select enough test use cases T of type of covering grade pet chip collection of its type covering energy collecting c
C) on the method level, from test use cases T cIn select the test use cases T that its method covers the enough covering method grade pet chip collection of energy collecting m
D) on the statement level, from test use cases T mIn select its statement and cover the test case T that energy collecting enough covers statement level section collection s
CN2010101737873A 2010-05-14 2010-05-14 Regression testing case selection method based on hierarchical slicing Expired - Fee Related CN101859276B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101737873A CN101859276B (en) 2010-05-14 2010-05-14 Regression testing case selection method based on hierarchical slicing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101737873A CN101859276B (en) 2010-05-14 2010-05-14 Regression testing case selection method based on hierarchical slicing

Publications (2)

Publication Number Publication Date
CN101859276A CN101859276A (en) 2010-10-13
CN101859276B true CN101859276B (en) 2012-02-22

Family

ID=42945195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101737873A Expired - Fee Related CN101859276B (en) 2010-05-14 2010-05-14 Regression testing case selection method based on hierarchical slicing

Country Status (1)

Country Link
CN (1) CN101859276B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309801B (en) * 2012-03-15 2016-01-13 百度在线网络技术(北京)有限公司 A kind of method and apparatus determining regression test scope
CN102831060B (en) * 2012-08-24 2015-07-08 东南大学 Modification influence analysis based regression test case updating method of part software
CN104008059B (en) * 2014-06-17 2016-06-29 东南大学 A kind of software architecture appraisal procedure based on tolerance and Predicting Technique
CN105760288B (en) * 2014-12-15 2019-02-01 阿里巴巴集团控股有限公司 Test the method and device of revised application program
CN106095663B (en) * 2016-05-26 2017-06-27 西安交通大学 Program based on hierarchical model returns location of mistake method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6668340B1 (en) * 1999-12-10 2003-12-23 International Business Machines Corporation Method system and program for determining a test case selection for a software application
CN1776643A (en) * 2004-11-15 2006-05-24 华为技术有限公司 Method and device for testing software product robustness

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6668340B1 (en) * 1999-12-10 2003-12-23 International Business Machines Corporation Method system and program for determining a test case selection for a software application
CN1776643A (en) * 2004-11-15 2006-05-24 华为技术有限公司 Method and device for testing software product robustness

Also Published As

Publication number Publication date
CN101859276A (en) 2010-10-13

Similar Documents

Publication Publication Date Title
Ermedahl A modular tool architecture for worst-case execution time analysis
CN101859276B (en) Regression testing case selection method based on hierarchical slicing
US10831456B1 (en) External code integrations within a computing environment
US9141350B2 (en) Embedded system performance
US7325232B2 (en) Compiler for multiple processor and distributed memory architectures
US10394694B2 (en) Unexplored branch search in hybrid fuzz testing of software binaries
CN105808438B (en) A kind of Reuse of Test Cases method based on function call path
CN101576850B (en) Method for testing improved host-oriented embedded software white box
CN110196720A (en) A kind of Simulink generates the optimization method of dynamic link library
CN101271397A (en) Recognition method of nested loop structure
CN105302624B (en) Start spacing automatic analysis method between cycle flowing water iteration in a kind of reconfigurable compiling device
CN105260222B (en) Start spacing optimization method between cycle flowing water iteration in a kind of reconfigurable compiling device
CN101351801B (en) Method for reconstructing statement, and computer system having the function therefor
CN109086985B (en) Professional test information management system for spacecraft assembly
CN110232130A (en) Metadata management pedigree generation method, device, computer equipment and storage medium
CN109271322A (en) A kind of software test range determining method, method for testing software and device
CN106919403B (en) multi-granularity code clone detection method based on Java byte codes in cloud environment
CN110377525B (en) Parallel program performance prediction system based on runtime characteristics and machine learning
CN108536585B (en) Data change influence domain analysis method
CN107391124B (en) Conditional slicing method based on golden section search and software execution track
Konur Towards light-weight probabilistic model checking
Shimasaki et al. An analysis of Pascal programs in compiler writing
Tretter et al. Executing dataflow actors as Kahn processes
CN113391795A (en) Method and system for realizing self-adaptive mapping of application scene and software development kit
CN106155668A (en) A kind of graphic representation method of macrolanguage

Legal Events

Date Code Title Description
C06 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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120222

Termination date: 20140514