How interface design test cases?

I. Introduction

  Before starting interface testing, we think about what the process interface test is? Here, some people will have a curiosity and doubt, and my heart mmp: What is the process interface testing to Kazakhstan? ? ? Not that reference interface documentation, direct use interface test tools (eg jmeter and postman) test. . . In fact, if a project in just a few interfaces, you can do a temporary interface testing, but the project can be more than a few interfaces, ranging from dozens of interfaces, as many as hundreds of thousands of interfaces. In addition, if your company's project, the first to do interface testing. And the ancients said:. "No rules no standards," So ha, we still need to strictly abide by the process interface testing.

Second, the interface testing process

  Interface Test belongs to functional testing, interface testing process is similar to the previous functional tests. Interface testing process is as follows:

  1. Take the test as soon as possible to find a development interface documentation (requirements documents);
  2. The interface document to write test cases (use cases may be prepared according to conventional write rules, such as equivalence partitioning, the design method of boundary value, scene, etc.);
  3. Perform a test to see different parameters of the request, the interface returned data is as expected

Third, why write use cases

  1. Clarify ideas, to avoid leakage test and measurement is repeated;
  2. Improve test efficiency;
  3. Follow-up test progress;
  4. Better identify problems and record problems, recurring problem;
  5. Follow repetitive work;
  6. Tell Leadership: I have done;
  7. A product of the process interface test (test)

  7:00 above, useful for example, own an idea, not a test point measurement is repeated many times, but also to avoid leakage test.

Fourth, the case design Interface

  

  From four cases with interface design aspects: functionality, business logic, abnormal, safety

  Features:

  1) function is normal;

  2) function is implemented in the interface documentation

       Example: For example, add a garden blog essay, you need to be logged in to add. That is not supported by operational requirements essays visitors added functionality, if the design is not a logged-on user, and then to add essay test interfaces, interfaces can be added to the results of essays, the function is not normal, does not meet the requirements, and interface description document.

  Business Logic: is dependent service;
       Example: Before calling this interface, the interface need to call log, if not also logged data request, does not meet the business logic.

  异常:参数异常和数据异常
  1)参数异常:关键字参数,参数为空,多,少参数,错误参数

  2)数据异常:关键字数据,数据为空,长度不一致,错误数据
       举例:不管数据异常还是参数异常,测试点差不多,一个参数有key和value,key表示参数,value表示数据。第一,看看参数和数据能不能支持关键字,例如Java中的保留关键字等等。第二个就是参数和数据都为空,看看是否做了判断。第三个,参数多和少,例如有两个参数的接口,你需要设计一个三个参数的用例,一个只有一个参数的用例。数据那边长度不一致,例如设计很长的字符串是否支持,因为数据库创建表过程都设置好了每个字段的长度。输入错误的参数和数据,例如故意输出单词等等。

  安全测试用例设计:
  1)cookie:有cookie才能获取数据,如果不带cookie还有信息返回,说明有问题
  2)header:正常接口带header信息,删除header看是否能够返回数据。
  3)唯一识别码:app手机识别码,一般是唯一的。

       安全测试主要从上面三点检查。第三个是唯一识别码,主要是指app上手机的识别码,一般很少用到,除非很严格的接口测试,例如银行app登录,需要指纹,而指纹来源手机,一般有一个手机识别码判断过程。

 

 参考链接:https://www.cnblogs.com/du-hong/p/10508736.html

Guess you like

Origin www.cnblogs.com/huainanhai/p/11966410.html