In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
It has been more than ten years since the development of testing, the work of testing has been paid more and more attention by all aspects, and the requirements for testers are getting higher and higher. according to incomplete statistics, the automation requirements of test projects have reached nearly 50%. Automated testing has occupied a considerable position in the testing industry, and the requirements for automated testing are getting higher and higher, so it is even more necessary to improve the ability of testers. So today I would like to share with you some of the contents about automation.
It is well known that testing should be automated. Agile emphasizes test automation, but we often don't do enough, not fast enough, or maybe not at all. I think one of the main reasons for the lack of test automation is that we focus on the wrong level of automation. Most teams focus on unit testing and UI testing, but ignore service-level testing.
To illustrate why service-layer testing is so valuable, let's take a closer look at each layer of the test automation pyramid.
Unit testing
Unit testing forms the basis of the pyramid of test automation. Therefore, it should be the largest part of a reliable test automation strategy. Automated unit testing is great because it provides programmers with specific error data.
For example, if an automated unit test reports that "there is a BUG on line 56", the programmer may actually find the BUG near line 62, and the tester can only tell "there is a BUG while you are retrieving member records from the database", which means you may need to find the BUG in more than 1000 lines of code The advantage of automated unit testing is that it can greatly reduce the location of the scope of defects. In addition, because it is usually written in the same language as system development, programmers are more suitable for writing unit tests.
UI test
By contrast, we want to do as few UI automated tests as possible. Why? Because UI automated testing is more fragile, expensive, and time-consuming. For example, suppose we want to test a very simple calculator that allows the user to enter two integers and click a multiplication or division button to see the result.
To test through UI, we need to write a series of test scripts to drive UI, such as entering the appropriate data into each field, pressing the multiply or divide button, and then comparing the expected and actual values. This kind of test is useful, but not ideal.
In addition, testing an application in this way is partially redundant-think about how many times UI needs to be tested for such a set of tests. Each test case calls the code related to the multiplication and division button and the code that performs the function operation, and each test case also tests the code that displays the results, and so on. Testing through the user interface like this is very expensive and should be as few as possible.
Service layer testing
However, this does not mean that we do not need to test the features. We need to find an appropriate way to avoid UI executing tests, which is the origin of service-level testing in the test automation pyramid. In our testing approach, "service" refers to the response of an application to an input or set of inputs.
In our calculator example, two services are involved: multiplication and division. Service layer testing is the testing of application services independent of the user interface. So if we want to test more than a dozen multiplication test cases, we execute them not through the calculator's user interface but through the service layer. This is more efficient and less tedious than executing the same test case at the user level.
Automated unit testing is great, but it can only cover part of the application's testing requirements. UI testing is usually necessary, but should be used in small quantities. Service layer testing fills the gap between unit testing and UI testing, and meets the automated testing needs of the team with less workload and cost.
Although I would like to say that I hope this article can be helpful to you, after all, the knowledge that can be obtained by a single scan of an article is limited, and please treat it rationally. Maybe the knowledge I summarized is one-sided. If you have any good ways and methods, please leave a message in the comments area. Finally, I hope you can be unimpeded on the test road.
All right, after you have finished reading the article, I will share some information with you.
Information related to interface testing
Link: https://pan.baidu.com/s/1ojpoWnpxxReR1sO2Gxy_YQ password: dgfa
Data related to performance testing
Link: https://pan.baidu.com/s/1_oZhvOIRvcz0JGcCWUGT-g password: d82b
Introduction to software testing to improve e-books
Link: https://pan.baidu.com/s/1Fp8CFE0D2p0uAZk6xcexhQ password: exna
Data related to automated testing
Link: https://pan.baidu.com/s/1yeD1EMg-HalNuRBDODGx7g password: ofdg
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.