CN103605603A - Covering table reduction method and system - Google Patents

Covering table reduction method and system Download PDF

Info

Publication number
CN103605603A
CN103605603A CN201310477511.8A CN201310477511A CN103605603A CN 103605603 A CN103605603 A CN 103605603A CN 201310477511 A CN201310477511 A CN 201310477511A CN 103605603 A CN103605603 A CN 103605603A
Authority
CN
China
Prior art keywords
covering table
new
flexible positions
combination
parameter
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
CN201310477511.8A
Other languages
Chinese (zh)
Other versions
CN103605603B (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.)
Nanjing University
Beihang University
Academy of Mathematics and Systems Science of CAS
Original Assignee
Nanjing University
Beihang University
Academy of Mathematics and Systems Science of CAS
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 Nanjing University, Beihang University, Academy of Mathematics and Systems Science of CAS filed Critical Nanjing University
Priority to CN201310477511.8A priority Critical patent/CN103605603B/en
Publication of CN103605603A publication Critical patent/CN103605603A/en
Application granted granted Critical
Publication of CN103605603B publication Critical patent/CN103605603B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a covering table reduction method and system. The method comprises the following steps of performing analysis processing on an initial covering table to obtain a relatively flexible position set of the covering table; according to the relatively flexible position set, judging the number of flexible positions included by each of test cases in the covering table, and ranking the test cases in the covering table according to the sequence of the number of the flexible positions from small to large to obtain a first new covering table; performing further analysis processing on the first new covering table to obtain a flexible position set of the covering table; according to the flexible position set, deleting the test cases completely including the flexible positions in the covering table to obtain a new flexible position set; replacing flexible positions in the new flexible position set in a preset value range randomly to obtain a second new covering table; executing the above steps circularly until the final covering table meeting preset conditions is obtained. Therefore, numbers of the actual test cases are decreased, test cost is reduced, and the covering rate of parameter combination in the original covering table is ensured.

Description

Cover the method and system of table yojan
Technical field
The present invention relates to computer realm, relate in particular to a kind of method and system that cover table yojan.
Background technology
The system action of software or hardware system can be subject to the impact of a plurality of parameters or factor conventionally, and wherein each parameter has a plurality of different discrete values.In such system, the system failure is normally caused by some values combination of partial parameters, and the target of software or hardware testing is to build corresponding test case to trigger these system failures.Limit method of testing can fully be tested all parameter value combinations for the treatment of examining system, but it needs a large amount of test cases, thereby cannot application in reality test.By comparison, by all t-that cover between any t parameter, combine, combined test method can, guaranteeing, under the prerequisite of higher fault detect rate, greatly to reduce testing cost, be a kind of very effective method of testing.
Combined test method is used and is covered table as test use cases.At a t-way, cover in table, between t parameter, all values of t-combination all at least need to occur once in covering table arbitrarily, and the t is here called coverage strength.If all values of the combination of each t-in a t-way covering table only occur once, this covering table is optimum covering table (also referred to as orthogonal arrage), has minimum scale (number of test case).But the generation of covering table is a complicated problem, treats examining system for the overwhelming majority, cannot generate at present the covering table of optimum scale, in the covering table finally obtaining, generally there are a lot of Fault-tolerant Integrateds.
Summary of the invention
Based on this, for solving problem and the defect of existence of the prior art, be necessary to provide the method and system of a kind of simple and effective covering table yojan.
A kind of method that covers table yojan providing for realizing the object of the invention, comprises the following steps:
S100, carries out analyzing and processing to initial covering table, obtains the relative flexible positions collection of described initial covering table;
S200, according to described relative flexible positions collection, judge the number that comprises flexible positions in every test case in described initial covering table, and by the number of described flexible positions order from small to large, the described test case in described initial covering table is sorted, obtain the first new covering table;
S300, is further analyzed processing to the described first new covering table, obtains the flexible positions collection of the described first new covering table;
S400, according to described flexible positions collection, deleting in the described first new covering table is all the test case of flexible positions, obtains new flexible positions collection;
S500 replaces the flexible positions that described new flexible positions is concentrated at random in default span, obtains the second new covering table;
S600, using the described second new table that covers as the initial table that covers, return step S100 circulation execution above-mentioned in steps, until be met pre-conditioned final covering table;
Described pre-conditioned for presetting circulation total degree, or in default cycle index, the number of the test case in the described second new covering table is identical.
In an embodiment, step S100 comprises the following steps therein:
S110 is flexible positions by all position marks in described initial covering table;
S120, select any t parameter in described initial covering table to combine, obtain m t-combination of parameter in described initial covering table, and be original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only appearance t-combined value is once corresponding, obtain the relative flexible positions collection of described initial covering table;
Wherein, described t is positive integer, is the coverage strength of described initial covering table;
M=C(n, t), n is the number of parameter in described initial covering table;
The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
In an embodiment, step S120 comprises the following steps therein:
S121, selects any t parameter in described initial covering table to combine, and obtains m t-combination of parameter in described initial covering table;
S122, selects a described t-combination of non-selected mistake in described initial covering table, is a t-combination;
S123 is original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only an appearance t-combined value is once corresponding;
S124, judges the t-combination that whether also has non-selected mistake in described initial covering table, if return to execution step S122; Otherwise, obtain the relative flexible positions collection of described initial covering table.
In an embodiment, step S300, comprises the following steps therein:
S310 is flexible positions by all position marks in the described first new covering table;
S320, select any t parameter in the described first new covering table to combine, obtain m t-combination of parameter in the described first new covering table, according to putting in order of all test cases in the described first new covering table, by the position recovering of the described first new covering table corresponding to the t-combined value occurring for the first time, be original value, obtain the flexible positions collection of the described first new covering table;
Wherein, described t is positive integer, is the coverage strength of described initial covering table;
Described m=C(n, t), n is the number of parameter in described initial covering table;
The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
In an embodiment, step S320, comprises the following steps therein:
S321, selects any t parameter in the described first new covering table to combine, and obtains m t-combination of parameter in the described first new covering table;
S322, selects a described t-combination of non-selected mistake in the described first new covering table, is the 2nd t-combination;
S323, according to putting in order of all test cases in the described first new covering table, is original value by the position recovering of the described first new covering table corresponding to described the 2nd t-combined value occurring for the first time;
S324, judges the t-combination that whether also has non-selected mistake in the described first new covering table, if return to execution step S322; Otherwise, obtain the flexible positions collection of the described first new covering table.
A kind of system that covers table yojan based on same inventive concept, comprises relative flexible positions collection generation module, order module, and flexible positions collection generation module, flexible positions collection adjusting module, and the new table generation module that covers, wherein:
Described relative flexible positions collection generation module, for initial covering table is carried out to analyzing and processing, obtains the relative flexible positions collection of described initial covering table;
Described order module, be used for according to described relative flexible positions collection, judge the number that comprises flexible positions in every test case in described initial covering table, and by the number of described flexible positions order from small to large, the described test case in described initial covering table is sorted, obtain the first new covering table;
Described flexible positions collection generation module, for the described first new covering table is further analyzed to processing, obtains the flexible positions collection of the described first new covering table;
Described flexible positions collection adjusting module, for according to described flexible positions collection, deleting in the described first new covering table is all the test case of flexible positions, obtains new flexible positions collection;
Described new covering table generation module is replaced the flexible positions that described new flexible positions is concentrated at random in default span, obtains the second new covering table.
In an embodiment, described relative flexible positions collection generation module, comprises the first mark submodule therein, and the first processing submodule, wherein:
Described the first mark submodule, for being flexible positions by all position marks of described initial covering table;
Described first processes submodule, be used for selecting any t the parameter of described initial covering table to combine, obtain m t-combination of parameter in described initial covering table, and be original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only appearance t-combined value is once corresponding, obtain the relative flexible positions collection of described initial covering table;
Described t is positive integer, is the coverage strength of described initial covering table;
Described m=C(n, t), n is the number of parameter in described initial covering table;
The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
In an embodiment, described first processes submodule comprises the first assembled unit therein, the first selected cell, and the first reduction unit, and the first judging unit, wherein:
Described the first assembled unit, for selecting any t the parameter of described initial covering table to combine, obtains m t-combination of parameter in described initial covering table;
Described the first selected cell, for selecting a described t-combination of the non-selected mistake of described initial covering table, is a t-combination;
Described the first reduction unit is original value for the position recovering that occurs the initial covering table that a t-combined value is once corresponding by all test cases of described initial covering table;
Described the first judging unit, for judging that whether described initial covering table also exists the t-combination of non-selected mistake, processes if turn described the first assembled unit; Otherwise, obtain the relative flexible positions collection of described initial covering table.
In an embodiment, described flexible positions collection generation module comprises the second mark submodule therein, and the second processing submodule, wherein:
Described the second mark submodule, for being flexible positions by all position marks of the described first new covering table;
Described second processes submodule, be used for selecting any t the parameter of the described first new covering table to combine, obtain m t-combination of parameter in the described first new covering table, according to putting in order of all test cases in the described first new covering table, by the position recovering of the described first new covering table corresponding to the t-combined value occurring for the first time, be original value, obtain the flexible positions collection of the described first new covering table;
Described t is positive integer, is the coverage strength of described initial covering table; M is positive integer.
In an embodiment, described second processes submodule comprises the second assembled unit therein, the second selected cell, and the second reduction unit, and the second judging unit, wherein:
Described the second assembled unit, for selecting any t the parameter of the described first new covering table to combine, obtains m t-combination of parameter in the described first new covering table;
Described the second selected cell, for selecting a described t-combination of the non-selected mistake of the described first new covering table, is the 2nd t-combination;
Described the second reduction unit for according to the putting in order of all test cases of the described first new covering table, is original value by the position recovering of the described first new covering table corresponding to described the 2nd t-combined value occurring for the first time;
Described the second judging unit, for judging that whether the described first new covering table also exists the t-combination of non-selected mistake, processes if turn described the second assembled unit; Otherwise, obtain the flexible positions collection of the described first new covering table.
Beneficial effect of the present invention comprises:
A kind of method and system that cover table yojan provided by the invention, former test is carried out to yojan with covering table, obtain final new covering table fewer than the number of the test case in former covering table, thereby reduce the number of actual test case, reduce the testing cost in actual test.And can guarantee the coverage rate of parameter combinations in former covering table.
Accompanying drawing explanation
Fig. 1 is a kind of process flow diagram that covers a specific embodiment of the method for showing yojan of the present invention;
Fig. 2 is a kind of system architecture schematic diagram that covers a specific embodiment of the system of showing yojan of the present invention.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing, the embodiment of the method and system of the covering table yojan of the embodiment of the present invention is described.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The method of the covering table yojan of the embodiment of the present invention, as shown in Figure 1, comprises the following steps:
S100, carries out analyzing and processing to initial covering table, obtains the relative flexible positions collection of described initial covering table;
S200, according to described relative flexible positions collection, judge the number that comprises flexible positions in every test case in described initial covering table, and by the number of described flexible positions order from small to large, the described test case in described initial covering table is sorted, obtain the first new covering table;
S300, is further analyzed processing to the described first new covering table, obtains the flexible positions collection of the described first new covering table;
S400, according to described flexible positions collection, deleting in the described first new covering table is all the test case of flexible positions, obtains new flexible positions collection;
S500 replaces the flexible positions that described new flexible positions is concentrated at random in default span, obtains the second new covering table.
S600, using the described second new table that covers as the initial table that covers, return step S100 circulation execution above-mentioned in steps, until be met pre-conditioned final covering table.
Described pre-conditioned for presetting circulation total degree, or in default cycle index, the number of the test case in the described second new covering table is identical.
Circulation being for example set and stopping the yojan to covering table after 5 times, circulation execution step S100~S500,5 programs of backed off after random to the yojan of covering table of taking second place, obtain the final new covering table after yojan.Or arrange initial covering table is carried out to yojan according to step S100~S500, if it is all identical that continuous circulation is carried out the number of the test case comprising in the second new covering table obtaining for 5 times, stop the yojan to covering table, obtain the final new covering table after yojan.In most cases the number of the test case in described the second final new covering table is less than the number of the test case in described initial covering table, thereby reduces the number of actual test case, reduces the testing cost in actual test.The embodiment of the present invention afterwards only to being all that the test case of flexible positions is deleted, guarantees the coverage rate of parameter combinations in former covering table by sequence.After flexible positions random assignment in the covering table to after deleting, again carry out yojan, further reduce the number of actual test case.
Preferably, as a kind of embodiment, step S100 comprises the following steps:
S110 is flexible positions by all position marks in described initial covering table.
Adopt oppositely definite mode to determine the flexible positions collection that covers table, all positions that first will carry out in the covering table of yojan are all labeled as flexible positions, follow-uply get rid of again.
S120, select any t parameter in described initial covering table to combine, obtain m t-combination of parameter in described initial covering table, and be original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only appearance t-combined value is once corresponding, obtain the relative flexible positions collection of described initial covering table.
Wherein, described t is positive integer, is the coverage strength of described initial covering table;
Described m=C(n, t), n is the number of parameter in described initial covering table;
The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
It should be noted that, if treat, examining system comprises n test parameter herein, and the coverage strength of covering table is t, selects any t parameter in covering table to combine, and total m=c (n, t) is individual in such combination.For any one combination in m t-combination, the difference of the quantity that the number of its combined value can value according to parameter and difference.For example, in the covering table that comprises 4 parameters at certain, t=2, and each parameter comprises two different values 1 or 0, in covering table, by the 1st and the 2nd 2-that parameter forms, combining corresponding 2-combined value may be (0,0 ,-,-), (0,1 ,-,-), (1,0,-,-), (1,1 ,-,-) four kinds.If a certain 2-combined value only occurs once in initial covering table, this being combined to corresponding position recovering is original value, and all the other positions still remain flexible positions.As in upper example, cover in all test cases of table (1,0 ,-,-) combined value and only occurred once, (1,0 ,-,-) combined value is reduced in the relevant position of initial covering table.After handling all combinations, remaining flexible positions forms relative flexible positions collection.
Described position is interpreted as: certain parameter value in a test case.For example (0,0,1,1) is a test case, and 0,0,1,1 is respectively 4 diverse locations of this test case.
Described flexible positions is interpreted as: for an every test case covering in table, each position is all included in C (n-1, t-1) in the t-combined value of individual t-combination, if these combined values all in remaining test case, occur, this position is called flexible positions.
For example, consider test use cases T={ (0,1,1), (0,1,2), (0,2,1) }, suppose that coverage strength is 2, first position 0 of the 1st test case is flexible positions, this is because the 2-combined value that comprises it has (0,1,-) and (0,-, 1), they occur respectively in the 2nd and the 3rd test case.
Described relative flexible positions collection (RFS) is interpreted as: in covering table, the set of all flexible positions is called relative flexible positions collection.The dirigibility that value replacement can affect all the other flexible positions is carried out in some position that flexible positions is concentrated.
Described flexible positions collection (FS) is interpreted as: flexible positions collection is a subset of relative flexible positions collection, and it meets the dirigibility that can carry out value replacement to these positions simultaneously and not affect all the other flexible positions.
Preferably, as a kind of embodiment, step S120 comprises the following steps:
S121, selects any t parameter in described initial covering table to combine, and obtains m t-combination of parameter in described initial covering table;
S122, selects a described t-combination of non-selected mistake in described initial covering table, is a t-combination;
A t-combination in covering table is carried out to analyzing and processing, until handle all t-combinations at every turn.
S123 is original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only an appearance t-combined value is once corresponding;
S124, judges the t-combination that whether also has non-selected mistake in described original covering table, if return to execution step S122; Otherwise, obtain the relative flexible positions collection of described initial covering table.
Preferably, as a kind of embodiment, step S300, comprises the following steps:
S310 is flexible positions by all position marks in the described first new covering table;
S320, select any t parameter in the described first new covering table to combine, obtain m t-combination of parameter in the described first new covering table, according to putting in order of all test cases in the described first new covering table, by the position recovering of the described first new covering table corresponding to the t-combined value occurring for the first time, be original value, obtain the flexible positions collection of the described first new covering table;
Wherein, described t is positive integer, is the coverage strength of described initial covering table;
M=C(n, t), n is the number of parameter in described initial covering table;
The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
It should be noted that herein, searching by by the position recovering of (rather than only occurring once) the covering table that t-combined value is corresponding occurring for the first time of flexible positions collection, guarantee that all flexible positions that finally obtain form flexible positions collection (rather than relative flexible positions collection), avoid causing the deletion of necessary test case.
Preferably, as a kind of embodiment, step S320, comprises the following steps:
S321, selects any t parameter in the described first new covering table to combine, and obtains m t-combination of parameter in the described first new covering table.
S322, selects a described t-combination of non-selected mistake in the described first new covering table, is the 2nd t-combination.
A t-combination in covering table is carried out to analyzing and processing, until handle all t-combinations at every turn.
S323, according to putting in order of all test cases in the described first new covering table, is original value by the position recovering of the described first new covering table corresponding to described the 2nd t-combined value occurring for the first time;
S324, judges the t-combination that whether also has non-selected mistake in the described first new covering table, if return to execution step S322; Otherwise, obtain the flexible positions collection of the described first new covering table.
For better explanation the present invention, lift an object lesson below and describe.
Suppose that software systems to be measured are subject to the impact of 5 different parameters, are designated as respectively p 1, p 2, p 3, p 4, p 5, wherein each parameter all has two different legal values, is designated as respectively 0 and 1.These parameters can be user's input, system configuration, internal event etc., for example p 1can represent " operating system ", its corresponding value is respectively " Windows " and " Linux ".
In such system, the system failure is caused by some the value combination between some parameters often.For example work as p 1value is 0, p 3value is can cause certain system failure at 1 o'clock, and in order to detect such system failure, its corresponding combined value (0 ,-, 1 ,-,-) just need to be included in certain test case.Limit method of testing can fully detect all possible combined value, but it needs 2 5article=32, test case, test cost is larger.
For such system, use combined test method can greatly reduce test cost.For example, if supposing the system fault is to be caused by the value combination between any 2 parameters, combined test only needs 7 test cases in table 1 so.The test use cases that these 7 test cases form is called a 2-way covering table.At a 2-way, cover in table, all 2 * 2=4 value combinations of any 2 parameters all at least cover once in this table.For example,, for p 1and p 3the 2-combination of these two parameters, all 4 2-combined values of its correspondence (0 ,-, 0 ,-,-), (0 ,-, 1 ,-,-), (1 ,-, 0 ,-,-), (1 ,-, 1 ,-,-) can in this table, find.
2-way of table 1 covers table
? p 1 p 2 p 3 p 4 p 5
t 1 0 1 1 0 0
t 2 0 1 0 1 1
t 3 1 0 1 0 1
t 4 1 1 0 1 1
t 5 0 0 0 0 1
t 6 1 0 0 1 0
t 7 0 0 1 1 1
Use this method to carry out yojan to this covering table below, and to set stopping criterion for iteration be 1 iteration.First, need to find the relative flexible positions collection of this covering table.According to corresponding flow process S110, in covering table, all positions are all labeled as flexible positions when initial, carry out mark here with *, as shown in table 2.
Table 2 is found the original state of relative flexible positions collection
? p 1 p 2 p 3 p 4 p 5
t 1 * * * * *
t 2 * * * * *
t 3 * * * * *
t 4 * * * * *
t 5 * * * * *
t 6 * * * * *
t 7 * * * * *
Then, according to S120, from these 5 parameters, select successively any 2 parameters to combine, for example in order (1,2) (i.e. the 1st and the 2nd parameter), (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,4), (3,5), (4,5) are selected.First the 2-combination of selecting parameter (1,2) to form, combines corresponding 2-combined value with this 2-and has 4, initial, covers in table, only has the 4th row t 4in combined value (1,1 ,-,-,-) only occur once, therefore by the position recovering in covering table corresponding to this combined value, all the other positions remain unchanged, as shown in table 3.
Table 3 is gone back the result after raw parameter (1,2) row
? p 1 p 2 p 3 p 4 p 5
t 1 * * * * *
t 2 * * * * *
t 3 * * * * *
t 4 1 1 * * *
t 5 * * * * *
t 6 * * * * *
t 7 * * * * *
Secondly, the 2-combination of selecting parameter (1,3) to form, same, corresponding with this 2-combination 2-combined value has 4, in covering and showing, only has the 3rd row t 3in combined value (1 ,-, 1 ,-,-) only occur once, therefore by the position recovering in covering table corresponding to this combined value, all the other positions remain unchanged, as shown in table 4.
Table 4 is gone back the result after raw parameter (1,3) row
? p 1 p 2 p 3 p 4 p 5
t 1 * * * * *
t 2 * * * * *
t 3 1 * 1 * *
t 4 1 1 * * *
t 5 * * * * *
t 6 * * * * *
t 7 * * * * *
Successively the 2-combination of remaining parameter is reduced, obtain net result as shown in table 5, wherein, all flexible positions that are not reduced form the relative flexible positions collection of covering table.
Table 5 covers the relative flexible positions collection of table
? p 1 p 2 p 3 p 4 p 5
t 1 0 1 1 0 0
t 2 * * * * *
t 3 1 * 1 0 *
t 4 1 1 * * *
t 5 * * 0 0 *
t 6 0 0 1 1 1
t 7 * * 0 1 *
Obtain after relative flexible positions collection, according to the number of flexible positions in every test case, according to S200, by order from small to large, initial covering table is reordered, the first new covering table obtaining is as shown in table 6.
The new table that covers of table 6 first
? p 1 p 2 p 3 p 4 p 5
t 1 0 1 1 0 0
t 6 1 0 0 1 0
t 3 1 0 1 0 1
t 4 1 1 0 1 1
t 5 0 0 0 0 1
t 7 0 0 1 1 1
t 2 0 1 0 1 1
Subsequently, according to S300, find the flexible positions collection of the first new covering table.The finding method of flexible positions collection is similar with relative flexible positions collection, according to this any 2 parameters in covering table is combined, for example, first consider the 2-combination that parameter (1,2) row form.In 4 2-combined values corresponding with this 2-combination, the position in the covering table that the combined value of appearance is corresponding for the first time will be reduced.(0,0 ,-,-,-), (0,1 ,-,-,-), (1,0 ,-,-,-), (1,1 ,-,-,-) come across for the first time respectively t 5, t 1, t 6and t 4, therefore the position recovering in corresponding covering table, as shown in table 7.
Table 7 is gone back the result after raw parameter (1,2) row
? p 1 p 2 p 3 p 4 p 5
t 1 0 1 * * *
t 6 1 0 * * *
t 3 * * * * *
t 4 1 1 * * *
t 5 0 0 * * *
t 7 * * * * *
t 2 * * * * *
Successively the 2-combination of remaining parameter is reduced, obtain net result as shown in table 8, wherein, all flexible positions that are not reduced form the flexible positions collection of the rear covering table of sequence.
The first new flexible positions collection that covers table after table 8 sequence
? p 1 p 2 p 3 p 4 p 5
t 1 0 1 1 0 0
t 6 1 0 0 1 0
t 3 1 0 1 0 1
t 4 1 1 0 1 1
t 5 0 0 0 0 1
t 7 0 * 1 1 1
t 2 * * * * *
According to S400, now there is a test case t 2its all positions are flexible positions, therefore delete this test case.For remaining flexible positions, according to S500, in default span 0 or 1, choose at random an assignment, obtain the second new covering table as shown in table 9.
The new table that covers of after table 9 yojan second
? p 1 p 2 p 3 p 4 p 5
t 1 0 1 1 0 0
t 6 1 0 0 1 0
t 3 1 0 1 0 1
t 4 1 1 0 1 1
t 5 0 0 0 0 1
t 7 0 1 1 1 1
Because initial setting up stopping criterion for iteration is 1 iteration, meet end condition, iteration finishes, and the yojan of covering table completes, 1 test case that amounted to yojan.If not yet reach end condition, using the second new table that covers as the initial table that covers, turn S100 continuation iteratively to the covering table after yojan analyze, yojan, replacement.Because the present embodiment is comparatively simple, therefore test case of yojan only.
In other embodiments of the invention, the target of covering table yojan is number of parameters from 38 to 48, and each parameter has 2 different values, the covering table that coverage strength is 6.Concrete covering table can be located to obtain from [3] (http://math.nist.gov/coveringarrays/ipof/ipof-results.html, Covering Arrays generated by IPOG-F).Adopt above-mentioned covering table reduction method, it is 300 that iterations is set, and obtains result as shown in table 10.
The Performance Ratio of table 10 covering table reduction method
Number of parameters 38 39 40 41 42 43 44 45 46 47 48
Former covering table scale 552 559 566 572 579 590 594 603 611 617 625
Prior art 545 553 560 570 575 586 593 602 610 616 624
This method 527 535 544 554 560 566 575 581 589 596 602
As can be seen from Table 10, the method for the covering table yojan of the embodiment of the present invention is the scale of the former covering table of yojan effectively, reduces the number of actual test case, reduces testing cost.
Based on same inventive concept, the embodiment of the present invention provides a kind of system that covers table yojan, because the principle that this system is dealt with problems is similar to a kind of aforementioned method, therefore, the enforcement of this system can realize according to the concrete steps of preceding method, repeats part and repeats no more.
A system that covers table yojan, as shown in Figure 2, comprises relative flexible positions collection generation module 100, order module 200, flexible positions collection generation module 300, flexible positions collection adjusting module 400, and the new table generation module 500 that covers.
Described relative flexible positions collection generation module 100, for initial covering table is carried out to analyzing and processing, obtains the relative flexible positions collection of described initial covering table.
Described order module 200, be used for according to described relative flexible positions collection, judge the number that comprises flexible positions in every test case in described initial covering table, and by the number of described flexible positions order from small to large, the described test case in described initial covering table is sorted, obtain the first new covering table.
Described flexible positions collection generation module 300, for the described first new covering table is further analyzed to processing, obtains the flexible positions collection of the described first new covering table.
Described flexible positions collection adjusting module 400, for according to described flexible positions collection, deleting in the described first new covering table is all the test case of flexible positions, obtains new flexible positions collection.
Described new covering table generation module 500 is replaced the flexible positions that described new flexible positions is concentrated at random in default span, obtains the second new covering table.
Module in said system, sequential loop is used and repeatedly covering table to be processed is carried out to yojan in actual use.
In an embodiment, described relative flexible positions collection generation module 100, comprises the first mark submodule 110 therein, and first processes submodule 120.
Described the first mark submodule 110, for being flexible positions by all position marks of described initial covering table.
Described first processes submodule 120, be used for selecting any t the parameter of described initial covering table to combine, obtain m t-combination of parameter in described initial covering table, and be original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only appearance t-combined value is once corresponding, obtain the relative flexible positions collection of described initial covering table.
Described t is positive integer, is the coverage strength of described initial covering table; M=C(n, t), n is the number of parameter in described initial covering table; The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
In an embodiment, described first processes submodule 120 comprises the first assembled unit 121, the first selected cell 122, the first reduction units 123, and the first judging unit 124 therein.
Described the first assembled unit 121, for selecting any t the parameter of described initial covering table to combine, obtains m t-combination of parameter in described initial covering table.
Described the first selected cell 122, for selecting a described t-combination of the non-selected mistake of described initial covering table, is a t-combination.
Described the first reduction unit 123 is original value for the position recovering that occurs the initial covering table that a t-combined value is once corresponding by all test cases of described initial covering table.
Described the first judging unit 124, for judging that whether described initial covering table also exists the t-combination of non-selected mistake, processes if turn described the first assembled unit; Otherwise, obtain the relative flexible positions collection of described initial covering table.
In an embodiment, described flexible positions collection generation module 300 comprises the second mark submodule 310 therein, and second processes submodule 320.
Described the second mark submodule 310, for being flexible positions by all position marks of the described first new covering table.
Described second processes submodule 320, be used for selecting any t the parameter of the described first new covering table to combine, obtain m t-combination of parameter in the described first new covering table, according to putting in order of all test cases in the described first new covering table, by the position recovering of the described first new covering table corresponding to the t-combined value occurring for the first time, be original value, obtain the flexible positions collection of the described first new covering table.
Described t is positive integer, is the coverage strength of described initial covering table; M is positive integer.
In an embodiment, described second processes submodule 320 comprises the second assembled unit 321, the second selected cell 322, the second reduction units 323, and the second judging unit 324 therein.
Described the second assembled unit 321, for selecting any t the parameter of the described first new covering table to combine, obtains m t-combination of parameter in the described first new covering table.
Described the second selected cell 322, for selecting a described t-combination of the non-selected mistake of the described first new covering table, is the 2nd t-combination.
Described the second reduction unit 323 for according to the putting in order of all test cases of the described first new covering table, is original value by the position recovering of the described first new covering table corresponding to described the 2nd t-combined value occurring for the first time.
Described the second judging unit 324, for judging that whether the described first new covering table also exists the t-combination of non-selected mistake, processes if turn described the second assembled unit; Otherwise, obtain the flexible positions collection of the described first new covering table.
The system of the covering table yojan of the embodiment of the present invention, general described final new covering table is fewer than the number of the test case in former covering table, and effectively the number of the actual test case of yojan, reduces the testing cost in actual test.And can guarantee the coverage rate of parameter combinations in former covering table.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.

Claims (10)

1. a method that covers table yojan, is characterized in that, comprises the following steps:
S100, carries out analyzing and processing to initial covering table, obtains the relative flexible positions collection of described initial covering table;
S200, according to described relative flexible positions collection, judge the number that comprises flexible positions in every test case in described initial covering table, and by the number of described flexible positions order from small to large, the described test case in described initial covering table is sorted, obtain the first new covering table;
S300, is further analyzed processing to the described first new covering table, obtains the flexible positions collection of the described first new covering table;
S400, according to described flexible positions collection, deleting in the described first new covering table is all the test case of flexible positions, obtains new flexible positions collection;
S500 replaces the flexible positions that described new flexible positions is concentrated at random in default span, obtains the second new covering table;
S600, using the described second new table that covers as the initial table that covers, returns to step S100 circulation and carries out until be met pre-conditioned final covering table;
Described pre-conditioned for presetting circulation total degree, or in default cycle index, the number of the test case in the described second new covering table is identical.
2. the method for covering table according to claim 1 yojan, is characterized in that, step S100 comprises the following steps:
S110 is flexible positions by all position marks in described initial covering table;
S120, select any t parameter in described initial covering table to combine, obtain m t-combination of parameter in described initial covering table, and be original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only appearance t-combined value is once corresponding, obtain the relative flexible positions collection of described initial covering table;
Wherein, described t is positive integer, is the coverage strength of described initial covering table;
Described m=C(n, t), n is the number of parameter in described initial covering table; The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
3. the method for covering table according to claim 2 yojan, is characterized in that, step S120 comprises the following steps:
S121, selects any t parameter in described initial covering table to combine, and obtains m t-combination of parameter in described initial covering table;
S122, selects a described t-combination of non-selected mistake in described initial covering table, is a t-combination;
S123 is original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only an appearance t-combined value is once corresponding;
S124, judges the t-combination that whether also has non-selected mistake in described initial covering table, if return to execution step S122; Otherwise, obtain the relative flexible positions collection of described initial covering table.
4. the method for the covering table yojan described in claims 1 to 3 any one, is characterized in that, step S300 comprises the following steps:
S310 is flexible positions by all position marks in the described first new covering table;
S320, select any t parameter in the described first new covering table to combine, obtain m t-combination of parameter in the described first new covering table, according to putting in order of all test cases in the described first new covering table, by the position recovering of the described first new covering table corresponding to the t-combined value occurring for the first time, be original value, obtain the flexible positions collection of the described first new covering table;
Wherein, described t is positive integer, is the coverage strength of described initial covering table;
Described m=C(n, t), n is the number of parameter in described initial covering table;
The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
5. the method for covering table according to claim 4 yojan, is characterized in that, step S320 comprises the following steps:
S321, selects any t parameter in the described first new covering table to combine, and obtains m t-combination of parameter in the described first new covering table;
S322, selects a described t-combination of non-selected mistake in the described first new covering table, is the 2nd t-combination;
S323, according to putting in order of all test cases in the described first new covering table, is original value by the position recovering of the described first new covering table corresponding to described the 2nd t-combined value occurring for the first time;
S324, judges the t-combination that whether also has non-selected mistake in the described first new covering table, if return to execution step S322; Otherwise, obtain the flexible positions collection of the described first new covering table.
6. a system that covers table yojan, is characterized in that, comprises relative flexible positions collection generation module, order module, and flexible positions collection generation module, flexible positions collection adjusting module, and the new table generation module that covers, wherein:
Described relative flexible positions collection generation module, for initial covering table is carried out to analyzing and processing, obtains the relative flexible positions collection of described initial covering table;
Described order module, be used for according to described relative flexible positions collection, judge the number that comprises flexible positions in every test case in described initial covering table, and by the number of described flexible positions order from small to large, the described test case in described initial covering table is sorted, obtain the first new covering table;
Described flexible positions collection generation module, for the described first new covering table is further analyzed to processing, obtains the flexible positions collection of the described first new covering table;
Described flexible positions collection adjusting module, for according to described flexible positions collection, deleting in the described first new covering table is all the test case of flexible positions, obtains new flexible positions collection;
Described new covering table generation module is replaced the flexible positions that described new flexible positions is concentrated at random in default span, obtains the second new covering table.
7. the system of covering table according to claim 6 yojan, is characterized in that, described relative flexible positions collection generation module, comprises the first mark submodule, and the first processing submodule, wherein:
Described the first mark submodule, for being flexible positions by all position marks of described initial covering table;
Described first processes submodule, be used for selecting any t the parameter of described initial covering table to combine, obtain m t-combination of parameter in described initial covering table, and be original value by the position recovering of the initial covering table that in all test cases in described initial covering table, only appearance t-combined value is once corresponding, obtain the relative flexible positions collection of described initial covering table;
Described t is positive integer, is the coverage strength of described initial covering table; M=C(n, t), n is the number of parameter in described initial covering table; The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
8. the system of covering table according to claim 7 yojan, is characterized in that, described first processes submodule comprises the first assembled unit, the first selected cell, and the first reduction unit, and the first judging unit, wherein:
Described the first assembled unit, for selecting any t the parameter of described initial covering table to combine, obtains m t-combination of parameter in described initial covering table;
Described the first selected cell, for selecting a described t-combination of the non-selected mistake of described initial covering table, is a t-combination;
Described the first reduction unit is original value for the position recovering that occurs the initial covering table that a t-combined value is once corresponding by all test cases of described initial covering table;
Described the first judging unit, for judging that whether described initial covering table also exists the t-combination of non-selected mistake, processes if turn described the first assembled unit; Otherwise, obtain the relative flexible positions collection of described initial covering table.
9. the system of covering table claimed in claim 6 yojan, is characterized in that, described flexible positions collection generation module comprises the second mark submodule, and the second processing submodule, wherein:
Described the second mark submodule, for being flexible positions by all position marks of the described first new covering table;
Described second processes submodule, be used for selecting any t the parameter of the described first new covering table to combine, obtain m t-combination of parameter in the described first new covering table, according to putting in order of all test cases in the described first new covering table, by the position recovering of the described first new covering table corresponding to the t-combined value occurring for the first time, be original value, obtain the flexible positions collection of the described first new covering table;
Described t is positive integer, is the coverage strength of described initial covering table; M=C(n, t), n is the number of parameter in described initial covering table; The corresponding a plurality of described t-combined values of certain t-combination of described parameter, every each described t-combined value that test case comprises m described t-combination in described initial covering table.
10. the system of covering table according to claim 9 yojan, is characterized in that, described second processes submodule comprises the second assembled unit, the second selected cell, and the second reduction unit, and the second judging unit, wherein:
Described the second assembled unit, for selecting any t the parameter of the described first new covering table to combine, obtains m t-combination of parameter in the described first new covering table;
Described the second selected cell, for selecting a described t-combination of the non-selected mistake of the described first new covering table, is the 2nd t-combination;
Described the second reduction unit for according to the putting in order of all test cases of the described first new covering table, is original value by the position recovering of the described first new covering table corresponding to described the 2nd t-combined value occurring for the first time;
Described the second judging unit, for judging that whether the described first new covering table also exists the t-combination of non-selected mistake, processes if turn described the second assembled unit; Otherwise, obtain the flexible positions collection of the described first new covering table.
CN201310477511.8A 2013-10-12 2013-10-12 Cover the method and system of table yojan Expired - Fee Related CN103605603B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310477511.8A CN103605603B (en) 2013-10-12 2013-10-12 Cover the method and system of table yojan

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310477511.8A CN103605603B (en) 2013-10-12 2013-10-12 Cover the method and system of table yojan

Publications (2)

Publication Number Publication Date
CN103605603A true CN103605603A (en) 2014-02-26
CN103605603B CN103605603B (en) 2016-03-02

Family

ID=50123832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310477511.8A Expired - Fee Related CN103605603B (en) 2013-10-12 2013-10-12 Cover the method and system of table yojan

Country Status (1)

Country Link
CN (1) CN103605603B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704381A (en) * 2017-08-31 2018-02-16 电子科技大学 A kind of Generation of software test case method of combination of two
CN110888803A (en) * 2019-11-08 2020-03-17 北京新能源汽车技术创新中心有限公司 Method and system for converting test decision table into test case
CN113076250A (en) * 2021-04-14 2021-07-06 南京大学 Dynamic random test method and device with constraint test model

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040205071A1 (en) * 2001-05-03 2004-10-14 Akio Uesugi File distribution system, file delivery server apparatus, and reception client apparatus
CN101236494A (en) * 2008-02-02 2008-08-06 南京大学 Information systems test combination generation method based on coverage density
CN101866316A (en) * 2010-06-23 2010-10-20 南京大学 Software defect positioning method based on relative redundant test set reduction
CN102999320A (en) * 2011-09-15 2013-03-27 阿里巴巴集团控股有限公司 Automatic test case generation method and system
CN103246600A (en) * 2012-02-10 2013-08-14 广州博纳信息技术有限公司 Fast verification method for software testing and evaluation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040205071A1 (en) * 2001-05-03 2004-10-14 Akio Uesugi File distribution system, file delivery server apparatus, and reception client apparatus
CN101236494A (en) * 2008-02-02 2008-08-06 南京大学 Information systems test combination generation method based on coverage density
CN101866316A (en) * 2010-06-23 2010-10-20 南京大学 Software defect positioning method based on relative redundant test set reduction
CN102999320A (en) * 2011-09-15 2013-03-27 阿里巴巴集团控股有限公司 Automatic test case generation method and system
CN103246600A (en) * 2012-02-10 2013-08-14 广州博纳信息技术有限公司 Fast verification method for software testing and evaluation

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
聂长海,徐宝文: "一种最小测试用例集生成方法", 《计算机学报》 *
聂长海等: "一种新的二水平多因素系统两两组合覆盖测试数据生成算法", 《计算机学报》 *
谢晓园等: "面向路径覆盖的演化测试用例生成技术", 《软件学报》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704381A (en) * 2017-08-31 2018-02-16 电子科技大学 A kind of Generation of software test case method of combination of two
CN110888803A (en) * 2019-11-08 2020-03-17 北京新能源汽车技术创新中心有限公司 Method and system for converting test decision table into test case
CN110888803B (en) * 2019-11-08 2023-08-22 北京国家新能源汽车技术创新中心有限公司 Method and system for converting test decision table into test case
CN113076250A (en) * 2021-04-14 2021-07-06 南京大学 Dynamic random test method and device with constraint test model
CN113076250B (en) * 2021-04-14 2023-08-25 南京大学 Dynamic random test method and device with constraint test model and storage medium

Also Published As

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

Similar Documents

Publication Publication Date Title
Ulrich et al. Pattern detection in null model analysis
KR101981028B1 (en) System for detecting security vulnerability based on binary, method and program thereof
CN105577440B (en) A kind of network downtime localization method and analytical equipment
CN103365765A (en) Test case screening method and test case screening system for testing
US9891281B1 (en) Method and system for automatically identifying test runs contributing to coverage events of interest in verification test data
CN103605603A (en) Covering table reduction method and system
CA3004594C (en) Cause backtracing method
CN1749769A (en) Invariant detects
CN104063307B (en) A kind of method for testing software and system
CN103617119B (en) Based on the mutual regression test case selection method covering of statement
CN104536882A (en) Error locating method based on frequent sub-graph mining
Chen et al. Invasive weed optimization algorithm for solving permutation flow-shop scheduling problem
KR101940486B1 (en) Low cost apparatus and method for error-based program testing
CN109213105B (en) Reconfigurable device, reconfigurable realization method and distributed control system
CN110083538A (en) A kind of concurrent program noise injection method
CN106874215B (en) Serialized storage optimization method based on Spark operator
CN110262950A (en) Abnormal movement detection method and device based on many index
Parsa et al. A new algorithm to Test Suite Reduction based on cluster analysis
CN107992526A (en) Main broadcaster recommends method, storage device and computer equipment
Zuiev et al. Questions of radioelectronic equipment diagnostics programs efficiency analysis
CN107102942A (en) A kind of minimum Fault Locating Method based on input domain location of mistake
Tong et al. Back to the brink: Phylogeography and demographic history of the endangered Torreya jackii
CN109815104B (en) GPGPU program approximate analysis system and method based on soft error perception
CN110442508B (en) Test task processing method, device, equipment and medium
Shen et al. A new test suite reduction method for wearable embedded software

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160302

Termination date: 20161012