- Example--editbox
- Allow 1 to 6 English characters or numbers, press OK to end
- Valid equivalence classes and invalid equivalence classes
| Valid equivalence classes |
Invalid equivalence class |
| E1: Length: 1 to 6 |
T1: Length: 0,7 |
| E2: Character: a-z,a-z,0-9 |
T2: Characters: English, characters other than numbers, control characters, punctuation |
| Number |
Test Cases |
Expected output |
| 1 (E1,E2) |
A |
Valid input |
| 2 (E1,E2) |
Z |
Valid input |
| 3 (E1,E2) |
A |
Valid input |
| 4 (E1,E2) |
Z |
Valid input |
| 5 (E1,E2) |
0 |
Valid input |
| 6 (E1,E2) |
9 |
Valid input |
| 7 (E1,E2) |
Aaaaaa |
Valid input |
| 8 (E1,E2) |
Aaaaaa |
Valid input |
| 9 (E1,E2) |
000000 |
Valid input |
| Ten (E1,e2) |
Aa0aa0 |
Valid input |
| One (E1,T2) |
Space |
Invalid input |
| (E1,T2) |
Ff |
Invalid input |
| (E1,T2) |
, |
Invalid input |
| (E1,T2) |
Space (6) |
Invalid input |
| (E1,T2) |
FF (6) |
Invalid input |
| (E1,T2) |
,,,,,, |
Invalid input |
| (E2,T1) |
Null |
Invalid input |
| (E2,T1) |
Aaaaaaa |
Invalid input |
| (E2,T1) |
Aaaaaaa |
Invalid input |
| (E2,T1) |
0000000 |
Invalid input |
- Example--nextdata
- The Nextdata function contains three variables: Month,day,year, the output of the function is the day after the input date.
- The input variable month,day,year is required to be an integer value, and the following conditions are met:
- 1≤month≤12
- 1≤day≤31
- 1812≤year≤2012
- Equivalence class Partitioning:
| Valid equivalence classes |
Invalid equivalence class |
| M1:1≤month≤12 |
m2:month<1 |
|
M3:month>12 |
| D1:1≤day≤31 |
d2:day<1 |
|
D3:day>31 |
| y1:1812≤year≤2012 |
y2:year<1812 |
|
y3:year>2012 |
| Number |
Year |
Month |
Day |
Expected output |
| 1 |
1812 |
1 |
1 |
1812/1/2 |
| 2 |
1812 |
1 |
31 |
1812/2/1 |
| 3 |
1812 |
2 |
29 |
1812/3/1 |
| 4 |
1812 |
2 |
30 |
Date is illegal |
| 5 |
1813 |
2 |
28 |
1813/3/1 |
| 6 |
1813 |
2 |
29 |
Date is illegal |
| 7 |
1813 |
12 |
31 |
1814/1/1 |
| 8 |
2012 |
12 |
31 |
2013/1/1 |
| 9 |
1811 |
6 |
15 |
Year input is not in the legal range |
| 10 |
2013 |
6 |
15 |
Year input is not in the legal range |
| 11 |
1912 |
0 |
15 |
Month input is not in the legal range |
| 12 |
1912 |
13 |
15 |
Month input is not in the legal range |
| 13 |
1912 |
6 |
0 |
Day input is not in the legal range |
| 14 |
1912 |
6 |
32 |
Day input is not in the legal range |
| 15 |
1811 |
0 |
15 |
Year,month input is not in the legal range |
| 16 |
1811 |
6 |
0 |
Year,day input is not in the legal range |
| 17 |
1912 |
0 |
0 |
Month,day input is not in the legal range |
| 18 |
1811 |
0 |
0 |
Year,month,day input is not in the legal range |
|
|
|
|
|
Application of equivalence class partition method of "Software testing"