CN101984416A - Method and device for generating test case - Google Patents

Method and device for generating test case Download PDF

Info

Publication number
CN101984416A
CN101984416A CN2010105302387A CN201010530238A CN101984416A CN 101984416 A CN101984416 A CN 101984416A CN 2010105302387 A CN2010105302387 A CN 2010105302387A CN 201010530238 A CN201010530238 A CN 201010530238A CN 101984416 A CN101984416 A CN 101984416A
Authority
CN
China
Prior art keywords
test
test factor
combination
priority
factor combination
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
CN2010105302387A
Other languages
Chinese (zh)
Other versions
CN101984416B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201010530238.7A priority Critical patent/CN101984416B/en
Publication of CN101984416A publication Critical patent/CN101984416A/en
Application granted granted Critical
Publication of CN101984416B publication Critical patent/CN101984416B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for generating a test case, which are used for increasing the coverage on a core test scene so as to improve the efficiency for controlling fault leakage. The method comprises the following steps: combining test factors contained in a test class, and generating a plurality of test factor combinations; for each test factor combination, determining the priority of the test factor combination according to the attribute of each test factor in the test factor combination, and classifying the test factor combination into a set of the corresponding priority according to the priority of the test factor combination; selecting a corresponding quantity of test factor combinations from the set according to the test phase, the test coverage or the task cycle of the current test; and generating a test case based on the selected test factor combinations. By using the technical scheme, the coverage on a core test scene can be increased, and the efficiency for controlling fault leakage can be improved.

Description

A kind of generation method and device of test case
Technical field
The present invention relates to field tests, relate in particular to a kind of generation method and device of test case.
Background technology
At present, when carrying out software system test, generally treat the brake point and test one by one by the test case that sets in advance.Test case is a group of input, executive condition working out for certain special objective and predicts the outcome, so that test certain Program path or examine and whether satisfy certain particular requirement.Test case mainly is applicable to integration testing, system testing and regression test, when implementing test, the tester is a standard with the test case that is provided with, carry out corresponding test operation in strict accordance with test event that is provided with in the test case and testing procedure, and test case is recorded in the test case management software, so that generate the test result document automatically.When the test case scale expands to a certain degree, if all items in the test case is tested, long, testing efficiency reduction then consuming time, thereby may have influence on the progress and the test effect of product test, as a VPN (Virtual Private Network, VPN (virtual private network)) module, its corresponding use-case number extend to several ten thousand to hundreds of thousands.
At present, be to improve testing progress and test effect, when generating test case, introduce test factor, and assist the test processs such as setting, execution, analysis of retrofit testing use-case by test factor.As, determine category of test that needs test and the test factor that comprises thereof at first according to the actual requirements, again the various test factor of quantity is made up, generate the test factor combination (a test factor combination provides a kind of test scene) of some, and pass through software only according to the priority of each test factor in the test factor combination, from the test factor combination that generates, choose the test factor combination (being typical combination) that is used to generate test case; Operating personnel test each test factor combination according to test case, and generate corresponding test document according to test result.The test factor combination tool of using morely at present is PICT (the Pairwise Independent Combinatorial Testing of Microsoft's exploitation, match independent combined test) instrument, it is fairly simple to use this instrument that test factor is made up, only need making up test factor by appointment, form becomes file, such as demo.txt, carry out this file below order line: pict demo.txt can determine the test factor combination that is used to generate test case.
Adopt above-mentioned method of testing, though improved testing efficiency and testing progress to a certain extent, but it has brought following technological deficiency: when choosing the test factor combination that is used to generate test case, only determine typical combination according to the priority of test factor, the foundation of determining typical combination is more single, on the one hand, make the test scene that test case comprised that generates might not can react the demand of actual test very accurately, thereby may cause test case can not cover the current test scene that needs most test, cause comparatively serious fault to be revealed then; On the other hand, the test case that generates can not well be adapted to the environment of actual needs test, as test period and actual duty cycle be not inconsistent, the covering scale of test scene do not meet actual covering scale, also or test case be not suitable for current test phase.
To sum up, adopt the existing method that generates test case, the problem that exists test scene that test case comprises and actual environment not to conform to, thus cause coverage rate to the core test scene low and to problems such as fault leakage control efficiency differences
Summary of the invention
The invention provides a kind of generation method and device of test case,, fault is revealed the efficient of controlling thereby improve to improve coverage rate to the core test scene.
A kind of generation method of test case comprises:
The test factor that category of test comprised is made up, generate a plurality of test factor combinations;
At each test factor combination, determine the priority that this test factor makes up according to the attribute of each test factor in this test factor combination, and this test factor combination is referred in the set of respective priority according to the priority of this test factor combination;
According to when the residing test phase of Pretesting, test covering scale or duty cycle, from set, choose the test factor combination of respective numbers;
Generate test case according to the test factor combination of choosing.
A kind of generating apparatus of test case comprises:
Test factor combination generation unit, the test factor that is used for category of test is comprised makes up, and generates a plurality of test factor combinations;
Distribution unit, be connected with described test factor combination generation unit, be used for each test factor that described test factor combination generation unit generates is made up, attribute according to each test factor in this test factor combination is determined the priority that this test factor makes up, and according to the priority of this test factor combination this test factor combination is referred in the set of respective priority;
Choose the unit, be connected, be used for from the higher set of priority, choosing the test factor combination of respective numbers according to when the residing test phase of Pretesting, test covering scale or duty cycle with described distribution unit;
The test case generation unit is connected with the described unit of choosing, and is used for generating test case according to the described test factor combination of choosing unit selection.
Adopt technical solution of the present invention, on the one hand, at each test factor combination, determine the priority of this test factor combination according to the attribute of each test factor in this test factor combination, and the combination of this test factor is referred in the set of respective priority, and when choosing the test factor combination that is used to generate test case, choose the higher test factor combination of priority, thereby the more realistic test environment of test scene that the feasible test case that generates comprises, cover the test scene (being the core test scene) of current actual needs test with higher probability, thereby improved coverage rate to the core test scene, thereby reduced the probability that fault is revealed, improved the control efficiency that fault is revealed; On the other hand, according to when the residing test phase of Pretesting, test covering scale or duty cycle, choose the test factor combination of respective numbers, thereby further make test case meet the test environment of current reality.
Description of drawings
Fig. 1 is the method flow diagram that generates test case in the embodiment of the invention;
The fault leakage rate that Fig. 2 A provides for the embodiment of the invention and the graph of a relation of distribution and density;
The duty cycle that Fig. 2 B provides for the embodiment of the invention and the graph of a relation of distribution and density;
The graph of a relation of the duty cycle that Fig. 2 C provides for the embodiment of the invention, distribution and density and fault leakage rate;
Fig. 3 is the concentric circles model synoptic diagram of test case in the embodiment of the invention;
Fig. 4 is with the synoptic diagram of test factor combination distribution in the concentric circles model in the embodiment of the invention;
Fig. 5 is the structural representation of test case generating apparatus in the embodiment of the invention.
Embodiment
At the above-mentioned technical matters that prior art exists, the embodiment of the invention provides the generation method of test case, to improve the coverage rate of core test scene, improves the control efficiency that fault is revealed.This method comprises: the test factor that category of test comprised is made up, generate a plurality of test factor combinations; At each test factor combination, determine the priority that this test factor makes up according to the attribute of each test factor in this test factor combination, and this test factor combination is referred in the set of respective priority according to the priority of this test factor combination; According to when the residing test phase of Pretesting, test covering scale or duty cycle, from the higher set of priority, choose the test factor combination of respective numbers; Generate test case according to the test factor combination of choosing.Adopt technical solution of the present invention, on the one hand, at each test factor combination, determine the priority of this test factor combination according to the attribute of each test factor in this test factor combination, and the combination of this test factor is referred in the set of respective priority, and when choosing the test factor combination that is used to generate test case, choose the higher test factor combination of priority, thereby the more realistic test environment of test scene that the feasible test case that generates comprises, cover the test scene (being the core test scene) of current actual needs test with higher probability, thereby improved coverage rate to the core test scene, thereby reduced the probability that fault is revealed, improved the control efficiency that fault is revealed; On the other hand, according to when the residing test phase of Pretesting, test covering scale or duty cycle, choose the test factor combination of respective numbers, thereby further make test case meet the test environment of current reality.
Below in conjunction with Figure of description technical solution of the present invention is described in detail.
Referring to Fig. 1, for generating the method flow diagram of test case in the embodiment of the invention, this method comprises:
Step 101, the test factor that category of test comprised is made up, generate a plurality of test factor combinations.
Step 102, at the combination of each test factor, attribute according to each test factor in this test factor combination is determined the priority that this test factor makes up, and according to the priority of this test factor combination this test factor combination is referred in the set of respective priority.
Step 103, basis are chosen the test factor combination of respective numbers when the residing test phase of Pretesting, test covering scale or duty cycle from the higher set of priority.
The test factor combination that step 104, basis are chosen generates test case.
Preferably, in the above-mentioned steps 101, can obtain the test factor combination, obtain the complete or collected works of test scene by the test factor that category of test comprised being carried out the cartesian product computing.Comprise as category of test: message classification, port classification and traffic classes, the test factor quantity that message classification, port classification and traffic classes are comprised is respectively M, N, K, the test factor of these three category of tests is carried out quadrature calculating can obtain M * N * K test factor combination, this M * N * K test factor constitutes the complete or collected works of test scene.As, suppose that category of test is port classification and traffic classes, category of test is defined as set a: F={f1, f2 ..., fn}, wherein fi represents i test factor in the category of test, then above-mentioned port classification and traffic classes can be defined as following set respectively:
Port classification F1={ gigabit ether port, 10,000,000,000 ether ports }
Traffic classes F2={ multicast stream, broadcast, positive flow, reverse direction flow }
The test factor of above-mentioned port classification and traffic classes is carried out Descartes's computing to be obtained:
Port type F1 * discharge pattern F2={ (gigabit ether port, multicast stream), (gigabit ether port, broadcast), (gigabit ether port, positive flow), (gigabit ether port, reverse direction flow), (10,000,000,000 ether ports, multicast stream), (10,000,000,000 ether ports, broadcast), (10,000,000,000 ether ports, positive flow), (10,000,000,000 ether ports, reverse direction flow) }.
Preferably, the attribute of test factor can comprise following one or more: the number of stoppages that priority, test factor write down in test history, the priority of affiliated category of test, level attribute, whether be test factor that increases newly etc.In the above-mentioned steps 102, determine the priority of this test factor combination according to the attribute of each test factor in this test factor combination, comprise:, determine the priority of this test factor combination in test history according to the priority of each test factor in the test factor combination, the number of stoppages that test factor writes down, the priority of affiliated category of test, level attribute.As, the number of stoppages that test factor writes down in test history is many more, shows that then the probability that this test factor breaks down is bigger, and then the significance level that this test factor is tested is bigger; The priority of category of test is high more under the test factor, it is more serious to show that then the failure ratio brought is not passed through in the test of this test factor, then the significance level that this test factor is tested is bigger etc., can be set to the test factor combination of high priority with being included in the test factor combination of the higher or test factor that rank is bigger of more, the affiliated category of test priority of record trouble number of times in the test record; Test factor is what increase newly, and then the significance level that this test factor is tested is bigger.
Preferably, in the above-mentioned steps 103, from set, choose the test factor combination of some, comprising:, determine the quantity of the test factor combination that needs test according to test phase, test covering scale or duty cycle; According to the priority order from high to low of set, from set, choose the test factor combination of described quantity successively.As, test phase is the system testing stage first round, then can as much as possiblely choose the test factor combination and test; When test phase is second system wheel test phase, but the higher test factor combination of selected part priority is tested; When test phase is regression test, can chooses previous stage and not test by the test factor combination of test.As test the covering scale when being all standing, can test all test factor combinations; When if test covering scale covers for part, can the higher test factor combination of selected part priority test.Also as, if when the current task cycle is nervous, but the higher test factor combination of selected part priority is tested; If the current task period ratio is sufficient, can as much as possiblely chooses the test factor combination and test.
Preferably, the embodiment of the invention at each set, can be provided with the distribution density of this set, and the value of distribution density is that the test factor number of combinations that is distributed in this set accounts for the ratio that test factor makes up total amount.When choosing the test factor combination that is used to generate test case, can determine to distribute and density according to the covering scale of current actual demand, the test factor of choosing some according to this distribution and density from corresponding set makes up again; The big more then corresponding covering scale of distribution and density is big more, otherwise the more little then corresponding covering scale of distribution and density is more little, and promptly distribution and density are reacted the covering scale.
In the step 103 in the embodiment of the invention, comprise: according to current test phase, covering scale or duty cycle, choose corresponding distribution and density D D (S), and from corresponding set, choose the test factor combination that is used to generate test case according to DD (S); The relation that distribution and density and fault are revealed is shown in Fig. 2 A, the corresponding relation of distribution and density and duty cycle is shown in Fig. 2 B, Fig. 2 A is combined the distribution that obtains and the relation between density, fault leakage rate and the duty cycle shown in Fig. 2 C with Fig. 2 B, when actual measurement, can choose corresponding distribution and density according to fault leakage rate and duty cycle; The embodiment of the invention can be chosen one in conjunction with duty cycle and comparatively reasonably distribute and density according to actual test environment when taking into account the fault leakage rate.As, the set of supposing to be provided with is followed successively by core set C1, expanded set C2 and peripheral set C3 according to priority order from high to low, wherein, the distribution density of core set C1 is 20%, and the distribution density of expanded set C2 is 30%, and the distribution density of peripheral set C3 is 50%.If DD (the S)=DD (C1) that chooses, then all the test factor combinations among the set C1 are chosen in expression; If DD (S)=DD (the C1)+DD (C2) that chooses, then all the test factor combinations among set C1 and the set C2 are chosen in expression; If DD (S)=DD (C1) * P (C1)+DD (C2) * P (C2)+DD (C3) * P (C3) of choosing, then represent from set C1, to choose the test factor combination of P (C1) ratio, from set C2, choose the test factor combination of P (C2) ratio and from set C3, choose the test factor combination of P (C3) ratio.
Illustrate, distribute and density as choosing: if current test phase is first round system testing according to test phase, then can choose distribution and density is DD (S)=(20%+50%+30%)=1, promptly choose all the test factor combinations in all set, so that test scene is comprehensively tested; If current test phase is the test of second wheel system, then can from the part set, choose all or part of test factor combination and test, distribute and density D D (S)=20% as choosing, promptly choose all the test factor combinations among the core set C1; If current test phase is regression test, the all or part of test factor combination of sets that then can choose in the highest set of priority is tested, distribute and density D D (S)=20% * 1+30 * (2/3)+50% * 0 as choosing, the test factor of promptly choosing 2/3 among all test factor combinations among the core set C1, the expanded set C2 makes up.Choose distribution and density according to current covering scale: if current covering scale is all standing, distribution of then choosing and density are 1, and whole test factor combinations of promptly choosing in all set are tested; If the covering scale is for covering the core test scene, distribution of then choosing and density are the distribution density of the highest set of priority, promptly choose whole test factor combinations of the highest set of priority and test.Choose distribution and density according to duty cycle: the duty cycle anxiety, then from the part set, choose all or part of test factor combination and test; If the duty cycle abundance then can be chosen all or part of test factor combination and test from all set.The mode of choosing is varied, is not limited in the above-mentioned example of enumerating, and can also choose accordingly according to actual needs.
Preferably, for adapting to actual applied environment, make up with the test factor of upgrading timely in the set, thereby make the test factor in the set make up realistic test environment, above-mentioned flow process also comprises:
Step 105, the test factor in described test case combination is tested, and adjusted the value of described respective numbers according to test result; Or/and, according to the test factor combination that is comprised in each set of test result adjustment.
In the above-mentioned steps 105, adjust the value of respective numbers, can comprise: determine the percent of pass of testing, if described percent of pass during more than or equal to the percent of pass threshold value that is provided with, then can reduce the value of described respective numbers to test factor combination in the test case; If described percent of pass during less than the percent of pass threshold value that is provided with, then can improve the value of described respective numbers.
In the above-mentioned steps 105, according to the test factor combination that is comprised in each set of test result adjustment, can comprise:,, then it is adjusted to priority and be higher than in the set of gathering at this test factor combination place if the test factor combined test does not pass through at each the test factor combination in the test case; If the test factor combined test passes through, then it is adjusted to priority and be lower than in the set of gathering at this test factor combination place.
In the above-mentioned steps 105, test factor combination in the quantity of the test factor combination that adjustment is chosen according to test result and each set of adjustment, comprise: (1) is according to the quantity of the test factor combination of choosing, determine the scale of the use-case example of implementation of test cases, and the testability of carrying out according to the scale analysis test paper of use-case example, determine that then the use-case example expands if testability is low, the quantity of the test factor combination of promptly choosing is bigger than normal, and the test factor number of combinations of then needs being chosen reduces; (2) determine the test percent of pass of each set, the test factor combination that test is passed through in the set that priority is higher is adjusted in the lower set of priority, the unsanctioned test factor combination of test is adjusted in the higher set of priority in the set that priority is lower, as, the test factor combination that test among the collection core set C1 is passed through is adjusted among expanded set C2 or the peripheral set C3, the test factor combination that test among the expanded set C2 is passed through is adjusted among the peripheral set C3, with expanded set C2 or/and among the peripheral set C3 the test factor combination by test do not adjust among the core set C1, perhaps the periphery is gathered among the C3 test factor combination and does not adjust among the expanded set C2 by test.
Preferably, reveal for reducing fault, the distribution and the density of test factor combination is chosen in adjustment according to test result.As determining percent of pass according to test result when the percent of pass threshold value is set, then improve and distribute and density; Otherwise, distribute and density if percent of pass during less than the percent of pass threshold value that is provided with, then reduces.
With a specific embodiment technical solution of the present invention is carried out more in detail, clearly described below.
Among this embodiment, the both sides AC access interface of supposing the entry PE of test case TC_0010_VPN and outlet PE is a trunk pattern but the vlan configuration is asymmetric, category of test comprises message classification, port classification and traffic classes, the priority of these three category of tests is set to 2,4,5 respectively, and these three test factor that category of test comprised are respectively shown in table 1, table 2 and table 3.The set of embodiment of the invention setting has three, is respectively core set C1, expanded set C2 and peripheral set C3, and wherein the priority of core set is the highest, and expanded set is taken second place, and peripheral set is minimum.
Test factor and priority thereof that table 1 is comprised for the message classification
Title Priority
Message utag is identical with trunk vlan 3
Message utag and trunk vlan are inequality 5
Test factor and priority thereof that table 2 is comprised for the port classification
Title Priority
Gigabit ether port 3
10,000,000,000 ether ports 5
The LAG port 5
The MC-LAG port 3
Test factor and priority thereof that table 3 traffic classes is comprised
Title Priority
Multicast stream 2
Broadcast 2
Positive flow 4
Reverse direction flow 4
The test factor that above-mentioned message classification, port classification and traffic classes are comprised is carried out the cartesian product computing, can obtain 32 test factor combinations, these 32 test factor constitute the test scene complete or collected works, and are as shown in table 4.
Table 4 carries out the test factor combination that the cartesian product computing obtains for the test factor that category of test is comprised
Sequence number The test factor combination
1 Message utag is identical with trunk vlan, gigabit ether port, multicast stream
2 Message utag is identical with trunk vlan, gigabit ether port, broadcast
3 Message utag is identical with trunk vlan, gigabit ether port, positive flow
4 Message utag is identical with trunk vlan, gigabit ether port, reverse direction flow
5 Message utag and trunk vlan are inequality, gigabit ether port, multicast stream
6 Message utag and trunk vlan are inequality, gigabit ether port, broadcast
7 Message utag and trunk vlan are inequality, gigabit ether port, positive flow
8 Message utag and trunk vlan are inequality, gigabit ether port, reverse direction flow
9 Message utag is identical with trunk vlan, 10,000,000,000 ether ports, multicast stream
10 Message utag is identical with trunk vlan, 10,000,000,000 ether ports, broadcast
11 Message utag is identical with trunk vlan, 10,000,000,000 ether ports, positive flow
12 Message utag is identical with trunk vlan, 10,000,000,000 ether ports, reverse direction flow
13 Message utag and trunk vlan are inequality, 10,000,000,000 ether ports, multicast stream
14 Message utag and trunk vlan are inequality, 10,000,000,000 ether ports, broadcast
15 Message utag and trunk vlan are inequality, 10,000,000,000 ether ports, positive flow
16 Message utag and trunk vlan are inequality, 10,000,000,000 ether ports, reverse direction flow
17 Message utag is identical with trunk vlan, LAG port, multicast stream
18 Message utag is identical with trunk vlan, LAG port, broadcast
19 Message utag is identical with trunk vlan, LAG port, positive flow
20 Message utag is identical with trunk vlan, LAG port, reverse direction flow
21 Message utag and trunk vlan are inequality, LAG port, multicast stream
22 Message utag and trunk vlan are inequality, LAG port, broadcast
23 Message utag and trunk vlan are inequality, LAG port, positive flow
24 Message utag and trunk vlan are inequality, LAG port, reverse direction flow
25 Message utag is identical with trunk vlan, MC-LAG port, multicast stream
26 Message utag is identical with trunk vlan, MC-LAG port, broadcast
27 Message utag is identical with trunk vlan, MC-LAG port, positive flow
28 Message utag is identical with trunk vlan, MC-LAG port, reverse direction flow
29 Message utag and trunk vlan are inequality, MC-LAG port, multicast stream
30 Message utag and trunk vlan are inequality, MC-LAG port, broadcast
31 Message utag and trunk vlan are inequality, MC-LAG port, positive flow
32 Message utag and trunk vlan are inequality, MC-LAG port, reverse direction flow
According to the priority of each test factor priority, the number of stoppages that test factor writes down in test history, affiliated category of test in the test factor combination, level attribute (but comprise must survey rank, can select to survey rank accident rank), whether comprise new factors such as test factor, above-mentioned test factor combination is referred to respectively in the corresponding set.Preferably, the test factor combination that will include the test factor with following one or more attributes is referred to core set or/and in the expanded set: the number of stoppages is more, and rank is higher, and priority is higher, and test factor is new the interpolation.
Consider based on above-mentioned factor, the severity level of the test factor in the message classification [message utag is different with trunk vlan] is than test factor [message utag is identical with trunk vlan] height, therefore, can consider that the test factor combination that will comprise test factor [message utag is different with trunk vlan] is referred in the core set; The test factor in the port classification [10,000,000,000 ether port] and the priority of [LAG port] all are higher than [gigabit ether port], can consider to comprise test factor [10,000,000,000 ether port] or/and the test factor combination of [LAG port] is referred in the core set; The priority of the test factor in the traffic classes [positive flow] and [reverse direction flow] is higher, and the priority of test factor [broadcast] and [multicast stream] is lower, can will comprise test factor [positive flow] or/and the test factor combination of [reverse direction flow] is referred in the core set.
To sum up, be referred in the different set test factor combination as shown in table 5.
The combination of table 5 test factor is referred in the corresponding set
Figure BDA0000030553360000131
According to key elements such as current test phase, covering scale or duty cycles, choose distribution and density D D (S)=DD (C1)=25%, all test factor combinations (being that sequence number is 1,6,9,15,16,23,24,26 test factor combination) of promptly choosing among the core set C1 are tested; At this moment, the test event that test case comprised of generation comprises the test factor combination of above-mentioned sequence number.The both sides AC access interface of this test case TC_0010_VPN entry PE and outlet PE is that trunk pattern but vlan are when disposing asymmetric situation, can go up example according to core set C1 and dissolve 8 use-case examples, expression is which test scene in the test case when Pretesting:
TC_0010_VPN entry PE and outlet PE ... @1 represent current sequence number among the test case TC_0010_VPN is being tested for the test scene that the combination of 1 test factor provides;
TC_0010_VPN entry PE and outlet PE ... @6 represent current sequence number among the test case TC_0010_VPN is being tested for the test scene that the combination of 6 test factor provides;
TC_0010_VPN entry PE and outlet PE ... @9 represent current sequence number among the test case TC_0010_VPN is being tested for the test scene that the combination of 9 test factor provides;
TC_0010_VPN entry PE and outlet PE ... @15 represent current sequence number among the test case TC_0010_VPN is being tested for the test scene that the combination of 15 test factor provides;
TC_0010_VPN entry PE and outlet PE ... @16 represent current sequence number among the test case TC_0010_VPN is being tested for the test scene that the combination of 16 test factor provides;
TC_0010_VPN entry PE and outlet PE ... @23 represent current sequence number among the test case TC_0010_VPN is being tested for the test scene that the combination of 23 test factor provides;
TC_0010_VPN entry PE and outlet PE ... @24 represent current sequence number among the test case TC_0010_VPN is being tested for the test scene that the combination of 24 test factor provides;
TC_0010_VPN entry PE and outlet PE ... @26 represent current sequence number among the test case TC_0010_VPN is being tested for the test scene that the combination of 26 test factor provides.
Preferably, can know the distributed intelligence of test factor combination fast for making the test case operational staff, the test factor combination distribution is in the set of respective priority, adopt the concentric circles distributed model, this concentric circles distributed model comprises a plurality of donuts, annulus is corresponding one by one with priority set from high to low successively according to size order from small to large, and is provided with the sequence number of the test factor combination that is comprised in the set of its correspondence in each annulus.
As shown in Figure 3, the concentric circles distributed model that provides for the embodiment of the invention, defined a kind of be the center of circle with the test case, be combined as the model of circle distribution with test factor, the concentric circles distributed model is provided with a plurality of distribution circles that priority, severity level reduce successively from the center of circle along radial direction, and these a plurality of distribution circles are corresponding with core set C1, expanded set C2 and peripheral set C3 successively; And its test factor that comprises combination sequence number is set in core set C1, expanded set C2 and peripheral set C3, then can obtain concentric circles distributed model as shown in Figure 4.The quantizating index that this concentric circles distributed model comprises can comprise distribution density DD (Ci) (distribution density of i the circle that distributes that expression begins from the center of circle), distribution and the density D D (S) of the circle that distributes, wherein:
The distribution density sum of all distribution circles of concentric circles distributed model is 1, as the total amount of the test factor that obtains combination is 100, the test factor number of combinations that is distributed among the core set C1 is 20, the test factor number of combinations that is distributed among the expansion circle C2 is 30, the test factor number of combinations that is distributed in peripheral set C3 is 50, the distribution density that then can obtain core set C1, expanded set C2 and peripheral set C3 is respectively DD (C1)=20/100=20%, DD (C2)=30/100=30%, DD (C3)=50/100=50%.
In addition, distribute and the account form of density D D (S) can be as the formula (1):
DD (S)=∑ (DD (Ci) * Ci) formula (1)
In the formula (1), DD (S) distributes and density, and DD (Ci) is the distribution density of i the circle that distributes, and Ci is that i distribution enclosed and ratio.
Based on the same idea of said method flow process, the embodiment of the invention also provides a kind of device that generates test case, and the structure of this device as shown in Figure 5.
Referring to Fig. 5, for generating the structural representation of the device of test case in the embodiment of the invention, this device comprises:
Test factor combination generation unit 51, the test factor that is used for category of test is comprised makes up, and generates a plurality of test factor combinations;
Distribution unit 52, be connected with test factor combination generation unit 51, each the test factor combination that is used for test factor combination generation unit 51 is generated, attribute according to each test factor in this test factor combination is determined the priority that this test factor makes up, and according to the priority of this test factor combination this test factor combination is referred in the set of respective priority;
Choose unit 53, be connected, be used for from set, choosing the test factor combination of respective numbers according to when the residing test phase of Pretesting, test covering scale or duty cycle with distribution unit 52;
Test case generation unit 54 and is chosen unit 53 and is connected, and is used for choosing the test factor combination of choosing unit 53 and generating test case according to described.
Described test factor combination generation unit 51 specifically is used for: the test factor that described category of test comprised is carried out the cartesian product computing, obtain the test factor combination.
Preferably, whether the priority that distribution unit 52 is determined test factor combination specifically is used for, and determines the priority of test factor combination according to following one or more attributes of each test factor in the test factor combination: the number of stoppages that test factor priority, test factor write down in test history, the priority of affiliated category of test, level attribute and be the test factor that increases newly.
Preferably, choose unit 53, specifically be used for:, determine the quantity of the test factor combination that needs test according to test phase, test covering scale or duty cycle; According to the priority order from high to low of set, from set, choose the test factor combination of described quantity successively.
Preferably, said apparatus also comprises:
Adjustment unit 55 is connected with test factor combination generation unit 51 with test case generation unit 54 respectively, is used for the test factor combination of described test case is tested, and adjusts the value of described respective numbers according to test result; Or/and, according to the test factor combination that is comprised in each set of test result adjustment.
Preferably, adjustment unit 55 is adjusted the value of respective numbers, specifically be used for: determine the percent of pass of testing, if described percent of pass during more than or equal to the percent of pass threshold value that is provided with, then reduces the value of described respective numbers to test case test factor combination; If described percent of pass during less than the percent of pass threshold value that is provided with, then improves the value of described respective numbers;
Or/and, adjustment unit 55 is adjusted the test factor combination that is comprised in each set, specifically be used for:,, then it is adjusted to priority and be higher than in the set of gathering at this test factor combination place if the test factor combined test does not pass through at each test factor combination of test case; If the test factor combined test passes through, then it is adjusted to priority and be lower than in the set of gathering at this test factor combination place.
Adopt technical solution of the present invention, on the one hand, at each test factor combination, determine the priority of this test factor combination according to the attribute of each test factor in this test factor combination, and the combination of this test factor is referred in the set of respective priority, and when choosing the test factor combination that is used to generate test case, choose the higher test factor combination of priority, thereby the more realistic test environment of test scene that the feasible test case that generates comprises, test scene from the current actual needs test of the covering of high probability, improved the coverage rate of core test scene, thereby reduced the probability that fault is revealed, improved the control efficiency that fault is revealed; On the other hand, according to when the residing test phase of Pretesting, test covering scale or duty cycle, choose the test factor combination of respective numbers, thereby further make test case meet the test environment of current reality; Again on the one hand, after the every test factor combination in the test case that generates is tested, adjustment is used to generate the quantity of the needed test factor combination of test case according to test result, or/and, respectively gather included test factor combination according to the test result adjustment, thereby further improved the realistic test environment of test factor combination in the set, thereby further improved coverage rate the core test scene.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (13)

1. the generation method of a test case is characterized in that, comprising:
The test factor that category of test comprised is made up, generate a plurality of test factor combinations;
At each test factor combination, determine the priority that this test factor makes up according to the attribute of each test factor in this test factor combination, and this test factor combination is referred in the set of respective priority according to the priority of this test factor combination;
According to when the residing test phase of Pretesting, test covering scale or duty cycle, from the higher set of priority, choose the test factor combination of respective numbers;
Generate test case according to the test factor combination of choosing.
2. the method for claim 1 is characterized in that, the test factor that category of test comprised in the test case is made up, and comprising:
The test factor that described category of test comprised is carried out the cartesian product computing, obtain the test factor combination.
3. the method for claim 1, it is characterized in that, the attribute of test factor comprise following one or more: the number of stoppages that the priority of test factor, test factor write down in test history, the priority of affiliated category of test, level attribute and whether be the test factor that increases newly.
4. as each described method of claim 1~3, it is characterized in that, from set, choose the test factor combination of some, comprising:
According to test phase, test covering scale or duty cycle, determine the quantity of the test factor combination that needs test;
According to the priority order from high to low of set, from set, choose the test factor combination of respective numbers successively.
5. as each described method of claim 1~3, it is characterized in that, also comprise:
Combination is tested to the test factor in the described test case, and adjusts the value of described respective numbers according to test result; Or/and, according to the test factor combination that is comprised in each set of test result adjustment.
6. method as claimed in claim 5 is characterized in that, adjusts the value of respective numbers, comprising:
Determine the percent of pass that test factor combination in the test case is tested, if described percent of pass during more than or equal to the percent of pass threshold value that is provided with, then reduces the value of described respective numbers; If described percent of pass during less than the percent of pass threshold value that is provided with, then improves the value of described respective numbers;
Or/and,
According to the test factor combination that is comprised in each set of test result adjustment, comprise: at each the test factor combination in the test case, if the test factor combined test does not pass through, then it is adjusted to priority and be higher than in the set of gathering at this test factor combination place; If the test factor combined test passes through, then it is adjusted to priority and be lower than in the set of gathering at this test factor combination place.
7. the method for claim 1, it is characterized in that, the test factor combination distribution is in the set of respective priority, adopt the concentric circles distributed model, this concentric circles distributed model comprises a plurality of donuts, annulus is corresponding one by one with priority set from high to low successively according to size order from small to large, and is provided with the sequence number of the test factor combination that is comprised in the set of its correspondence in each annulus.
8. the generating apparatus of a test case is characterized in that, comprising:
Test factor combination generation unit, the test factor that is used for category of test is comprised makes up, and generates a plurality of test factor combinations;
Distribution unit, be connected with described test factor combination generation unit, be used for each test factor that described test factor combination generation unit generates is made up, attribute according to each test factor in this test factor combination is determined the priority that this test factor makes up, and according to the priority of this test factor combination this test factor combination is referred in the set of respective priority;
Choose the unit, be connected, be used for from the higher set of priority, choosing the test factor combination of respective numbers according to when the residing test phase of Pretesting, test covering scale or duty cycle with described distribution unit;
The test case generation unit is connected with the described unit of choosing, and is used for generating test case according to the described test factor combination of choosing unit selection.
9. device as claimed in claim 8 is characterized in that, described test factor combination generation unit specifically is used for: the test factor that described category of test comprised is carried out the cartesian product computing, obtain the test factor combination.
10. device as claimed in claim 8, it is characterized in that, whether described distribution unit is determined the priority of test factor combination, specifically is used for: the priority of determining the test factor combination according to following one or more attributes of each test factor of test factor combination: the number of stoppages that test factor priority, test factor write down in test history, the priority of affiliated category of test, level attribute and be the test factor that increases newly.
11., it is characterized in that the described unit of choosing specifically is used for as each described device of claim 8~10:, determine the quantity of the test factor combination that needs test according to test phase, test covering scale or duty cycle;
According to the priority order from high to low of set, from set, choose the test factor combination of described quantity successively.
12. as each described device of claim 8~10, it is characterized in that, also comprise:
Adjustment unit is connected with test factor combination generation unit with described test case generation unit respectively, is used for the test factor combination of described test case is tested, and adjusts the value of described respective numbers according to test result; Or/and, according to the test factor combination that is comprised in each set of test result adjustment.
13. device as claimed in claim 12, it is characterized in that, described adjustment unit is adjusted the value of respective numbers, specifically be used for: determine the percent of pass of testing the combination of test case test factor, if described percent of pass during more than or equal to the percent of pass threshold value that is provided with, then reduces the value of described respective numbers; If described percent of pass is during less than the percent of pass threshold value that is provided with, the value of high described respective numbers then;
Or/and, the test factor combination that is comprised in each set of described adjustment unit adjustment, specifically be used for:,, then it is adjusted to priority and be higher than in the set of gathering at this test factor combination place if the test factor combined test does not pass through at each test factor combination of test case; If the test factor combined test passes through, then it is adjusted to priority and be lower than in the set of gathering at this test factor combination place.
CN201010530238.7A 2010-11-02 2010-11-02 Method and device for generating test case Active CN101984416B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010530238.7A CN101984416B (en) 2010-11-02 2010-11-02 Method and device for generating test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010530238.7A CN101984416B (en) 2010-11-02 2010-11-02 Method and device for generating test case

Publications (2)

Publication Number Publication Date
CN101984416A true CN101984416A (en) 2011-03-09
CN101984416B CN101984416B (en) 2014-12-10

Family

ID=43641585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010530238.7A Active CN101984416B (en) 2010-11-02 2010-11-02 Method and device for generating test case

Country Status (1)

Country Link
CN (1) CN101984416B (en)

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004691A (en) * 2010-11-12 2011-04-06 中兴通讯股份有限公司 Method and system for executing test case
CN102541735A (en) * 2011-12-28 2012-07-04 云海创想信息技术(天津)有限公司 Automatic software test method
CN102831061A (en) * 2012-08-28 2012-12-19 盛科网络(苏州)有限公司 System testing method based on scattered points
CN103064785A (en) * 2012-12-04 2013-04-24 北京奇虎科技有限公司 Method and device for detection of terminal performance
CN103136098A (en) * 2011-11-30 2013-06-05 西门子公司 Method, device and system for fuzzing test
CN103853652A (en) * 2012-11-29 2014-06-11 百度在线网络技术(北京)有限公司 Test case generation method and device
CN104199779A (en) * 2014-09-24 2014-12-10 福建联迪商用设备有限公司 Combined testing method and system for embedded modules
CN104407970A (en) * 2014-11-06 2015-03-11 国云科技股份有限公司 Novel software test use case designing and compiling method
CN104850494A (en) * 2015-04-29 2015-08-19 百度在线网络技术(北京)有限公司 Method and device for testing storage system
CN105988930A (en) * 2015-03-02 2016-10-05 阿里巴巴集团控股有限公司 Test case generation method and device
CN106845781A (en) * 2016-12-22 2017-06-13 中信银行股份有限公司 The generation system and method for scene and flow for operational trials
CN107305527A (en) * 2016-04-22 2017-10-31 腾讯科技(深圳)有限公司 The treating method and apparatus of code file
CN108345979A (en) * 2017-01-23 2018-07-31 阿里巴巴集团控股有限公司 A kind of service test method and device
CN109324960A (en) * 2018-08-13 2019-02-12 中国平安人寿保险股份有限公司 Automatic test approach and terminal device based on big data analysis
WO2019051714A1 (en) * 2017-09-14 2019-03-21 深圳传音通讯有限公司 Test method and test apparatus for application memory of smart device
CN109656802A (en) * 2017-10-10 2019-04-19 大连飞创信息技术有限公司 Test case design system based on high coupling automatic matching technology
CN109684209A (en) * 2018-12-17 2019-04-26 北京奇虎科技有限公司 A kind of method for generating test case, device and electronic equipment
CN109726124A (en) * 2018-12-20 2019-05-07 北京爱奇艺科技有限公司 Test macro, test method, managing device, test device and calculating equipment
CN109728975A (en) * 2018-12-29 2019-05-07 广东电网有限责任公司 A kind of network protocol attack testing method, device, equipment and readable storage medium storing program for executing
CN109992498A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 Generation method and system, the computer system of test case
CN110928758A (en) * 2018-09-19 2020-03-27 北京京东尚科信息技术有限公司 Method and device for generating test case
CN112445708A (en) * 2020-11-30 2021-03-05 统信软件技术有限公司 Pressure testing method and device and computing equipment
CN113032241A (en) * 2019-12-09 2021-06-25 腾讯科技(深圳)有限公司 Test data processing method and device and storage medium
CN114185768A (en) * 2021-11-17 2022-03-15 北京达佳互联信息技术有限公司 Test case generation method and device, electronic equipment and storage medium
CN116204446A (en) * 2023-05-06 2023-06-02 云账户技术(天津)有限公司 Automatic test flow management method and device based on JIRA platform

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5159600A (en) * 1990-01-02 1992-10-27 At&T Bell Laboratories Arrangement for generating an optimal set of verification test cases
CN101082876A (en) * 2006-05-30 2007-12-05 四川华智信息技术有限公司 Software automatically evaluating tool bag
CN101196817A (en) * 2008-01-04 2008-06-11 福建星网锐捷网络有限公司 Test case generating method and system
CN101645012A (en) * 2009-09-11 2010-02-10 兰雨晴 Combinational selection method of foundational software platform integrated test
CN101847120A (en) * 2010-03-31 2010-09-29 中兴通讯股份有限公司 Design method and system of test case

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5159600A (en) * 1990-01-02 1992-10-27 At&T Bell Laboratories Arrangement for generating an optimal set of verification test cases
CN101082876A (en) * 2006-05-30 2007-12-05 四川华智信息技术有限公司 Software automatically evaluating tool bag
CN101196817A (en) * 2008-01-04 2008-06-11 福建星网锐捷网络有限公司 Test case generating method and system
CN101645012A (en) * 2009-09-11 2010-02-10 兰雨晴 Combinational selection method of foundational software platform integrated test
CN101847120A (en) * 2010-03-31 2010-09-29 中兴通讯股份有限公司 Design method and system of test case

Cited By (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004691A (en) * 2010-11-12 2011-04-06 中兴通讯股份有限公司 Method and system for executing test case
CN103136098B (en) * 2011-11-30 2016-03-23 西门子公司 The methods, devices and systems of fuzz testing
CN103136098A (en) * 2011-11-30 2013-06-05 西门子公司 Method, device and system for fuzzing test
CN102541735A (en) * 2011-12-28 2012-07-04 云海创想信息技术(天津)有限公司 Automatic software test method
CN102831061A (en) * 2012-08-28 2012-12-19 盛科网络(苏州)有限公司 System testing method based on scattered points
CN103853652B (en) * 2012-11-29 2019-02-12 百度在线网络技术(北京)有限公司 A kind of test cases generation method and device
CN103853652A (en) * 2012-11-29 2014-06-11 百度在线网络技术(北京)有限公司 Test case generation method and device
CN103064785A (en) * 2012-12-04 2013-04-24 北京奇虎科技有限公司 Method and device for detection of terminal performance
CN103064785B (en) * 2012-12-04 2016-03-30 北京奇虎科技有限公司 A kind of detection method of terminal capabilities and device
CN104199779B (en) * 2014-09-24 2017-08-01 福建联迪商用设备有限公司 A kind of method and system of flush bonding module combined test
CN104199779A (en) * 2014-09-24 2014-12-10 福建联迪商用设备有限公司 Combined testing method and system for embedded modules
CN104407970A (en) * 2014-11-06 2015-03-11 国云科技股份有限公司 Novel software test use case designing and compiling method
CN105988930A (en) * 2015-03-02 2016-10-05 阿里巴巴集团控股有限公司 Test case generation method and device
CN104850494A (en) * 2015-04-29 2015-08-19 百度在线网络技术(北京)有限公司 Method and device for testing storage system
CN104850494B (en) * 2015-04-29 2018-05-25 百度在线网络技术(北京)有限公司 A kind of method and apparatus for memory system testing
CN107305527A (en) * 2016-04-22 2017-10-31 腾讯科技(深圳)有限公司 The treating method and apparatus of code file
CN107305527B (en) * 2016-04-22 2020-05-19 腾讯科技(深圳)有限公司 Code file processing method and device
CN106845781A (en) * 2016-12-22 2017-06-13 中信银行股份有限公司 The generation system and method for scene and flow for operational trials
CN108345979B (en) * 2017-01-23 2021-07-09 阿里巴巴集团控股有限公司 Service testing method and device
CN108345979A (en) * 2017-01-23 2018-07-31 阿里巴巴集团控股有限公司 A kind of service test method and device
WO2019051714A1 (en) * 2017-09-14 2019-03-21 深圳传音通讯有限公司 Test method and test apparatus for application memory of smart device
CN109656802A (en) * 2017-10-10 2019-04-19 大连飞创信息技术有限公司 Test case design system based on high coupling automatic matching technology
CN109656802B (en) * 2017-10-10 2022-05-13 大商所飞泰测试技术有限公司 Test case design system based on high coupling automatic matching technology
CN109992498B (en) * 2017-12-29 2022-12-02 北京京东尚科信息技术有限公司 Test case generation method and system and computer system
CN109992498A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 Generation method and system, the computer system of test case
CN109324960A (en) * 2018-08-13 2019-02-12 中国平安人寿保险股份有限公司 Automatic test approach and terminal device based on big data analysis
CN110928758A (en) * 2018-09-19 2020-03-27 北京京东尚科信息技术有限公司 Method and device for generating test case
CN110928758B (en) * 2018-09-19 2024-04-05 北京京东尚科信息技术有限公司 Method and device for generating test cases
CN109684209A (en) * 2018-12-17 2019-04-26 北京奇虎科技有限公司 A kind of method for generating test case, device and electronic equipment
CN109726124A (en) * 2018-12-20 2019-05-07 北京爱奇艺科技有限公司 Test macro, test method, managing device, test device and calculating equipment
CN109728975B (en) * 2018-12-29 2021-03-12 广东电网有限责任公司 Network protocol attack testing method, device, equipment and readable storage medium
CN109728975A (en) * 2018-12-29 2019-05-07 广东电网有限责任公司 A kind of network protocol attack testing method, device, equipment and readable storage medium storing program for executing
CN113032241A (en) * 2019-12-09 2021-06-25 腾讯科技(深圳)有限公司 Test data processing method and device and storage medium
CN113032241B (en) * 2019-12-09 2024-02-13 腾讯科技(深圳)有限公司 Test data processing method, device and storage medium
CN112445708A (en) * 2020-11-30 2021-03-05 统信软件技术有限公司 Pressure testing method and device and computing equipment
CN114185768A (en) * 2021-11-17 2022-03-15 北京达佳互联信息技术有限公司 Test case generation method and device, electronic equipment and storage medium
CN116204446B (en) * 2023-05-06 2023-08-18 云账户技术(天津)有限公司 Automatic test flow management method and device based on JIRA platform
CN116204446A (en) * 2023-05-06 2023-06-02 云账户技术(天津)有限公司 Automatic test flow management method and device based on JIRA platform

Also Published As

Publication number Publication date
CN101984416B (en) 2014-12-10

Similar Documents

Publication Publication Date Title
CN101984416B (en) Method and device for generating test case
CN102576432B (en) Automated test execution plan generation
CN104185840B (en) It is used for being prioritized the mthods, systems and devices of multiple tests in lasting deployment streamline
CN102214139B (en) Automatic test performance control and debugging method facing distributed system
CN104679488B (en) A kind of flow custom development platform and flow custom development approach
US8065243B2 (en) Optimizing operations of a hydrogen pipeline system
CN112348339A (en) Power distribution network planning method based on big data analysis
CN102521700A (en) Electrical network informatization evaluation rapid test system
CN102053912A (en) Device and method for automatically testing software based on UML (unified modeling language) graphs
CN101350739B (en) Method for locating fault in IP network
CN109240755A (en) A kind of configuration file comparison method and configuration file Compare System
US11704186B2 (en) Analysis of deep-level cause of fault of storage management
CN102693460A (en) Tester management system and method thereof
Crnkovic et al. On the use of component-based principles and practices for architecting cyber-physical systems
CN108694448A (en) PHM platforms
CN107423097A (en) The management method and device of a kind of application program
CN106646315A (en) Automatic testing system and automatic testing method for digital measuring instruments
CN109978495A (en) A kind of nuclear power station debugging test Report workout method and system
CN108681505A (en) A kind of Test Case Prioritization method and apparatus based on decision tree
CN106230638B (en) A kind of cloud service test based on event and adjustment method and system
CN111859139A (en) Application program recommendation method and device, computing equipment and medium
CN114238081A (en) Method and system suitable for small satellite batch test
CN114675956A (en) Method for configuration and scheduling of Pod between clusters based on Kubernetes
CN102495796A (en) Software vulnerability test method based on unit testing
CN107544895A (en) Hadoop big datas platform testing system and method

Legal Events

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