For software test cases, we have many methods, such as equivalence class partitioning method, boundary value analysis method and causality diagram method. There are different ways to think differently, so we have to learn to use test cases reasonably to achieve the results we expect.
Take a question as an example:
EditBox
Allow 1 to 6 characters or numbers, press OK to end.
Analyze its valid equivalence classes:
Length: 1 to 6
Character: a-z,a-z,0-9
Parse its invalid equivalence class:
Length: 0,7
Characters: Characters outside of English and numerals, control characters, and punctuation
Based on the above analysis, we can design its test cases:
| Number |
Test Cases |
Results |
| 1 |
1 |
True |
| 2 |
123 |
True |
| 3 |
123456 |
True |
| 4 |
1234567 |
False |
| 5 |
Null |
False |
| 6 |
A |
True |
| 7 |
Abc |
True |
| 8 |
ABCdef |
True |
| 9 |
Abcdefg |
False |
| 10 |
A |
True |
| 11 |
Abc |
True |
| 12 |
ABCDEF |
True |
13 |
ABCDEFG |
False |
The above use case not only takes into account the equivalence class partitioning method, in which the numbers 1, 3, 6, 8, 10 and 12 also take into account the boundary value analysis method, I think more reliable and effective test cases, I hope there is worth reference to the place.
Test cases of software testing