CN105260317A - Test case selection method - Google Patents

Test case selection method Download PDF

Info

Publication number
CN105260317A
CN105260317A CN201510808292.6A CN201510808292A CN105260317A CN 105260317 A CN105260317 A CN 105260317A CN 201510808292 A CN201510808292 A CN 201510808292A CN 105260317 A CN105260317 A CN 105260317A
Authority
CN
China
Prior art keywords
subtree
test
leaf node
node
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.)
Granted
Application number
CN201510808292.6A
Other languages
Chinese (zh)
Other versions
CN105260317B (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.)
Huzhou Yinglie Intellectual Property Operation Co ltd
Original Assignee
Shanghai Feixun Data Communication 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510808292.6A priority Critical patent/CN105260317B/en
Publication of CN105260317A publication Critical patent/CN105260317A/en
Application granted granted Critical
Publication of CN105260317B publication Critical patent/CN105260317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention provides a test case selection method which includes the following steps that 1, a test project is selected; 2, a tree-shaped structure is formed according to the test project, nodes of the tree-shaped structure are formed by parameters of the test project, and the nodes form the tree-shaped structure according to the owner-member relationship of the parameters; 3, the influence index of each subtree with a father node of each leaf node as a root node is obtained according to influences of the parameters corresponding to the leaf nodes of the tree-shaped structure on the test project; 4, leaf nodes on each subtree with the father node of each leaf node as the root node are selected according to the influence index, and a parameter sequence corresponding to the test project is formed. According to the technical scheme, the test case selection method has the advantages that operation is simple, and the parameters corresponding to the test project are covered comprehensively, so that a comprehensive test can be conducted, and the defects that in the prior art, test efficiency is low, and operation is tedious are overcome.

Description

A kind of choosing method of test case
Technical field
The present invention relates to communication technical field, particularly relate to a kind of choosing method of the test case for communication facilities.
Background technology
Test case (TestCase) behavioral activity of software test is done a scientific tissue to conclude, and object the behavior of software test can be changed into manageable pattern; Test case is also by one of concrete for test method quantized simultaneously.And existing combined method design test case is divided into two kinds, one is cross design technique and combined covering technology, wherein cross design technique process data are slow, especially implement difficulty when test data is more very large, separately have combined covering technology to there is the not high defect of the loaded down with trivial details efficiency of test.
Summary of the invention
For the problems referred to above that test case in prior art exists, now provide a kind of and be intended to test comprehensively and the choosing method of simple test case.
Concrete technical scheme is as follows:
A choosing method for test case, comprises the following steps:
Step S1, select a test event;
Step S2, form a tree structure according to described test event, the node of described tree is formed by the parameter of described test event, and described node forms described tree structure according to the subordinate relation between described parameter;
Step S3, according to described parameter corresponding to the leaf node of described tree structure on the impact of described test event, obtain with the father node of described leaf node the Intrusion Index of every the described subtree being root node;
Step S4, according to described Intrusion Index choose with the father node of described leaf node be root node every described subtree on described leaf node, form the argument sequence of corresponding described test event.
Preferably, in described step S3, the acquisition calculation method of described Intrusion Index is, described in the described parameter influence that the leaf node of described subtree is corresponding during test event test result, the Intrusion Index of described subtree is the quantity of the leaf node of described subtree, the described parameter that the leaf node of described subtree is corresponding do not affect described test event test result time, the Intrusion Index of described subtree is 1.
Preferably, in described step S4, the method choosing described leaf node is,
When the Intrusion Index of described subtree is 1, in the described leaf node of described subtree, choose described parameter corresponding to a described leaf node at random;
When the Intrusion Index of described subtree is the quantity of the leaf node of described subtree, choose the described parameter that all described leaf node of described subtree is corresponding.
Preferably, the method forming described argument sequence in described step S4 is, the described parameter chosen is combined according to corresponding described subtree.
Preferably, provide an electronic table unit in order to preserve described tree structure and to show described parameter corresponding to the node of described tree structure.
Preferably, provide a computing unit, connect described electronic table unit, in order to choose with described leaf node according to described Intrusion Index, and form the argument sequence of corresponding described test event.
Preferably, described electronic table unit is Excel.
Preferably, described computing unit is formed primarily of the macroblock in Excel.
Preferably, described argument sequence shows in the mode of string expression.
Preferably, string expression corresponding for described test event is spliced the last of described string expression corresponding to the described argument sequence that formed in described step S4.
Technique scheme tool has the following advantages or beneficial effect: simple to operate, and comprehensive to the parameters distribution that test event is corresponding, thus can comprehensively test, and overcomes testing efficiency in prior art lower, and the problem that operation is more complicated.
Accompanying drawing explanation
With reference to appended accompanying drawing, to describe embodiments of the invention more fully.But, appended accompanying drawing only for illustration of and elaboration, do not form limitation of the scope of the invention.
Fig. 1 is the process flow diagram of the embodiment of the choosing method of a kind of test case of the present invention;
Fig. 2 is the tree structure schematic diagram of the embodiment of the choosing method of a kind of test case of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite of not making creative work, all belongs to the scope of protection of the invention.
It should be noted that, when not conflicting, the embodiment in the present invention and the feature in embodiment can combine mutually.
Below in conjunction with the drawings and specific embodiments, the invention will be further described, but not as limiting to the invention.
The present invention includes a kind of choosing method of test case.
As shown in Figure 1, a kind of choosing method of test case, comprises the following steps:
Step S1, select a test event;
Step S2, form a tree structure according to test event, the node of tree is formed by the parameter of test event, and node forms tree structure according to the subordinate relation between parameter;
Step S3, according to parameter corresponding to the leaf node of tree structure on the impact of test event, obtain with the Intrusion Index of the father node of leaf node every stalk tree that is root node;
Step S4, to choose with the leaf node on the father node of leaf node every stalk tree that is root node according to Intrusion Index, form the argument sequence of corresponding test event.
In technique scheme, by the parameter of test event is formed a tree structure, its interior joint forms tree structure according to the subordinate relation between parameter, according to parameter corresponding to the leaf node of tree structure on the impact of test event, the Intrusion Index of every stalk tree that further acquisition is root node with the father node of leaf node, and choose according to Intrusion Index with the leaf node on the father node of leaf node every stalk tree that is root node, thus form the argument sequence of corresponding test event.According to this argument sequence, can know and need which test case to test this test event.
In one preferably embodiment, in step s3, the acquisition calculation method of Intrusion Index is, during parameter influence test event test result corresponding to the leaf node of subtree, the Intrusion Index of subtree is the quantity of the leaf node of subtree, the parameter that the leaf node of subtree is corresponding do not affect test event test result time, the Intrusion Index of subtree is 1.
In one preferably embodiment, in step S4, the method choosing leaf node is,
When the Intrusion Index of subtree is 1, in the leaf node of subtree, choose a parameter that leaf node is corresponding at random;
When the Intrusion Index of subtree is the quantity of the leaf node of subtree, choose the parameter that all leaf nodes of subtree are corresponding.
Technique scheme, selects corresponding parameter by Intrusion Index with different strategies, thus can reduce the quantity of test case, improves the efficiency of test.
In one preferably embodiment, the method forming argument sequence in step S4 is the parameter chosen combined according to corresponding subtree.
In one preferably embodiment, provide an electronic table unit in order to preserve the parameter corresponding to node of tree structure and display tree structure.
In one preferably embodiment, provide a computing unit, connect electronic table unit, in order to choose with leaf node according to Intrusion Index, and form the argument sequence of corresponding test event.
Technique scheme inputs corresponding test event by the electronic table unit person of being easy to use, and parameter corresponding to test event and corresponding Intrusion Index, and can show tree structure intuitively, further, corresponding argument sequence can be calculated easily by computing unit, both simplify operation and be improved efficiency.
In one preferably embodiment, electronic table unit can be Excel.Excel is now widely used spreadsheet systems, easy and simple to handle, and has good extendability.
In one preferably embodiment, computing unit is formed primarily of the macroblock in Excel.Macroblock in Excel can provide programmes to the object in excel spreadsheet lattice, thus can realize corresponding computing function.
In one preferably embodiment, argument sequence shows in the mode of string expression.With character string mode display parameter sequence, user can be got information about needs for which test case.
In one preferably embodiment, string expression corresponding for test event is spliced the last of string expression corresponding to the argument sequence that formed in step S4.
As shown in Figure 2, further illustrate with a kind of specific embodiment below, under the embodiment being test event with switch learning MAC address function;
By mutual machine learning MAC address is formed a tree structure,
Wherein the parameter of test event is respectively, ACCESS, TRUNK, HYBIRD under port type, VLAN pattern, physical port, aggregation port, VLAN pattern and GE port corresponding to physical port and 10GE port and static polymerization corresponding to aggregation port and dynamic aggregation.
By above-mentioned parameter being formed the node of tree structure, and form tree structure according to the subordinate relation between each parameter,
Further, leaf node is the father node of GE port and 10GE port is physical port, and be root node with physical port, obtain further GE port and 10GE port to the impact of test event, draw with physical port be Intrusion Index corresponding to the subtree of root node to be 1;
Further, leaf node is the father node of static polymerization and dynamic aggregation is aggregation port, and be root node with aggregation port, obtain further static polymerization and dynamic aggregation to the impact of test event, draw with aggregation port be Intrusion Index corresponding to the subtree of root node to be 2;
Further, leaf node is ACCESS, TRUNK, HYBIRD, father node be poly-VLAN pattern, and with VLAN pattern for root node, obtain ACCESS, TRUNK, HYBIRD, impact on test event further, draw with Intrusion Index corresponding to the VLAN pattern subtree that is root node as 1;
Thus the Intrusion Index obtaining with physical port the subtree being root node is 1, take aggregation port as the Intrusion Index of the subtree of root node be 2, the Intrusion Index of the subtree being root node with VLAN pattern is 1, and further to choose according to Intrusion Index with root node be leaf node under physical port with taking root node as leaf node under aggregation port and root node be the leaf node under VLAN pattern
Further by electronic table unit, parameter corresponding for the node of tree structure and display tree structure is preserved, and be connected with electrical form by computing unit, in order to choose with leaf node according to Intrusion Index, and form the argument sequence of corresponding test event, as shown in the formula 1), 2).
1), (GE port, 10GE port) is got 1 value * (ACCESS, TRUNK, HYBIRD) at random and is got 1 value at random.
2), (static polymerization, dynamic aggregation) 2 value traversal * (ACCESS, TRUNK, HYBIRD) get 1 value at random.
In above-mentioned formula 1) in GE port, getting wherein 1 value in 10GE port at random, as got GE port, in ACCESS, TRUNK, HYBIRD, getting 1 value at random, as got ACCESS, then the argument sequence be combined to form is, GE port ACCESS pattern.
In above-mentioned formula 2) in static polymerization, when getting static polymerization in dynamic aggregation, in ACCESS, TRUNK, HYBIRD, get 1 value at random, as HYBIRD, then the argument sequence be combined to form is, static polymerization HYBIRD pattern;
When value is dynamic aggregation, in ACCESS, TRUNK, HYBIRD, get 1 value at random as TRUNK, then the argument sequence be combined to form is, dynamic aggregation TRUNK pattern.
The character string " MAC address learning checking " of splicing upper corresponding test event after above-mentioned three argument sequences respectively can be obtained following sequence:
The MAC address learning checking of GE port ACCESS pattern;
The MAC address learning checking of static polymerization mouth HYBIRD pattern;
The MAC address learning checking of dynamic aggregation mouth TRUNK pattern.
Test the test job that can complete test event 3 times by known only need of above-mentioned sequence, by existing method of testing, need the parameter corresponding to all leaf nodes all once to test, namely need to carry out 12 tests.Need test needs 12 times before comparing, tested by said method and only need 3 times, thus improve testing efficiency.
Technique scheme tool has the following advantages or beneficial effect: inoperation is simple, and comprehensive to the parameters distribution that test event is corresponding, thus can comprehensively test, and overcomes testing efficiency in prior art lower, and the problem that operation is more complicated.
The foregoing is only preferred embodiment of the present invention; not thereby embodiments of the present invention and protection domain is limited; to those skilled in the art; should recognize and all should be included in the scheme that equivalent replacement done by all utilizations instructions of the present invention and diagramatic content and apparent change obtain in protection scope of the present invention.

Claims (10)

1. a choosing method for test case, is characterized in that, comprises the following steps:
Step S1, select a test event;
Step S2, form a tree structure according to described test event, the node of described tree is formed by the parameter of described test event, and described node forms described tree structure according to the subordinate relation between described parameter;
Step S3, according to described parameter corresponding to the leaf node of described tree structure on the impact of described test event, obtain with the father node of described leaf node the Intrusion Index of every the described subtree being root node;
Step S4, according to described Intrusion Index choose with the father node of described leaf node be root node every described subtree on described leaf node, form the argument sequence of corresponding described test event.
2. the choosing method of test case according to claim 1, it is characterized in that, in described step S3, the acquisition calculation method of described Intrusion Index is, described in the described parameter influence that the leaf node of described subtree is corresponding during test event test result, the Intrusion Index of described subtree is the quantity of the leaf node of described subtree, the described parameter that the leaf node of described subtree is corresponding do not affect described test event test result time, the Intrusion Index of described subtree is 1.
3. the choosing method of test case according to claim 2, is characterized in that, in described step S4, the method choosing described leaf node is,
When the Intrusion Index of described subtree is 1, in the described leaf node of described subtree, choose described parameter corresponding to a described leaf node at random;
When the Intrusion Index of described subtree is the quantity of the leaf node of described subtree, choose the described parameter that all described leaf node of described subtree is corresponding.
4. the choosing method of test case according to claim 3, is characterized in that, the method forming described argument sequence in described step S4 is, the described parameter chosen is combined according to corresponding described subtree.
5. the choosing method of test case according to claim 1, is characterized in that, provides an electronic table unit in order to preserve described tree structure and to show described parameter corresponding to the node of described tree structure.
6. the choosing method of test case according to claim 5, it is characterized in that, a computing unit is provided, connect described electronic table unit, in order to choose according to described Intrusion Index with described leaf node, and form the argument sequence of corresponding described test event.
7. the choosing method of test case according to claim 5, is characterized in that, described electronic table unit is Excel.
8. the choosing method of test case according to claim 6, is characterized in that, described computing unit is formed primarily of the macroblock in Excel.
9. the choosing method of test case according to claim 1, is characterized in that, described argument sequence shows in the mode of string expression.
10. the choosing method of test case according to claim 9, is characterized in that, string expression corresponding for described test event is spliced the last of described string expression corresponding to the described argument sequence that formed in described step S4.
CN201510808292.6A 2015-11-19 2015-11-19 A kind of choosing method of test case Active CN105260317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510808292.6A CN105260317B (en) 2015-11-19 2015-11-19 A kind of choosing method of test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510808292.6A CN105260317B (en) 2015-11-19 2015-11-19 A kind of choosing method of test case

Publications (2)

Publication Number Publication Date
CN105260317A true CN105260317A (en) 2016-01-20
CN105260317B CN105260317B (en) 2017-10-13

Family

ID=55100017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510808292.6A Active CN105260317B (en) 2015-11-19 2015-11-19 A kind of choosing method of test case

Country Status (1)

Country Link
CN (1) CN105260317B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423217A (en) * 2017-07-10 2017-12-01 东北大学秦皇岛分校 Black box fuzz testing method and system based on variation tree
CN108874671A (en) * 2018-06-20 2018-11-23 上海哔哩哔哩科技有限公司 Testing case management, device, system and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719786A (en) * 2004-07-08 2006-01-11 中兴通讯股份有限公司 Automatic testing system and method for command of command line interface of data communication apparatus
CN101499105A (en) * 2009-03-11 2009-08-05 北京时代民芯科技有限公司 Function tree structure of micro-processor function validation test case and its automatic generation method
CN102323906A (en) * 2011-09-08 2012-01-18 哈尔滨工程大学 MC/DC test data automatic generation method based on genetic algorithm
US8290882B2 (en) * 2008-10-09 2012-10-16 Microsoft Corporation Evaluating decision trees on a GPU
CN102736979A (en) * 2012-06-29 2012-10-17 南京大学 Symbolic-execution-based method for generating test cases with feedback
WO2014088144A1 (en) * 2012-12-05 2014-06-12 경북대학교 산학협력단 Function test device based on unit test case reuse and function test method therefor

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1719786A (en) * 2004-07-08 2006-01-11 中兴通讯股份有限公司 Automatic testing system and method for command of command line interface of data communication apparatus
US8290882B2 (en) * 2008-10-09 2012-10-16 Microsoft Corporation Evaluating decision trees on a GPU
CN101499105A (en) * 2009-03-11 2009-08-05 北京时代民芯科技有限公司 Function tree structure of micro-processor function validation test case and its automatic generation method
CN102323906A (en) * 2011-09-08 2012-01-18 哈尔滨工程大学 MC/DC test data automatic generation method based on genetic algorithm
CN102736979A (en) * 2012-06-29 2012-10-17 南京大学 Symbolic-execution-based method for generating test cases with feedback
WO2014088144A1 (en) * 2012-12-05 2014-06-12 경북대학교 산학협력단 Function test device based on unit test case reuse and function test method therefor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DR.VELUR RAJAPPA等: ""Efficient Software Test Case Generation Using Genetic Algorithm Based Graph Theory"", 《FIRST INTERNATIONAL CONFERENCE ON EMERGING TRENDS IN ENGINEERING AND TECHNOLOGY》 *
段飞雷等: ""MC/DC最小测试用例集快速生成算法"", 《计算机工程》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423217A (en) * 2017-07-10 2017-12-01 东北大学秦皇岛分校 Black box fuzz testing method and system based on variation tree
CN107423217B (en) * 2017-07-10 2020-02-14 东北大学秦皇岛分校 Black box fuzzy test method and system based on variation tree
CN108874671A (en) * 2018-06-20 2018-11-23 上海哔哩哔哩科技有限公司 Testing case management, device, system and storage medium

Also Published As

Publication number Publication date
CN105260317B (en) 2017-10-13

Similar Documents

Publication Publication Date Title
CN105260354B (en) A kind of Chinese AC automatic machines working method based on keyword dictionary tree construction
CN105095491B (en) Process model restorative procedure based on Petri network basic structure
CN103761276B (en) Methods of exhibiting and device that a kind of tree structure data compares
JP5426716B2 (en) Distribution network power flow analysis system and method
JP2017535854A5 (en)
CN105426499A (en) Implementation method of data visualization
CN104462979A (en) Automatic dynamic detection method and device of application program
CN103605606B (en) A kind of embedded software test use-case batch execution method that can automatically change
CN103391224B (en) Protocol hierarchy Self-adaptive method based on parallel-expansion finite state machine
CN106202529A (en) A kind of page rendering method and device
CN109376153A (en) System and method for writing data into graph database based on NiFi
CN103793349A (en) Data processing method and data processing device
CN105260317A (en) Test case selection method
CN106354641A (en) Testing method and device for process engine
CN105912812A (en) Method and device for determining shed parameters of post insulator
CN106154094A (en) A kind of method utilizing cable system tester to carry out cable system self study test
CN105243013A (en) Software testing method and system
CN106598799A (en) Fault injection simulation system and fault management system
CN104008056B (en) Method for testing software and device
CN103425558B (en) A kind of method realizing the test of board I/O port based on test configurations table
CN104615537A (en) Constrained random verification method and device for picture processing class IPs
CN104199096B (en) A kind of seismic data cube layer plane extracting method and device
CN104461565A (en) Optical module testing parameter configuration method and system
CN105824758B (en) A kind of heap area object comparative approach based on execution index and access path
CN106954264B (en) A kind of downlink physical shares the method for mapping resource and system of channel PDSCH

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201211

Address after: Dai Xi Zhen Shang Qiang Lu, Wuxing District, Huzhou City, Zhejiang Province

Patentee after: HUZHOU AIDI ELECTRIC Co.,Ltd.

Address before: 201616 No. 3666 Sixian Road, Songjiang District, Shanghai

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221226

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: Dai Xi Zhen Shang Qiang Lu, Wuxing District, Huzhou City, Zhejiang Province

Patentee before: HUZHOU AIDI ELECTRIC Co.,Ltd.