Software Testing--the basic concept and practical application of equivalence class division

Source: Internet
Author: User

In this week's Test course, we learned a method of black-Box testing: equivalence class partitioning

The basic concept of an equivalence class

1. The so-called equivalence class refers to a disjoint subset of the input fields, and the set of all equivalence classes is the entire input domain. The goal is to test the non-redundancy of the use case.

  

2. Two cases of dividing equivalence classes (valid/invalid)
(1) Effective equivalence class: whether the test program realizes the specifications of the pre-defined functions and performance.
(2) Invalid equivalence class: Check whether the software function and performance of the implementation of the specification does not meet the requirements of the place.

3. Common principles of equivalence class partitioning
(1) divided by interval
(2) divided by numerical value
(3) divided by numerical value set
(4) by restrictive conditions or rules
(5) Subdivision equivalence class

4. Several methods of equivalence class partitioning

(1) divided by interval: You can determine a valid equivalence class, two invalid equivalence class.

(2) divided by numerical value
If the input criteria specify a set of possible values for the input data, and the program handles each value differently, you can divide a valid equivalence class for each value and divide an invalid equivalence class.

(3) divided by numerical value set
A set of input values is specified in the specification, a valid equivalence class can be determined and an invalid equivalence class is divided.

(4) by restrictive conditions or rules
The specification specifies the rules and restrictions that the input data must adhere to, and a valid equivalence class (conforming to the rules) and several (≥1) invalid equivalence classes (violation rules at different angles) can be established.

(5) Subdivision equivalence class
If we are sure that the elements (examples) in an equivalence class that have been divided are treated differently in the program, then the equivalence class should be further divided into smaller equivalence classes.

Two test Cases
Title: Allow 1 to 6 English characters or numbers, press OK to end

Valid equivalence classes: Length: 1 to 6 characters: a-z,a-z,0-9
Invalid equivalence class: Length: 0, 7 characters: English/numeric characters, control characters, punctuation

Step1. Equivalence class Partitioning

Valid equivalence classes Invalid equivalence class
Length: 1 to 6 Character: a-z,a-z,0-9
Length: 0,7 Characters: English/numeric characters, control characters, punctuation

Step2. Test Cases

Number Input character Expected output
1 A Valid input
2 Z Valid input
3 z02345 Valid input
4 Za Valid input
5 Zzzzzzz Invalid input
6 ,, Invalid input
7 Space Invalid number in
8 * Invalid input
9 ZZZ000 Valid input
10 t0y Valid input
11 !!! Invalid input
12 !!!!!!! Invalid input
13 Uyueiuwy Invalid input
14 008899 Valid input

Software Testing--the basic concept and practical application of equivalence class division

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.