Ali Daniel teaches you about automated testing in minutes

Today I will share with you how to understand automated testing. First of all, let's start with the recruitment needs. Looking at recent career opportunities, when it comes to "software test engineers", there are basically requirements for automated testing. E.g:

1. Understand selenium, appium or other automated testing frameworks;

2. Familiar with at least one object-oriented development language, a certain degree of code knowledge is preferred;

3. Familiar with Java or python, have certain test automation experience and code reading ability;

4. Understand interface integration testing, and use interface testing tools such as JMeter, Postman, and SoapUI.

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 carries out automated testing literacy, and strives to let you understand automated testing within one minute.

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

Test: We are familiar with this. The most classic explanation is that "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: process.

Testing is a process performed to find software errors. This process can be the following:

1. Run the tested software and perform the functions of the software;

2. Run other tools to check the inside and outside of the software.

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

Insert picture description here
For example: the test supervisor asks the test engineer to traverse all the functions of the software. The test engineer traverses all the functions of the software through the mouse, keyboard, microphone, mobile phone screen touch, etc., what is this called? Children's shoes familiar with the test understand that this is the legendary "manual visual inspection", this is the "human flesh test".

automation

Up to this point, combined with the above statement, automated testing is to allow the tested software to run by itself and perform the functions of the software; or to allow other tools to run by themselves to check the internal and external aspects of the software.

Since testing is a process, automated testing is an automatic execution process.

Next we discuss a core issue: automatic. What is automatic? Let the machine move by itself, it is automatic. Let the machine traverse all the functions of the software according to the requirements of human beings. This is automation. Would it be clearer?

Here comes the point, the machine. Let the machine move, this is the human ordering the machine to operate. I wonder if the children's shoes have thought about how the machine knows the requirements of human beings? In the above example, the test supervisor only needs to tell the test engineer, and the command transmission is complete. But direct human communication is far easier than human-computer communication.

First of all, the machine cannot understand "human words", no matter Chinese or English...

Secondly, the "assembly language" that the machine knows by default should be that most of the children's shoes can't, and it's impossible to master it in the short term.

Well, use "programming language". It’s time to take out our other picture:

Insert picture description here
Machine learning is a programming language, so easy and simple to the point of outrageously: Install it and the machine will learn it. Fortunately, it is not particularly difficult for humans to learn programming languages. It seems that this is feasible.

With a programming language, there will be a bridge for human-machine 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 becomes automatic. After being able to get here, I hope all children's shoes understand the basic "automatic" principle.

Then we introduce various common tools to continue discussing automated testing. Before going further, let’s take a look at the common categories of tests. Under the different classification dimensions here, we can be divided into different tests, here we carefully analyze.

From the perspective of the practical 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 perspective of the technical level of software testing: manual testing, automated testing, test development...

For the classification under these dimensions, only part of the test can be completed by the "manual visual inspection" of the "human flesh test". The rest is actually done by a machine in a broad concept. We extracted this part of the test: system testing-black box testing-functional testing-manual testing. It is undeniable that this line is the key coverage area of ​​software testing practitioners at present, and places outside this range are where automated testing comes in.

automated test

Next, we will discuss the mainstream automated testing solutions. Without exception, they are composed of a programming language for man-machine communication and tools for machine operation.

Functional automation test

VBScript + QTP (HP UFT), commercial function automated test solution

Python/PHP/Java/C#/JavaScprit/Ruby + Selenium/Appium + unit test framework, open source function automation test solution

Here we introduce a little bit more, Selenium/Appium itself cannot be regarded as a testing tool, but only 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 and Ruby are two light script languages

PHP and JavaScript are two languages ​​that deal specifically with the Web

The tool plus the specified language allows the machine to operate the browser, but the test cannot be done at this time, so each language's own unit test framework is needed to complete the construction of this functional automated test plan.

In addition, there is also a temporary temporary solution in the industry, which is a testing solution composed of Python 2 + Robot Framework + Selenium Library plug-in + unit testing framework. This solution is not very recommended by the author. It is mainly based on two points:

Idea: This is a keyword-based solution, so the keyword is 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 do 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 automated testing solution

Thoughtworks' automated testing tool based on BDD concept

Gauge itself is a complete test plan

Gauge is a test plan covered from requirements analyst (BA) to test engineer (QA)

Java/Python + Macaca, Alibaba's functional automated testing program, the disadvantage is that there is less documentation

JavaScript + TestCafe, DevExpress's open source function automated test solution

pure node.js-TestCafe does not use Selenium and does not require plug-ins to run tests in the actual browser. It is built on top of node.js, so it integrates with modern development tools and works well

No additional setup or configuration required-TestCafe is to run the test immediately after all settings npm install

Complete testing tool-using a single launch command, TestCafe launches the browser, runs the test, collects the results and generates a report

JavaScript + Postman, a free automated testing solution for web interface functions

Groovy + SoapUI, an open source web interface function automated test solution

Performance automated testing

Java/C + HP LoadRunner, commercial version performance test program

Java + JMeter, open source version performance test solution

Python + locust, open source version performance test solution

Here, we borrow a picture of someone else, Martin Fowler, one of the founders of agile development methods, who borrowed the concept of pyramid to show the level of testing.

Insert picture description here
In fact, automated testing covers the entire process from UI (functional testing) to contract (interface testing) and underlying code methods (unit testing). If you want to master automated testing well, you really need experience in the following three areas :

Programming language, object-oriented programming is preferred, because a large number of open source technical solutions are based on object-oriented programming

Third-party testing tools and testing frameworks, these are mainly learned through the official website documents

The concept and design of testing, tools and language are just the means of testing, how to prepare test data, how to set test checkpoints and test steps, these determine the success or failure of the test

Software testing is the easiest subject in IT-related industries to get started~ It does not require the logical thinking of developers, and operations and maintenance personnel are not required to be on call 24 hours a day. What is needed is a careful attitude and a broad understanding of IT-related knowledge. The growth path of each tester from entering the industry to becoming a professional expert can be divided into three stages: software testing, automated testing, and test development engineers. **I recommend a technical exchange group 313782132, which contains various software testing materials and technical exchanges.
**
In addition, the integrated front-end and server back-end technologies are the guarantee for test execution.

Above, I hope it will be helpful to you. Friends who have been helped are welcome to like and comment.

Guess you like

Origin blog.csdn.net/weixin_50271247/article/details/109330731