In this week's software testing lesson we learned the equivalence class partitioning method, and in this work further familiar with the application of this method, using this method to study the editbox use case.
Functional Requirements:
Allow 1 to 6 English characters or numbers, press OK to end
Valid equivalence classes:
Length: 1 to 6
Character: a-z,a-z,0-9
invalid equivalence class:
Length: 0,7
Characters: English/numeric characters, control characters, punctuation
equivalence class partitioning:
|
Valid classes |
Invalid class |
Length |
1 to 6 |
0,7 |
Character |
A-z,a-z,0-9 |
English/numeric characters, control characters, punctuation |
test Case:
Number |
Input |
overriding equivalence classes |
Output |
Test1 |
123456 |
Length 1 to 6, character 0-9 |
Enter the correct |
Test2 |
123abc |
Length 1 to 6, character 0-9, A-Z |
Enter the correct |
Test3 |
|
Length of 0 |
Please enter a character with a length of 1-6 |
Test4 |
1234567 |
Length 7, character 0-9 |
Please enter a character with a length of 1-6 |
Test5 |
Abcdefg |
Length is 7. Character A-Z |
Please enter a character with a length of 1-6 |
Test6 |
123! |
Length 1 to 6, English/numeric characters, control characters, punctuation |
Only English characters and numbers are allowed |
Code and results:
This experiment would like to use the Java language to achieve, but there is a period of time useless some unfamiliar, instead of using JSP language to achieve.
Here is the code:
The results are as follows:
The editbox of application of equivalence class partitioning method