How to write an effective test case _ test

Source: Internet
Author: User
Tags function definition
A test case is a document about a specific test step that describes the input parameters, conditions, and configuration of the test, the expected output, and so on to determine whether the software being tested is working properly. Designing, writing, and executing test cases are an important part of the test activity, and test cases are typically managed by a test case management system or tool. First, the principle of writing test cases the importance of test cases is beyond doubt, it is the core of the whole process of software testing, is the basic basis for testing the implementation of the link. Test case writing should follow the principle: 1, test cases to achieve maximum coverage of the software system function points. Test engineers should test the preparation of the program after the completion of the development phase to write test cases, reference requirements specifications and software function points to the operation of each function point of refinement, as far as possible to the maximum demand coverage. 2. Test cases should have an accurate definition of test function points, test conditions, test steps, input values, and expected results. 3,   test cases should be designed to include various types of test cases. In the design of test cases, in addition to meet the basic functional requirements of the system, we should also consider all kinds of anomalies, boundary conditions and the ability to withstand pressure. 4,   test case management. Use a test case management system to manage test cases. A good test case should have a higher likelihood of discovering an error that has not been discovered. A successful test case can find an error that has not been discovered, usually a good test case has the following characteristics: 1,   the probability of a high discovery error 2,   No redundancy test and redundancy steps 3,   test is "best category" 4,   is neither too simple nor too complex 5,   cases are reusable and easy to track. 6,   Ensure that the system can meet functional requirements test cases can not be designed seamlessly, it is not possible to fully meet the coverage of software requirements, the test execution process will certainly find that some test path or data in the use case is not reflected, then should be added to the use case library, to facilitate others and subsequent versions of the test. Second, how to write test case test cases have a lot of information, can be added or deleted according to the actual situation, in general, a good test case should contain the following information: 1, product related information (1)        Name of the SOFTWARE PRODUCT or project (2)        version of the SOFTWARE Product or project (3)        function module name (4)        function Description(5)        test Platform These information recommendations can be manually selected in the test case. 2. Basic record information (1)        test Case Warehousing (2)        test Case Warehousing Time (3)         test Case Update (4)        test Case Update time these information recommendations can be automatically generated by test cases. 3. Properties of test Cases (1)        test case ID: ID of test case (automatically generated by case management system, easy to track Management) (2)         test Case Name: Test Case Name (3)        test function point: Test function Checkpoint (4)         Test Objective: The test function point of the test purposes (5)        Test level: Master path test, smoke test, basic functional testing, detailed functional testing.       under the face of these test levels to explain: A,                       Master Path Test: The main function path of the important module and function in the control requirement, the main path test is the design probe module, Quick-Check the testability of the program (Testability also includes the success of the installation test) The main basis of test case B,                       Smoke test:The main path test case is a subset of smoke test cases, and smoke test is the main test case for regression test. C,                       basic function test: Control the basic function path of all modules and functions in the requirement and overall design, basic function test is the main basis of writing complete automatic test script to test the non important level module of software PRODUCT. D,                      Detailed functional testing: To test the various modules and functions of each module and function, various types, against the functional paths of all modules and functions in the overall design. The detailed function test case is the main basis for the key module, which is apt to happen the wrong module. (6)        test types: Functional testing, boundary testing, anomaly testing, performance testing, stress testing, compatibility testing, security testing, recovery testing, installation testing, interface testing, start/Stop testing, document testing, Configure testing, reliability testing, usability testing, and multiple language testing. (7)        Preset conditions: Description of the special conditions or configuration of the test (8)        Test step: Describe the test process in detail, with fewer than 15 steps recommended for the case. (9)        expected results: Expected test Results For example: if the current test of China Mobile Internet Short message gateway can send the correct text to the Chinese unicom Internet, test cases are designed as follows: (1)         test Case id:tc000001 (2)        Test Case name: China Mobile Global Mobile phone users successfully sent SMS to China Unicom mobile phone users (3)        testing function point: China Mobile fullThe successful status report of China Unicom Gateway (4)        test purpose: A,     .                 China Mobile Internet Short message gateway can correctly handle the global users sent to the Chinese unicom SMS; B,                      China Mobile Internet Short message gateway can correctly handle the status report of the return of the Chinese unicom internet Short message gateway successfully. (5)        Test level: basic function Test (6)        test type: Function Test (7)         preset conditions: Each gateway entity is connected according to the relationship of the network diagram, and the connection and communication between the entities are normal. (8)        test steps: A,                      GSM Mobile phone users (13901000001) to China Unicom mobile phone users (13001000001) to send MO text messages, content for "Test", the destination number is filled in China Unicom mobile phone number; B,                      China Unicom internet Short message gateway sent to China Unicom users after the success of the mobile Internet SMS Gateway to return a status report to identify success. (9)        expected results: A,                      China Unicom Mobile phone users (13001000001) received a text message, the content of the "test", the source number for China Mobile's global access to the user number (13901000001);                      in China Mobile internet Short Message network closed to produce SMO, where "short message sent status" fill in 0 (for success), "Source mobile phone number" for 13001000001, "Destination mobile phone number" for 13001000001. Third, the template of the test case is a complete template for the test case: Test case ID TC000002 test Case name Illegal user login Management Web product name Interconnection Gateway Product version V3.3.2 function module name Management Web test platform all use case warehousing smilings use case more New Smilings use case storage time 2006-5-30 use case update time 2006-5-30 test function point input wrong username and password test purpose to block illegal user login system Test level detailed function test test type function test Preset condition login username and password is admin/ Test Step 1, enter user name is admin, password is test% 2, press "Login" button to login Admin page expected results 1, the system refused the user login 2, prompted error message: "Sorry, your user password is incorrect, please reconfirm and login." The test case design process for a brand new product, the first thing to understand is the relationship between the product requirements document and the product module. Then you need to write a master path test case and a smoke test case from the requirements document that correspond to all requirements, and this time also includes some basic path test cases and even detailed test cases. At this time, because there is no direct use of the product experience, writing test cases to consider a wide range and not too elaborate. Continue to read Product function definition document, all function definition directly corresponding to write related test cases, this time, it is best to have a certain contact with the program itself, deepen the understanding of the program, in order to write better, more comprehensive test caseCases. Finally, in the actual test, we still need to expand, modify the previous test cases, get the complete basic function test cases and detailed test cases. If for a product that has a certain or a large number of cases, whether or not the tester is familiar with the product, the main task is to read, check the requirements and related changes, and then to the original case to understand, expand and modify. That is the reuse/reuse of the case.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.