Last night in a test exchange group, listened to a test the old driver shared the content of the interface Automation test, has a deeper understanding of interface automation, but also for the next company's interface automation implementation, provides more ideas.
This blog, say the function test to interface automation, as well as the interface automation of some things ...
Objective
Automated testing, is a hot topic in recent years, of course, it is a development trend of software testing in the future. In the future, non-core test work, such as functional testing, will be outsourced.
To continue to move forward in the software testing industry, it is essential to have a core competency and to master automated testing techniques.
In the book "Google Software Testing", it was introduced: in google,70% 's automated testing work focused on unit testing, 20% focused on interface testing, the remaining 10% is the UI test.
Admittedly, we do not have Google so perfect mechanism and engineer culture, there is no need to copy Google, but Google as the Internet 2.0 times the most dazzling company, its technology development direction, process management, etc. can be said to be in the near future,
We also want to get to the direction. Choosing the right one, landing application, is what we should do now.
At present, the domestic Internet industry, the large environment, still in a rapid development, the need for process standardization of the period, how to keep pace with the changing development, in addition to constantly understand the new things to contact, but also need to continue to learn, improve themselves, to the internal
Driving force to keep up with the tide of the times. Even if can not do, also can not become the era of the elimination of the batch. Speaking of which, 2 books are recommended: Wu's book "Top of the Tide", "The Mystery of Silicon Valley", interested in children's shoes can go to see ...
First, the necessity and significance of interface testing
interface, API, application programming interface, Introduction to the interface, before the blog has been described in detail, interested in children's shoes can go to see: Introduction to Interface Testing
Here is the main talk about the necessity and significance of interface testing:
Interface test implementation in a multi-system platform architecture, has a very efficient cost-benefit ratio (of course, unit test revenue is higher, but the implementation of unit testing cost more investment, more technical requirements, so should choose more suitable for their own is the best solution).
Interface testing is inherently high complexity for the platform to bring efficient defect detection and quality supervision capabilities, platform complexity, the larger the system, the more obvious the effect of interface testing.
In general, the interface test is to ensure the high complexity of system quality inherent requirements and low-cost economic benefits driven by the best solution, mainly reflected in the following three aspects:
1, Save the test cost
According to the data model, a program bug at the bottom can cause 8 or so bugs in the upper layer, and the underlying bug is more likely to cause the whole network to crash, and the interface test can provide a low cost and high efficiency solution in the case of system complexity increasing.
2. Interface test is different from unit test
Interface test is to stand at the user's point of view of the system interface for a comprehensive and efficient continuous detection.
3. Higher efficiency
The implementation of interface testing for automation and continuous integration, when the complexity and volume of the system, the lower the cost of interface testing, the corresponding, the higher the efficiency output.
Ii. what skills are required to do interface testing?
In this respect, the previous blog also said that portals: what skills are required to do interface testing
To do interface testing, the required skills, the basic is the following points:
Business Flow : Understand the business logic interaction between the system and the internal components;
Data Flow : Understanding interface I/O (input/output: input and output);
protocol : Includes HTTP protocol, TCP/IP protocol family (previous blog has system introduction protocol, Portal: HTTP protocol: Rookie starter Series)
Tools : Tools can help us to better and more efficient completion of work, commonly used interface testing tools are: JMeter, LoadRunner, Soapui, postman, etc.;
Database Knowledge : Whether it is from the database to obtain knowledge, or confirm the data landed, or interface to the data to perform what operations, all need to confirm, so the database knowledge (in fact, adding and removing changes) is very necessary;
Supplement: Several necessary points of interface document: completeness, consistency, fault tolerance ;
Third, interface automation testing
1. How to carry out
First, debug a single interface to ensure that a single interface is correct and unobstructed (similar to benchmark tests in performance testing);
Second, clear data flow, business flow;
Finally, the N interface test scripts are strung together and executed;
The most important point, do not think too much too complex, first of all the most basic of the simplest to do, on the success of the more than half, as for the expansion of the third-party interface, HTTPS, scheduled tasks, automatic test report, automatic email and other functions, which are constantly accumulated and optimized,
Action up on the line, think too much better action, let interface Automation test Landing, is the first thing we need to consider!
2. Need to know before carrying out
How many pages does the test object now contain?
How many interfaces does each page involve?
Which step is called separately?
What fields are included in each interface?
Which table does each field correspond to the database?
What do the individual fields in each table mean?
What do the various interfaces do to the table?
3. Automation Framework
What is a framework? You can understand it as a complete ring, or as a whole set of environments where the interface test scripts run, the platform, whatever you want; an automated test framework typically contains the following points:
Data pools: Storage management of test data, typically set as a data package that includes:
Log (journal file), report (test reports file, generally XML format), Case-data (test data for a single interface, generally JSON format), Server-data (interface business concatenation data, can be managed in Excel)
Script Management Center: the Unified management of interface test scripts, storage, scheduling center, commonly used tools such as Maven, Ant, or you can use the Unit test framework in the programming language to provide the functionality, choose their own applicable;
Run the platform: usually with the help of tools to run these test scripts, the tool can use the above mentioned several (Jemter, LoadRunner, SOAPUI, etc.), similarly, the selection of the appropriate is very important;
Continuous Integration tools: The most common is Jenkins, its role is to monitor the external program call execution, timing or trigger scheduling tasks, test script execution and other functions;
Communication services:Dubbo, Spring_boot, Thrift and other RPC, rest synchronous call service;
Test Results Statistics Management Center: such as Testlink, the purpose is to automatically update the test results upload, better statistical test results, in order to optimize later;
It says so much, in fact its meaning is: data and script separation, test results automatically submit notification, improve test script and test data maintenance convenience, etc...
The framework I am using is:jemter+maven+jenkins+dubbo+mysql...
About the interface Automation test, basically is the above content, of course, choose suitable for their own actual situation of the framework, the implementation of the ground, is the focus, action up, to turn over the salted fish ...
Original: https://www.cnblogs.com/imyalost/p/7430126.html
Discussion on Interface Automation test