Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Preliminary Conception on the Construction of automatic Test platform

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

one。 Preface

The test platform can be understood as a test management platform, which is mainly implemented by WEB, which facilitates the unified work of others, facilitates the unified management of the company, and can improve the efficiency of the company. The platform is mainly for testing, but not only for testing. The starting point of everything is to improve work efficiency, reduce company costs, and provide a more pleasant working environment for the company.

two。 Why do you need a test platform?

At present, many small companies or larger companies, testing is based entirely on functional testing, if only functional testing, you can directly use open source project quality management software (such as Zen Tao). If you carry out interface, UI automation testing, performance testing, you can consider building your own test platform. Take the interface test as an example. Generally, the message body needs to be constructed after the interface test is captured. Some people like to use postman tools to save the interface directly, while others like to use other tools such as fiddler directly. In this way, different testers have different tools and use cases. The former newcomer to take over the job may need to learn new tools, although the time is short, but it is also a cost, while in the latter, if there is a problem with the local machine, all the use cases may be gone. It not only consumes the cost of the company, but also leads to non-standard department management.

If you build a unified platform, you can solve the above problems. For example, you can copy the message body directly into the WEB interface to complete the interface test and add additional data verification features. After passing the test for each interface and scenario, you can save the content directly to the database. In this way, 1 is the centralized and unified management of the code; 2 is low requirements and low for operators, and anyone only needs to construct the message body in accordance with the format to carry out interface testing; 3) all people can share use cases as long as they have the corresponding permissions. Testers can also communicate and learn from each other, and can also find problems and improve use cases; 4 is to improve work efficiency; 5 is compared with the existing open source tools, can be expanded at will.

Taking interface testing as an example, this paper briefly describes the idea of building a test platform. We know that interfaces are the most important part of a program, and interface testing may be relatively simple relative to performance and functionality. We only need to understand the interface protocol, read the interface documents, be familiar with the user usage scenarios, and understand the surface and hidden needs of users, we can design a variety of interface test cases, and can be carried out at the same time with the development work.

three。 How?

Since we build our own platform for interface testing, I think WEB is the best choice. We only need to deploy the server, and the client can access it directly without having to install other software on each client like other applications.

Use HTML/CSS to lay out an interface to ensure that you can enter URL, RequestBody and the corresponding request method, so that the backend accepts the data from the frontend for analysis and stitching (the backend processing mainly depends on the form of parameters passed by the frontend, and it is best to define the specification in advance). The back end sends the processed parameters to the corresponding server, and receives the return value of the response back to the front and displays it on the interface. This is the simplest interface testing process. As shown in the figure:

four。 How to perfect

The front is only a simple interface testing process, can only be said to complete the interface testing function, but compared with other testing tools can not reflect the advantages of the platform, how to ensure the advantages of the platform?

After the API returns, you must automatically verify the relevant parameters: 1 is the verification of the returned status or returned value; 2 is the verification of the relevant database data; these tasks can be done on the page. If the verification of the returned status or returned value can be directly specified in an json format, the field to be verified and the corresponding value (the value can be a variable). If you need to verify the database, you can do it in the form of a form. The value that needs to be verified in the form can be arbitrary, for example, it can be the value of the input parameter; the value after the input parameter can be processed; the type of database value can be verified by using rules (some require values, some require letters or numbers; some require certain specified values; you can specify query conditions (where or in, etc.).

In this way, you only need to define the format to complete the whole process of verification from the request to the return result.

five。 How to expand

If only interface testing is called a test platform, then there are some big questions and small ones. Personally, the test platform can not only complete the relevant tests through the WEB page, but also run the specified use cases automatically on a regular basis (when there are many people and the machines are naturally insufficient, you can specify the use cases to run automatically in the middle of the night). You can test the quality of the code before it is released, and release is allowed only when the code can only meet the specifications. Common testing tools for each project (such as mock messages) can be included in the platform so that everyone can directly use …

There are only the unexpected, there is nothing impossible. The premise is low cost, high efficiency, not just for the sake of platform and deliberate platform.

six。 Welcome to the official account of the author.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report