当前位置:网站首页>The whole network is the most complete. How to do interface automation test? Proficient in interface automation test details
The whole network is the most complete. How to do interface automation test? Proficient in interface automation test details
2022-04-23 03:05:00 【Netease Test Development Center】
Catalog : Reading guide
One 、 Preface
Generally speaking, the interface is a bridge for transmitting data between the front end and the back end , Be careful : Not every project has an interface , Some large projects are front-end and back-end separated , So how do they deliver and return data ? Generally speaking, there is an analog parameter data in both the front end and the back end
Two 、 Design of interface automation test " can "
1、 The goal of interface automation
- For the project API Layer of HTTP Functional logic verification of the interface
- Reduce manual testing work ( Regression test ; Cross module verification )
- Realize the verification that cannot be done by manual verification ( For example, the interface involves sorting and comparison of a large amount of data )
- Functional logic that is difficult to fully verify by hand ( For example, the functional verification of the interface involves a large amount of data )
P.S. In actual projects , What is the fundamental purpose of interface automation ?
Personally, I think it's time to run , Can monitor interface , When the interface fails to function , Can discover in time , To discover Bug. therefore , Code coverage can be used to evaluate the integrity of interface automation , But it's more important to find the problem
2、 Interface automation Case Use case design principles
Bear in mind :
- Don't automate for the sake of automation , The primary goal is when problems arise , Can find out for the first time
- The code coverage statistics in automation can be used as a reference , But you can't start with improving coverage , fall into Case In design
Be careful : Good interface automation Case Design , Depend on Case The designer's functional understanding ( The skill of manual test )+ Function coverage point
principle :
1. Convert manual test points into automated use cases
Case Design attention : The standard that the verification case passes — Refer to a function point that is prone to problems . Or say , There must be no problem in explaining this function point through a use case ; conversely , There must be something wrong .
2. Covering manual testing is not easy to check / Too time-consuming inspection
such as :
- One HTTP Interface design, when comparing a large amount of data
- Interface json When returning, you cannot directly check whether the function point is correct ( Need to call another interface json For indirect verification )
- An interface json Return needs to be associated with the interfaces of other modules ” Mutual verification “( Need to call the interfaces of other modules json, Two json To verify each other's correctness )
3.“ Marginal ” Functional check of This mainly refers to regression verification
If the system involves marginal functional verification , Automate use cases at the design level of such functions
4. Degree of interface verification
Verification of interfaces : That is, the standard to judge whether an interface is normal . Be careful : Interface parameters ” reasonably “ Combine
5.DB Data update check
( If necessary ) Pay attention to check from the perspective of interface DB Update of data :
- Update the data of other systems to the system to be tested DB Data in
- The system to be tested is updated to... Every day due to user operation DB Data in
6. Data preparation for interface automation
About whether you need to automate the interface , Deliberately DB Prepare the required data in , Depending on the degree of need . principle : Unless necessary , Otherwise, you don't have to prepare . If you don't prepare data , Unable to complete the validation of the interface , Then you can prepare the data yourself
Be careful : Once you prepare your own data , Evaluate the impact on other functional verification . Make sure DB Data volume and authenticity in ( The simulated data needs to be sufficient , And it should not be too different from the real data )
3、 Interface automation use cases run regularly
Automation usually chooses to run regularly every day . One thing to pay attention to here is the timing of regular running
Points for attention in time selection :
1) When running online , Pay attention to the impact on the online interface ( General requirements : Online regression verification can run at any time )
2) If you want to check DB Relevant logic of data update , Pay attention to the stability of the data ( For example, when the number of users is small )
3) At testing time ( Non-production environment ), The interface involves reading , Write DB, Consider whether you need to run regularly
3、 ... and 、 Design of interface automation test " You can't "
First , Interface automation is not everything , There are always times when it can't be covered . Know the of automation ” You can't “ The place of , In order to better cooperate with the manual test
Automated ” You can't “ The points are as follows :
1)HTTP Sudden pressure problem at the interface ( Early pressure measurement )
2)Web Manual testing at level ( When the new features come online , When returning to the original function , The interface still needs to be verified automatically , Manual testing Web Page functions )
3) Abnormal situation ( If a third party is required API Hang up / Timeout scenario )
1、 The difficulty of interface automation
1) Realize change vs Maintenance workload vs Check the level of detail
Check the level of detail : Compare yourself to yourself ; Compare the same index with similar interfaces ( Because the caliber is inconsistent , Or implement changes internally , Subsequent maintenance is required )
Experience : Compare yourself to yourself , Good expansion and compatibility ( Dynamic parameters + Complete the function check ); Compared with other interfaces It depends on demand ( Before and after interface test Data accuracy check comparison reference );
P.S. A little bit smaller , Execution time and frequency
purpose : Found dysfunctional , Function not available ;
2) Interface monitoring —— Execution time and frequency
- Check the level of detail vs Execution time and frequency ( Only with yourself )
- Check the level of detail vs Call the police frequently ( How is an interface normal , Return non 200+ Function is normal )
3) Data reports
The correctness of the data : Statistical caliber ( The caliber of the business party + Multiple interfaces / The difference of module caliber leads to the inconsistency of business parties )
2、 Pain point of interface automation
Of course, the pain point comes from the difficulty :
- When the implementation of the interface itself changes frequently 、 The inspection of the interface is too detailed 、 When development and repair are slow , Then the constant alarm will come
- Unreasonable automation design and maintenance scheme , When the cost of automation is greater than the benefit of Automation , Interface automation becomes insignificant
The experience in the actual project is : Automation for automation . Especially when the test scenario is too complex , When the cost of automation is much greater than the cost of manual testing , There is no need to automate testing
be relative to UI In terms of Automation , Interface automation has greater value
In order to optimize the transformation path or improve the user experience ,APP/web The button controls and layout of the interface will change once in almost every version , Frequent code changes that lead to automation , It didn't reduce the workload
Once the interface is developed , Post refactoring / The frequency of substantial modification is lower . Therefore, the cost performance of interface automation is still very high , For the regression of old functions in iterative versions ,beta test , Online regression can get twice the result with half the effort

版权声明
本文为[Netease Test Development Center]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230302083576.html
边栏推荐
- Simple example of using redis in PHP
- Opencv reads webcam video and saves it locally
- How to use C language to realize [guessing numbers game]
- MYSQL_ From mastery to abandonment
- 使用两种方法来解决“最大回文数乘积”问题
- Gavl021, gavl281, AC220V to 5v200ma small volume non isolated chip scheme
- Thoughts on the 2022 national network security competition of the national secondary vocational group (only one idea for myself) - network security competition questions (7)
- 由于3²+4²=5²,所以称‘3,4,5‘为勾股数,求n(包括n)以内所有勾股数数组。
- PDH optical transceiver 4-way E1 + 4-way 100M Ethernet 4-way 2m optical transceiver FC single fiber 20km rack type
- Face longitude:
猜你喜欢
Laravel8- use JWT
Detailed log display of openfeign call
樹莓派開發筆記(十二):入手研華ADVANTECH工控樹莓派UNO-220套件(一):介紹和運行系統
Traversal of l2-006 tree (middle and later order determination binary tree & sequence traversal)
Opencv fills the rectangle with a transparent color
TP5 inherits base and uses the variables in base
tf. keras. layers. Density function
Opencv combines multiple pictures into video
Summary of interface automation interview questions for software testing
Traversée de l'arbre L2 - 006
随机推荐
tf. keras. layers. Conv? D function
MYSQL05_ Ordr by sorting, limit grouping, group by grouping
MYSQL04_ Exercises corresponding to arithmetic, logic, bit, operator and operator
c#可变参数params的介绍
Array and collection types passed by openfeign parameters
TP5 customization in extend directory succeeded and failed. Return information
Source Generator实战
腾讯视频VIP会员,周卡特价9元!腾讯官方直充,会员立即生效!
C#语法糖空合并运算符【??】和空合并赋值运算符【 ??=】
使用两种方法来解决“最大回文数乘积”问题
Résumé du gestionnaire de projet du système d'information Chapitre VI gestion des ressources humaines du projet
Wepy learning record
[learn junit5 from official documents] [II] [writingtests] [learning notes]
Assembly learning Chapter III of assembly language (Third Edition) written by Wang Shuang
Thoughts on the 2022 national network security competition of the national secondary vocational group (only one idea for myself) - network security competition questions (9)
7-11 重排链表 (25 分)
ASP.NET 6 中间件系列 - 自定义中间件类
Recursion - outputs continuously increasing numbers
Restart redis
Regular object type conversion tool - Common DOM class