CN107544905A - The optimization method and system of regression test case collection - Google Patents

The optimization method and system of regression test case collection Download PDF

Info

Publication number
CN107544905A
CN107544905A CN201710784881.4A CN201710784881A CN107544905A CN 107544905 A CN107544905 A CN 107544905A CN 201710784881 A CN201710784881 A CN 201710784881A CN 107544905 A CN107544905 A CN 107544905A
Authority
CN
China
Prior art keywords
test case
regression
testing requirement
collection
regression test
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
CN201710784881.4A
Other languages
Chinese (zh)
Other versions
CN107544905B (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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Publication of CN107544905A publication Critical patent/CN107544905A/en
Application granted granted Critical
Publication of CN107544905B publication Critical patent/CN107544905B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

Present disclose provides a kind of optimization method and system of regression test case collection, maintenance unit carries out pre maintenance to original regression test case collection, obtain benchmark regression test case collection, about subtract unit about to subtract benchmark regression test case collection, minimum regression test case subset is obtained, sequencing unit is ranked up to the execution sequence of test case in minimum regression test case subset.The disclosure can find in New function hide the defects of, and can find because process variations come to other old functional bands the defects of;On the premise of testing requirement all standing is ensured, regression test case collection scale is reduced, reduces the cost of test;Large-scale regression test case collection can be handled, the experience of tester that depends critically upon has been abandoned, the shortcomings that extensive regression test case collection can not be handled;The relation between maintenance program code and test case is not needed, with more operability and practicality.

Description

The optimization method and system of regression test case collection
Technical field
This disclosure relates to software testing technology field, more particularly to a kind of optimization method of regression test case collection and it is System.
Background technology
With the increasingly complicated and continuous iteration of business bank's science technology system, regression test is into business bank's Software Evolution During frequently carry out and huge one work of cost overhead.In order to tackle huge regression test case collection, some Bank begins to use some regression test case collection optimisation techniques to optimize regression test process, as far as possible compression verification number According to the scale of collection, the operating efficiency of regression test is improved.
The optimization of regression test case collection needs to reach following target:
1st, the regression test case collection after optimizing should be able to cover all business demands to be measured, it is impossible to exist a certain The situation that the not tested use-case of business demand covers.
2nd, on the premise of it can cover all business demands to be measured, the scale of original regression test case collection should be made into The reduction of one step, such as only carry out the use-case that original regression test case concentrates 60%.
3rd, regression test case concentrates the sequence of use-case to contribute to lift the announcement efficiency of defect after optimizing, most The early stage that defect should perform in use-case is just found.
Current existing regression test case collection optimisation technique mainly includes four kinds:
1) zero regression test:For the reparation of defect, exact p-value is only done;For what's new, only run all newly-increased The functional test use-case added, for judging whether correctly to realize new function.
2) complete regression is tested:The strategy does not consider that change influences, and reruns all old test cases and new addition Test case, this is a kind of safe regression testing policy, omits the least risk of defect, but testing cost is very high.
3) regression test based on risk selection:Based on certain risk standard come the selection recurrence survey from test case library Examination bag.Run most important, crucial and suspicious test first, and skip those are secondary, test cases of exception or that A little function phases are to very stable module.Because even if running those secondary use-cases finds defects, the seriousness of these defects also compared with It is low.
4) regression test based on code dependent analysis:When tester has enough confidence to the localization of modification, It can be analyzed with code dependent, regression test is confined in the module that is changed and its interface.
It is found by the applicant that there is following defect in above-mentioned prior art:
(1) zero regression test, can not disclose in regression test version and other modules are newly introduced because of the increase of New function Defect.
(2) complete regression is tested, and when handling business bank's so large-scale regression test collection, the testing time is long, surveys It is high to try cost.
(3) regression test based on risk selection, business bank's science technology system is complicated, and regression test case collection scale is big, Single people be difficult by rule of thumb come differentiate some test case whether need carry out regression test, to tester's professional standards requirement Height, and lack quantitative objective standard.
(4) regression test based on code dependent is, it is necessary to record the relation table between test case library and code, almost All business banks are all without the relation between both records, and the relation between test case library and code is continuous In dynamic change, arrangement gets up to need to put into substantial amounts of manpower, it is also difficult to achieve under the reality of work of business bank.
The content of the invention
(1) technical problems to be solved
In order to solve the above-mentioned technical problem at least one, present disclose provides a kind of the excellent of regression test case collection Change method and system.
(2) technical scheme
Present disclose provides a kind of optimization system of regression test case collection, including:Maintenance unit, for original recurrence Test use cases carry out pre maintenance, obtain benchmark regression test case collection;About subtract unit, for the benchmark regression test Set of uses case is about subtracted, and obtains minimum regression test case subset;Sequencing unit, for minimum regression test case The execution sequence of integrated test use-case is ranked up, and realizes the fully optimized to regression test case collection.
In some embodiments of the present disclosure, the maintenance unit is using ADCL models to the original regression test case Collection is increased, deleted, being improved, join operation, to carry out pre maintenance to the original regression test case collection.
In some embodiments of the present disclosure, the maintenance unit includes:Increase subelement, for increase testing requirement with Test case;Subelement is deleted, for deleting out-of-date testing requirement and test case;Subelement is improved, has change for improving Dynamic testing requirement and test case;Couple subelement, for checking increase and pair of improved test case and testing requirement It should be related to, and the test case of coverage test demand is coupled with the testing requirement.
In some embodiments of the present disclosure, the unit that about subtracts uses Zero-one integer programming model, is lost using intelligent optimization Propagation algorithm is about subtracted to the benchmark regression test case collection.
In some embodiments of the present disclosure, the unit that about subtracts is used to extract test case execution temporal information, test Demand information, use-case demand covering relation information;Delete redundancy testing use-case and redundancy testing demand;0- is carried out to test case 1 gene code, and by the way that the gene of individual is all set into individual and the population that 1 generation initializes;To every in current population Individual xiCalculate its fitness f using time cost as targeti, and application roulette policy selection operator produces middle generation;It is right Crossover operator is applied in centre for population, using 1/L as mutation probability application mutation operator, produces population of new generation;To a new generation Population genetic decoding simultaneously calculates each individual x in population of new generationi+1Fitness f using time cost as targeti+1, select suitable Response numerical value highest individual produces minimum regression test case subset as the final result about subtracted.
In some embodiments of the present disclosure, the sequencing unit includes:Subelement is grouped, for being incited somebody to action according to ordering factor Test case in minimum regression test case subset is grouped;Sort subelement, for determining each group according to ordering factor The priority metrics of middle test case.
In some embodiments of the present disclosure, the packet subelement is for being the test being not turned off by corresponding defect state Use-case, execution state are Failed, N/A, Not Completed, No Run, Blocked test case are divided into preferred group;Will Newly increase or improved test case is divided into preferential group;By the non-test case point for newly increasing and improving and correspond to defect and be turned off Enter general group;The non-test case for newly increasing and improving and never correspond to any defect is divided into be measured group.
In some embodiments of the present disclosure, when number is more than zero when test case corresponds to the defects of, sequence is single Member is used for the defects of the defects of correspond to according to test case number, corresponding testing requirement number, correspondence order of severity and right The testing requirement priority answered calculates the priority metrics of test case in preferred group;Number etc. when test case corresponds to the defects of In zero and test case perform state be Failed when, it is described sequence subelement for according to corresponding to test case testing requirement Number, corresponding testing requirement priority calculate the priority metrics of test case in preferred group.
In some embodiments of the present disclosure, the sequence subelement is used for the module all defect according to where test case The order of severity, the test case sum of module where test case, all defect number of module where test case, test Testing requirement priority corresponding to testing requirement number corresponding to use-case and test case calculates test case in preferential group Priority metrics.
In some embodiments of the present disclosure, the sequence subelement be used for the defects of being corresponded to according to test case number, Corresponding testing requirement number, it is corresponding the defects of the order of severity and corresponding testing requirement priority calculate and tested in general group The priority metrics of use-case.
According to another aspect of the present disclosure, there is provided a kind of optimization method of regression test case collection, including:To original time Return test use cases to carry out pre maintenance, obtain benchmark regression test case collection;The benchmark regression test case collection is carried out About subtract, obtain minimum regression test case subset;And the execution to test case in the minimum regression test case subset Order is ranked up, and realizes the fully optimized to regression test case collection.
It is described that original regression test case collection progress pre maintenance is included in some embodiments of the present disclosure:Using ADCL models are increased the original regression test case collection, deleted, improved, join operation.
It is described to increase operation and include in some embodiments of the present disclosure:Increase testing requirement and test case;It is described to delete Division operation includes:Delete out-of-date testing requirement and test case;The improvement operation includes:Improving has the testing requirement of variation And test case;The join operation includes:Increase and the corresponding relation of improved test case and testing requirement are checked, and will The test case of coverage test demand is coupled with the testing requirement.
In some embodiments of the present disclosure, described the step of about being subtracted to benchmark regression test case collection, uses 0-1 Integer programming model, benchmark regression test case collection is about subtracted using intelligent optimization genetic algorithm.
In some embodiments of the present disclosure, it is described benchmark regression test case collection is about subtracted including:Extraction step: Extract test case and perform temporal information, testing requirement information, use-case demand covering relation information;Delete step:Delete redundancy Test case and redundancy testing demand;Initialization step:To test case carry out 0-1 gene codes, and by by individual Gene is all set to individual and the population of 1 generation initialization;In middle generation, produces step:To each individual x in current populationiMeter Calculate its fitness f using time cost as targeti, and application roulette policy selection operator produces middle generation;Population of new generation Produce step:Crossover operator is applied for population to centre, using 1/L as mutation probability application mutation operator, produces a new generation's kind Group;Judgment step:Judge whether population of new generation meets end condition, if it is, implementing result produces step:If not, return In generation, produces step among receipt row;As a result step is produced:To population genetic decoding of new generation and calculate every in population of new generation Individual xi+1Fitness f using time cost as targeti+1, fitness numerical value highest individual is selected as the most termination about subtracted Fruit, produce minimum regression test case subset.
In some embodiments of the present disclosure, the execution sequence to test case in minimum regression test case subset Be ranked up including:The test case in minimum regression test case subset is grouped according to ordering factor;According to sequence Factor determines the priority metrics of test case in each group.
It is that test case, the execution state being not turned off are by corresponding defect state in some embodiments of the present disclosure Failed, N/A, Not Completed, No Run, Blocked test case are divided into preferred group;It will newly increase or improved Test case is divided into preferential group;Newly increase non-and improve and test case that corresponding defect is turned off is divided into general group;Will be non- The test case for newly increasing and improving and never correspond to any defect is divided into be measured group.
In some embodiments of the present disclosure, when number is more than zero when test case corresponds to the defects of, according to test case The defects of corresponding number, corresponding testing requirement number, it is corresponding the defects of the order of severity and corresponding testing requirement priority Calculate the priority metrics of test case in preferred group;Number is equal to zero and test case performs the defects of test case corresponds to When state is Failed, testing requirement number, corresponding testing requirement priority calculate preferred group according to corresponding to test case The priority metrics of middle test case.
In some embodiments of the present disclosure, the order of severity of module all defect, test according to where test case are used The test case sum of module where example, the corresponding test of all defect number, test case of test case place module need Testing requirement priority corresponding to number and test case is asked to calculate the priority metrics of test case in preferential group.
In some embodiments of the present disclosure, the defects of being corresponded to according to test case number, corresponding testing requirement number, The defects of the corresponding to order of severity and corresponding testing requirement priority calculate the priority metrics of test case in general group.
(3) beneficial effect
It can be seen from the above technical proposal that the optimization method and system of the regression test case collection of the disclosure have it is following Beneficial effect:
(1) the defects of disclosure can find to hide in New function, and can are found because process variations give other old functional bands The defects of coming, hence it is evident that better than zero regression testing method.
(2) disclosure has been carried out necessarily on the premise of testing requirement all standing is ensured to regression test case collection scale The reduction of degree, the cost of test is reduced, better than complete regression method of testing.
(3) disclosure gives regression test case the intensive objective reasonable standard for subtracting and sorting, and can handle extensive Regression test case collection, abandoned the regression testing method based on risk selection and depended critically upon the experience of tester, nothing Method handles the shortcomings that extensive regression test case collection.
(4) relation that this public course need not be between maintenance program code and test case, compared to based on code dependent The regression testing method of analysis, with more operability and practicality.
(5) disclosure can adaptively screen out the redundancy testing use-case that original regression test case is concentrated, and realize most The automatic acquisition of small regression test case collection, and influence of the different factors to regression test case significance level is taken into full account, entirely Face optimizes the regression test case collection of complicated science technology system, so as to realize on the premise of testing requirement all standing, effectively contracting Subtract the scale of regression test case collection to be tested, reduce the time cost and manpower of business bank's software systems regression test work Cost, and improve regression test defect exposure efficiency.
Brief description of the drawings
Fig. 1 is the structural representation of the optimization system of the regression test case collection of the embodiment of the present disclosure.
Fig. 2 is the regression test case collection optimization process figure of the embodiment of the present disclosure.
Fig. 3 is the ADCL model schematics of the embodiment of the present disclosure.
Fig. 4 is the flow chart of the optimization method of the regression test case collection of the embodiment of the present disclosure.
Fig. 5 is the flow chart about subtracted in the optimization method of the regression test case collection of the embodiment of the present disclosure.
Embodiment
The disclosure proposes a kind of optimization method and system of regression test case collection, and this method and system, which include, to be directed to back Return the maintenance of test use cases, about subtract with three parts such as sequence, can adaptively screen out original regression test case and concentrate Redundancy testing use-case, realize the automatic acquisition of minimum regression test case collection, and take into full account different factors to return survey The influence of example significance level on probation, the fully optimized regression test case collection of complicated science technology system, is needed so as to realize in test Demand perfection on the premise of covering, effectively reduce the scale of regression test case collection to be tested, reduce business bank's software systems and return The time cost and human cost of test job, and improve regression test defect exposure efficiency.
For the purpose, technical scheme and advantage of the disclosure are more clearly understood, below in conjunction with specific embodiment, and reference Accompanying drawing, the disclosure is further described.
The embodiment of the present disclosure proposes a kind of optimization system of regression test case collection, as shown in figure 1, optimization system bag Include:Maintenance unit, about subtract unit and sequencing unit.
Maintenance unit, for carrying out pre maintenance to original regression test case collection, obtain benchmark regression test case collection.
About subtract unit, for about being subtracted to benchmark regression test case collection, obtain minimum regression test case subset.
Sequencing unit, for being ranked up to the execution sequence of test case in minimum regression test case subset, so as to Realize the fully optimized to regression test case collection.
Please referring also to Fig. 2, during system is optimized to the optimization of regression test case collection, first by original recurrence Test use cases input maintenance unit, and maintenance unit is based on software-implemented fault injection book, test specification book and programing change Coverage confirmation form carries out pre maintenance to original regression test case collection.In an example of the disclosure, figure is referred to 3, the pre maintenance carries out " increasing ", " deleting ", " changing ", " connection " operation to original regression test case collection using ADCL models, point The new testing requirement test case out-of-date with test case, deletion Biao Shi not increased, improve the testing requirement and the survey that have variation Try out example, new test case is coupled with testing requirement.
Specifically, maintenance unit includes increasing subelement (Add), deletes subelement (Delete), improves subelement (Change) and connection subelement (Link).
Increase subelement, used for increasing testing requirement according to regression test stage new test specification book with test Example, increased test case are added to original regression test case and concentrated.If the testing requirement in certain other Geju City is in old survey Example on probation, which is concentrated, to be uncovered, and the old testing requirement that the subelement is also used for increasing new test case to be uncovered to this is carried out Covering, and the test case newly increased is merged into original regression test case and concentrated.
Because testing requirement is deleted with the significantly reason such as variation, some test cases that original regression test case is concentrated Tested test system is no longer desirable for completely, and these test cases will be out-of-date, and delete subelement needs for deleting out-of-date test Ask, and concentrated from original regression test case and delete out-of-date test case.
With the progress of software project, slight change may occur for some testing requirements, for example, the value of some variable Boundary is changed, then the threshold in testing requirement, which should just be done, accordingly to be changed and change test case, and it is single to improve son Member is used for the test case for improving the testing requirement for having variation and original regression test case is concentrated.
Couple subelement, for checking increase and the corresponding relation of improved test case and testing requirement, if test Use-case t can coverage test demand r, this test case and testing requirement are coupled.
After maintenance unit carries out the pre maintenances such as " increasing ", " deleting ", " changing ", " connection " to original regression test case collection, obtain Benchmark regression test case collection.Referring back to Fig. 2, then about subtract unit and corresponding relation report is about subtracted based on test case demand and surveyed Examination performance report is about subtracted to benchmark regression test case collection.In the present embodiment, about subtract unit and use 0-1 paced beats Model is drawn, test case is about subtracted to problem and regards a Zero-one integer programming as, using intelligent optimization genetic algorithm, by test case About subtract " minimum regression test case subset " in problem and regard optimum individual in genetic algorithm as, optimal in genetic algorithm The method of body search is applied directly to during regression test case about subtracts.
Specifically, about subtract unit and corresponding relation report and test execution situation report are about subtracted by test case demand first Accuse, the test case of extraction benchmark regression test case collection performs temporal information, testing requirement information, use-case demand covering relation Information;By deleting 1-1 redundancy testings use-case and 1-1 redundancy testing demands, the Zero-one integer programming that test case about subtracts is reduced Solution scale, namely the search space of genetic algorithm is reduced, lift search efficiency;The test concentrated to benchmark regression test case Use-case according to whether perform carry out 0-1 gene codes, and by by individual gene be all set to 1 generation initialize individual with Population;To each individual x in current populationiCalculate its fitness f using time cost as targeti, and apply roulette strategy Selection opertor produces middle generation;Crossover operator is applied for population to centre, using 1/L as mutation probability application mutation operator, production Raw population of new generation;To population genetic decoding of new generation and calculate each individual x in population of new generationi+1Using time cost as The fitness f of targeti+1, select fitness numerical value highest individual to produce minimum regression test as the final result about subtracted and use Example collection, the minimum regression test case subset can meet test coverage.
Redundancy testing use-case is defined as:If T={ t1, t2..., tnIt is test use cases, R={ r1, r2..., rmBe Testing requirement collection, make R (ti) represent all tested use-case tiThe set that the testing requirement of satisfaction is formed, make T (ri) represent institute Having can coverage test demand riThe set that is formed of test case.Assuming that in the presence of two different test case ti∈ T, tj∈ T so that R (ti)∈R(tj), i.e. test case tjThe testing requirement collection covered completely includes test case tiThe survey covered Examination demand collection, then claim test case tiFor tj1-1 redundancy testing use-cases.Similar, redundancy testing requirement definition is:Assuming that deposit In two different testing requirement ri∈ R, rj∈ R so that T (ri)∈T(rj), i.e., all energy coverage test demand rjTest use Example collection contains all energy coverage test demand riTest use cases, then claim testing requirement riFor testing requirement rj1-1 redundancies Testing requirement.
Referring back to Fig. 2, after obtaining minimum regression test case subset, sequencing unit is based on the basic attribute information of test case Report, the report of test case defect corresponding relation and defect base attribute information, in minimum regression test case subset The execution sequence of test case is ranked up.Sequencing unit include packet subelement and sequence subelement, packet subelement according to Test case in minimum regression test case subset is grouped by ordering factor, and sequence subelement determines according to ordering factor The priority metrics of test case in each group.In regression test case phase sorting, ordering factor can be basic by test case Attribute information report, the report of test case defect corresponding relation and defect base attribute information acquisition, in the present embodiment may be used To consider the influence that a variety of ordering factors as shown in table 1 sort to regression test case.
Table 1
Test case in minimum regression test case subset is grouped by packet subelement according to ordering factor, is used Rule is grouped to test case as shown in table 2:
Table 2
Corresponding defect state is " Failed " to be not turned off and performing state by packet subelement, " N/A ", " Not Completed ", " No Run ", the test case of " Blocked " are divided into preferred group;It will newly increase or improved test case is divided Enter preferential group;Newly increase non-and improve and test case that corresponding defect is turned off is divided into general group;Newly increase non-and change The test case entered and never correspond to any defect is divided into be measured group.
After point, sequence subelement determines the priority metrics of test case in each group according to ordering factor.It is specific next Say,
The defects of the defects of sequence subelement corresponds to according to test case number, corresponding testing requirement number, correspondence, is tight Weight degree and corresponding testing requirement priority calculate the priority metrics of test case in preferred group.
In one example, the priority of preferred group test case, which scores, is:
Wherein, SiFor the priority scoring of i-th of test case, NiThe defects of being corresponded to for i-th of test case number, Mi For testing requirement number, A corresponding to i-th of test caseinFor the order of severity of n-th of defect corresponding to i-th of test case Scoring, BimFor the relative importance value scoring of m-th of testing requirement corresponding to i-th of test case.Above formula illustrates, if the defects of corresponding to Number is more than 0, then the priority scoring of test case by it is corresponding the defects of number, corresponding testing requirement number, corresponding lack Fall into the order of severity and corresponding testing requirement priority determines jointly.If the defects of corresponding number is equal to 0, and test case Execution state is " Failed ", and the priority scoring plus 2r, wherein r to test case are that test case performs status consideration in shadow Weight during priorities of test cases is rung, and considers corresponding testing requirement number and corresponding testing requirement priority.
The survey for the module where the subelement order of severity of module all defect, test case according to where test case that sorts Example on probation is total, testing requirement number and test corresponding to all defect number of test case place module, test case Testing requirement priority corresponding to use-case calculates the priority metrics of test case in preferential group.
In one example, preferentially the priority scoring of group test case is:
Wherein SiFor the priority scoring of i-th of test case, AmFor in all defect of test case said module The severity scale of m defect, CqFor the test case sum of test case said module, GqTest case said module All defect number, MiFor testing requirement number, B corresponding to i-th of test caseimFor m-th corresponding to i-th of test case The relative importance value scoring of testing requirement, TiRepresent i-th of test case, ModulqRepresent the targeted software module of test case.
The mode of the general group priorities of test cases measurement of subelement calculating of sorting is similar with preferred group, the difference is that general Group does not consider the execution state of test case, and in one example, the general priority for organizing test case, which scores, is:
Wherein, SiFor the priority scoring of i-th of test case, NiThe defects of being corresponded to for i-th of test case number, Mi For testing requirement number, A corresponding to i-th of test caseinFor the order of severity of n-th of defect corresponding to i-th of test case Scoring, BimFor the relative importance value scoring of m-th of testing requirement corresponding to i-th of test case.
Another embodiment of the disclosure proposes a kind of optimization method of regression test case collection, as shown in figure 4, using above-mentioned Optimization system optimizes to test case, including:
Step S1, pre maintenance is carried out to original regression test case collection, obtains benchmark regression test case collection.
Step S2, benchmark regression test case collection is about subtracted, obtain minimum regression test case subset.
Step S3, the execution sequence of test case in minimum regression test case subset is ranked up, so as to realize pair The fully optimized of regression test case collection.
In step sl, original regression test case collection is inputted into maintenance unit first, maintenance unit is based on software metrics Specification, test specification book and programing change coverage confirmation form are tentatively tieed up to original regression test case collection Shield.In an example of the disclosure, the pre maintenance using ADCL models original regression test case collection is carried out " increasing ", " deleting ", " changing ", " connection " operation.Step S1 is specifically included:
According to the test specification book increase testing requirement and test case that the regression test stage is new, increased test is used Example is added to original regression test case and concentrated.It is not coated to if the testing requirement in certain other Geju City is concentrated in old test case Lid, increases new test case to be covered to the old testing requirement that this is uncovered, and the test case newly increased is merged Concentrated to original regression test case.
Out-of-date testing requirement is deleted, and is concentrated from original regression test case and deletes out-of-date test case.
Improve the test case of the testing requirement for having variation and original regression test case concentration.
Increase and the corresponding relation of improved test case and testing requirement are checked, if test case t can cover survey Examination demand r, this test case and testing requirement are coupled.
In step s 2, about subtract unit and corresponding relation report and test execution situation report are about subtracted based on test case demand Benchmark regression test case collection is about subtracted.
In the present embodiment, step S2 includes:
Sub-step S2a:Extract the information of test case.
About subtract unit and corresponding relation report and test execution situation report are about subtracted by test case demand first, extract base The test case of quasi- regression test case collection performs temporal information, testing requirement information, use-case demand covering relation information.
Sub-step S2b:Delete redundancy testing use-case and redundancy testing demand.
1-1 redundancy testings use-case and 1-1 redundancy testing demands are deleted in definition in being saved according to 4-1, reduce test case about The solution scale of the Zero-one integer programming subtracted, namely the search space of genetic algorithm is reduced, lift search efficiency.
Sub-step S2c:Gene code is carried out to test case and generates initialization individual and population.
To benchmark regression test case concentrate test case according to whether perform carry out 0-1 gene codes, and pass through by The gene of individual is all set to individual and the population of 1 generation initialization.
Sub-step S2d:To each individual x in current populationiCalculate its fitness f using time cost as targeti, and Middle generation is produced using roulette policy selection operator.
Sub-step S2e:Crossover operator is applied for population to centre, using 1/L as mutation probability application mutation operator, produced Population of new generation.
Sub-step S2f:Judge whether population of new generation meets end condition, if it is, performing sub-step S2g:If not, Return and perform sub-step S2d.End condition specifically refers to:Continuous N is not changed for Population adaptation angle value or iterations Reaching the upper limit N, M and N can freely be set, generally M=100, N=1000.
Sub-step S2g:To population genetic decoding of new generation and calculate each individual x in population of new generationi+1With generation time Valency is the fitness f of targeti+1, select fitness numerical value highest individual to produce minimum return as the final result about subtracted and survey Example collection on probation.
In step s3, sequencing unit is based on the basic attribute information report of test case, test case defect corresponding relation Report and defect base attribute information, are arranged the execution sequence of the test case in minimum regression test case subset Sequence.
Referring to Fig. 5, step S3 is specifically included:
Sub-step S3a:Packet subelement enters the test case in minimum regression test case subset according to ordering factor Row packet.
Sub-step S3b:Sequence subelement determines the priority metrics of test case in each group according to ordering factor.
In sub-step S3a, corresponding defect state is by packet subelement to be not turned off and performing state " Failed ", " N/A ", " Not Completed ", " No Run ", the test case of " Blocked " are divided into preferred group;Will be newly-increased Add or improved test case is divided into preferential group;Newly increase non-and improve and test case that corresponding defect is turned off is divided into one As group;The non-test case for newly increasing and improving and never correspond to any defect is divided into be measured group.
In sub-step S3b, sequence subelement the defects of correspond to according to test case number, corresponding testing requirement are individual The defects of counting, the be corresponding order of severity and corresponding testing requirement priority calculate the degrees of priority levels of test case in preferred group Amount.Shown in the priority scoring formula such as formula (1) of first choice group test case.
The survey for the module where the subelement order of severity of module all defect, test case according to where test case that sorts Example on probation is total, testing requirement number and test corresponding to all defect number of test case place module, test case Testing requirement priority corresponding to use-case calculates the priority metrics of test case in preferential group.It is preferential to organize the preferential of test case Shown in level scoring formula such as formula (2).
The mode of the general group priorities of test cases measurement of subelement calculating of sorting is similar with preferred group, the difference is that general Group does not consider the execution state of test case, shown in the general priority scoring formula such as formula (3) for organizing test case.
The defects of optimization method and system of the regression test case collection that the disclosure proposes can find to hide in New function, And can find because process variations come to other old functional bands the defects of, hence it is evident that better than zero regression testing method.The disclosure is ensureing On the premise of testing requirement all standing, a certain degree of reduction is carried out to regression test case collection scale, has reduced test Cost, better than complete regression method of testing.In addition, the disclosure give regression test case it is intensive subtract and sort it is objective rationally Standard, large-scale regression test case collection can be handled, abandon the regression testing method heavy dependence based on risk selection Experience in tester, the shortcomings that extensive regression test case collection can not be handled.This public course need not maintenance program generation Relation between code and test case, compared to regression testing method analyze based on code dependent, with more operability with Practicality.
So far, the present embodiment is described in detail combined accompanying drawing.According to above description, those skilled in the art There should be clear understanding to the disclosure.
It should be noted that in accompanying drawing or specification text, the implementation that does not illustrate or describe is affiliated technology Form known to a person of ordinary skill in the art, is not described in detail in field.In addition, above-mentioned definition to each element and not only limiting Various concrete structures, shape or the mode mentioned in embodiment, those of ordinary skill in the art can be carried out simply more to it Change or replace, such as:
(1) direction term mentioned in embodiment, such as " on ", " under ", "front", "rear", "left", "right" etc., only it is ginseng The direction of accompanying drawing is examined, is not used for limiting the protection domain of the disclosure;
(2) consideration that above-described embodiment can be based on design and reliability, the collocation that is mixed with each other uses or and other embodiment Mix and match uses, i.e., the technical characteristic in different embodiments can freely form more embodiments.
Particular embodiments described above, the purpose, technical scheme and beneficial effect of the disclosure are carried out further in detail Describe in detail bright, should be understood that the specific embodiment that the foregoing is only the disclosure, be not limited to the disclosure, it is all Within the spirit and principle of the disclosure, any modification, equivalent substitution and improvements done etc., the guarantor of the disclosure should be included in Within the scope of shield.

Claims (20)

1. a kind of optimization system of regression test case collection, including:
Maintenance unit, for carrying out pre maintenance to original regression test case collection, obtain benchmark regression test case collection;
About subtract unit, for about being subtracted to the benchmark regression test case collection, obtain minimum regression test case subset;
Sequencing unit, for being ranked up to the execution sequence of test case in the minimum regression test case subset, realize To the fully optimized of regression test case collection.
2. optimization system as claimed in claim 1, the maintenance unit is used the original regression test using ADCL models Example collection is increased, deleted, being improved, join operation, to carry out pre maintenance to the original regression test case collection.
3. optimization system, the maintenance unit include as claimed in claim 2:
Increase subelement, for increasing testing requirement and test case;
Subelement is deleted, for deleting out-of-date testing requirement and test case;
Subelement is improved, the testing requirement and test case for having variation for improving;
Couple subelement, for checking increase and the corresponding relation of improved test case and testing requirement, and by coverage test The test case of demand is coupled with the testing requirement.
4. optimization system as claimed in claim 1, the unit that about subtracts uses Zero-one integer programming model, using intelligent optimization Genetic algorithm is about subtracted to the benchmark regression test case collection.
5. optimization system as claimed in claim 4, the unit that about subtracts is used to extract test case execution temporal information, test Demand information, use-case demand covering relation information;
Delete redundancy testing use-case and redundancy testing demand;
0-1 gene codes are carried out to test case, and by the way that the gene of individual is all set into individual and the kind that 1 generation initializes Group;
To each individual x in current populationiCalculate its fitness f using time cost as targeti, and apply roulette strategy Selection opertor produces middle generation;
Crossover operator is applied for population to centre, using 1/L as mutation probability application mutation operator, produces population of new generation;
To population genetic decoding of new generation and calculate each individual x in population of new generationi+1Adaptation using time cost as target Spend fi+1, select fitness numerical value highest individual to produce minimum regression test case subset as the final result about subtracted.
6. optimization system, the sequencing unit include as claimed in claim 1:
Subelement is grouped, for the test case in minimum regression test case subset being grouped according to ordering factor;
Sort subelement, for determining the priority metrics of test case in each group according to ordering factor.
7. optimization system as claimed in claim 6,
The packet subelement be used for will corresponding defect state be test case, the execution state being not turned off be Failed, N/A, Not Completed, No Run, Blocked test case are divided into preferred group;It will newly increase or improved test case is divided into Preferential group;Newly increase non-and improve and test case that corresponding defect is turned off is divided into general group;Newly increase non-and improve And the test case for never corresponding to any defect is divided into be measured group.
8. optimization system as claimed in claim 7, when number is more than zero when test case correspond to the defects of, the sequence list Member is used for the defects of the defects of correspond to according to test case number, corresponding testing requirement number, correspondence order of severity and right The testing requirement priority answered calculates the priority metrics of test case in preferred group;
Number is equal to zero and test case when to perform state be Failed, the sequence subelement when test case corresponds to the defects of Test case in preferred group is calculated for testing requirement number, corresponding testing requirement priority according to corresponding to test case Priority metrics.
9. optimization system as claimed in claim 7, the sequence subelement is used to lack according to test case place module is all The all defect number of module where the test case sum of module where the sunken order of severity, test case, test case, survey Testing requirement priority corresponding to testing requirement number corresponding to example on probation and test case calculates test case in preferential group Priority metrics.
10. optimization system as claimed in claim 7, the sequence subelement is for the defects of being corresponded to according to test case Several, corresponding testing requirement number, it is corresponding the defects of the order of severity and corresponding testing requirement priority calculate in general group The priority metrics of test case.
11. a kind of optimization method of regression test case collection, including:
Pre maintenance is carried out to original regression test case collection, obtains benchmark regression test case collection;
The benchmark regression test case collection is about subtracted, obtains minimum regression test case subset;And
The execution sequence of test case in the minimum regression test case subset is ranked up, realized to regression test case The fully optimized of collection.
12. optimization method as claimed in claim 11, described that original regression test case collection progress pre maintenance is included:Adopt The original regression test case collection is increased with ADCL models, deletes, improve, join operation.
13. optimization method as claimed in claim 12,
It is described to increase operation and include:Increase testing requirement and test case;
The deletion action includes:Delete out-of-date testing requirement and test case;
The improvement operation includes:Improving has the testing requirement and test case of variation;
The join operation includes:Increase and the corresponding relation of improved test case and testing requirement are checked, and covering is surveyed The test case of examination demand is coupled with the testing requirement.
14. optimization method as claimed in claim 11, described the step of about being subtracted to benchmark regression test case collection, uses Zero-one integer programming model, benchmark regression test case collection is about subtracted using intelligent optimization genetic algorithm.
15. optimization method as claimed in claim 14, it is described benchmark regression test case collection is about subtracted including:
Extraction step:Extract test case and perform temporal information, testing requirement information, use-case demand covering relation information;
Delete step:Delete redundancy testing use-case and redundancy testing demand;
Initialization step:0-1 gene codes are carried out to test case, and it is initial by the way that the gene of individual is all set into 1 generation The individual of change and population;
In middle generation, produces step:To each individual x in current populationiCalculate its fitness f using time cost as targeti, and Middle generation is produced using roulette policy selection operator;
Population of new generation produces step:Crossover operator is applied for population to centre, application variation is calculated using 1/L as mutation probability Son, produce population of new generation;
Judgment step:Judge whether population of new generation meets end condition, if it is, implementing result produces step:If not, return In generation, produces step among receipt row;
As a result step is produced:To population genetic decoding of new generation and calculate each individual x in population of new generationi+1With generation time Valency is the fitness f of targeti+1, select fitness numerical value highest individual to produce minimum return as the final result about subtracted and survey Example collection on probation.
16. optimization method as claimed in claim 11, the execution to test case in minimum regression test case subset Order be ranked up including:
The test case in minimum regression test case subset is grouped according to ordering factor;
The priority metrics of test case in each group are determined according to ordering factor.
17. optimization method as claimed in claim 16,
It is that the test case, the execution state that are not turned off are Failed, N/A, Not Completed, No by corresponding defect state Run, Blocked test case are divided into preferred group;
It will newly increase or improved test case is divided into preferential group;
Newly increase non-and improve and test case that corresponding defect is turned off is divided into general group;
The non-test case for newly increasing and improving and never correspond to any defect is divided into be measured group.
18. optimization method as claimed in claim 17, when number is more than zero when test case corresponds to the defects of, used according to test The defects of example is corresponding number, corresponding testing requirement number, it is corresponding the defects of the order of severity and corresponding testing requirement it is preferential Level calculates the priority metrics of test case in preferred group;
Number is equal to zero and test case when to perform state be Failed when test case corresponds to the defects of, according to test case pair Testing requirement number, the corresponding testing requirement priority answered calculate the priority metrics of test case in preferred group.
19. optimization method as claimed in claim 17, the order of severity of module all defect, test according to where test case The test case sum of module where use-case, the corresponding test of all defect number, test case of test case place module Testing requirement priority corresponding to demand number and test case calculates the priority metrics of test case in preferential group.
20. optimization method as claimed in claim 17, the defects of being corresponded to according to test case number, corresponding testing requirement The defects of counting, the be corresponding order of severity and corresponding testing requirement priority calculate the degrees of priority levels of test case in general group Amount.
CN201710784881.4A 2017-08-22 2017-09-01 Regression test case set optimization method and system Active CN107544905B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2017107267341 2017-08-22
CN201710726734 2017-08-22

Publications (2)

Publication Number Publication Date
CN107544905A true CN107544905A (en) 2018-01-05
CN107544905B CN107544905B (en) 2021-02-05

Family

ID=60958611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710784881.4A Active CN107544905B (en) 2017-08-22 2017-09-01 Regression test case set optimization method and system

Country Status (1)

Country Link
CN (1) CN107544905B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109344048A (en) * 2018-08-17 2019-02-15 中国平安人寿保险股份有限公司 A kind of test method, storage medium and server
CN110059015A (en) * 2019-04-28 2019-07-26 西安邮电大学 Evolution of Population multiple target priorities of test cases sort method
CN110209593A (en) * 2019-06-14 2019-09-06 南京大学 A kind of Android application testing method towards preference setting
CN110389890A (en) * 2018-04-20 2019-10-29 杭州海康威视数字技术股份有限公司 A kind of the updating maintenance method, apparatus and computer equipment in public use-case library
CN111858371A (en) * 2020-07-28 2020-10-30 北京达佳互联信息技术有限公司 Software testing method, system, storage medium and computer equipment
CN111949552A (en) * 2020-09-03 2020-11-17 Oppo广东移动通信有限公司 Test case set generation method and device, computer equipment and storage medium
CN112131108A (en) * 2020-09-18 2020-12-25 电信科学技术第十研究所有限公司 Test strategy adjusting method and device based on characteristic attributes
CN114401211A (en) * 2022-01-17 2022-04-26 重庆邮电大学 Test system and test method for accessing industrial wireless network equipment to IPv6 network

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464831A (en) * 2009-01-09 2009-06-24 西安邮电学院 Reduction technology for test use cases
CN103123607A (en) * 2013-03-08 2013-05-29 扬州大学 Software regression testing method based on formal conceptual analysis
CN103605611A (en) * 2013-12-10 2014-02-26 浪潮电子信息产业股份有限公司 Test case optimization method based on genetic algorithm
CN105430707A (en) * 2015-11-03 2016-03-23 国网江西省电力科学研究院 WSN (Wireless Sensor Networks) multi-objective optimization routing method based on genetic algorithm
CN105446885A (en) * 2015-12-28 2016-03-30 西南大学 Regression testing case priority ranking technology based on needs

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464831A (en) * 2009-01-09 2009-06-24 西安邮电学院 Reduction technology for test use cases
CN103123607A (en) * 2013-03-08 2013-05-29 扬州大学 Software regression testing method based on formal conceptual analysis
CN103605611A (en) * 2013-12-10 2014-02-26 浪潮电子信息产业股份有限公司 Test case optimization method based on genetic algorithm
CN105430707A (en) * 2015-11-03 2016-03-23 国网江西省电力科学研究院 WSN (Wireless Sensor Networks) multi-objective optimization routing method based on genetic algorithm
CN105446885A (en) * 2015-12-28 2016-03-30 西南大学 Regression testing case priority ranking technology based on needs

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110389890A (en) * 2018-04-20 2019-10-29 杭州海康威视数字技术股份有限公司 A kind of the updating maintenance method, apparatus and computer equipment in public use-case library
CN110389890B (en) * 2018-04-20 2024-01-23 杭州海康威视数字技术股份有限公司 Updating and maintaining method and device for public use case library and computer equipment
CN109344048A (en) * 2018-08-17 2019-02-15 中国平安人寿保险股份有限公司 A kind of test method, storage medium and server
CN110059015B (en) * 2019-04-28 2022-09-30 西安邮电大学 Method for sequencing priorities of population evolution multi-target test cases
CN110059015A (en) * 2019-04-28 2019-07-26 西安邮电大学 Evolution of Population multiple target priorities of test cases sort method
CN110209593B (en) * 2019-06-14 2021-05-28 南京大学 Preference setting-oriented android application testing method
CN110209593A (en) * 2019-06-14 2019-09-06 南京大学 A kind of Android application testing method towards preference setting
CN111858371A (en) * 2020-07-28 2020-10-30 北京达佳互联信息技术有限公司 Software testing method, system, storage medium and computer equipment
CN111949552A (en) * 2020-09-03 2020-11-17 Oppo广东移动通信有限公司 Test case set generation method and device, computer equipment and storage medium
CN112131108A (en) * 2020-09-18 2020-12-25 电信科学技术第十研究所有限公司 Test strategy adjusting method and device based on characteristic attributes
CN112131108B (en) * 2020-09-18 2024-04-02 电信科学技术第十研究所有限公司 Feature attribute-based test strategy adjustment method and device
CN114401211A (en) * 2022-01-17 2022-04-26 重庆邮电大学 Test system and test method for accessing industrial wireless network equipment to IPv6 network
CN114401211B (en) * 2022-01-17 2023-05-12 重庆邮电大学 Test system and test method for accessing industrial wireless network equipment to IPv6 network

Also Published As

Publication number Publication date
CN107544905B (en) 2021-02-05

Similar Documents

Publication Publication Date Title
CN107544905A (en) The optimization method and system of regression test case collection
CN106201871B (en) Based on the Software Defects Predict Methods that cost-sensitive is semi-supervised
CN101866316B (en) Software defect positioning method based on relative redundant test set reduction
CN109783617A (en) For replying model training method, device, equipment and the storage medium of problem
CN106803799B (en) Performance test method and device
CN109344048A (en) A kind of test method, storage medium and server
CN110232434A (en) A kind of neural network framework appraisal procedure based on attributed graph optimization
CN109948940B (en) Heuristic algorithm-based Web service crowdsourcing test task allocation method
CN107832219A (en) The construction method of software fault prediction technology based on static analysis and neutral net
CN105808438B (en) A kind of Reuse of Test Cases method based on function call path
CN101231614A (en) Method for locating software unsoundness base on execution track block semblance
CN103123607B (en) Software regression testing method based on formal conceptual analysis
CN102831055A (en) Test case selection method based on weighting attribute
CN104217088B (en) The optimization method and system of operator's mobile service resource
CN115629998B (en) Test case screening method based on KMeans clustering and similarity
CN106843941A (en) Information processing method, device and computer equipment
CN111782532B (en) Software fault positioning method and system based on network abnormal node analysis
CN109690571A (en) Group echo system and method based on study
CN104281522A (en) Statement coverage and defect detection based multi-objective test data reduction method
CN111179576B (en) Power utilization information acquisition fault diagnosis method and system with inductive learning function
CN102289408A (en) regression test case sequencing method based on error propagation network
CN103218419B (en) Web tab clustering method and system
CN102521130B (en) Error location method based on cluster invariant analysis
CN110147941A (en) Content of examination acquisition methods, Stakeholder Evaluation method and device
CN114021758A (en) Operation and maintenance personnel intelligent recommendation method and device based on fusion of gradient lifting decision tree and logistic regression

Legal Events

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