How to do automated testing? How can interface automation testing be done well?


foreword

Common frameworks for interface automation testing: Python+requests+pytest+yaml+alluer+Jenkins;

The purpose of interface automation testing?

The main purpose of automated testing is for regression testing. When the code changes, it may affect the logic that should not be changed. At this time, in order to confirm this situation, regression testing is required.

Sometimes the scope of the regression test is relatively large. If the test is all done manually, once or twice is acceptable. If you do it every time, not to mention the labor cost, the testers who repeatedly execute the same test cases will also complain.

Through the interface automation test, the verification that is not easy to do by manual test can be realized, such as the sorting of a large amount of data in the verification interface, and the comparison of multiple fields. If all are done manually, the efficiency problem is unacceptable.

It is difficult to fully verify the functional logic by hand, and some abnormal and extreme scenarios are difficult to construct by hand. At this time, if we understand the internal logic of the interface, we can trigger the internal logic of the interface by using scripts to construct such scenarios purposefully, so that It is relatively easy to verify and test these logics.

The regular automatic test for the online interface can start a certain monitoring function. When there is a problem with the interface function, it can be found in time through the regular patrol test.

required skills

First of all, we must have a considerable understanding of the business. If we want to design a good interface automation test case, we must have a deep understanding of the business, because there will be a certain amount of investment in the early stage of interface automation. If we can focus our limited investment on the business The core function points in it will have the effect of getting twice the result with half the effort.

The second is to have the basic test design skills used in the design of functional test cases. Automated testing is the same as functional testing. .

Finally, there are some coding capabilities and architectural design capabilities.

What should I pay attention to?

Since there is a certain cost to carry out interface automation testing, there is actually a trade-off in writing interface automation test cases.

If the test case is written in detail, we have tested every function point in the interface and even every branch path is covered, then it will be particularly dependent on the logic of the code under test. If the logic of the code under test changes slightly, the test case may It will fail to execute.

If the content of our test case verification is not so detailed, it is possible that even if the logic of the tested code changes, the execution of the test case is not easy to fail. At this time, it is possible to miss the real bug caused by the code change.

Therefore, to carry out automated testing, it is necessary to find a balance point, especially to cooperate with other levels of testing, such as unit testing, UI automation testing, manual testing, etc.

We can define a set of layered test specifications in advance, that is, which logic should be guaranteed by interface automation test, which logic should be guaranteed by UI automation test, and which logic should be guaranteed by manual test. When we conduct tests at different levels, we can cooperate with each other to achieve a higher test coverage.

There is no unified standard for this specification, and it is also set according to the actual business, resources, manpower and other factors of your team.

Finally, the interface automation test case actually has a life cycle, from generation to modification to discarding. The value of an automated test case can only be exerted within its life cycle, so we must extend its life cycle as much as possible, and reduce the cost of case generation and modification as much as possible, so the entire automated test case must be managed.

Speaking of management, we have to talk about metrics. Some metrics about automated testing are listed for your reference:

The total number of cases;
the amount of case changes;
code coverage;
manpower input;
the number of single/all case executions;
the number of problems found in single/all cases
;

When we carry out automated testing, we need to adjust the automated testing plan and strategy by analyzing the above indicators and the trends of these indicators over a period of time.

The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled

1. From entry to mastery of Python programming

Please add a picture description

2. Interface automation project actual combat

Please add a picture description

3. Actual Combat of Web Automation Project

Please add a picture description

4. Actual Combat of App Automation Project

Please add a picture description

5. Resume of first-tier manufacturers

Please add a picture description

6. Test and develop DevOps system

Please add a picture description

7. Commonly used automated testing tools

Please add a picture description

Eight, JMeter performance test

Please add a picture description

9. Summary (little surprise at the end)

Only by persevering can we usher in the dawn of victory; only by making continuous progress can we see our own growth; as long as we have faith and perseverance, there are no difficulties that cannot be overcome. So, let us muster up the courage and work hard towards the goal!

As long as you have dreams and pursuits, don't give up your efforts. Every step counts, and every step requires effort and sweat. The success of others does not mean your failure. Go forward bravely and believe that you will be able to succeed. Do your best and make hard work an eternal theme.

No matter how many difficulties and challenges you encounter, you must persevere, because only through wind and rain can you see the rainbow, and you can only get rewards if you pay. Believe in your ability, go forward bravely, and keep working hard, success is not far away!

Guess you like

Origin blog.csdn.net/x2waiwai/article/details/131228205