当前位置:网站首页>It's amazing. This article completely explains the service interface testing
It's amazing. This article completely explains the service interface testing
2022-07-28 03:52:00 【Software testing】
For the interface test of the server, we generally start from the function , For example, the verification of request parameters and response parameters , Verification of business logic or business rules , Verification of database operation . After the function is normal, safety related inspections will be carried out as required 、 Performance test and series expansion test , For example, compatibility testing with historical versions 、 Timeout verification and design rationality verification of the interface , Use case design is also analyzed and designed from these aspects , The following mind map is a summary of the test focus :
The details are as follows :
For input
Input mainly refers to the input parameters of the interface , In our usual tests , Will consider the normal input first , And abnormal input parameters , Exceptions include : Parameter exception and data exception , Use case design uses equivalence class partition and boundary value analysis
A、 Normal input parameters
Normal input parameters are well understood , It is based on the input standard of the interface design document , Enter normal parameters , The response returns normally according to the agreed conditions in the interface design document
B、 Parameter exception
Parameter exceptions include : The parameter is empty. , More or less participation , Wrong parameters
C、 Data exception
Data exception : Wrong data type 、 Non null parameter is null , The length does not conform to the design , Data outside the scope of the dictionary , Illegal members , Special or sensitive characters , Abnormal parameter data with associated relationship, etc
For processing logic
Before interface testing, generally, R & D will provide interface design documents or business-related design drawings 、 flow chart , Processing logic for business processes , We can start with the constraints of entering parameters 、 The action object of the event 、 Business state transition
A、 Analysis of constraints
Numerical limits : Dictionaries , Grade , Industry related restrictions , Amount limit , Score limits, etc
The limitation of state : It works | Invalid , On-line | offline , Pull black | Wash white, etc
Relationship constraints : Exist or not exist , Bind or unbind, etc
Limits of authority : Administrators , Ordinary users, etc
B、 Object analysis
Object analysis is mainly used to operate legal and illegal objects , For example, bank card users recharge their cards , There may be : user A Use non users A Recharge your card ; user A Recharge with your own card , The card has expired ; user A Recharge with your own card , The card is blacklist or loss report, etc .
C、 Analysis of state transition
Such as payment business , Pay first , There will be a refund after cancellation , Pay again if payment is unsuccessful , Payment failure , Whether the switching between States is normal , Failure to operate smoothly according to normal business , How does the status display , Is it controllable , Whether there is an abnormal state , How to deal with empty status business, etc
D、 Timing analysis
In some complex activities , An activity consists of a series of actions in a specified order , These actions form an action flow , Yes, in this order , To wait until the expected results , What will the program do with other branch actions that occur during execution
For example, zebra parking risk control business , If the vehicle directly turns around after entering the station and does not drive into the high-speed service, how to deal with it ?
For output
When considering exceptions , Usually we think of the normal situation , Invalid situation , But it may not cover all error codes , The error code returned by the interface definition can help us supplement the use cases in this part , For example, the network is abnormal , Invalid rule , Invalid parameter , Invalid business ID, Invalid task , Server exception, etc , hold errorcode More use cases can be designed by adding the values of
The design of use cases based on the output , You can find out whether the front and rear ends output results normally , Whether the prompt is friendly , Prompt whether sensitive information appears, etc
Database operation
A、 Whether the database operation is frequent , Whether it will take a lot of time in the process of writing to the library CPU, Whether the process is released after the library is written
B、 Whether business data warehousing is normal , Whether there is duplicate data warehousing , Whether there is garbled code ; Whether log data warehousing is normal
C、 Whether the data update is normal , Especially the time field , Whether the time is 24 The hour format
D、 Data deletion 、 Whether the backup is normal
Security
Whether sensitive information is encrypted ( Such as bank account number , password , Transfer amount )
Performance related
A、 Under what circumstances will interface concurrency occur , What is the concurrency scenario , When concurrency can cause problems
B、 Maximum concurrency , response time , throughput , Resource consumption
Interface timeout
The interface normally has a return , What if the interface doesn't return ? Therefore, the processing after interface timeout is also a part to be considered in the test , If the timeout is not handled properly , It may cause process blocking , Or receive the interface return after timeout, resulting in logical confusion
Compatibility analysis with historical versions
Obsolete protocol or interface , The code does not comment , Under certain circumstances, a protocol or interface whose historical version has been discarded may be triggered , Cause unexpected problems after user use or function call , Loss
The same system , When interfaces between different services call each other , Whether the new interface is affected by the historical interface , In particular, the old and new interfaces deal with a certain function , Whether there is a problem of business incompatibility
This requires testers to test a system for a long time , Then you might think of this scenario , It will be clear when and which version has been refactored , Abandon those interfaces , Added those interfaces , Which scenarios will trigger a rule of the history interface
The interface design is reasonable
Whether the interface fields are redundant , Whether the interface returns the information expected by the caller , Whether the interface definition meets the needs of all callers , Whether the interface call is convenient , Whether the interface is extensible , Whether the interface parameters are convenient to use , Whether the business rules of the interface are correct , The interface will affect the use of the whole service
The house needs to be built layer by layer , Knowledge needs to be learned at one point one . We should lay a good foundation in the process of learning , More hands-on practice , Don't talk much , The last dry goods here ! I stayed up late to sort out the stages ( function 、 Interface 、 automation 、 performance 、 Test open ) Skills learning materials + Practical explanation , Very suitable for studying in private , It's much more efficient than self-study , Share with you .
Get off w/x/g/z/h: Software testing tips dao
Typing is not easy , If this article is helpful to you , Click a like, collect a hide and pay attention , Give the author an encouragement . It's also convenient for you to find it quickly next time .
边栏推荐
- 一个仿win10蓝屏的404页面源码
- 简单、好用的性能测试工具推荐
- Greedy - 53. Maximum subarray sum
- Common interface testing tools
- C language: realize the exchange of two numbers without creating temporary variables
- pip-script.py‘ is not present Verifying transaction: failed
- Xctf attack and defense world web master advanced area php2
- Do you regret doing automated testing?
- Responsive high-end website template source code Gallery material resource download platform source code
- Qt:QMessageBox消息框、自定义信号和槽
猜你喜欢

Selenium -- Web automated testing tool

In December, the PMP Exam adopted the new syllabus for the first time. How to learn?

Monotonous stack -- 42. Receiving rain -- a difficult problem that big factories must know

BRD,MRD,PRD的区别

常用的接口测试工具

Interface automation test, complete introduction
![[paper notes] mobile robot autonomous navigation experimental platform based on deep learning](/img/6a/7f0c2b2a53332636f3172bc3b0b74d.png)
[paper notes] mobile robot autonomous navigation experimental platform based on deep learning

ES6 from entry to mastery 07: Deconstruction assignment

Read Plato farm's eplato and the reason for its high premium

Advanced Mathematics (Seventh Edition) Tongji University exercises 3-4 personal solutions (first 8 questions)
随机推荐
【图像分类】2021-MLP-Mixer NIPS
【OPENVX】对象基本使用之vx_distribution
Screenshot of deepstream detection results
动态规划——63. 不同路径 II
An article grasps the calculation and processing of date data in PostgreSQL
Greedy - 53. Maximum subarray sum
Qt:QMessageBox消息框、自定义信号和槽
C language: realize the exchange of two numbers without creating temporary variables
ES6 from getting started to mastering 08: extended object functions
[openvx] VX for basic use of objects_ distribution
简单、好用的性能测试工具推荐
Data mining-02
[openvx] VX for basic use of objects_ matrix
面试必备杀技:SQL查询专项训练!
Capacity expansion and reduction of RBD block storage device (VI)
【力扣】1337.矩阵中战斗力最弱的k行
贪心——55. 跳跃游戏
【P4】解决本地文件修改与库文件间的冲突问题
MangoPapa 的实用小脚本(目录篇)
静态博客搭建工具汇总