当前位置:网站首页>How to design interface test cases? Teach you a few tips to draft easily
How to design interface test cases? Teach you a few tips to draft easily
2022-07-07 02:42:00 【Xiaowu knock code】
Interface testing is a part of project testing , As its name suggests , The main object it tests is the interface , It is a kind of test to test the interface between system components . The interface test is mainly used to detect the interaction points between the external system and the tested system and between the internal systems . The focus of the test is to check the data interaction 、 Pass on 、 Control and management processes and interdependencies between systems .
Interface test a request , Different parameter combinations , It may become dozens of use cases , Accidentally write several interfaces , There are hundreds of use cases , It's disgusting to write endlessly . What do I do ?
When designing test cases, we can conduct primary and secondary analysis according to the business function of the project , Prioritize , First positive thinking , Then reverse , Categorize , Finally, there is time to consider whether to write use cases with low priority , If necessary, draw a mind map , Write after clear thinking .
When executing, it is also executed according to the priority , The whole hierarchy is clear , The management and maintenance of use cases have also become easier .
1. Grading of test cases
The following is the rank order I summarized in the actual test process :
1) The priority of the normal typical value use case of the main business function interface is 1( Use case for smoke test )
2) The normal typical value of the main function of each module, and the priority of the use case is 2
3) The priority of positive use cases and all abnormal use cases other than normal typical value use cases is 3
4) Usability testing, default values of input parameters, and parameter types that are restricted by development 、 The priority of developing tests such as errors easily found in self-test is 5, Lowest priority
Of course, if you write down the above, you will find that there are still many , At this time, you should think about whether these partial use cases you designed are really meaningful ? Has the actual user usage scenario been taken into account 、 need ? Is it possible that this scenario will occur ? Do programmers have any restrictions on these fields , Do they promise not to make mistakes like this or that , If they have made control to ensure that there will be no exceptions designed by you , Why do you have to do this ? Four no four ?
At this time, you may say , Not ah , When it comes to testing , My supervisor told me to combine according to the test method , Measure everything , You were UI Layer test . The design of interface test cases is not the business layer , It cannot be arranged and combined purely according to mathematics , We should also subtract according to the actual situation .
2. Screening of test cases
So… We need to screen the use cases , Interface testing belongs to a lower level of testing , Of course, all manual testing methods are used , However, the interface parameter data needs to analyze each parameter according to the actual function of the test interface , Logical combination and arrangement shall be carried out when it meets the business logic , There are some cases , Itself through the design of code , Made some restrictions , Mistakes don't happen in UI Layer drop
Write use cases according to the test method and the data design written in the last blog , Do the following screening :
1) Eliminate unimportant interfaces
2) Exceptions are use cases, which are removed or retained according to whether the interface itself is compatible with exceptions or whether there is front-end control
3) According to the interface documentation , Actual business situation , scene , Select the function to be realized by the interface
4) Development assistance screening again
3. Testing principle
1) Basic configuration , Such as domain name , Environment configuration, etc , Separate file configuration , Facilitate testing in different environments , Script maintenance
2) Specify what functions the interface implements , What kind of functions are actually needed . Is it consistent
3) Too much interface test data , Using data-driven mode is more hierarchical , And easy to maintain
4) Smoke test cases and test cases that can be used for performance test should be selected from many test cases
5) Single interface test first , In multi interface business testing
6) After the test is completed , Need to clean up dirty data
How to design interface test cases ?
First , Clear the starting point . Like all tests , The starting point of interface testing is to prove that the program under test is wrong . Guided by this starting point , Your design behavior will try to develop in this direction , It's easier to find problems , There will be no deviation in the general direction .
secondly , Choose a good test object . For a system to do interface testing, choosing a good test object is the key to interface testing . A system has countless interfaces , If each interface is tested separately , It's going to be a very painful thing , It's not just cumbersome and wasteful , And any internal interface changes , Will result in the unavailability of our use cases .
It is recommended to take the whole system as a whole , Select the entire system for external use 、 The outermost interface of the interaction is your test object , The use case with this test object will have good robustness , And more efficient .
in addition , According to the flow of data , These outermost interfaces can be divided into two categories : One is the interface for data to enter the system ; One is the interface that data flows out of the system .
The interface into the system is actually the interface of the execution call of our use case . These interfaces can be called by changing parameters , Simulate external use ; And the outgoing interface is the point where our use case really needs to be validated .
Where does the data flow from , What's the state of the outflow , At this time, the state of the system is what we should verify .
Finally, thank everyone who reads my article carefully , The following online link is also a very comprehensive one that I spent a few days sorting out , I hope it can also help you in need !

These materials , For those who want to change careers 【 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 ! Everything should be done as soon as possible , Especially in the technology industry , We must improve our technical skills . I hope that's helpful ……
If you don't want to grow up alone , Unable to find the information of the system , The problem is not helped , If you insist on giving up after a few days , You can click the small card below to join our group , We can discuss and exchange , There will be various software testing materials and technical exchanges .
| Click the small card at the end of the document to receive it |
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 .
Self study recommendation B Stop video :
Zero basis transition software testing : Self taught software testing , Got the byte test post offer, Is the B The best video station !
Advanced automation testing : Huawei has landed , Salary increase 20K,2022 Most suitable for self-study python Automated test tutorial , Spend it yourself 16800 Bought , Free sharing
边栏推荐
- 本周 火火火火 的开源项目!
- MMDetection3D加载毫米波雷达数据
- Have fun | latest progress of "spacecraft program" activities
- KYSL 海康摄像头 8247 h9 isapi测试
- Pgadmin4 of PostgreSQL graphical interface tool
- wireshark安装
- Untiy文本框的代码换行问题
- Matlb| economic scheduling with energy storage, opportunity constraints and robust optimization
- postgresql之整体查询大致过程
- Gee upgrade can realize one piece of run tasks
猜你喜欢

数论 --- 快速幂、快速幂求逆元

Google Earth engine (GEE) -- 1975 dataset of Landsat global land survey

Unity custom webgl packaging template

MES管理系统的应用和好处有哪些

3 -- Xintang nuc980 kernel supports JFFS2, JFFS2 file system production, kernel mount JFFS2, uboot network port settings, and uboot supports TFTP

Lombok makes the pit of ⽤ @data and @builder at the same time

What are the characteristics of the operation and maintenance management system

记一次JAP查询导致OOM的问题分析

The third season of ape table school is about to launch, opening a new vision for developers under the wave of going to sea

unity中跟随鼠标浮动的面板,并可以自适应文字内容的大小
随机推荐
4--新唐nuc980 挂载initramfs nfs文件系统
Cloud Mail .NET Edition
leetcode:736. LISP syntax parsing [flowery + stack + status enumaotu + slots]
[C # notes] reading and writing of the contents of text files
压缩 js 代码就用 terser
进程管理基础
CSDN summer camp course project analysis
Niuke programming problem -- double pointer of 101 must be brushed
Lombok makes the pit of ⽤ @data and @builder at the same time
MES管理系统的应用和好处有哪些
Safety delivery engineer
服装企业部署MES管理系统的五个原因
C#/VB.NET 删除Word文檔中的水印
Introduction to the internal structure of the data directory of PostgreSQL
Summary of basic debugging steps of S120 driver
What are the characteristics of the operation and maintenance management system
Planning and design of double click hot standby layer 2 network based on ENSP firewall
差异与阵列和阵列结构和链表的区别
代码调试core-踩内存
Oracle中日期的使用方法实例