One of the basic techniques for continuous integration that we learned earlier is automated testing. Integration can only be completed if the test passes; Automated testing ensures continuous operability. This is for the code section. There are also project-specific ones, such as unit tests, various regression tests, and so on. This article is about automated testing for the project part.
1. What is automated testing?
Automated testing, as the name suggests, automates testing. Through some automated testing tools or their own wheels to simulate the previous manual bit/write work and verify the results to complete the whole test process, such a test process, is automated testing.
2. How to automate tests?
Automated testing covers a wide range: unit testing, integration testing, interface testing, GUI testing and so on can be automated execution; At the same time, different systems are different. Some are suitable for or can do automatic testing of GUI, while others may only be suitable for automatic testing of interface. Therefore, it is necessary to consider the specific link of automatic testing for different tested projects.
For example, for search engines, the front end is often relatively simple, just a text box and submit button, most of the logic processing is completed at the back end, in this case, automatic interface testing can achieve twice the result with half the effort; If the system under test has a lot of page operations, consider automated testing of the GUI. Neither of these situations is absolute, and automated testing can be carried out at all stages if the testing resources are sufficient.
In addition, there is another point to consider the feasibility of automated testing. For example, for a system, GUI testing is the most appropriate and effective, but it may be difficult to achieve automated testing of GUI through various tools or scripts, so it needs to consider flexibility. Consider whether automated tests can be adjusted to interface tests or integration tests.
The implementation method is generally to use relevant tools.
3. Why automate tests?
1) Automated testing saves costs (according to the project) After all, automated testing does free up a lot of manpower (manpower is the biggest cost for IT companies), allowing machines to perform some repetitive work day and night.
2) Some test items are difficult to implement manually (manual cost is high), such as 12306’s pressure test and load test. It is not realistic to find so many people to test at the same time. It can be simulated by machines.
3) Project quality procedures such as version management need to build Verify to ensure that the code of Check in will not affect the version library. Similar to a smoke test
4. Advantages and disadvantages of automated testing
1) Advantages: Avoid fatigue of testers due to repeated work, improve test efficiency, ensure consistency and repeatability of each test, better use of unattended time to carry out some tests that cannot be carried out manually, and maintenance costs are relatively high
2) Disadvantages The system development time may not be shortened without manual testing defects found multiple UI layout issues are not easy to find
5. What kind of project is suitable for automated testing
Projects with the following characteristics are more suitable for automated testing (by automated testing, we mean unit testing and regression testing for the project. As for automated testing of continuous integration of code, any project should have) :
1) Less project changes 2) long cycle 3) sufficient project resources (automation is not completed by one person, but requires a group of people to maintain it for a long time)
Automated testing is not just a matter of do or don’t, but a matter of cost and effectiveness. Whether it is to make software, system or website, the ultimate goal is basically to make profits, to make profits must control costs, improve profits. Therefore, cost input must also be considered in the testing effort. How do you determine if your system is suitable for automated testing? Do you think the main consideration is whether the current project under test is long-term or short-term? If the tested project is to be continuously developed and maintained in the next six months or several years, then a large number of regression tests need to be repeated. In this case, an automated regression test system can save costs and investment. If the project is to be measured in the short term, such as a month, or a few months, if the development is not very easy in the automated test at the same time, also don’t have enough time to do it, then no need for automated testing, tried to make automated test scripts, may only use once or twice, it’s not worth it.
For example: Internet projects, to be online within a week, you do not line others line people will not use you, the project cycle is short, rapid change, you have not done a good job of automation, the project may be offline. For example, the project related to the “Double 12” activity of a certain treasure was offline within a week. For a project suitable for automated testing, such as a bao client, most functions remain unchanged for each release and the project will not be offline within 3-5 years, which is more suitable for automation.
How to implement automated testing effectively