CN106776260B - The traversal search method of combination of two Test cases technology - Google Patents

The traversal search method of combination of two Test cases technology Download PDF

Info

Publication number
CN106776260B
CN106776260B CN201510802517.7A CN201510802517A CN106776260B CN 106776260 B CN106776260 B CN 106776260B CN 201510802517 A CN201510802517 A CN 201510802517A CN 106776260 B CN106776260 B CN 106776260B
Authority
CN
China
Prior art keywords
combination
valued combinations
parameters
uncovered
test case
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
CN201510802517.7A
Other languages
Chinese (zh)
Other versions
CN106776260A (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 Institute of Computer Technology and Applications
Original Assignee
Beijing Institute of Computer Technology and Applications
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 Institute of Computer Technology and Applications filed Critical Beijing Institute of Computer Technology and Applications
Priority to CN201510802517.7A priority Critical patent/CN106776260B/en
Publication of CN106776260A publication Critical patent/CN106776260A/en
Application granted granted Critical
Publication of CN106776260B publication Critical patent/CN106776260B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of traversal search methods of combination of two Test cases technology, wherein comprises determining that the valued combinations set of all parameters;The combination for forming two all values forms the valued combinations set of all two two parameters;The valued combinations collection for setting all two two parameters is combined into all uncovered valued combinations set;Set a test case set;Selection one belongs to the value set of all parameters but is not belonging to a combination T of test case set;Statistical combination T covers the number of combinations G in all uncovered valued combinations set;In all combinations that S8, statistical combination T are not covered in all uncovered valued combinations set, the parameter H of the most frequency of occurrence of frequency of occurrence;S9, F=a × G-b × H is calculated;The maximum combination Tmax of F value for finding out all valued combinations set for belonging to all parameters but being not belonging to test case set rejects the valued combinations of element T max covering in all uncovered valued combinations set.

Description

The traversal search method of combination of two Test cases technology
Technical field
The present invention is directed to combination of two Test cases technology problem, gives a kind of traversal search method of novel and high-efficiency.
Background technique
It when testing software, needs to test the various states of system, it is raw to carry out combination of two test case Cheng Shi needs that multiple test cases is selected to complete test.
For example, system shares multiple parameters, there are many values again for each parameter:
It is assumed that system shares 3 parameters:
1st parameter has 2 values={ Windows XP, Windows 2000 };
2nd parameter has 3 values={ English, Chinese, Japanese };
3rd parameter has 2 values={ Word 2003, Word 2007 };
Each parameter takes a kind of value in test, forms a test case, such as:
One test case: (Windows 2000, Japanese, Word 2007).
For example, in following 5 test cases:
Test case 1:(Windows 2000, Japanese, Word 2007);
Test case 2:(Windows XP, Japanese, Word 2003);
Test case 3:(Windows XP, Chinese, Word 2007);
Test case 4:(Windows 2000, Chinese, Word 2003);
Test case 5:(Windows 2000, English, Word 2007);
Wherein: the combination of " Windows XP " and " Japanese " occurs in test case 2, " Windows XP " and " in The combination of text " occurs in test case 3, but " Windows XP " does not occur in five test cases with " English ", So above-mentioned five test cases are not the test cases of combination of two.
For five test cases above, if adding 1 following test case:
Test case 6:(Windows XP, English, Word 2003);
All valued combinations that this six test cases cover any two factor can be verified.
When for carrying out combination of two Test cases technology, it is " any to meet how to select test case as few as possible All valued combinations of two factors all occurred in some test case ", it is technical problem urgently to be solved.
Summary of the invention
The purpose of the present invention is to provide a kind of traversal search methods that two combined test use-cases generate, for progress two When two combined test use-cases generate, solve how to select test case as few as possible meet " any two factor it is all Valued combinations all occurred in some test case " the problem of.
A kind of traversal search method of combination of two Test cases technology of the present invention, wherein include: S1, determine all ginsengs Several valued combinations set, the combination in the value set of all parameters is a kind of possible test case;S2, from all In parameter, every two parameter selects a value, and the combination for forming two all values forms the valued combinations of all two two parameters Set;S3, the valued combinations collection for setting all two two parameters are combined into all uncovered valued combinations set;S4, setting One test case set, and it is set as empty;If S5, all uncovered valued combinations set are not empty sets, turn S6, if All uncovered valued combinations collection are combined into empty set, then turn S12;Value set that S6, selection one belong to all parameters but It is not belonging to a combination T of test case set;S7, statistical combination T are covered in all uncovered valued combinations set Number of combinations is denoted as G;All combinations that S8, statistical combination T are not covered in all uncovered valued combinations set In, the parameter of the most frequency of occurrence of frequency of occurrence, the number of the parameter is denoted as H;S9, calculate F=a × G-b × H, wherein a and B is weighted value;S10, S6 to S9 is repeated, find out all valued combinations set for belonging to all parameters but is not belonging to test case The maximum combination of F value of set, is denoted as Tmax;S11, element T max is included in test case set, is not coated all The valued combinations that element T max covering is rejected in the valued combinations set of lid, turn S5;S12, output test case set.
One embodiment of the traversal search method of combination of two Test cases technology according to the present invention, wherein a >=0, b >=0, a+b=1.
The traversal search method that two combined test use-case of one kind of the invention generates, can effectively select survey as few as possible Example on probation meets " all valued combinations of any two factor all occurred in some test case ".
The traversal search method that two combined test use-case of one kind of the invention generates, has the advantages that
(1) it is adapted for carrying out the combination of two Test cases technology of time-consuming type test item;
(2) belong to direct search method, program realization is convenient and simple, is easy to tool;
(3) there is very strong test case optimization ability, test case optimization degree is very high;
(4) traversal of interblock space have it is natural can concurrency, be very suitable for parallel computation;
(5) there is settable adjustment parameter, more preferably calculated result can be found by parameter regulation.
Detailed description of the invention
Fig. 1 show the flow chart of the traversal search method of combination of two Test cases technology of the present invention.
Specific embodiment
To keep the purpose of the present invention, content and advantage clearer, with reference to the accompanying drawings and examples, to of the invention Specific embodiment is described in further detail.
The thought of the traversal search method of combination of two Test cases technology of the present invention is sketched are as follows: traverses all possibility one by one Test case, should make the covering of current test case is as much as possible not cover combination, take into account the next test of searching again When use-case, can have an opportunity to cover and as much as possible do not cover combination.It can simply be summarized as, should consider current more coverings, again Consider that subsequent more covering, tradeoff between the two can be realized by weighted factor, the current weight a covered subsequent more The weight b more covered.
Parameter described in following embodiments refers to the set of same class testing factor;Element in identity set is description The convenient value become in set, each each one element of selection of set form a test case.
Fig. 1 show the flow chart of the traversal search method of combination of two Test cases technology of the present invention, as shown in Figure 1, The traversal search method of combination of two Test cases technology of the present invention includes:
S1, the valued combinations set for determining all parameters, the combination in the value set of all parameters is that one kind can The test case of energy;
S2, from all parameters, every two parameter selects a value, form two all values combination formed one all two The valued combinations set of two parameter;
S3, the valued combinations collection for setting all two two parameters are combined into all uncovered valued combinations set;
S4, one test case set of setting, and it is set as empty;
If S5, all uncovered valued combinations set are not empty sets, turn S6, if all uncovered takes Value composite set is empty set, then turns S12;
S6, selection one belong to the value set of all parameters but are not belonging to a combination T of test case set;
S7, statistical combination T cover the number of combinations in all uncovered valued combinations set, are denoted as G;
In all combinations that S8, statistical combination T are not covered in all uncovered valued combinations set, occurrence out The parameter of the most frequency of occurrence of number, the number of the parameter are denoted as H;
S9, F=a × G-b × H is calculated, wherein a and b is weighted value;
S10, S6 to S9 is repeated, find out all valued combinations set for belonging to all parameters but is not belonging to test case set The maximum combination of F value, be denoted as Tmax;
S11, element T max is included in test case set, is rejected in all uncovered valued combinations set The valued combinations of element T max covering, turn S5;
S12, output test case set.
It is illustrated below with a specific embodiment, the traversal search side of the combination of two Test cases technology of the present embodiment Method.Assuming that the present embodiment tool is there are three parameter A, B and C, the 1st parameter has 2 values={ A1, A2 }, and the 2nd parameter has 2 Value={ B1, B2 }, the 3rd parameter have 2 values={ C1, C2 }.
S1, the valued combinations set for determining all parameters, the combination in the value set of all parameters is that one kind can The test case of energy;
Then { valued combinations of all parameters } set=(A1, B1, C1), (A1, B1, C2), (A1, B2, C1), (A1, B2, C2), (A2, B1, C1), (A2, B1, C2), (A2, B2, C1), (A2, B2, C2) };
S2, from all parameters, every two parameter selects a value, form two all values combination formed one all two The valued combinations set of two parameter;
1st parameter has 2 values={ A1, A2 }, and the 2nd parameter has 2 values={ B1, B2 }, and the 3rd parameter has 2 A value={ C1, C2 }, then { valued combinations of all two two parameters } set=(A1, B1), (A1, B2), (A2, B1), (A2, B2), (A1, C1), (A1, C2), (A2, C1), (A2, C2), (B1, C1), (B1, C2), (B2, C1), (B2, C2) };
S3, the valued combinations collection for setting all two two parameters are combined into all uncovered valued combinations set;
S4, one test case set of setting, and it is set as empty;
If S5, all uncovered valued combinations set are not empty sets, turn S6, if all uncovered takes Value composite set is empty set, then turns S12;
S6, selection one belong to the value set of all parameters but are not belonging to a combination T of test case set;
For example, element T=(A1, B1, C1);
S7, statistical combination T cover the number of combinations in all uncovered valued combinations set, are denoted as G;
Such as: { all uncovered valued combinations } set=(A1, B1), (A1, C1), (A1, B2), (A1, C2), (A2, B1), (A2, C1) }, element T=(A1, B1, C1), cover { all uncovered valued combinations } set (A1, B1) and (A1, C1), element number 2, so G=2;
In all combinations that S8, statistical combination T are not covered in all uncovered valued combinations set, occurrence out The parameter of the most frequency of occurrence of number, the number of the parameter are denoted as H;
Such as: { all uncovered valued combinations } set=(A1, B1), (A1, C1), (A1, B2), (A1, C2), (A2, B1), (A2, C1) }, element T=(A1, B1, C1), the member not covered be known as (A1, B2), (A1, C2), (A2, B1), (A2, C1), wherein there is 4 A parameters, 2 B parameters, 2 C parameters, frequency of occurrence it is most be A parameter, occur 4 times, so H=4;
S9, F=a × G-b × H is calculated, wherein a and b is that weighted value can carry out flexible choice, wherein a >=0, b >=0, A+b=1;
S10, S6 to S9 is repeated, find out all valued combinations set for belonging to all parameters but is not belonging to test case set The maximum combination of F value, be denoted as Tmax;
S11, element T max is included in test case set, is rejected in all uncovered valued combinations set The valued combinations of element T max covering, turn S5;
S12, output test case set.
The traversal search method of combination of two Test cases technology of the present invention is applied to a specific example, it is assumed that input parameter Number=3;
1st parameter has 3 values={ Windows XP, Windows 2000, Windows NT };
2nd parameter has 5 values={ English, Simplified Chinese, Traditional Chinese, Japanese, Korean };
3rd parameter has 4 values={ Word 97, Word 2003, Word 2007, Word2010 };
Then final calculation result includes:
TEST 1:(Windows NT, Korean, Word 2010)
TEST 2:(Windows 2000, Korean, Word 2007)
TEST 3:(Windows XP, Korean, Word 2003)
TEST 4:(Windows 2000, Japanese, Word 2010)
TEST 5:(Windows NT, Japanese, Word 2007)
TEST 6:(Windows XP, Japanese, Word 97)
TEST 7:(Windows XP, Traditional Chinese, Word 2010)
TEST 8:(Windows NT, Traditional Chinese, Word 2003)
TEST 9:(Windows 2000, Traditional Chinese, Word 97)
TEST 10:(Windows XP, Simplified Chinese, Word 2007)
TEST 11:(Windows 2000, Simplified Chinese, Word 2003)
TEST 12:(Windows NT, Simplified Chinese, Word 97)
TEST 13:(Windows NT, English, Word 2010)
TEST 14:(Windows 2000, English, Word 2007)
TEST 15:(Windows XP, English, Word 2003)
TEST 16:(Windows NT, Korean, Word 97)
TEST 17:(Windows NT, Japanese, Word 2003)
TEST 18:(Windows NT, Traditional Chinese, Word 2007)
TEST 19:(Windows NT, Simplified Chinese, Word 2010)
TEST 20:(Windows NT, English, Word 97)
It is above-mentioned that the above-mentioned goal of the invention of the present invention can be completed.
In practical applications, firstly, traversal search method is mainly applied to parameter and value is few but test case is held The time-consuming fc-specific test FC field of row, calculating speed is not focal issue;Secondly, traversal search method can be parallel with natural Property, using the parallel computation of multi-core CPU, multi -CPU, the calculating speed of traversal search method can be greatly improved.
Traversal search method of the invention, has the advantages that
(1) it is adapted for carrying out the combination of two Test cases technology of time-consuming type test item;
(2) belong to direct search method, program realization is convenient and simple, is easy to tool;
(3) there is very strong test case optimization ability, test case optimization degree is very high;
(4) traversal of interblock space have it is natural can concurrency, be very suitable for parallel computation;
(5) there is settable adjustment parameter, more preferably calculated result can be found by parameter regulation.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, without departing from the technical principles of the invention, several improvement and deformations can also be made, these improvement and deformations Also it should be regarded as protection scope of the present invention.

Claims (2)

1. a kind of traversal search method of combination of two Test cases technology, which is characterized in that
S1, the valued combinations set for determining all parameters, the combination in the value set of all parameters are a kind of possible Test case;
S2, from all parameters, every two parameter selects a value, and the combination for forming two all values forms one and all joins two-by-two Several valued combinations set;
S3, the valued combinations collection for setting all two two parameters are combined into all uncovered valued combinations set;
S4, one test case set of setting, and it is set as empty;
If S5, all uncovered valued combinations set are not empty sets, turn S6, if all uncovered value groups Intersection is combined into empty set, then turns S12;
S6, selection one belong to the value set of all parameters but are not belonging to a combination T of test case set;
S7, statistical combination T cover the number of combinations in all uncovered valued combinations set, are denoted as G;
In all combinations that S8, statistical combination T are not covered in all uncovered valued combinations set, frequency of occurrence is most More parameters, is denoted as H;
S9, F=a × G-b × H is calculated, wherein a and b is weighted value;
S10, S6 to S9 is repeated, the F for finding out all valued combinations set for belonging to all parameters but being not belonging to test case set It is worth maximum combination, is denoted as Tmax;
S11, element T max is included in test case set, rejects element in all uncovered valued combinations set The valued combinations of Tmax covering, turn S5;
S12, output test case set.
2. the traversal search method of combination of two Test cases technology as described in claim 1, which is characterized in that a >=0, b >= 0, a+b=1.
CN201510802517.7A 2015-11-19 2015-11-19 The traversal search method of combination of two Test cases technology Active CN106776260B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510802517.7A CN106776260B (en) 2015-11-19 2015-11-19 The traversal search method of combination of two Test cases technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510802517.7A CN106776260B (en) 2015-11-19 2015-11-19 The traversal search method of combination of two Test cases technology

Publications (2)

Publication Number Publication Date
CN106776260A CN106776260A (en) 2017-05-31
CN106776260B true CN106776260B (en) 2019-04-19

Family

ID=58914530

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510802517.7A Active CN106776260B (en) 2015-11-19 2015-11-19 The traversal search method of combination of two Test cases technology

Country Status (1)

Country Link
CN (1) CN106776260B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704381A (en) * 2017-08-31 2018-02-16 电子科技大学 A kind of Generation of software test case method of combination of two
CN110990257B (en) * 2019-10-29 2022-11-18 西安爱生技术集团公司 Automatic generation method for code-level test case set
CN112416771B (en) * 2020-11-23 2023-06-30 北京计算机技术及应用研究所 Method for generating test case by combining arbitrary intensity

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236494A (en) * 2008-02-02 2008-08-06 南京大学 Information systems test combination generation method based on coverage density
CN102135937A (en) * 2011-03-15 2011-07-27 西安邮电学院 Pairwise overlay integrated software test case suite generating method
CN104346278A (en) * 2014-09-28 2015-02-11 上海新炬网络技术有限公司 Matrix-model-based software testing method
CN104461908A (en) * 2014-12-31 2015-03-25 中国科学院软件研究所 Regression test case reusing method based on software combination test

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5107131B2 (en) * 2008-04-28 2012-12-26 株式会社東芝 Test case generation device, generation method thereof, and program for test case generation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236494A (en) * 2008-02-02 2008-08-06 南京大学 Information systems test combination generation method based on coverage density
CN102135937A (en) * 2011-03-15 2011-07-27 西安邮电学院 Pairwise overlay integrated software test case suite generating method
CN104346278A (en) * 2014-09-28 2015-02-11 上海新炬网络技术有限公司 Matrix-model-based software testing method
CN104461908A (en) * 2014-12-31 2015-03-25 中国科学院软件研究所 Regression test case reusing method based on software combination test

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于AETG算法的两两组合测试用例生成方法;梁凡,宋晓秋;《计算机工程与设计》;20141130;第35卷(第11期);第3850-3854页

Also Published As

Publication number Publication date
CN106776260A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN108416686B (en) Ecological geological environment type division method based on coal resource development
CN106776260B (en) The traversal search method of combination of two Test cases technology
CN109784473A (en) A kind of short-term wind power prediction method based on Dual Clocking feature learning
CN105005029A (en) Multi-mode radar signal sorting method based on data field hierarchical clustering
CN109117742A (en) Gestures detection model treatment method, apparatus, equipment and storage medium
CN104021374A (en) Fingerprint sensor array
Cator et al. A shape theorem and semi-infinite geodesics for the Hammersley model with random weights
CN103824223A (en) Crop yield remote sensing estimation method based on MapReduce and neural network
CN102819652A (en) Mechanical parameter optimization design method based on adaptive reverse differential evolution
Reuveni Catalan's trapezoids
CN106127227A (en) Use Raman spectrum that material carries out cluster analysis and know method for distinguishing
CN104915504A (en) BFS strategy improvement method used for novel calculation network reliability evaluation
Wu The research on under water resources supporting capacity restraint in Xi’an city of the water sports
CN108121868B (en) A kind of space face domain generation method and system based on KDtree for sheet metal component modeling
CN105354264A (en) Locality-sensitive-hashing-based subject label fast endowing method
Singh et al. Common Fixed Point Theorems for Compatible Mappings in Metric Spaces
Liu et al. The application of greedy algorithm in real life
Sun et al. A Combinatorial Proof of the Log-Convexity of Catalan-Like Numbers.
CN104361150B (en) A kind of conversion based on MCAM-Geant4 method for automatic modeling for neutron transport simplifies system
Yu et al. Extensions of Two Single-Machine Scheduling Problems with an Aging Effect
Zhou et al. An efficient selection sorting algorithm for two-dimensional arrays
Gomez Marulanda et al. IPC-Net: 3D point-cloud segmentation using deep inter-point convolutional layers
Ma et al. Some class 1 graphs on gc-colorings
Tang et al. YOLO-Ant: A Lightweight Detector via Depthwise Separable Convolutional and Large Kernel Design for Antenna Interference Source Detection
CN107464254A (en) A kind of fast target detection method for improving space-invariance

Legal Events

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