当前位置:网站首页>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
边栏推荐
猜你喜欢

wireshark安装

C # / vb. Net supprime le filigrane d'un document word

Kysl Haikang camera 8247 H9 ISAPI test

MySQL - common functions - string functions

Matlb| economic scheduling with energy storage, opportunity constraints and robust optimization

HAVE FUN | “飞船计划”活动最新进展

C#/VB.NET 删除Word文檔中的水印

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

3--新唐nuc980 kernel支持jffs2, Jffs2文件系统制作, 内核挂载jffs2, uboot网口设置,uboot支持tftp

Classify the features of pictures with full connection +softmax
随机推荐
The so-called consumer Internet only matches and connects industry information, and does not change the industry itself
MySQL提升大量数据查询效率的优化神器
This week's hot open source project!
Statistics of radar data in nuscenes data set
[unity notes] screen coordinates to ugui coordinates
【Socket】①Socket技术概述
服装企业部署MES管理系统的五个原因
PCL 常用拟合模型及使用方法
What management points should be paid attention to when implementing MES management system
C语言练习题_1
The panel floating with the mouse in unity can adapt to the size of text content
Summary of basic debugging steps of S120 driver
STM32 project -- Topic sharing (part)
How to build a 32core raspberry pie cluster from 0 to 1
Code line breaking problem of untiy text box
Untiy文本框的代码换行问题
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
Remember the problem analysis of oom caused by a Jap query
PostgreSQL图形化界面工具之pgAdmin4
导数、偏导数、方向导数