当前位置:网站首页>Practice Guide for interface automation testing (middle): what are the interface testing scenarios
Practice Guide for interface automation testing (middle): what are the interface testing scenarios
2022-07-07 04:18:00 【Peng Yuyan in the testing industry】
In the first article Practice Guide for interface automation testing ( On ): What preparations should be made for interface automation I explained in detail to the partners what preparations need to be done for interface automation .【 At the end of the article, I share the interface automation test tutorial 】
The last step in the preparation is the design of interface test cases , Is the use case design good , It is directly related to our test quality .
How to design test cases , Here, I combine my own experience , Help you sort out the design ideas of interface test cases .
I hope it will help and improve your subsequent interface testing work .
1 Interface test scenario sorting
1.1 Design thinking
In the interface test , For the most part , Our test quality depends on the design of interface test scenarios , The interface test scenario is different from the traditional function test scenario .
Many test students can't convert well for a while , At first, the idea of interface testing will be confused .
Here, let's sort out the common test scenarios of the interface , And classified , Interested students suggest reading it several times , And think more .
notes :
The actual test of performance and safety is much more complex than that of function .
This article focuses on the functional perspective test , Then write a special article to explain in detail how to conduct the performance and security testing of the interface .
1.2 Explain from the perspective of function
Functional division of interface test , According to different perspectives , There are many ways to divide .
At present, the test scenarios mainly used in my actual testing work can be divided into five categories :
Foundation inspection
Normal multi angle
Extremely multi angle
Required item check
Boundary value check
Pay attention to this sequence :
Foundation inspection -> Normal multi angle -> Extremely multi angle -> Required item check -> Boundary value check
The priority is reduced in turn . Actually, when conducting interface test , It is suggested to design test cases in this priority order .
Not all interface tests need to be designed so comprehensively , Time cost needs to be comprehensively considered 、 The importance of interfaces is determined by multiple factors .
The following explains the classification of each scene from the perspective of function , It is beneficial for everyone to understand clearly :
1) Foundation inspection
The main purpose of this angle is to verify the acceptability of the interface , Enter valid input parameters , Check that the interface returns to normal , It can be judged by returning the status code or key field .
But is the content returned correctly , Not within the inspection range of this angle .
2) Normal multi angle
This angle mainly verifies a variety of effective input parameter combinations , Check that all interfaces can return correct data that meets expectations .
Similar to ordinary function test , From the perspective of black box , Using the idea of equivalence , Divide the possible normal scenario combination values of each input parameter of the interface .
And check the correctness of the result returned by the interface , Whether it meets the expected results of our input settings .
3) Extremely multi angle
This angle mainly verifies a variety of invalid input parameter combinations , Check whether the interface returns the expected error message .
It should be noted that , This perspective is more about the abnormal scenarios from the business perspective .
Instead of testing for abnormal data of an input parameter , The abnormal data test for each parameter will be put more into the boundary value check scenario .
4) Required item check
This angle check is relatively clear , According to the interface document , Check whether each required input parameter is really set as a required item .
In scene design , It needs to be tested when only the required items are entered into the parameter , The interface should be able to return the information of successful processing , Otherwise, there is something wrong with the document , Or there is something wrong with the interface code logic .
5) Boundary value check
This angle is mainly checked from the perspective of the input element level , Carry out special character check for each input parameter of the interface 、 Length boundary value check, etc .
The inspection priority of this angle is the lowest , The reason is that the front end of the general system will have control , This kind of illegal data generally cannot be transferred to the back end .
But for better robustness of the interface , Although the front end is controlled , But the back-end interface also adds verification control , The security and robustness will be higher .
Of course, in the actual project , Back end developers often spend more time because of this processing , Often do not do too comprehensive control .
In this case , Our test can be based on specific system usage scenarios , Comprehensively evaluate the risks , If there is a big risk , Or specifically require developers to improve the background verification .
2 Use case design demonstration
For the maintenance of interface use cases , Here are two recommended tools :
One is a single soldier artifact Jmeter
One is free and very easy to use API Interface collaboration platform Eolink
Eolink
The platform not only supports API Collaborative development of interfaces , More abundant interface testing functions , Support the testing of interfaces .
Eolink
An example of interface test case maintenance is as follows :
The picture below is for use Jmeter
Maintain a set of interface test cases for creating application interfaces , Later, I will take this as an example to explain the interface test scenario mentioned in the above chapter .
explain :
The picture above shows right Create an application interface Test cases written .
The use case of this interface is completely in accordance with 5 Design test cases by scenario classification , And when designing use cases , Use case design is carried out according to the classification priority of each scenario .
The advantage of this is that the whole design idea is relatively clear , Try to avoid omitting some scenario use case writing .
2.1 Basic inspection class use case display
explain :
The use case input parameters are randomly set with a set of parameters that can make the interface return to normal .
explain :
Assertion settings are also relatively simple , It is considered successful when the interface returns a key field .
2.2 Normal multi angle use case presentation
explain :
This use case is mainly set to check whether applications of different construction types can be successfully created .
2.3 Abnormal multi angle use case display
explain :
This use case is to check when language Field has a nonexistent value , Check the interface and return failure ( Such wrong data , The interface will return non 200 Error code ).
2.4 Required inspection case display
explain :
This use case is to check when language Field set to null after , The check interface returns the expected failure information , The failure message is : You must choose his development language for your application .
2.5 Boundary value check case display
explain :
This use case is to check tag There are many illegal fields to enter parameters , The check interface returns the expected failure information .
The failure message is :
The project name can only contain letters 、 Numbers 、 Center line , And cannot start and end with a dash . length 2-50 Characters
Last , Let me introduce you to my friends again Eolink
Magical features in test cases :
Support the ability to automatically generate test cases .
This capability can intelligently generate test cases for a variety of scenarios , And realize the rapid generation of various normal types , Exception types , The boundary value , Use cases with mandatory values .
Interested partners suggest going to the official website to learn more :
https://www.eolink.com/
In addition, the platform has rich and easy-to-use testing functions , Help the project team better respond to API Interface for management and testing .
Here are a few easy-to-use functions :
1) Support online 、 Local 、 Client to test
eolink
In addition to regular support for server-side test initiation , It also supports clients ( Local )、 plug-in unit ( Local ) Launch the test , Meet the testing needs of many different scenarios .
Want to know more , You can see :
https://help.eolink.com/#/tutorial/?groupID=c-628&productID=13
client ( Local ):
Server testing ( On-line ):
plug-in unit ( Local ):
2) One click regression / Smoke testing
In the old ways of collaboration , Testers are always at the end of the line .
Unable to participate in project discussions , Can't do fast, wide-range regression testing , I can't even finish the test on time , Lead to project delay or go online with fear .
stay API In the R & D management platform , Because collaboration is based on API The document is in progress , When back-end developers will API After the document is written , The tester can step in right away .
stay API Write test cases based on documents , Move testing forward .
When API After development , The tester can push API All test cases are tested , And get detailed test reports .
Back end development only needs to see the test results to know its own API Whether the test requirements are met , If there is an exception, it can be targeted to improve .
Want to know more , You can see :
https://help.eolink.com/#/tutorial/?groupID=c-469&productID=13
3) Rich and detailed test reports
The platform also provides rich and detailed test reports , It is convenient to view and analyze the test results .
Want to know more , You can see :
https://help.eolink.com/#/tutorial/?groupID=c-469&productID=13
Let me know , The next article will introduce the idea of interface automation test assertion setting , Interested partners , It is suggested to keep an eye on .
Experience address :
https://www.eolink.com/?utm_source=w2703
Learning resource sharing
Finally, thank everyone who reads my article carefully , Watching the rise and attention of fans all the way , Reciprocity is always necessary , Although it's not very valuable , If you can use it, you can take it
These materials , For thinking 【 Advanced automated testing 】 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 ! Everything should be done as soon as possible , Especially in the technology industry , We must improve our technical skills . I hope that's helpful …….
边栏推荐
- EasyUI export excel cannot download the method that the box pops up
- CUDA Programming
- 别样肉客联手德克士在全国部分门店推出别样汉堡
- Termux set up the computer to connect to the mobile phone. (knock the command quickly), mobile phone termux port 8022
- Restore backup data on GCS with br
- ggplot 分面的细节调整汇总
- 高薪程序员&面试题精讲系列120之Redis集群原理你熟悉吗?如何保证Redis的高可用(上)?
- 二进制、八进制、十六进制
- 一些常用软件相关
- 機器人(自動化)課程的持續學習-2022-
猜你喜欢
Analysis on urban transportation ideas of 2022 Zhongqing cup C
一些常用软件相关
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
Web service performance monitoring scheme
数据的存储
Class constant pool and runtime constant pool
Imitate Tengu eating the moon with Avatar
测试/开发程序员怎么升职?从无到有,从薄变厚.......
DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR翻译
【写给初发论文的人】撰写综述性科技论文常见问题
随机推荐
ABAP 动态内表分组循环
Ssm+jsp realizes enterprise management system (OA management system source code + database + document +ppt)
termux设置电脑连接手机。(敲打命令贼快),手机termux端口8022
[leetcode]Spiral Matrix II
MySQL data loss, analyze binlog log file
【knife-4j 快速搭建swagger】
tflite模型转换和量化
2022 middle school Youth Cup mathematical modeling question B fertility policy research ideas under the background of open three children
Surpassing postman, the new generation of domestic debugging tool apifox is elegant enough to use
leetcode:面试题 17.24. 子矩阵最大累加和(待研究)
使用Thread类和Runnable接口实现多线程的区别
Antd comment recursive loop comment
HW notes (II)
Use dumping to back up tidb cluster data to GCS
opencv第三方库
golang 压缩和解压zip文件
史上最全MongoDB之初识篇
CUDA Programming
如何检测mysql代码运行是否出现死锁+binlog查看
VIM - own active button indent this command "suggestions collection"