The design of software test cases plays a self-evident role in testing. It is the basis for a good test and one of the most challenging tasks. We hope to use a series of classic or exquisite test cases to train employees or share experiences.
The advantages of test cases are as follows:
- One test case can be used with a single click
- Areas or boundaries that are hard to perceive
- Improves test efficiency
- It can solve technical difficulties, operational complexity, or difficult environments.
- Use development tools to complete testing
- ......
-------------------- Example 1 --------------------------------
1 program som (maxint, N: INT)
2 int result: = 0; I: = 0;
3 if n <0
4 then N: =-N;
5 while (I <n) and (result <= maxint)
6 {I: = I + 1;
7 result: = Result + I;
8}
9 If result <= maxint
10 then output (result)
11 else output ("too large ")
12 end.
With two sets of data (two test cases), we can cover all the branches:
Maxint = 10, n = 3
Maxint = 0, n =-1
-------------------- Example 2 --------------------------------
Currently, there are many email tests. You need to test the input of different email addresses, for example:
Abc@x.com, AB .c@xy.com, a_ B _c@x.com, ABC @ xy., ABC @. com, abc2xy.com, ABC @ xy.com ,...
One is to use a script to implement automatic data-driven testing, and a simple method is to enter the Word documents, including the mail title, subject (content), etc,
|
«Last name»
|
«First name»
|
«Job title»
|
«COMPANY»
|
«Business phone»
|
«Business Fax»
|
«Email address»
|
Use the Mail Merge function of word to automatically test the sending of many emails.
----------------------- End --------------------------------------------------
Thank you ......