How to write test cases at work

As a tester, whether you are a senior testing expert or a newbie, you should know that writing test cases is one of the core tasks of our testing. Often, whether the test cases are written in a standard or not can best reflect the quality of our testers. gap, so how to write an excellent and high-quality test case?

First of all, if we want to write a high-quality test case that meets the needs, our most important step is to analyze our own needs first. Only by thoroughly analyzing the needs can we write excellent test cases. Generally, a requirements review will be conducted after the requirements are issued. At the requirements review meeting, we usually consider and analyze the feasibility of issuing the requirements through the functions, performance, data, interface, etc. of the software, and raise any objections to the product. Only by finalizing the objectionable demand points as soon as possible can the next step of work be carried out better.

After we participate in the requirements review, the next step is to formulate our test plan. In layman's terms, it means who will do what at what time and what will be produced in the end. That is, which modules the testers should test, within what deadline, and which documents should be submitted.

After formulating the test plan, we will start writing test cases. Generally, when we write test cases, we will use the test case method (equivalence class division method, boundary value analysis method, cause-and-effect diagram method, error speculation method, scene diagram method etc.) to write test cases.

picture

Equivalence class division method: Equivalence class division is generally divided into two different situations: valid equivalence classes and invalid equivalence classes. The effective equivalence class refers to reasonable and meaningful input data, which mainly tests whether the program can achieve the functions specified in the requirements. The invalid equivalence class refers to unreasonable or meaningless input data. It mainly detects whether the program will have abnormalities when inputting data that does not comply with the rules.

Boundary value analysis method: Boundary value analysis method is a supplementary method of equivalence class. It is mainly a black box testing method for testing the boundary value of input or output. Generally, a large number of errors occur at the boundary of input or output range. Therefore, designing test cases for various edge cases can detect more errors.

Cause-effect diagram method: Cause-effect diagram method is a method that uses graphical methods to analyze the relationship between input (cause) and output (result) to design test cases. It is suitable for checking various inputs and outputs of program conditions. combination situation.

Error speculation method: Error speculation method, as you can tell by the name, it is a method of guessing errors. This method has no fixed form and relies more on experience and intuition. Generally, we will not know it at work. Used unconsciously.

Scenario diagram method: The scene diagram method can be understood as a simulation based on software business scenarios. It generally uses a flow chart to simulate the user's operating scenarios in the process of using the software.

The above is the entire process of writing test cases. Generally speaking, as long as the test cases are written according to the method mentioned above, they must be high-quality test cases.

Finally, I would like to thank everyone who reads my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, if you can use it, you can take it directly:

Insert image description here

This information should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can also help you!   

Guess you like

Origin blog.csdn.net/nhb687096/article/details/132977528