当前位置:网站首页>How to implement interface exception scenario testing? Exploration of test methods and implementation of test tools

How to implement interface exception scenario testing? Exploration of test methods and implementation of test tools

2022-06-22 14:11:00 Software testing Fairy

background : As the front and rear ends separate 、 The wide application of microservices and other technologies , Interface testing plays a more and more important role in the whole testing process , How to test the interface more efficiently 、 Measuring more fully has become an urgent problem to be solved .

Currently, when testing a specific interface , The commonly adopted method is that testers use interface testing tools according to the field value rules in interface documents ( for example Postman etc. ) Manually modify a field value in the interface message back and forth for testing .

This method is relatively friendly to single or simple interfaces , However, a system often contains a large number of interfaces 、 The interface logic is complex 、 The interface contains many fields , This brings many problems to the implementation of interface testing , For example, it takes time and effort 、 Big workload 、 Missing some test scenarios, etc .

At the same time, due to the tight project schedule and other reasons , In the process of interface testing, we usually pay more attention to whether the normal scenarios are implemented , Compared with the abnormal scene, the attention is not enough , Thus, it is very easy to cause relevant test problems .

therefore , In order to reduce the occurrence of such cases , This paper explores and practices this problem , Relevant methods are summarized , It has been applied to many projects , It worked very well .

Method exploration

Analysis and induction of abnormal scenarios

After analyzing and summarizing the relevant situations of abnormal scenario testing in the current interface testing , It can be roughly divided into two categories: basic exception scenarios and special exception scenarios , The basic exception scenario is applicable to each field in the specific interface , Special exception scenarios only apply to specific interface fields .

The specific classification and examples are shown in the figure below :

Method exploration

Combined with the analysis and induction of the above abnormal scenarios and the actual implementation of the current test interface test , The testing of interface exception scenarios can solidify the related repetitive work through the tool process , It is automatically tested by tools to reduce duplication of effort , Further improve test efficiency .

Technical implementation of interface exception scenario testing tool

Flow chart of interface exception scenario test tool

As shown in the above flow chart , The overall idea of technology realization is : First, the interface configuration and other relevant information of the interface to be tested are used as input , Then it is parsed and matched with relevant exception scenarios , Secondly, generate corresponding interface test cases and test scripts for the matched exception scenarios , Finally, the script execution generates the corresponding test results .

Application practice

Tool interface

Practical examples

XX Information query interface :

Application practice

At present, the method and tool have been applied to multiple projects and interfaces , More than 1000 abnormal scenario test cases have been generated , Multiple test defects were found , On average, reduce the workload to one third of the original manual test time , The test efficiency and test quality are significantly improved .

summary

Although it has been applied in many projects , Also achieved certain effect , But in the process of application , Also encountered many problems , for example : Currently, the supported exception scenarios are relatively limited 、 The form of interface documents is not uniform (excel、word etc. )、 The interface formats of each system are various , But at the moment it only supports http-json Type interface test, etc , These problems will be analyzed and solved one by one .

Besides , More in-depth exploration is needed in special exception scenarios , In this way, more test experience and special exception scenarios can be solidified and incorporated into the tool process , Then the corresponding use cases are generated and executed automatically , To save time 、 energy , Reduce the investment of testers in this field , Put more effort into other relatively more important tests , Further improve test quality and efficiency .

Last :

You can go to my personal number :atstudy-js, You can get one for free 10G Software Test Engineer interview classic documents . And the corresponding video learning tutorial is free to share ! It includes basic knowledge 、Linux necessary 、Mysql database 、 Caught tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance test, etc .

These test data , For doing 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you !

原网站

版权声明
本文为[Software testing Fairy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221250491095.html