Writing method of function test case
From: 51cmm.com
Author: snowers Issue Date: 2004/07/26 source of functional testing test case 1, that is the main source of demand for testing test cases are: 1) demand explanation "and related documents 2) related to the design specifications (outline design, Detailed design, etc.) 3) A record of the development group exchanges (can be an explanation of the developer) 4) It has been fundamentally molded UI (can be targeted to supplement some cases) In short, all you can get The project documentation is tryable to get it. From the obtained information, a number of small "function points" is decomposed, understand the "function point", write the corresponding test case. 2. Organized or different companies have different companies Practice, in principle, as long as it is convenient for management and tracking, how to organize it. Use the case can be organized according to the large function block, such as the use case of the query function module, can organize the test case of the module, can be organized. In the case where there is no dedicated test case management tool, two states are generated after the use case is executed: "pass", "failed" - thus plus "unforgettable" case, a total of 3 states. After the use case is executed in an example, the use case status should be "failed" or "pass". Organize the use case of the same state. As for the example file format, can be .doc or .xls (if there is a special test Use an example management tool to another matter). 3. Use examples with other materials, that is, how to solve the problem with the problem test case, the more risks faced by the test case: the change of the demand, the modification of the design, the error and omissions of demand, etc. Since the main source of the use case is a description of the demand and design, the tracking of the use case is actually a change in test cases, demand and design changes, will cause changes in test cases. As mentioned, the function point number of decomposition With the corresponding use case. For example, you can list a table, list the association relationship between the various (numbered) function points and test examples. This way, you only need to track "function point when the demand and design changes "Whether it changes, does it increase a new function point. Importance and difficulty, the information and information of the hand must be the latest. 4. A good example of the expression, that is, the information that should be included in the case, an excellent test Use case, the following information should be included: 1) Software or item Name 2) Software or project version (internal version number) 3) Function Module Name 4) Simple description of the test case, ie, the purpose or method 5) test Reference information (easy to track and refer to) 6) This test case is dependent on the dependency of other test examples 7) The pre-condition of this example, that is, the condition of the implementation of this example must be met, if the access to the database 8) No. (ID) of the use case, if it can be a software name, a short-term screen . 9) Steps, step description, test data description 10) Expected results (this is the most important) and actual results (if there is a bug management tool, this can be omitted) 11) Developers (must be) and testers ( There is no) 12) Test execution date 5. An example of a test case is given. This example already contains a template for test cases.
Project / Software Technology Export Contract Network Application System (Enterprise End) Program 1.0.25 Function Module Name Login Prepared People XXX Sample No. - TC-TEP_LOGIN_1 Compilation Time 2002.10.12 Related Use Example Related Useless Demolition Features User Authentication Test Detection Verification Enter the legal information, allow legal logins to prevent illegal landing preset conditions without special procedures, such as database access, reference information requirements, instructions for "landing" test data User name = yiyh password = 1 operation step operation Description data expectation results Actual results actual results test status
1 Enter the user name and press the "Login" button. Username = yiyh, password is empty display warning message "Please enter the username and password!" 2 Enter the password, press the "Login" button. User name is empty, password = 1 Display warning information "Please enter username and password!" 3 Enter the username and password, press the "Login" button. Username = yiyh, password = 2 Display warning information "Please enter the username and password!" 4 Enter the username and password, press the "Login" button. Username = xxx, password = 1 Display Warning Information "Please enter the username and password!" 5 Enter the username and password, press the "Login" button. Username = xxx, password = 2 Display warning information "Please enter username and password!" 6 Enter the username and password, press the "Login" button. Username = empty, password = empty display warning message "Please enter the username and password!" 7 Enter the username and password, press the "Login" button. Username = yiyh, password = 1 Enter the system page. 8 Enter the username and password, press the "Login" button. Username = admin, password = admin enters the system maintenance page. 9 Enter the username and password, press the "Login" button. Username = yiyh ', password = 1 Display warning information "Please enter the username and password!" 10 Enter the username and password, press the "Login" button. Username = yiyh, password = 1 'Display warning information "Please enter username and password!" 11 Enter the username and password, press the Reset button. Username = yiyh, password = 1 Clear input information tester developer project leader
Remarks: This use case does not consider the input of "corporate code"; the test case does not cover all illegal inputs, such as illegal inputs may have
"User = *, PW = *" combination, the default operation of the carriage return, the space input, the processing of the processing of the input overflow (may skip authentication), and so on.
If you are interested, you can at least add 5-10 input combinations.
(Of course, if the step exceeds 15 steps, the easy operationality of the use case is reduced, and you can create a test such as TC-TEP_LOGIN_2).