How to Write Test Cases

Source: Internet
Author: User
Tags how to write test cases

TesterThe main test behavior is to discover PHP by running a pre-designed test case? Name = % C8 % ed % BC % Fe "> problems in the software are providedDevelopmentPersonnel, so that the software problems can be modified.
Therefore, test cases are used to discover software problems, but they are not the only method to discover problems. Generally, test cases are used to simulate operations performed by real users. Therefore, when designing test cases, we must consider the effectiveness, coverage, and execution efficiency.
Because of the wide variety of software systems, it is impossible to design a public template for use. Moreover, the purpose of the test case is to simulate user operations, so it is necessary to write flexibly without being in the same format.
Let's take a look at the following example:
A page contains some text, images, an input field, and two buttons.
This is what we can perceive on the surface. It can be called a test element or a test object.
Others are logical operations contained in these elements or objects.
Next we will consider how to write test cases:
From the perspective of UI testing: we should consider whether the layout of the entire page is reasonable; whether the images, text, input fields, and buttons displayed on the page are correct; and whether the image size is appropriate; whether the font, style, and color of the text are correct, whether there are misspelled characters in the text, whether the buttons and input fields are suitable, and so on.
SlavePerformance TestingAngle:
If the page contains a relatively large image, we can test the time response of multiple users simultaneously refreshing the page. In this way, when designing test cases, we can record the refresh time of one user, the refresh time of 10 users, the time of 50 users, and the time of refreshing of 100 users, the refresh time of 200 users. Record the time to determine whether the existence of these larger images can affect the page refresh speed.
If the page function is to store the content in the input fieldDatabaseWe can test how many users can store data correctly. In this way, when designing test cases, we can set a data size to be stored in the database in a short period of time. By analyzing the database information, we can obtain the effective range of input data stored in the database.
If we want to continuously guide this page to test the stability andReliabilityYou can also design a test case that contains this page.
From the perspective of functional testing:
You can test the functions of this page from several aspects. The correct method of data, the correct method of data error, the correct method of data error, and the wrong method of data error.
You can also use other pages to pass the correct data, or accept the data to pass it out to check the validity.
You can test the features of text fields for text fields.
You can test the features of two buttons. Then combine them for testing.
The above example shows how to write a test case depends on what you want to do, what the system is, and so on. Therefore, it is best to select a method that can cover the software and be as close to the test target as possible to write the case, and then supplement it with other methods.
In addition, we can develop a general specification that lists what a test case should generally contain:
Test Case No:
Simple Description: you can read the description to understand the main purpose and object of the test case.
Status: record the status after the test case is run, generally pass, fail, and block.
Execution date: Date on which the test case is tested
Product Version: the version in which the test case runs
CC % Ca % A6 ">Test Engineer: The engineer runs the test case.
Detailed Description: if you have some background information and necessary function descriptions, You can provide them to test engineers here.
Environment and settings: Provides test engineers with some special configuration methods andTest Environment
Operation steps and test points
In addition, we can create a table to track the status of these written test cases.
First, some people familiar with the system divide the functional areas, and then set the test points for this functional area. Then try to write the content to be tested for each test point. Enter the test description in the table. Other testers then write the tests. At last, some people Review the coverage and accuracy of features and test objects. In this way, it is easier to track the coverage and depth of existing test cases of the system.

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: 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.