CN103885876B - Method of testing and equipment - Google Patents

Method of testing and equipment Download PDF

Info

Publication number
CN103885876B
CN103885876B CN201210564597.3A CN201210564597A CN103885876B CN 103885876 B CN103885876 B CN 103885876B CN 201210564597 A CN201210564597 A CN 201210564597A CN 103885876 B CN103885876 B CN 103885876B
Authority
CN
China
Prior art keywords
test
test case
program
available
measured
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.)
Active
Application number
CN201210564597.3A
Other languages
Chinese (zh)
Other versions
CN103885876A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201210564597.3A priority Critical patent/CN103885876B/en
Publication of CN103885876A publication Critical patent/CN103885876A/en
Application granted granted Critical
Publication of CN103885876B publication Critical patent/CN103885876B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Tests Of Electronic Circuits (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the present invention provides a kind of method of testing and equipment.The embodiment of the present invention passes through according to the transformation relation pre-set, the test case of generation transformation corresponding with available test case, and then run the program to be measured using the available test case, to generate the first test result, and run the program to be measured using the test case of the transformation, to generate the second test result, make it possible to according to first test result, second test result and the transformation relation, the program to be measured is verified, to determine whether the program to be measured is correct, test process is participated in without operating personnel, it is simple to operate, and accuracy is high, so as to improve the efficiency and reliability of test operation.

Description

Method of testing and equipment
【Technical field】
The present invention relates to measuring technology, more particularly to a kind of method of testing and equipment.
【Background technology】
In software test procedure, many intermediate link is required for operating personnel to be controlled manually.For example, used in test The design phase of example, operating personnel can be according to specific testing requirement, design test case;Or for another example tied in test The expection stage of fruit, operating personnel can utilize the test case of design, run program to be measured, calculate expected test knot Fruit.
However, the complex operation of existing test operation, and easily error, so as to result in the efficiency of test operation and can By the reduction of property.
【The content of the invention】
The many aspects of the present invention provide a kind of method of testing and equipment, to improve the efficiency of test operation and reliable Property.
An aspect of of the present present invention, there is provided a kind of method of testing, including:
Using self-adapting random testing algorithm, at least two test cases are generated;
Using greedy algorithm, at least two test case is scanned for, to select at least two test to use Available test case in example;
According to the transformation relation pre-set, the test case of transformation corresponding with the available test case is generated, The change that the transformation relation is used to indicate test case is with utilizing the test case before the change and after the change Treat the corresponding relation that ranging sequence is tested the change of generated test result;
The program to be measured is run using the available test case, to generate the first test result;
The program to be measured is run using the test case of the transformation, to generate the second test result;
According to first test result, second test result and the transformation relation, the program to be measured is entered Row checking.
Aspect as described above and any possible implementation, it is further provided a kind of implementation, it is described using certainly Random test algorithm is adapted to, generates at least two test cases, including:
Used using self-adapting random testing algorithm, and according to the covering threshold value pre-set, the test of generation at least two Example, at least two test case are more than or equal to the covering threshold value to the coverage condition of the program to be measured.
Aspect as described above and any possible implementation, it is further provided a kind of implementation, it is described using greedy Greedy algorithm, at least two test case is scanned for, including:
It is other in addition to the N-1 available test cases selected before from least two test case successively Test case in, select the available test case of n-th, until the coverage condition of N number of available test case is more than Or equal to the covering threshold value pre-set, the N is the integer more than or equal to 1;Wherein,
The program bag to be measured contains the first program that the N-1 that selects before available test cases have covered and before The second program that N-1 available test cases of selection are not covered with;
The available test case of n-th is more than at least two test case to the coverage condition of the second program The coverage condition of other test cases in addition to the N-1 that selects before available test cases to the second program.
Another aspect of the present invention, there is provided a kind of test equipment, including:
Generation unit, for utilizing self-adapting random testing algorithm, generate at least two test cases;
Search unit, for using greedy algorithm, being scanned at least two test case, with described in selection extremely Available test case in few two test cases;
The generation unit, it is additionally operable to according to the transformation relation pre-set, generation and the available test case pair The test case for the transformation answered, the transformation relation are used to indicate that the change of test case to be before the change and described with utilizing Test case after change treats the corresponding relation that ranging sequence is tested the change of generated test result;
Test cell, for running the program to be measured using the available test case, tied with the test of generation first Fruit;And the program to be measured is run using the test case of the transformation, to generate the second test result;
Authentication unit, for according to first test result, second test result and the transformation relation, to institute Program to be measured is stated to be verified.
Aspect as described above and any possible implementation, it is further provided a kind of implementation, the generation are single Member, it is specifically used for
Used using self-adapting random testing algorithm, and according to the covering threshold value pre-set, the test of generation at least two Example, at least two test case are more than or equal to the covering threshold value to the coverage condition of the program to be measured.
Aspect as described above and any possible implementation, it is further provided a kind of implementation, the search are single Member, it is specifically used for
It is other in addition to the N-1 available test cases selected before from least two test case successively Test case in, select the available test case of n-th, until the coverage condition of N number of available test case is more than Or equal to the covering threshold value pre-set, the N is the integer more than or equal to 1;Wherein,
The program bag to be measured contains the first program that the N-1 that selects before available test cases have covered and before The second program that N-1 available test cases of selection are not covered with;
The available test case of n-th is more than at least two test case to the coverage condition of the second program The coverage condition of other test cases in addition to the N-1 that selects before available test cases to the second program.
As shown from the above technical solution, the embodiment of the present invention is by the way that according to the transformation relation pre-set, generation is with can use Test case corresponding to the test case changed in quality, and then run the program to be measured using the available test case, with The first test result is generated, and the program to be measured is run using the test case of the transformation, is tied with the test of generation second Fruit, enabling according to first test result, second test result and the transformation relation, to the program to be measured Verified, to determine whether the program to be measured is correct, test process is participated in without operating personnel, it is simple to operate, and correctly Rate is high, so as to improve the efficiency and reliability of test operation.
【Brief description of the drawings】
Technical scheme in order to illustrate the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art In the required accompanying drawing used be briefly described, it should be apparent that, drawings in the following description be the present invention some realities Example is applied, for those of ordinary skill in the art, without having to pay creative labor, can also be attached according to these Figure obtains other accompanying drawings.
Fig. 1 is the schematic flow sheet for the method for testing that one embodiment of the invention provides;
Fig. 2 is the structural representation for the test equipment that another embodiment of the present invention provides.
【Embodiment】
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
In addition, the terms "and/or", only a kind of incidence relation for describing affiliated partner, represents there may be Three kinds of relations, for example, A and/or B, can be represented:Individualism A, while A and B be present, these three situations of individualism B.Separately Outside, character "/" herein, it is a kind of relation of "or" to typically represent forward-backward correlation object.
Fig. 1 is the schematic flow sheet for the method for testing that one embodiment of the invention provides, as shown in Figure 1.
101st, tested using self-adapting random(Adaptive Random Testing, ART)Algorithm, generation at least two Test case.
102nd, greediness is utilized(Greedy)Algorithm, at least two test case is scanned for, with selection described in extremely Available test case in few two test cases.
103rd, according to the transformation relation that pre-sets, the test use of generation transformation corresponding with the available test case Example, the change that the transformation relation is used to indicate test case using the test before the change and after the change with being used Example treats the corresponding relation that ranging sequence is tested the change of generated test result.
104th, the program to be measured is run using the available test case, to generate the first test result.
105th, the program to be measured is run using the test case of the transformation, to generate the second test result.
106th, according to first test result, second test result and the transformation relation, ranging is treated to described Sequence is verified.
Wherein, 104 and 105 execution can be without the order of fixation, and the present embodiment is to this without limiting.
So, by according to the transformation relation pre-set, generating the test of transformation corresponding with available test case Use-case, and then the program to be measured is run using the available test case, to generate the first test result, and utilize institute The test case for stating transformation runs the program to be measured, to generate the second test result, enabling according to the described first test As a result, second test result and the transformation relation, are verified to the program to be measured, to determine the program to be measured It is whether correct, test process is participated in without operating personnel, it is simple to operate, and accuracy is high, so as to improve the effect of test operation Rate and reliability.
Alternatively, in a possible implementation of the present embodiment, by performing 101, the generation that can be automated Test case with different.
Specifically, first, according to the input data form and data create-rule pre-entered, random the 1st survey of generation Example T1 on probation, and record the coverage condition that T1 treats ranging sequence.
Then, then at random generate n(N is the integer more than or equal to 2)Individual alternative test case, and, and record them The coverage condition of ranging sequence is treated, and, the distance between each alternative test cases of n and T1 are calculated, chosen distance maximum Alternative test case is as the 2nd test case T2.Wherein, the distance can be understood as alternative test case and test The quantitative criteria of otherness between use-case.
The method for calculating this distance can have many kinds.For example, alternative test case is treated into ranging sequence covering feelings The difference for the coverage condition that condition treats ranging sequence with test case takes absolute value, and is then added again.Assuming that the program bag to be measured Containing 3 rows, the coverage condition that test case T1 treats ranging sequence is 101, and alternative test case t1 treats the covering feelings of ranging sequence Condition is 001, and the coverage condition that alternative test case t2 treats ranging sequence is 011, wherein, 1 represents covering, and 0 represents not cover. So, the distance between t1 and T1 is | 0-1 |+| 0-0 |+| 1-1 | the distance between=1, t2 and T1 be | 0-1 |+| 1-0 |+| 1-1 |=2。
Or for another example alternative test case is treated into the coverage condition of ranging sequence and test case treats ranging sequence The union of coverage condition divided by alternative test case treat the coverage condition of ranging sequence and test case treats covering for ranging sequence The common factor of lid situation.Assuming that the program bag to be measured contains 3 rows, the coverage condition that test case T1 treats ranging sequence is 101 to cover The row of lid 2, the coverage condition that alternative test case t1 treats ranging sequence are that 001 i.e. 1 row of covering, alternative test case t2 is treated The coverage condition of ranging sequence is 011 i.e. 2 rows of covering, wherein, 1 represents covering, and 0 represents not cover.So, between t1 and T1 away from From being 3/1=3 for the distance between 2/1=2, t2 and T1.
Etc., also a lot of other methods can be used for calculating the distance, and the present embodiment is to this without limiting.
Then n, then is at random generated(N is the integer more than or equal to 2)Individual alternative test case, and, and record them The coverage condition of ranging sequence is treated, and, the distance between each alternative test cases of n and T1, T2 are calculated, selects minimum range Maximum alternative test case is as the 3rd test case T3.Wherein, minimum range is between alternative test case and T1 Distance, be less distance in the distance between alternative test case and T2 with, minimum range.
By that analogy, circulation performs aforesaid operations, to generate M(M is the integer more than or equal to 2)Individual test case, directly Be more than or equal to the covering threshold value pre-set to the coverage condition of the program to be measured to the M test case, or M be up to To the quantity threshold pre-set, untill.
Alternatively, in a possible implementation of the present embodiment, in 102, the used greedy algorithm Selection strategy be to select the test case maximum to the coverage condition currently without capped program to be measured successively, as Feasible test case.Specifically, specifically can be individual except the N-1 selected before from least two test case successively Outside available test case in other test cases, the available test case of n-th is selected, until described N number of available The coverage condition of test case is more than or equal to the covering threshold value pre-set, and the N is the integer more than or equal to 1;Wherein,
The program bag to be measured contains the first program that the N-1 that selects before available test cases have covered and before The second program that N-1 available test cases of selection are not covered with;
The available test case of n-th is more than at least two test case to the coverage condition of the second program The coverage condition of other test cases in addition to the N-1 that selects before available test cases to the second program.
Specifically, can be performed repeatedly according to preset strategy, for example, until the covering of N number of available test case Situation is more than or equal to the covering threshold value pre-set and specified herein, for example, 1 time or 2 times.
For example, it is assumed that program to be measured is software under testing system(System Under Test, SUT)Including following 11 row, i.e.,
01:if a>b:
02:if a>b+1:
03:do something
04:else:
05:do something
06:elif a=b:
07:do something
08:else a<b:
09:do something
10:if a==b+2:
11:do something
By performing 101, following test case is generated:
T1:A=3, b=1;
T2:A=3, b=2;
T3:A=3, b=3;
T4:A=4, b=4;
T5:A=3, b=4.
It can see from the test case, T1 covers 1,2,3,10 and 11 rows, and T2 covers 1,4 and 5 rows, T3 coverings 6 and 7 rows, T4 cover 6 and 7 rows, and T5 covers 8 and 9 rows.
First, coverage rate highest T1 is selected, 4,5,6,7,8 and 9 rows is so there remains and is not covered with.Then, then search Rope covers the coverage rate highest of these rows, it is found that T2, T3, T4 and T5 are 2.Certain strategy can be used, for example, order is selected A T2 is selected, 6,7,8 and 9 rows is there remains and is not covered with.T3 is similarly selected, remaining 8 and 9 are not covered with, and select T5, afterwards All rows are capped, then are left T4 and are then eliminated or are placed in lower whorl and are chosen again.
In the present embodiment, by according to the transformation relation pre-set, generating change in quality corresponding with available test case Test case, and then run the program to be measured using the available test case, to generate the first test result, and The program to be measured is run using the test case of the transformation, to generate the second test result, enabling according to described the One test result, second test result and the transformation relation, are verified to the program to be measured, to be treated described in determination Whether ranging sequence is correct, and test process is participated in without operating personnel, simple to operate, and accuracy is high, so as to improve test behaviour The efficiency and reliability of work.
In addition, the technical scheme provided using the present embodiment, due to participating in test process without operating personnel, can also enter One step reduces cost of labor, greatly improves measuring stability, reduces test risk.
In addition, the technical scheme provided using the present embodiment, as a result of transformation relation, is carried out to the program to be measured Checking so that without paying close attention to the inside implementation process of program to be measured, it is only necessary to pay close attention to available test case and the test changed in quality The change of use-case and the change of each self-corresponding test result, if meet the transformation relation, tested so as to save Cost is demonstrate,proved, it is particularly evident particularly with the program effect to be measured of complexity.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because According to the present invention, some steps can use other orders or carry out simultaneously.Secondly, those skilled in the art should also know Know, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention It is necessary.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
Fig. 2 is the structural representation for the test equipment that another embodiment of the present invention provides, as shown in Figure 2.The present embodiment Test equipment can include generation unit 21, search unit 22, test cell 23 and authentication unit 24.Wherein, generation unit 21, For utilizing self-adapting random testing algorithm, at least two test cases are generated;Search unit 22, for using greedy algorithm, At least two test case is scanned for, to select available test case at least two test case;Institute Generation unit 21 is stated, is additionally operable to according to the transformation relation pre-set, generation is corresponding with the available test case to change in quality Test case, the transformation relation be used to indicating the change of test case with using before the change and after the change Test case treat the corresponding relation that ranging sequence is tested the change of generated test result;Test cell 23, is used for The program to be measured is run using the available test case, to generate the first test result;And utilize the transformation Test case runs the program to be measured, to generate the second test result;Authentication unit 24, for being tied according to the described first test Fruit, second test result and the transformation relation, are verified to the program to be measured.
So, by generation unit according to the transformation relation pre-set, generation is corresponding with available test case to slough off The test case of change, and then the program to be measured is run using the available test case by test cell, to generate first Test result, and the program to be measured is run using the test case of the transformation, to generate the second test result so that test Demonstrate,proving unit can be according to first test result, second test result and the transformation relation, to the program to be measured Verified, to determine whether the program to be measured is correct, test process is participated in without operating personnel, it is simple to operate, and correctly Rate is high, so as to improve the efficiency and reliability of test operation.
Alternatively, in a possible implementation of the present embodiment, generation unit 21 by corresponding to execution operation, Test case of the generation with different that can be automated.
Specifically, first, the generation unit 21 is according to the input data form and data create-rule pre-entered, with Machine generates the 1st test case T1, and records the coverage condition that T1 treats ranging sequence.
Then, the generation unit 21 generates n at random again(N is the integer more than or equal to 2)Individual alternative test case, And and record the coverage condition that they treat ranging sequence, and, calculate the distance between each alternative test cases of n and T1, select The maximum alternative test case of distance is selected as the 2nd test case T2.Wherein, the distance can be understood as alternative survey The quantitative criteria of otherness on probation between example and test case.
The method that the generation unit 21 calculates this distance can have many kinds.
For example, alternative test case is treated ranging sequence coverage condition with test case to be measured by the generation unit 21 The difference of the coverage condition of program takes absolute value, and is then added again.Assuming that the program bag to be measured contains 3 rows, T1 pairs of test case The coverage condition of program to be measured is 101, and the coverage condition that alternative test case t1 treats ranging sequence is 001, alternative test The coverage condition that use-case t2 treats ranging sequence is 011, wherein, 1 represents covering, and 0 represents not cover.So, between t1 and T1 Distance is | 0-1 |+| 0-0 |+| 1-1 | the distance between=1, t2 and T1 be | 0-1 |+| 1-0 |+| 1-1 |=2.
Or for another example are treated into the coverage condition of ranging sequence by alternative test case for the generation unit 21 and test is used Example treats the union of the coverage condition of ranging sequence divided by alternative test case treats the coverage condition and test case of ranging sequence Treat the common factor of the coverage condition of ranging sequence.Assuming that the program bag to be measured contains 3 rows, test case T1 treats the covering of ranging sequence Situation is 101 i.e. 2 rows of covering, and the coverage condition that alternative test case t1 treats ranging sequence is 001 i.e. 1 row of covering, alternative The coverage condition that test case t2 treats ranging sequence is 011 i.e. 2 rows of covering, wherein, 1 represents covering, and 0 represents not cover.So, The distance between t1 and T1 are that the distance between 2/1=2, t2 and T1 are 3/1=3.
Etc., the generation unit 21 also has a lot of other methods to can be used for calculating the distance, and the present embodiment is to this Without limiting.
Then, the generation unit 21 generates n at random again(N is the integer more than or equal to 2)Individual alternative test case, And and record the coverage condition that they treat ranging sequence, and, calculate between each alternative test cases of n and T1, T2 away from From selecting the alternative test case of Maximizing Minimum Distance as the 3rd test case T3.Wherein, minimum range is alternative The distance between test case and T1, it is less distance in the distance between alternative test case and T2 with, minimum range.
By that analogy, the circulation of generation unit 21 performs aforesaid operations, to generate M(M is the integer more than or equal to 2) Individual test case, until the M test case is more than or equal to the covering pre-set to the coverage condition of the program to be measured Threshold value, or M are to reach the quantity threshold pre-set, untill.
That is, the generation unit 21, self-adapting random testing algorithm can be specifically utilized, and according to setting in advance The covering threshold value put, generate at least two test cases, covering feelings of at least two test case to the program to be measured Condition is more than or equal to the covering threshold value.
Alternatively, it is described greedy used in the search unit 22 in a possible implementation of the present embodiment The selection strategy of greedy algorithm is to select the test maximum to the coverage condition currently without capped program to be measured successively to use Example, as feasible test case.Specifically, the search unit 22, specifically can be used for surveying from described at least two successively In example on probation in addition to the N-1 available test cases selected before in other test cases, select n-th available Test case, it is described until the coverage condition of N number of available test case is more than or equal to the covering threshold value that pre-sets N is the integer more than or equal to 1;Wherein,
The program bag to be measured contains the first program that the N-1 that selects before available test cases have covered and before The second program that N-1 available test cases of selection are not covered with;
The available test case of n-th is more than at least two test case to the coverage condition of the second program The coverage condition of other test cases in addition to the N-1 that selects before available test cases to the second program.
Specifically, the search unit 22 can perform repeatedly according to preset strategy, for example, until described N number of available The coverage condition of test case is more than or equal to the covering threshold value pre-set and specified herein, for example, 1 time or 2 times.
For example, it is assumed that program to be measured is software under testing system(System Under Test, SUT)Including following 11 row, i.e.,
01:if a>b:
02:if a>b+1:
03:do something
04:else:
05:do something
06:elifa=b:
07:do something
08:else a<b:
09:do something
10:if a==b+2:
11:do something
By performing 101, following test case is generated:
T1:A=3, b=1;
T2:A=3, b=2;
T3:A=3, b=3;
T4:A=4, b=4;
T5:A=3, b=4.
It can see from the test case, T1 covers 1,2,3,10 and 11 rows, and T2 covers 1,4 and 5 rows, T3 coverings 6 and 7 rows, T4 cover 6 and 7 rows, and T5 covers 8 and 9 rows.
First, the search unit 22 selects coverage rate highest T1, so there remains 4,5,6,7,8 and 9 rows not by Covering.Then, the search unit 22 searches again for covering the coverage rate highest of these rows, it is found that T2, T3, T4 and T5 are 2. The search unit 22 can use certain strategy, for example, one T2 of sequential selection, it is not coated to there remains 6,7,8 and 9 rows Lid.Similarly the search unit 22 selects T3, and remaining 8 and 9 are not covered with, and the search unit 22 selects T5, owns afterwards Row is capped, then is left T4 and is then eliminated or is placed in lower whorl and is chosen again.
In the present embodiment, by generation unit according to the transformation relation pre-set, generation and available test case pair The test case for the transformation answered, and then the program to be measured is run using the available test case by test cell, with life The program to be measured is run into the first test result, and using the test case of the transformation, to generate the second test result, Authentication unit is treated according to first test result, second test result and the transformation relation to described Ranging sequence is verified, to determine whether the program to be measured is correct, test process is participated in without operating personnel, simple to operate, And accuracy is high, so as to improve the efficiency and reliability of test operation.
In addition, the technical scheme provided using the present embodiment, due to participating in test process without operating personnel, can also enter One step reduces cost of labor, greatly improves measuring stability, reduces test risk.
In addition, the technical scheme provided using the present embodiment, because authentication unit employs transformation relation, to described to be measured Program is verified so that without paying close attention to the inside implementation process of program to be measured, it is only necessary to pays close attention to available test case with sloughing off The change of the test case of change and the change of each self-corresponding test result, if meet the transformation relation, so as to Checking cost is saved, it is particularly evident particularly with the program effect to be measured of complexity.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided by the present invention, it should be understood that disclosed system, apparatus and method can be with Realize by another way.For example, device embodiment described above is only schematical, for example, the unit Division, only a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or The mutual coupling discussed or direct-coupling or communication connection can be the indirect couplings by some interfaces, device or unit Close or communicate to connect, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit realized in the form of SFU software functional unit, can be stored in one and computer-readable deposit In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are causing a computer Equipment(Can be personal computer, server, or network equipment etc.)Or processor(processor)It is each to perform the present invention The part steps of embodiment methods described.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage(Read- Only Memory, ROM), random access memory(Random Access Memory, RAM), magnetic disc or CD etc. it is various Can be with the medium of store program codes.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although The present invention is described in detail with reference to the foregoing embodiments, it will be understood by those within the art that:It still may be used To be modified to the technical scheme described in foregoing embodiments, or equivalent substitution is carried out to which part technical characteristic; And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.

Claims (4)

  1. A kind of 1. method of testing, it is characterised in that including:
    Using self-adapting random testing algorithm, at least two test cases are generated;
    Using greedy algorithm, at least two test case is scanned for, to select at least two test case Available test case;
    According to the transformation relation pre-set, the test case of transformation corresponding with the available test case is generated, it is described Transformation relation is used for the corresponding relation of the change for the change and test result for indicating test case;The test result is utilizes institute Test case before stating change and after the change treats ranging sequence and is tested what is generated;
    The program to be measured is run using the available test case, to generate the first test result;
    The program to be measured is run using the test case of the transformation, to generate the second test result;
    According to first test result, second test result and the transformation relation, the program to be measured is tested Card;Wherein,
    It is described to utilize greedy algorithm, at least two test case is scanned for, including:
    It is other in addition to the N-1 available test cases selected before from least two test case successively to survey In example on probation, the available test case of n-th is selected, until the coverage condition of the individual available test cases of the N-1 selected before It is more than or equal to the covering threshold value pre-set with the coverage condition sum of the available test case of the n-th, the N is big In or equal to 1 integer;Wherein,
    The first program and select before that the program bag to be measured has covered containing the N-1 available test cases selected before The second program for being not covered with of N-1 available test cases;
    The available test case of n-th the coverage condition of the second program is more than at least two test case except The coverage condition of the other test cases N-1 that selects available test cases before outside to the second program.
  2. 2. according to the method for claim 1, it is characterised in that described to utilize self-adapting random testing algorithm, generation is at least Two test cases, including:
    Using self-adapting random testing algorithm, and according to the covering threshold value pre-set, generate at least two test cases, institute State at least two test cases and the covering threshold value is more than or equal to the coverage condition of the program to be measured.
  3. A kind of 3. test equipment, it is characterised in that including:
    Generation unit, for utilizing self-adapting random testing algorithm, generate at least two test cases;
    Search unit, for using greedy algorithm, being scanned at least two test case, with least two described in selection Available test case in individual test case;
    The generation unit, it is additionally operable to corresponding with the available test case according to the transformation relation pre-set, generation The test case of transformation, the transformation relation are used for the corresponding relation of the change for the change and test result for indicating test case; The test result is tested to treat ranging sequence using the test case before the change and after the change and given birth to Into;
    Test cell, for running the program to be measured using the available test case, to generate the first test result;With And the program to be measured is run using the test case of the transformation, to generate the second test result;
    Authentication unit, for according to first test result, second test result and the transformation relation, being treated to described Ranging sequence is verified;Wherein,
    The search unit, is specifically used for
    It is other in addition to the N-1 available test cases selected before from least two test case successively to survey In example on probation, the available test case of n-th is selected, until the coverage condition of the individual available test cases of the N-1 selected before It is more than or equal to the covering threshold value pre-set with the coverage condition sum of the available test case of the n-th, the N is big In or equal to 1 integer;Wherein,
    The first program and select before that the program bag to be measured has covered containing the N-1 available test cases selected before The second program for being not covered with of N-1 available test cases;
    The available test case of n-th the coverage condition of the second program is more than at least two test case except The coverage condition of the other test cases N-1 that selects available test cases before outside to the second program.
  4. 4. equipment according to claim 3, it is characterised in that the generation unit, be specifically used for
    Using self-adapting random testing algorithm, and according to the covering threshold value pre-set, generate at least two test cases, institute State at least two test cases and the covering threshold value is more than or equal to the coverage condition of the program to be measured.
CN201210564597.3A 2012-12-21 2012-12-21 Method of testing and equipment Active CN103885876B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210564597.3A CN103885876B (en) 2012-12-21 2012-12-21 Method of testing and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210564597.3A CN103885876B (en) 2012-12-21 2012-12-21 Method of testing and equipment

Publications (2)

Publication Number Publication Date
CN103885876A CN103885876A (en) 2014-06-25
CN103885876B true CN103885876B (en) 2018-01-05

Family

ID=50954784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210564597.3A Active CN103885876B (en) 2012-12-21 2012-12-21 Method of testing and equipment

Country Status (1)

Country Link
CN (1) CN103885876B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572462B (en) * 2014-12-31 2017-10-03 中国人民解放军理工大学 A kind of metamorphic testing case generation method based on self-adapting random strategy
CN106547695B (en) * 2016-10-26 2019-03-05 中广核工程有限公司 A kind of test macro and method of scale software
CN106897217A (en) * 2017-02-13 2017-06-27 北京趣拿软件科技有限公司 Method of testing and test device
CN107704393B (en) * 2017-09-29 2018-08-21 武汉斗鱼网络科技有限公司 Data test method, apparatus and electronic equipment
CN109783753A (en) * 2018-12-14 2019-05-21 平安普惠企业管理有限公司 The tree-shaped drawing generating method of web site url, device, equipment and storage medium
CN110823226B (en) * 2019-10-30 2021-04-30 北京航空航天大学 Unmanned aerial vehicle intelligent route planning test method based on metamorphic test technology
CN112988566B (en) * 2021-01-25 2024-01-02 杭州衣科信息技术股份有限公司 Test coverage rate improving method and device, computer equipment and storage medium
CN116126698B (en) * 2022-12-29 2023-08-01 中国人民解放军国防科技大学 Run-time configuration updating defect detection method based on metamorphic test
CN117056203B (en) * 2023-07-11 2024-04-09 南华大学 Numerical expression type metamorphic relation selection method based on complexity

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916225A (en) * 2010-09-02 2010-12-15 于秀山 Graphical user interface software function coverage testing method
CN102170378A (en) * 2011-04-22 2011-08-31 北京科技大学 Web service test method with no need of anticipation
CN102253889A (en) * 2011-08-07 2011-11-23 南京大学 Method for dividing priorities of test cases in regression test based on distribution

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020155587A1 (en) * 2001-04-20 2002-10-24 Sequenom, Inc. System and method for testing a biological sample

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916225A (en) * 2010-09-02 2010-12-15 于秀山 Graphical user interface software function coverage testing method
CN102170378A (en) * 2011-04-22 2011-08-31 北京科技大学 Web service test method with no need of anticipation
CN102253889A (en) * 2011-08-07 2011-11-23 南京大学 Method for dividing priorities of test cases in regression test based on distribution

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
软件测试用例自动生成算法综述;聂鹏等;《计算机应用研究》;20120228;第1-6页 *

Also Published As

Publication number Publication date
CN103885876A (en) 2014-06-25

Similar Documents

Publication Publication Date Title
CN103885876B (en) Method of testing and equipment
US9300134B2 (en) Methods and systems for power restoration planning
CN102999320B (en) Automatic example generation method and system
CN108762911A (en) Timing task management method, apparatus, computer equipment and storage medium
CN109886661A (en) Across chain digital cash exchanging method, device, computer system and storage medium
CN106980571A (en) The construction method and equipment of a kind of test use cases
CN109413202A (en) The ordering system and method for block chain Transaction Information
CN107844411A (en) A kind of method of testing and relevant apparatus
CN106257507A (en) The methods of risk assessment of user behavior and device
CN106657399A (en) Background server selection method and device realized based on middleware
CN108519883A (en) Parameter amending method, device, terminal device and storage medium
CN107864187A (en) The online task executing method of terminal device and server
CN103631714A (en) Method for generating minimum combination testing cases based on matrix multiplicity
CN106022936B (en) Community structure-based influence maximization algorithm applicable to thesis cooperative network
Alsewari et al. One-parameter-at-a-time combinatorial testing strategy based on harmony search algorithm OPAT-HS
Abd Halim et al. Similarity distance measure and prioritization algorithm for test case prioritization in software product line testing
CN107220120A (en) Method and apparatus for delivering software solution
Doungsa-Ard et al. GA-based automatic test data generation for UML state diagrams with parallel paths
WO2011114135A1 (en) Detecting at least one community in a network
CN105630680B (en) A kind of random test program generation method
CN109977005A (en) End-to-end test method, medium, device and calculating equipment
CN110413287A (en) The dispositions method and device of software
Balint et al. A novel approach to combine a SLS-and a DPLL-solver for the satisfiability problem
CN106056331A (en) Commodity inventory early warning method and early warning system
CN106776265A (en) Test case update method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant