CN104461875A - Method for designing software testing case according to equivalence classes - Google Patents
Method for designing software testing case according to equivalence classes Download PDFInfo
- Publication number
- CN104461875A CN104461875A CN201410683193.5A CN201410683193A CN104461875A CN 104461875 A CN104461875 A CN 104461875A CN 201410683193 A CN201410683193 A CN 201410683193A CN 104461875 A CN104461875 A CN 104461875A
- Authority
- CN
- China
- Prior art keywords
- equivalence class
- equivalence
- test case
- class
- invalid
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention relates to the technical field of software testing, in particular to a method for designing a software testing case according to equivalence classes. The method comprises the steps that an equivalence partitioning standard is built firstly, and then equivalence partitioning is carried out on an input condition to determine the valid equivalence classes and the invaid equivalence classes; an equivalence class table is built according to partitioning, the testing case is designed according to the partitioning table, and finally the testing case is output. The design and compiling quality of the testing case and testing efficiency are improved, and the method can be used for designing and compiling the software testing case.
Description
Technical field
The present invention relates to software testing technology field, particularly a kind of method according to equivalence class design software test case.
Background technology
Software test is the important means improving software quality, and test case is the guidance in software test procedure, is the criterion that must observe of software test, the basic guarantee that software testing quality is stable especially.In software test procedure, testing example design and establishment are most important in software test activity, are the correctness of test execution, the basis of validity.How effectively design test case is the problem that tester pays close attention to always.Utilize this method design test case can not consider the inner structure of program, take Specification as foundation, select suitable typical subset, every demand of serious analysis and deliberation instructions, particularly functional requirement, mistake can be found as much as possible, improve the quality of software test.
Summary of the invention
The technical matters that the present invention solves is to provide a kind of method according to equivalence class design software test case; Solve the complete or redundancy of testing example design, the problems such as at substantial time.
The technical scheme that the present invention solves the problems of the technologies described above is:
Described method first sets up the standard of equivalence class partition, then carries out equivalence class partition to determine effective equivalence class and invalid equivalence class to initial conditions; Set up equivalence class table according to aforementioned division, and also finally export test case according to equivalence class table design test case.
Described equivalence class sets according to following condition:
1) complete test, redundancy is avoided;
2) be divided into mutually disjoint one group of subset, subset and be whole set;
3) test case is identified in same class; In same equivalence class, process identical, same treatment is mapped to " identical execution route ".
Described equivalence class partition carried out to initial conditions be:
1) when initial conditions defines the number of span or value, an effective equivalence class and two invalid equivalence classes can be established;
2) when initial conditions defines the set of input value or define the condition of " must how ", an effective equivalence class and an invalid equivalence class can be established;
3) when initial conditions is a Boolean quantity, an effective equivalence class and an invalid equivalence class can be determined;
4) at the class value defining input data; , and when program will process respectively to each input value, identical number effective equivalence class and an invalid equivalence class can be established;
5) defining in the regular situation that must observe of input data, an effective equivalence class and several invalid equivalence classes can be established;
6) when knowing that in the equivalence class divided, the mode of each element in routine processes is different, then this equivalence class further should be divided into less equivalence class.
Described after establishing equivalence class, equivalence class table can be set up, list all equivalence class initial conditions marked off: effectively equivalence class, invalid equivalence class, then design test case in the following manner from the equivalence class marked off:
1) for each equivalence class specifies a unique numbering;
2) test case that design one is new, makes it cover the not yet effective equivalence class of covered field as much as possible, repeats this step, until all effective equivalence classes are all capped;
3) test case that design one is new, makes it only cover an invalid equivalence class be not yet capped, repeats this step, until all invalid equivalence classes are all capped.
The present invention adopts the method design of equivalence class partition to write test case, achieve the standard by setting up equivalence class partition, then equivalence class partition is carried out for establishing effective equivalence class and invalid equivalence class to initial conditions, then equivalence class table is set up, and according to the equivalence class table design test case also last process exporting test case, under guarantee reaches the prerequisite of expected test coverage rate, reduce the difficulty of Test Sample Design; Improve the quality of Test Sample Design, when the test duration is tighter, the selection test case that can shoot the arrow at the target, improves testing efficiency and test mass.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the present invention is further described:
Fig. 1 is method flow diagram of the present invention;
Fig. 2 is effective, the invalid differentiation instance graph of equivalence class of the present invention.
Embodiment
As shown in Figure 1, the design write method of software test case of the present invention specifically comprises following step:
Step one: the standard setting up equivalence class partition;
1) complete test, redundancy is avoided.
2) divide equivalence class importantly: the division of set, be divided into mutually disjoint one group of subset, and subset and be whole set.
3) and be whole set: standby property.
4) subset is mutually disjointed: the nonredundancy ensureing a kind of form.
5) identify (selection) test case in same class, in same equivalence class, often process identical, same treatment is mapped to " identical execution route ".
Step 2: equivalence class partition is carried out to initial conditions;
1) when initial conditions defines the number of span or value, then an effective equivalence class and two invalid equivalence classes can be established.As shown in Figure 2: input value is student performance, scope is 0 ~ 100;
2) when initial conditions defines the set of input value or define the condition of " must how ", an effective equivalence class and an invalid equivalence class can be established.
3) when initial conditions is a Boolean quantity, an effective equivalence class and an invalid equivalence class can be determined.
4) defining a class value (assuming that n) of input data, and when program will process respectively to each input value, n effectively equivalence class and an invalid equivalence class can established.
Example: initial conditions illustrate educational background can be: one of training, undergraduate course, master, doctor four kinds, then get these four values of four kinds respectively as four effective equivalence classes, in addition using any educational background outside four kinds of educational backgrounds as invalid equivalence class.
5) defining in the regular situation that must observe of input data, an effective equivalence class (meeting rule) and several invalid equivalence classes (breaking the rules from different perspectives) can be established.
6) when knowing that in the equivalence class divided, the mode of each element in routine processes is different, then this equivalence class further should be divided into less equivalence class.
Step 3: after establishing equivalence class, can set up equivalence class table, lists all equivalence class initial conditions marked off: effectively equivalence class, invalid equivalence class, then from the equivalence class marked off by following three principle design test case:
1) for each equivalence class specifies a unique numbering;
2) test case that design one is new, makes it cover the not yet effective equivalence class of covered field as much as possible, repeats this step, until all effective equivalence classes are all capped;
3) test case that design one is new makes it only cover an invalid equivalence class be not yet capped, and repeats this step, until all invalid equivalence classes are all capped, thus completes testing example design.
Claims (5)
1., according to a method for equivalence class design software test case, it is characterized in that: described method first sets up the standard of equivalence class partition, then equivalence class partition is carried out to determine effective equivalence class and invalid equivalence class to initial conditions; Set up equivalence class table according to aforementioned division, and also finally export test case according to equivalence class table design test case.
2. the method according to equivalence class design software test case according to claim 1, is characterized in that; Described equivalence class sets according to following condition:
1) complete test, redundancy is avoided;
2) be divided into mutually disjoint one group of subset, subset and be whole set;
3) test case is identified in same class; In same equivalence class, process identical, same treatment is mapped to " identical execution route ".
3. the method according to equivalence class design software test case according to claim 1 and 2, is characterized in that: described carry out equivalence class partition to initial conditions and be:
1) when initial conditions defines the number of span or value, an effective equivalence class and two invalid equivalence classes can be established;
2) when initial conditions defines the set of input value or define the condition of " must how ", an effective equivalence class and an invalid equivalence class can be established;
3) when initial conditions is a Boolean quantity, an effective equivalence class and an invalid equivalence class can be determined;
4) at the class value defining input data; , and when program will process respectively to each input value, identical number effective equivalence class and an invalid equivalence class can be established;
5) defining in the regular situation that must observe of input data, an effective equivalence class and several invalid equivalence classes can be established;
6) when knowing that in the equivalence class divided, the mode of each element in routine processes is different, then this equivalence class further should be divided into less equivalence class.
4. the method according to equivalence class design software test case according to claim 1 and 2, it is characterized in that: described after establishing equivalence class, equivalence class table can be set up, list all equivalence class initial conditions marked off: effectively equivalence class, invalid equivalence class, then design test case in the following manner from the equivalence class marked off:
1) for each equivalence class specifies a unique numbering;
2) test case that design one is new, makes it cover the not yet effective equivalence class of covered field as much as possible, repeats this step, until all effective equivalence classes are all capped;
3) test case that design one is new, makes it only cover an invalid equivalence class be not yet capped, repeats this step, until all invalid equivalence classes are all capped.
5. the method according to equivalence class design software test case according to claim 3, it is characterized in that: described after establishing equivalence class, equivalence class table can be set up, list all equivalence class initial conditions marked off: effectively equivalence class, invalid equivalence class, then design test case in the following manner from the equivalence class marked off:
1) for each equivalence class specifies a unique numbering;
2) test case that design one is new, makes it cover the not yet effective equivalence class of covered field as much as possible, repeats this step, until all effective equivalence classes are all capped;
3) test case that design one is new, makes it only cover an invalid equivalence class be not yet capped, repeats this step, until all invalid equivalence classes are all capped.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410683193.5A CN104461875B (en) | 2014-11-23 | 2014-11-23 | A kind of method according to equivalence class design software test case |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410683193.5A CN104461875B (en) | 2014-11-23 | 2014-11-23 | A kind of method according to equivalence class design software test case |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104461875A true CN104461875A (en) | 2015-03-25 |
CN104461875B CN104461875B (en) | 2018-01-09 |
Family
ID=52907964
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410683193.5A Active CN104461875B (en) | 2014-11-23 | 2014-11-23 | A kind of method according to equivalence class design software test case |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104461875B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107291620A (en) * | 2017-06-30 | 2017-10-24 | 郑州云海信息技术有限公司 | A kind of method for generating test case and device |
CN109614335A (en) * | 2018-12-10 | 2019-04-12 | 艾瑞克·李 | Module ash box behavior specification and grey box testing case designing method |
CN110334009A (en) * | 2019-05-28 | 2019-10-15 | 中国平安人寿保险股份有限公司 | Automatic example generation method, device, terminal and storage medium |
CN113190436A (en) * | 2021-04-20 | 2021-07-30 | 北京异乡旅行网络科技有限公司 | Test case generation method and device and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100429630C (en) * | 2004-10-27 | 2008-10-29 | 北京航空航天大学 | Adaptive test method for software |
CN102063376B (en) * | 2011-02-16 | 2013-01-16 | 哈尔滨工程大学 | Test case selection method |
CN102314395A (en) * | 2011-10-12 | 2012-01-11 | 中国农业银行股份有限公司 | Method and system for generating test case |
CN103577311A (en) * | 2012-07-26 | 2014-02-12 | 深圳市世纪光速信息技术有限公司 | Method and device for screening test cases |
CN104123227A (en) * | 2014-08-13 | 2014-10-29 | 广东电网公司信息中心 | Method for automatically generating testing cases |
-
2014
- 2014-11-23 CN CN201410683193.5A patent/CN104461875B/en active Active
Non-Patent Citations (2)
Title |
---|
刘文红;吴欣: "基于SFTA和等价类的软件测试用例设计方法研究与应用", 《现代电子技术》 * |
楚书来;李卫丽: "基于等价类划分的黑盒测试用例设计与实现", 《电脑知识与技术》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107291620A (en) * | 2017-06-30 | 2017-10-24 | 郑州云海信息技术有限公司 | A kind of method for generating test case and device |
CN109614335A (en) * | 2018-12-10 | 2019-04-12 | 艾瑞克·李 | Module ash box behavior specification and grey box testing case designing method |
CN109614335B (en) * | 2018-12-10 | 2021-10-15 | 艾瑞克·李 | Module ash box behavior specification description and ash box test case design method |
CN110334009A (en) * | 2019-05-28 | 2019-10-15 | 中国平安人寿保险股份有限公司 | Automatic example generation method, device, terminal and storage medium |
CN113190436A (en) * | 2021-04-20 | 2021-07-30 | 北京异乡旅行网络科技有限公司 | Test case generation method and device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN104461875B (en) | 2018-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Sauquet et al. | Key questions and challenges in angiosperm macroevolution | |
Münkemüller et al. | From diversity indices to community assembly processes: a test with simulated data | |
CN104461875A (en) | Method for designing software testing case according to equivalence classes | |
CN104484162B (en) | A kind of software test case designs write method | |
CN106598827B (en) | Extract the method and device of daily record data | |
CN111174370A (en) | Fault detection method and device, storage medium and electronic device | |
CN105302719A (en) | Mutation test method and apparatus | |
CN106021101A (en) | Method and device for testing mobile terminal | |
CN109409531A (en) | A kind of machine learning method, device and equipment based on serializing file | |
CN102566988A (en) | Test case automatic generation method based on use utilization procedure digraphs and test method | |
CN105389200A (en) | Multi-group stimulation batch simulation method and system applied to super-large scale chip verification | |
CN104536882A (en) | Error locating method based on frequent sub-graph mining | |
CN102567190A (en) | Automatic test case generating method and testing method based on weighted directed graphs of user use flows | |
CN105488614A (en) | Accounting teaching demonstration system for practical simulation module | |
CN103853554A (en) | Software reconstruction position determination method and software reconstruction position identification device | |
CN103699682B (en) | Method for verifying structural logics of databases | |
Noel et al. | Finite Mixture Models for an underlying Beta distribution with an application to COVID-19 data | |
TW201721434A (en) | Computer program product applicable to automatic generation of software testing data and method thereof capable of making sure each functional module can access accurate testing data for testing | |
CN102436525B (en) | Method for automatically repairing hold time violation in multi-node parallel mode in integrated circuit designing process | |
CN108985493A (en) | A kind of ground class variation prediction method based on self-adapting changeable filter | |
CN104715112A (en) | Batched drilling method | |
CN103150254B (en) | Error locating method for software based on state-dependent probabilistic modeling | |
CN105930260A (en) | Method and apparatus for testing system availability | |
Chen et al. | Multi-level behaviours in agent-based simulation: colonic crypt cell populations | |
CN106547274A (en) | A kind of state machine method of testing based on scene matrix |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP02 | Change in the address of a patent holder |
Address after: 523808 19th Floor, Cloud Computing Center, Chinese Academy of Sciences, No. 1 Kehui Road, Songshan Lake Hi-tech Industrial Development Zone, Dongguan City, Guangdong Province Patentee after: G-Cloud Technology Co., Ltd. Address before: 523808 No. 14 Building, Songke Garden, Songshan Lake Science and Technology Industrial Park, Dongguan City, Guangdong Province Patentee before: G-Cloud Technology Co., Ltd. |
|
CP02 | Change in the address of a patent holder |