CN105260317B - A kind of choosing method of test case - Google Patents

A kind of choosing method of test case Download PDF

Info

Publication number
CN105260317B
CN105260317B CN201510808292.6A CN201510808292A CN105260317B CN 105260317 B CN105260317 B CN 105260317B CN 201510808292 A CN201510808292 A CN 201510808292A CN 105260317 B CN105260317 B CN 105260317B
Authority
CN
China
Prior art keywords
node
subtree
test
leaf node
test event
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
CN201510808292.6A
Other languages
Chinese (zh)
Other versions
CN105260317A (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

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

Abstract

The present invention provides a kind of test case selection method, comprises the following steps:Step S1, one test event of selection;Step S2, a tree structure formed according to test event, the node of tree formed by the parameter of test event, and node is according to the subordinate relation formation tree structure between parameter;Step S3, the influence according to the corresponding parameter of leaf node of tree structure to test event, obtain the Intrusion Index of every stalk tree by root node of the father node of leaf node;Leaf node on step S4, every stalk tree according to Intrusion Index selection by root node of the father node of leaf node, forms the argument sequence of correspondence test event.Its technical scheme beneficial effect is, not simple to operate, and, so as to comprehensively be tested, overcomes that testing efficiency in the prior art is relatively low to the corresponding parameters distribution of test event comprehensively, and the cumbersome defect of operation.

Description

A kind of choosing method of test case
Technical field
The present invention relates to the choosing method of communication technical field, more particularly to a kind of test case for communication equipment.
Background technology
Test case (Test Case) is that the behavioral activity of software test is done into a scientific tissue to conclude, purpose It is that the behavior of software test can be changed into manageable pattern;Test case is also that will test the method specifically quantified simultaneously One of.And existing combined method design test case is divided into two kinds, one kind is cross design technique and combined covering technology, its Middle cross design technique processing data is slow, and especially in the case where test data is more, enforcement difficulty is very big, separately there is combination Soverlay technique has the cumbersome inefficient defect of test.
The content of the invention
The above mentioned problem existed for test case in the prior art, now provides one kind and is intended to test comprehensively and simply surveys The choosing method of example on probation.
Concrete technical scheme is as follows:
A kind of choosing method of test case, comprises the following steps:
Step S1, one test event of selection;
Step S2, according to the test event formed a tree structure, the node of the tree is by the test item Purpose parameter is formed, and the node forms the tree structure according to the subordinate relation between the parameter;
Step S3, the influence according to the corresponding parameter of leaf node of the tree structure to the test event, Obtain the Intrusion Index of every subtree using the father node of the leaf node as root node;
Step S4, every son according to Intrusion Index selection using the father node of the leaf node as root node The leaf node on tree, forms the argument sequence of the correspondence test event.
It is preferred that, in the step S3, the acquisition of the Intrusion Index calculates method and is, the leaf node pair of the subtree When the parameter answered influences the test event test result, the Intrusion Index of the subtree is the leaf node of the subtree Quantity, the corresponding parameter of leaf node of the subtree do not influence the test event test result when, the son The Intrusion Index of tree is 1.
It is preferred that, in the step S4, the method for choosing the leaf node is,
When the Intrusion Index of the subtree is 1, a leaf is chosen in the leaf node of the subtree at random The corresponding parameter of child node;
When the Intrusion Index of the subtree is the quantity of the leaf node of the subtree, all described of the subtree is chosen The corresponding parameter of leaf node.
It is preferred that, the method that the argument sequence is formed in the step S4 is, by the parameter of selection according to pair The subtree answered is combined.
It is preferred that the section there is provided an electronic table unit to preserve the tree structure and the display tree structure The corresponding parameter of point.
It is preferred that there is provided a computing unit, connect the electronic table unit, to according to the Intrusion Index choose with The leaf node, and form the argument sequence of the correspondence test event.
It is preferred that, the electronic table unit is Excel.
It is preferred that, the computing unit is mainly formed by the macroblock in Excel.
It is preferred that, the argument sequence is shown in the way of string expression.
It is preferred that, the corresponding string expression of the test event is spliced to the ginseng formed in the step S4 The corresponding string expression of Number Sequence it is last.
Above-mentioned technical proposal has the following advantages that or beneficial effect:It is simple to operate, and to the corresponding parameter of test event Covering is comprehensive, so as to comprehensively be tested, and overcomes that testing efficiency in the prior art is relatively low, and operates more complicated ask Topic.
Brief description of the drawings
With reference to appended accompanying drawing, more fully to describe embodiments of the invention.However, appended accompanying drawing be merely to illustrate and Illustrate, and be not meant to limit the scope of the invention.
Fig. 1 is a kind of flow chart of the embodiment of the choosing method of test case of the invention;
Fig. 2 is a kind of tree structure schematic diagram of the embodiment of the choosing method of test case of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art obtained on the premise of creative work is not made it is all its His embodiment, belongs to the scope of protection of the invention.
It should be noted that in the case where not conflicting, the embodiment in the present invention and the feature in embodiment can phases Mutually combination.
The invention will be further described with specific embodiment below in conjunction with the accompanying drawings, 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, one test event of selection;
Step S2, a tree structure formed according to test event, the node of tree formed by the parameter of test event, Node is according to the subordinate relation formation tree structure between parameter;
Step S3, the influence according to the corresponding parameter of leaf node of tree structure to test event, are obtained with leaf section The father node of point is the Intrusion Index of every stalk tree of root node;
Leaf section on step S4, every stalk tree according to Intrusion Index selection by root node of the father node of leaf node Point, forms the argument sequence of correspondence test event.
In above-mentioned technical proposal, by by the parameter of test event one tree structure of formation, its interior joint according to parameter it Between subordinate relation formation tree structure, the influence according to the corresponding parameter of the leaf node of tree structure to test event enters The Intrusion Index of every stalk tree of the acquisition of one step by root node of the father node of leaf node, and according to Intrusion Index choose with The father node of leaf node is the leaf node on every stalk tree of root node, so as to form the parameter sequence of correspondence test event Row.Which according to the argument sequence, it would know that needs test case to test the test event.
In a kind of preferably embodiment, in step s3, the acquisition of Intrusion Index calculates method and is, the leaf section of subtree When the corresponding parameter of point influences test event test result, the Intrusion Index of subtree is the quantity of the leaf node of subtree, subtree The corresponding parameter of leaf node do not influence test event test result when, the Intrusion Index of subtree is 1.
In a kind of preferably embodiment, in step S4, the method for choosing leaf node is,
When the Intrusion Index of subtree is 1, the corresponding parameter of a leaf node is chosen in the leaf node of subtree at random;
When the Intrusion Index of subtree is the quantity of the leaf node of subtree, the corresponding ginseng of all leaf nodes of subtree is chosen Number.
Above-mentioned technical proposal, corresponding parameter is selected with different strategies by Intrusion Index, so as to reduce test The quantity of use-case, improves the efficiency of test.
In a kind of preferably embodiment, the method that argument sequence is formed in step S4 is, by the parameter of selection according to Corresponding subtree is combined.
There is provided an electronic table unit to preserve tree structure and show tree-like in a kind of preferably embodiment The corresponding parameter of node of structure.
There is provided a computing unit in a kind of preferably embodiment, electronic table unit is connected, to refer to according to influence Number is chosen with leaf node, and forms the argument sequence of correspondence test event.
Above-mentioned technical proposal inputs corresponding test event, and test event by the electronic table unit person of being easy to use Corresponding parameter and corresponding Intrusion Index, and intuitively tree structure can be shown, further, by calculating Unit can easily calculate corresponding argument sequence, both simplified operation and be improved efficiency.
In a kind of preferably embodiment, electronic table unit can be Excel.Excel is now widely used Spreadsheet systems, it is easy to operate, and with good autgmentability.
In a kind of preferably embodiment, computing unit is mainly formed by the macroblock in Excel.It is grand in Excel Module can be provided to be programmed to the object in Excel electrical forms, so that corresponding computing function can be realized.
In a kind of preferably embodiment, argument sequence is shown in the way of string expression.With character string mode Display parameters sequence, makes user can get information about needs which test cases.
In a kind of preferably embodiment, the corresponding string expression of test event is spliced and formed in step S4 The corresponding string expression of argument sequence it is last.
As shown in Fig. 2 being further illustrated below with a kind of specific embodiment, MAC Address function is being learnt with interchanger For under the embodiment of test event;
By the way that interaction machine is learnt into MAC Address one tree structure of formation,
The parameter of wherein test event is respectively, port type, VLAN patterns, physical port, aggregation port, VLAN patterns Under the corresponding GE ports of ACCESS, TRUNK, HYBIRD and physical port and 10GE ports and aggregation port it is corresponding Static polymerization and dynamic aggregation.
By the way that above-mentioned parameter to be formed to the node of tree structure, and form tree-like according to the subordinate relation between each parameter Structure,
Further, leaf node is that the father node of GE ports and 10GE ports is physical port, and using physical port as Root node, further obtains the influence of GE ports and 10GE ports to test event, draws the son using physical port as root node It is 1 to set corresponding Intrusion Index;
Further, leaf node is that the father node of static polymerization and dynamic aggregation is aggregation port, and using aggregation port as root Node, further obtains the influence of static polymerization and dynamic aggregation to test event, draws the subtree using aggregation port as root node Corresponding Intrusion Index is 2;
Further, leaf node be ACCESS, TRUNK, HYBIRD, father node be poly- VLAN patterns, and with VLAN Pattern is root node, further obtain ACCESS, TRUNK, HYBIRD, the influence to test event, draw using VLAN patterns as The corresponding Intrusion Index of subtree of root node is 1;
It is 1 so as to obtain by the Intrusion Index of the subtree of root node of physical port, using aggregation port as the subtree of root node Intrusion Index be 2, the Intrusion Index using VLAN patterns as the subtree of root node is 1, and is further selected according to Intrusion Index Leaf node under taking using root node as physical port with using root node as aggregation port under leaf node and root node be Leaf node under VLAN patterns,
It is further to be entered the corresponding parameter of node of tree structure and display tree structure by electronic table unit Row is preserved, and is connected by computing unit with electrical form, to be chosen according to Intrusion Index with leaf node, and forms correspondence The argument sequence of test event, such as following formula 1), 2).
1), (GE ports, 10GE ports) takes 1 value * (ACCESS, TRUNK, HYBIRD) to take 1 value at random at random.
2), (static polymerization, dynamic aggregation) 2 values traversal * (ACCESS, TRUNK, HYBIRD) takes 1 value at random.
In above-mentioned formula 1) in take wherein 1 value at random in GE ports, 10GE ports, such as take GE ports, ACCESS, 1 value is taken at random in TRUNK, HYBIRD, ACCESS is such as taken, then the argument sequence for combining formation is, GE ports ACCESS patterns.
In above-mentioned formula 2) in when taking static polymerization in static polymerization, dynamic aggregation, in ACCESS, TRUNK, HYBIRD 1 value, such as HYBIRD are taken at random, then the argument sequence for combining formation is, static polymerization HYBIRD patterns;
When value is dynamic aggregation, 1 value such as TRUNK is taken at random in ACCESS, TRUNK, HYBIRD, then combination is formed Argument sequence be, dynamic aggregation TRUNK patterns.
The character string " MAC address learning checking " of correspondence test event on respectively splicing after above three argument sequence Following sequence can be obtained:
The MAC address learning checking of GE ports ACCESS patterns;
The MAC address learning checking of static polymerization mouthful HYBIRD patterns;
The MAC address learning checking of dynamic aggregation mouthful TRUNK patterns.
Understand only to need 3 tests to complete the test job to test event by above-mentioned sequence, by existing test Method needs to carry out 12 tests, it is necessary to once test the corresponding parameter of all leaf nodes.Compared to needing before Test needs 12 times, only needed 3 times by above method test, so as to improve testing efficiency.
Above-mentioned technical proposal has the following advantages that or beneficial effect:It is not simple to operate, and to the corresponding ginseng of test event Number covering is comprehensive, so as to comprehensively be tested, and overcomes that testing efficiency in the prior art is relatively low, and operates more complicated ask Topic.
Preferred embodiments of the present invention are the foregoing is only, embodiments of the present invention and protection model is not thereby limited Enclose, to those skilled in the art, should can appreciate that made by all utilization description of the invention and diagramatic content Scheme obtained by equivalent substitution and obvious change, should be included in protection scope of the present invention.

Claims (8)

1. a kind of choosing method of test case, it is characterised in that comprise the following steps:
Step S1, one test event of selection;
Step S2, according to the test event formed a tree structure, the node of the tree is by the test event Parameter is formed, and the node forms the tree structure according to the subordinate relation between the parameter;
Step S3, the influence according to the corresponding parameter of leaf node of the tree structure to the test event, are obtained The Intrusion Index of every stalk tree by root node of the father node of the leaf node;The acquisition methods of the Intrusion Index are, When the corresponding parameter of leaf node of the subtree influences the test event test result, the Intrusion Index of the subtree For the quantity of the leaf node of the subtree, the corresponding parameter of leaf node of the subtree does not influence the test event Test result when, the Intrusion Index of the subtree is 1;
On step S4, every subtree according to Intrusion Index selection using the father node of the leaf node as root node The leaf node, form the argument sequence of the correspondence test event;
The method for choosing the leaf node is,
When the Intrusion Index of the subtree is 1, a leaf section is chosen in the leaf node of the subtree at random The corresponding parameter of point;
When the Intrusion Index of the subtree is the quantity of the leaf node of the subtree, all leaves of the subtree are chosen The corresponding parameter of node.
2. the choosing method of test case according to claim 1, it is characterised in that formed in the step S4 described The method of argument sequence is to be combined the parameter of selection according to the corresponding subtree.
3. the choosing method of the test case according to claim 1 a, it is characterised in that electronic table unit is provided and used To preserve the corresponding parameter of node of the tree structure and the display tree structure.
4. the choosing method of test case according to claim 3, it is characterised in that provide a computing unit, connects institute Electronic table unit is stated, to choose the leaf node according to the Intrusion Index, and the correspondence test event is formed Argument sequence.
5. the choosing method of test case according to claim 3, it is characterised in that the electronic table unit is Excel。
6. the choosing method of test case according to claim 4, it is characterised in that the computing unit is in Excel Macroblock formed.
7. the choosing method of the test case according to claim 1, it is characterised in that the argument sequence is with character string The mode of expression formula is shown.
8. the choosing method of test case according to claim 7, it is characterised in that by the corresponding word of the test event Symbol string expression splices the last of the corresponding string expression of the argument sequence formed in the 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 CN105260317A (en) 2016-01-20
CN105260317B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Citations (5)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101410099B1 (en) * 2012-12-05 2014-06-25 경북대학교 산학협력단 Function Test Apparatus based on Unit Test Cases Reusing and Function Test Method thereof

Patent Citations (5)

* 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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Efficient Software Test Case Generation Using Genetic Algorithm Based Graph Theory";Dr.Velur Rajappa等;《First International Conference on Emerging Trends in Engineering and Technology》;20080718;298-302 *
"MC/DC最小测试用例集快速生成算法";段飞雷等;《计算机工程》;20090930;第35卷(第17期);40-45 *

Also Published As

Publication number Publication date
CN105260317A (en) 2016-01-20

Similar Documents

Publication Publication Date Title
CN107704625A (en) Fields match method and apparatus
CN103902653B (en) A kind of method and apparatus for building data warehouse table genetic connection figure
CN104063361B (en) Report design method and Report Form Design system
CN104216961B (en) A kind of data processing method and device
CN107317725A (en) The method for visualizing and system of a kind of block chain
JP2013517558A5 (en)
CN103530379B (en) tree structure data display method and device
CN103793349A (en) Data processing method and data processing device
CN103345534B (en) A kind of Dynamic Graph processing method and processing device
CN105260317B (en) A kind of choosing method of test case
CN107329849A (en) A kind of data verification method and system based on Java systems
CN108228442A (en) A kind of detection method and device of abnormal nodes
CN103123646B (en) XML document is converted into automatically conversion method and the device of OWL document
CN105515859B (en) The method and system of community's detection are carried out to symbolic network based on similarity of paths
CN105117333A (en) Method and system for management of test cases
CN109710542A (en) A kind of completely N-ary tree construction method and device
CN107766519A (en) A kind of method of visual configuration data structure
CN102855278B (en) A kind of emulation mode and system
JP2012150756A (en) COMPUTER INFORMATION PROCESSING METHOD AND PROGRAM FOR CONVERTING SWF-FORMAT IMAGE REPRESENTATION OF AdobeFlash(R) INTO HTML-FORMAT IMAGE REPRESENTATION
CN109993387A (en) A kind of automatic scoring method and device based on NLP, examination system
CN107480364B (en) BIM (building information modeling) model dynamic organization method for engineering construction information management
CN103729523A (en) Automatic verification method orienting to parameterization system
Jing et al. Insights into symmetric and asymmetric vortex mergers using the core growth model
CN103281221B (en) Fire-fighting Internet of things system method of testing
Rosa et al. Clique approach for networks: applications for coauthorship networks

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

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.

TR01 Transfer of patent right