What do you call automated testing? How to improve the coverage of automated tests? Automated testing quick...


Preface

Automated testing has always been the core skill of testers and one of the important means of testing.
Especially in this year's so-called Internet winter market, major companies have very high requirements for the technical level of testers, and the technical level of testers is mainly concentrated in the three major areas of automated testing.

In addition, the writing of test auxiliary scripts, the development of test tools, the development of test platforms, etc. For ordinary testers who want to quickly improve their skills, automated testing must be an impeccable choice.

Automated Testing Quickly

Since the industry now has higher requirements for automated testing, many students have begun to learn automated testing.

However, I don’t have enough understanding of automated testing. I understand the automated testing framework and can write one or two test cases in a language. I consider myself an automated tester. According to the requirements for finding a job, the salary and remuneration are quite high.

Automated testing is a complete set of testing theory. It is not something that can be mastered by writing test cases with the help of an automated testing framework.

If you want to learn, you still need to lay a solid foundation, master a coding language, learn the corresponding automated testing framework, then understand the principles of automated testing implementation, master the automated testing design architecture, and plan in advance for what you want to do in the future. ;
One or two months of study is just an introduction, and long-term practice is still needed to accumulate and accumulate skills.

After clarifying the misunderstandings of automated testing, let's analyze how testers should treat automated testing correctly. First of all, you must have a clear understanding of automated testing. Automated testing is an essential skill for testers. Unless you want to work in a company for a few years and then switch careers without testing, your testing path will inevitably be affected. .

1. Learn automated testing correctly

I won’t discuss whether you should learn automated testing here. This is a necessary ability. In this case, we still need to master this ability, but we cannot be blind.

Don't think that automated testing will become a necessary capability, so you will learn all about interfaces, WebUI, and Apps, whether it is Java or Python, as this will become more and more confusing.

First, you must choose a language system, such as java or python, and master the basic capabilities of the corresponding language;

Secondly, arrange the learning sequence, such as learning interface automated testing first, then WebUI automated testing, and then App automated testing. When you can implement automated testing, you need to improve your capabilities, learn the architecture design of automated testing, implement continuous integration, etc., and work step by step and work steadily.

2. Implement automated testing according to actual work needs

Learning must be combined with actual work to improve better. If a company has automated testing-related technology construction, it is a good development platform.

If the company does not have the investment in this area, we need to start automated testing from scratch. How to do automated testing from scratch?

1) Analyze the purpose of automated testing, pre-release regression testing or online product monitoring, etc.;
analyze past problems encountered and what problems can be avoided if automated testing is adopted, and use data to convince leaders to promote the implementation of automated testing.

2) Analyze and select the scope of use cases covered by automated testing. Automated testing is either regression testing or online data monitoring, so not all test cases need to be converted into automated tests.

Select test cases that cover the core business, or pre-process functional test cases according to test requirements, such as using the shortest path algorithm to select test cases with higher coverage and convert them into automated test cases to improve automated testing Use case coverage.

3) Discuss the participants in automated testing implementation. Do you implement the automated testing project alone, or do you have team members involved in the implementation?

If you are an individual, you should choose a knowledge system you are familiar with to implement it. If you are a team, you should consider the technical level of the team members and choose the technology stack with the lowest conversion cost to ensure the highest input-output ratio.

4) Make technical selection based on the participants. Based on the confirmed automated test implementers, make technology selections, such as using the Java language or the Python language?

Of course, the automated testing framework is fixed, such as python+requests, java+HttpClient for interface automation; WebUI automated testing is Webdriver; App automated testing is Appium, etc.

5) Design automated testing architecture. No matter how you choose the technology stack for automated testing, before you start writing automated tests, it cannot be a simple list of automated test cases. You need to design the automated test architecture first.

Choose PageObject mode or data-driven mode?

Encapsulate public functions, design test case management, test data management, test case sets, logs, test report management, etc.

6) Write and schedule automated test cases. According to the scope of coverage that the previously selected automated test cases need to cover, the corresponding test cases are converted into automated test code.
In the process of writing automated test cases, we constantly improve the encapsulation of public functions, schedule and write automated test cases.

7) Based on the purpose of automated testing, set automated test execution strategies and implement continuous integration. After writing automated test cases, organize the test case set according to requirements and set the execution strategy for the automated test case set.

With the help of task scheduling tools such as Jenkins, continuous integration can be implemented, such as triggering the execution of automated tests after development and testing, and performing regression tests; or setting up scheduled tasks to regularly execute automated tests in the corresponding test environment to monitor business processes.

8) Specify later maintenance and expansion strategies. Automated testing requires constant maintenance to ensure its availability, such as optimizing the objects under test, reorganizing the architecture, adding new functions, etc. The corresponding automated test cases need to be optimized to ensure the timeliness of automated testing.

At the same time, designated corresponding personnel need to be trained, perform regular maintenance, maintain and write corresponding documents, and do a good job in technology accumulation and inheritance.

Improve automated test coverage

The most important thing when implementing automated testing is to ensure its usability. Many students have written many automated test cases, but feel that their usability is not high. The reason is not the problem of automated testing itself, but the lack of thorough consideration when implementing automated testing.

1. Introduce automated testing where appropriate

Before the company's business develops stably, or when products change frequently, automated testing is done for automated testing. At this time, the failure rate of automated testing will be very high. Not only will the maintenance cost be high, but the purpose of automated testing regression and monitoring will not be achieved.

As a result, automated testing will be abandoned or the role of automated testing will be doubted. At this time, don't rush to introduce automated testing. If you really need to introduce automated testing, you need to set the test granularity to be coarser, covering the core and business lines that have not changed much.

2. There is no overall planning for automation architecture design

Automated test cases cannot be a simple collection of test cases. If individual automated test cases are put together to form an automated test project, the later management and execution will be quite complicated.

The input-output ratio is far from expected, and this is not a normal implementation process of automated testing projects. Under normal circumstances, you need to first design the architecture of the automated test project, select the appropriate design pattern, design the code in a layered architecture, and independently select the set of test cases to be executed.

3. Unreasonable selection of test cases

Before implementing automated test cases, there was no reasonable selection of test cases, and manual test cases were converted into automated test cases one by one.

If this is the case, the test case coverage will definitely not be comprehensive. Therefore, it is necessary to make reasonable selection of test cases in the early stage and perform intelligent processing, such as selecting test cases for core business according to business needs;

Or as mentioned earlier, use the shortest path algorithm to select a set of test cases with higher coverage. First analyze the use case coverage from the perspective of use case selection, and then convert it into automated test cases, so as to better improve the automated test case coverage.

There are many test development students engaged in automated testing, but the corresponding levels are also different, ranging from T3 to T6. The automated testing projects they implement have their own strengths, which also shows that there is a lot of room for improvement in automated testing technology.

Therefore, you must calm down and constantly improve yourself. Don't feel that you are very capable just after learning automated testing, or always say that your testing development has encountered a bottleneck. Continuously lay a solid foundation related to testing technology, improve the knowledge system, improve problem-solving abilities, and broaden your horizons to advance step by step.

Commonly used automated testing frameworks:
interface automated testing direction: Python+requests+pytest+yaml+alluer+Jenkins;
web automated testing direction: Python+selenium4+pytest+POM+allure+Jenkins;
app automated testing direction: Python+appium+POM+ pytest+allure+Jenkins;

The following is the most comprehensive software testing engineer learning knowledge architecture system diagram in 2023 that I compiled.

1. Python programming from entry to proficiency

Please add image description

2. Practical implementation of interface automation projects

Please add image description

3. Web automation project actual combat

Please add image description

4. Practical implementation of App automation project

Please add image description

5. Resumes of first-tier manufacturers

Please add image description

6. Test and develop DevOps system

Please add image description

7. Commonly used automated testing tools

Please add image description

8. JMeter performance test

Please add image description

9. Summary (little surprise at the end)

Overcoming thorns and thorns, keep moving; move forward bravely and shine brightly. Difficulties are not something to be afraid of, but challenges need to be faced bravely. Persevere and move towards glory; rush with passion and create legends. Dreams burn the fire in your heart and work hard to create a brilliant life! Strive for eternity and achieve extraordinary results!

Brave pursuit, burning passion, and struggle are the only ways to achieve success. Keep your feet on the ground, not afraid of wind and rain, and only hard work can create miracles. Stick to your beliefs, surpass yourself, and write your own glorious chapter! Keep struggling, the future is defined by you!

Struggle is the background of life, and hard work is the melody of youth. Don’t forget your original intention, move forward bravely, and water your ideal garden with your sweat. Suffering creates perseverance, struggle lights up brilliance, and let the future fall for you! More than just struggle, achieve eternity!

Guess you like

Origin blog.csdn.net/m0_60054525/article/details/132131549