当前位置:网站首页>[learning] interface test case writing and testing concerns
[learning] interface test case writing and testing concerns
2020-11-06 21:30:00 【Qingqing QQ】
One 、 Why do interface tests
In the daily development process , Someone does front-end development , Someone's in charge of back-end development . Interface is to connect the front and back , Because the speed of front-end development and back-end development may not be the same , For example, the back end is developed , But the front end is not developed . So we don't need to test ? Most of us do function tests , Many are functional tests of the interface . If you understand interface testing , Then you can test the interface .
Two 、 What is an interface 、 What is interface testing
Interface : It is mainly the interaction and interaction between sub modules or subsystems .
The interface here is generalized , The protocol between client and background service ; The interface of communication between plug-ins ; Interface between modules ; As small as a method provided by a class ; Can be understood as interface .
The interface test : It refers to the testing of interfaces between modules or systems .
3、 ... and 、 Interface test process
Demand discussion , Requirements review , Scene design , Write Columns , Prepare the data , Perform the test
Four 、 Interface test case design
1 Use case design for interface testing , Mainly from the input and interface processing two aspects of consideration :
1) For input , It can be designed according to the parameter type ;
2) For interface processing , Use case design can be done according to logic ;
3) For output , Analysis and design can be made according to the results .
2 Design for input
For interfaces , Input is input parameter . Common parameter types are :
(1) Numerical type (int,long,float,double etc. )
(2) String type
(3) An array or list
(4) Structure
5、 ... and . How to test the interface
Through the tool simulation, the client sends the request to the server and receives the data returned by the server to perform the function of the interface , Logic business , abnormal , Security testing
A functional test : Test whether the function of this interface is realized , And test whether the interface is developed according to the interface document ( For example, the interface document specifies some keywords , When I was big, I changed the keywords to other keywords , Because throughout the project cycle , It's not just one development, it's multiple , Therefore, it may be due to the different keywords in the development process that some development functions are abnormal , There are also exceptions to automated scripts )
Logic business , It mainly refers to some logical business dependencies ( For example, when Alipay submits an order, you must ensure that you are logged in , If you don't log in and submit successfully , This is the anomaly , You can modify the requested cookie To test )
Abnormal test : Parameter exception : Key parameters ( Test with other keyword substitutions )、 The parameter is empty. 、 How many parameters ( Add the number by adding parameters ), Parameter error . Data exception : Keyword data ( Fill in the data with other data language data instead of )、 Data length 、 Data is empty 、 Data error .
Because the front and back calls of our project are mainly based on http Interface to protocol , So when testing the interface, it is mainly through tools or code simulation http Sending and receiving of requests . There are many tools like :apipost、jmeter、java+httpclient、robotframework+httplibrary etc. .
– It can also be used. Interface automation to achieve , It's code implementation , The framework and UI Automation is almost , Send request to judge by assertion .
6、 ... and 、 Tools for interface testing
Common tools for interface testing ,fiddler Grab request ,apipost Simulate the client by fiddler The request is modified and sent to the server and receives the data and exception returned by the server to verify the interface . Tools are not fixed , You need to choose according to the project .

7、 ... and 、 Typical problems found in interface testing
Interface testing often encounters bug And questions , as follows :
(1) Improper handling of incoming parameters , Cause procedure crash;
(2) Type overflow , Result in inconsistent data reading and writing ;
(3) Because the object permission is not checked , Access to sensitive information from other users ;
(4) Improper state handling , It leads to the confusion of logic ;
(5) The logic check is not perfect , We can take advantage of loopholes to gain illegitimate benefits .
Tools download link :
ApiPost - Directly generated documents API debugging 、 Management tools
版权声明
本文为[Qingqing QQ]所创,转载请带上原文链接,感谢
边栏推荐
- Swagger 3.0 brushes the screen every day. Does it really smell good?
- 2020-08-24:什么是小文件?很多小文件会有什么问题?很多小文件怎么解决?(大数据)
- 2020-08-17:详细说下数据倾斜怎么解决?
- Application insights application insights use application maps to build request link views
- Basic usage of Vue codemirror: search function, code folding function, get editor value and verify in time
- Will blockchain be the antidote to the global epidemic accelerating the transformation of Internet enterprises?
- 解决 WPF 绑定集合后数据变动界面却不更新的问题
- C and C / C + + mixed programming series 5 - GC collaboration of memory management
- Junit测试出现 empty test suite
- C language I blog assignment 03
猜你喜欢

ES6 learning notes (2): teach you to play with class inheritance and class objects

磁存储芯片STT-MRAM的特点

2020-08-18:介绍下MR过程?

STM32F030C6T6兼容替换MM32SPIN05PF

2020-08-29:进程线程的区别,除了包含关系之外的一些区别,底层详细信息?
![[forward] how to view UserData in Lua](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[forward] how to view UserData in Lua

迅为-iMX6ULL开发板上配置AP热点

ES6 learning notes (4): easy to understand the new grammar of ES6

2020-09-09:裸写算法:两个线程轮流打印数字1-100。

2020 database technology conference helps technology upgrade
随机推荐
How to make characters move
ORA-02292: 违反完整约束条件 (MIDBJDEV2.SYS_C0020757) - 已找到子记录
window系统 本机查找端口号占用方法
行为型模式之备忘录模式
2020-08-18:介绍下MR过程?
To Lianyun analysis: why is IPFs / filecoin mining so difficult?
打工人好物——磨炼钢铁意志就要这样高效的电脑
An article will take you to understand SVG gradient knowledge
What grammar is it? ]
C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
EOS founder BM: what's the difference between UE, UBI and URI?
2020-08-19:TCP是通过什么机制保障可靠性的?
Filecoin has completed a major upgrade and achieved four major project progress!
递归、回溯算法常用数学基础公式
Python basic data type -- tuple analysis
迅为iMX6开发板-设备树内核-menuconfig的使用
CCR coin frying robot: the boss of bitcoin digital currency, what you have to know
Qt音视频开发46-视频传输UDP版
STM32F030F4P6兼容灵动微MM32F031F4P6
Flink's datasource Trilogy 2: built in connector