It only takes one minute to show you about automated testing

At present, automated testing is not a new thing, or various methodologies of automated testing have emerged in an endless stream. However, there are not many teams who can understand automated testing and implement it well. Let's introduce automation in a popular way test……

First, let's start with job requirements. Looking at recent career opportunities, when it comes to " software testing engineer ", basically there are requirements for automated testing. For example:

  • Learn about selenium, appium or other automated testing frameworks
  • Familiar with at least one object-oriented development language, some code skills are preferred
  • Familiar with Java or python, have certain test automation experience and code reading ability
  • Understand interface integration testing , and use JMeter, Postman, SoapUI and other interface testing tools

Wait, the above content will not be listed one by one. Suddenly, automated testing is blooming everywhere, as if the automated testing capabilities of test engineers have become standard. This article starts with the requirements of automated testing, and simply performs automated testing literacy, trying to let everyone understand automated testing within one minute.

Then we will analyze it from the five words "automated testing".

test

Test: We are familiar with this. One of the most classic explanations is "program testing is a process performed to find errors." This definition from GJMyers' classic book "The Art of Software Testing " shows us the essence of testing: the process.

Testing is a process performed to find software errors, which can be as follows:

  • Run the software under test and perform the functions of the software
  • Run other tools to check the software inside and out

All in all, it is a process, a process of execution. Next is a schematic diagram of the most common test:

For example: the test supervisor asked the test engineer to traverse all the functions of the software. The test engineer traversed all the functions of the software through the mouse, keyboard, microphone, touch screen of the mobile phone, etc. What is this called? Children's shoes who are familiar with the test understand that this is the legendary "manual visual inspection", which is the "human flesh test".

We drew this picture well, and it actually looks like this.

automation

So far, combined with the above statement, automated testing is to let the tested software run by itself and execute the functions of the software; or to let other tools run by themselves to check the inside and outside of the software.

  • Since testing is a process, automated testing is a process of automatic execution.

Next we discuss a core issue: automatic. What is automatic? Let the machine move by itself, it is automatic. Let the machine go through all the functions of the software according to human requirements, which is automation. . Does this make it clearer?

Here comes the point, the machine. Let the machine move, this is not "eating chicken", it is human beings ordering the machine to operate. I don’t know if the children’s shoes have thought about it, how does the machine know the requirements of human beings? In the above example, the test supervisor only needs to tell the test engineer, and the order transmission is completed. But direct human communication is far easier than human-machine communication.

  • First of all, the machine can't understand "human language", no matter Chinese, English...
  • Secondly, the "assembly language" that the machine will know by default should not be understood by most children's shoes, and it will not be able to master it in the short term.

Well, with "programming language". Time to pull out another of our graphs:

Machine learning a programming language is so easy and simple that it is outrageous: install it and the machine will learn it. Fortunately, it is not particularly difficult for humans to learn programming languages. It seems this works.

With a programming language, there is a bridge for human-computer communication, and the rest is to help the machine choose tools. To do the corresponding test, you need to find the corresponding tool, so that the automation will be automatic. Can come here, I hope you children's shoes understand the basic "automatic" principle.

Similarly, draw a schematic diagram of this automated test:

Then we introduce various common tools to continue the discussion of automated testing. Before going any further, let's look at the commonly used categories of tests. Under different classification dimensions here, we can divide them into different tests, and here we analyze them carefully.

  • From the practice process of software testing: unit testing, integration testing, confirmation testing, system testing, acceptance testing...
  • From the perspective of software testing methods and strategies: white box testing, black box testing, gray box testing ...
  • From the testing perspective of software testing: functional testing, performance testing, compatibility testing, security testing, exploratory testing ...
  • From the technical level of software testing: manual testing, automated testing, test development...

For the classification under these dimensions, only a part of the tests can be completed through the "manual visual inspection" of the "human flesh test", and the rest actually need machines to complete in a broad sense. We extract this part of the test: system test - black box test - functional test - manual test. It is undeniable that this line is currently the key coverage area of ​​software testing practitioners, and places outside this range are where automated testing comes in handy.

automated test

Next, let's discuss the mainstream automated testing solutions. Without exception, they are composed of programming languages ​​for human-computer communication and tools for machine operation.

  • Functional automated testing
  • VBScript + QTP (HP UFT), commercial functional automation test solution
  • Python/PHP/Java/C#/JavaScprit/Ruby + Selenium/Appium + unit testing framework, open source functional automation testing solution
  • Let’s introduce a little more here. Selenium/Appium itself is not a testing tool, but a tool used by the machine to operate the browser, and this tool can understand multiple languages:
  • Java, C# these two heavy (zhòng) languages
  • Python, Ruby, two light scripting languages
  • PHP, JavaScript, two languages ​​that specialize in dealing with the Web
  • The tool plus the specified language can allow the machine to operate the browser, but it is not possible to test at this time, so each language's own unit test framework is needed to complete the construction of this functional automation test solution together.
  • In addition, there is also a temporary solution in the industry, which is   a test solution composed of Python 2 + Robot Framework + Selenium Library plug-in + unit test framework . This solution is not recommended by the author, mainly based on two points:
  • Idea: This is a keyword-based solution, so keywords are the specialty of QTP (HP UFT), not the original intention of Selenium
  • Technology: Python 2 will eventually withdraw from the stage of history. If you start automated testing from scratch, you should start with Python 3 directly. However, Robot Framework does not support Python 3...
  • Python/Java/C#/JavaScprit/Ruby + Gauge, another open source functional automation testing solution
  • Thoughtworks' automated testing tool based on the BDD concept
  • Gauge is a complete test solution in itself
  • Gauge is a test solution covering from requirements analyst (BA) to test engineer (QA)
  • Java/Python + Macaca, Alibaba's functional automation testing solution, the disadvantage is that there are few documents
  • JavaScript + TestCafe, DevExpress' open source functional automation testing solution
  • pure node.js  - TestCafe doesn't use Selenium and doesn't require a plugin to run tests in an actual browser. It's built on top of node.js so it integrates and works well with modern development tools
  • No additional setup or configuration required - TestCafe is all set up and runs tests immediately after npm install
  • Complete testing tool - With a single launch command, TestCafe launches the browser, runs tests, collects results and generates reports
  • JavaScript + Postman, a free automated test solution for web interface functions
  • Groovy + SoapUI, an open source web interface function automation test solution
  • Performance automated testing
  • Java/C + HP LoadRunner, commercial version performance testing solution
  • Java + JMeter, open source version performance testing solution
  • Python + locust, open source version performance testing solution

Here, we borrow a picture from someone else, Martin Fowler, one of the founders of the agile development method, he borrows the concept of the pyramid to show the level of testing.

In fact, automated testing covers the entire process from UI (functional testing) to contract (interface testing) and underlying code methods (unit testing). To master automated testing well, experience in the following three areas is indeed required :

  • Programming language, object-oriented programming is preferred, because a large number of open source technology solutions are based on object-oriented programming
  • Third-party testing tools and testing frameworks, which are mainly learned through the documentation on the official website
  • The concept and design of the test, tools and languages ​​are just the means of testing, how to prepare test data, how to set up test checkpoints and test steps, these determine the success or failure of the test

In addition, the comprehensive front-end and server back-end technologies are the guarantee for test execution. Come on, children's shoes, has a minute passed?

So have you learned about automated testing now? If you still have questions, welcome to join the author's exchange group: 735745871 for further communication.

Finally, a modest effort

Thanks to everyone who read my article carefully, although it is not a very valuable thing, if you can use it, you can take it away:

These materials should be the most comprehensive and complete preparation warehouse  for [software testing] friends . This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can help you too!

Information acquisition method:

Guess you like

Origin blog.csdn.net/qq_56271699/article/details/131152198