Novice must see: How to write a qualified test case?

Insert picture description here


Summary

Some time ago, a lot of little cuties left us a message and wanted to know how to write a qualified test case.

Let's learn how to write a qualified test case together!

1. What is the test case?

Test case refers to the description of the test task for a specific software product, which reflects the test plan, method, technology and strategy.

Simply think that a test case is a set of test inputs, execution conditions, and expected results prepared for a particular goal to verify whether a particular software requirement is met.

2. What are the necessary factors for test cases?

Preset conditions, execution steps, expected results, test results; Use case key points: Need to include the coupling relationship with other modules, the level of the use case (level0, level1), consider which requirements must be completed, and which requirements can be completed subsequently.

3. What are the methods for writing test cases?

Knowing what a test case is, how to write a test case? Don't worry, let's first learn about the methods of test cases.

Part 01

Equivalence class division

Divide all possible input data (valid and invalid) in the test into several equivalence classes. Then select representative data from each part as test cases for reasonable classification,The test case is composed of representatives of valid equivalence classes and invalid equivalence classes, so as to ensure the integrity and representativeness of the test cases.

Part 02

Boundary value

The boundary value is a supplement to the equivalence class. Test work experience tells us that a large number of errors are caused by the boundary value of input and output.

We also take the above example, an input box requires a number between 1 and 10,000. We need to test whether it exceeds this range, such as: 0, -1, -2, 1000, 10001, etc., to determine whether it exceeds our range.

Part 03

Cause and effect diagram

Graphically represent the various combinations of inputs, write out the judgment table, and design the corresponding test cases. The final result is the judgment table, which is suitable for checking various combinations of program input conditions.

Example: There is a design of a test case for a vending machine software that deals with drinks with a unit price of 5 cents. The specifications are as follows: if you put in a coin of 5 cents or 1 yuan and press the button of [Orange Juice] or [Beer], the corresponding drink will be delivered. If there is no change in the vending machine, a red light showing "finished change" will be on. At this time, after inserting a 1 yuan coin and pressing the button, the drink is not delivered and the 1 yuan coin is also withdrawn; if there is change, then The red light showing [finished change] is off, and the 5 dime coin will be refunded when the drink is delivered

Analyzing the cause and effect diagram is as follows:

Of course, in addition to the above several commonly used ones,Other methods include: state transition diagram, process analysis method, orthogonal verification method, etc.

When I was visiting the blog garden, I saw a limericks poem and I thought it was very suitable:

All inputs are equivalent

Given range plus boundary

Conditional isolation wants to determine

Specify the constant to be orthogonal

Cross-border operation process method

Multiple state transition diagram

Conditions combine cause and effect

4. How to write test cases?

Dang Dang Dang ~ finally came the main event, let's look at how to write a qualifying test it.

This is a picture of the login page:

Number: The serial number that uniquely identifies the use case. It is generally a number or a combination of module letters and numbers. For example: L001, L means login, 001 means use case serial number

Module: The name of the tested functional module, such as: login module

Use case name: What does this use case mean and what it does. Such as: input account

Prerequisites: The prerequisites for executing the use case. Such as: registered users can log in

Test steps: describe your test process in detail and completely

Expected results: results that would occur under normal circumstances

Actual results: actual measured results (may not match the expected results)

In addition, some companies may require priority, tester's name, test date, etc. to be added to the end of the use case. This depends on the actual situation of the company.

I wrote a test case for the login module based on the login page above, as shown in the following table, you can refer to it:

5. What to write test cases?

Test cases can be presented in Word or Excel, and the main tools used are Zen Tao, testlink, etc.

In general, while the testing industry has become the “new favorite” of the IT industry, the industry’s threshold is constantly increasing. Writing test cases is just the most basic skill, and there is a long way to go. The Superior Academy will accompany everyone in testing. Go down the road.


Finally: a wave of welfare for Internet testers

In the technology industry, you must improve your technical skills and enrich your practical experience in automation projects. This will be very helpful for your career planning in the next few years and the depth of your testing technology.

In the interview season of Golden 9th and Silver 10th, job-hopping season, organizing interview questions has become my habit for many years! The following is my collection and sorting in recent years, the whole is organized around [software testing], the main content includes: python automation test exclusive video, Python automation details, a full set of interview questions and other knowledge content.

May you and I meet and you will find something! If you want to exchange experience in software testing, interface testing, automated testing, and interviews. Follow the WeChat public account: [Sad Spicy Article] Receive a 216-page software test engineer interview book for free. And the corresponding video learning tutorials are free to share!

Recommend good articles:

What exactly should I learn in automated testing?

Why not consider Tencent when quitting? Talk about a little bit of the past between me and the goose factory

Which is more advanced, automated testing or manual testing?

Guess you like

Origin blog.csdn.net/weixin_50829653/article/details/112987303