Interface testing need to know?

1. What is the interface to test?

Testers called "interface test" is a test for an interface between the various components of the system, which is a functional test. The interface can be measured in Common interface operation difficult to find. As we all know the system is composed of a front-end back-end, front-end to do some data verification, backend also needs to be checked to ensure the safety, interface operation can obviously only checks to verify that the front layer, only direct face the order of the interface between the front and rear ends of the rear end also examine whether to do a check.

 

2 , Why do interface testing? 

a) System complexity of today's rise, a sharp increase in the cost of traditional testing methods and a substantial decline in test efficiency, test interfaces can provide a solution in this case.

 

b) interface testing is relatively easy to automate continuous integration, and UI Automation also relatively stable, can reduce manual regression testing time and labor costs, shorten the test cycle, the back-end support fast development version requirements. Continuous integration interfaces can be the root of why the low-cost high-yield.

 

c) Now a lot of the front and rear end systems architecture is separate from a security perspective, the:

 

      1, depends only on the front end has to be limiting system can not meet the security requirements (too easy to bypass the front), the rear end of the same need to be controlled, it is necessary to verify the level of the interface in this case.

 

      2, the front and rear end of the transmission, whether to encrypt the log information transmission and print authentication is required, particularly in relation to the user's private information, such as identity cards, bank cards and the like.

 

3, interface test problem found?

1) can be found in many operating page can not find the problem;

2) exception handling capabilities of the inspection system;

Security 3) inspection system, stability;

4) the front end just becomes, the interface test well, the rear end not changed;

 

4, interface testing process?

1) needs assessment, familiar with the business and demand

2) development to provide interface documentation

3) interface to write test cases

4) Example Review

5) start the test measurement Timothy

6) submit test reports

 

5 , interface documentation is interface testing of reference, at least include:

1) Interface Description

2) call url

3) request method (get \ post ......)

4) request parameters, parameter types, Request Parameter

5) Return Parameter Description

 

6, the interface design test cases

 (1) verify the correctness: First, to ensure the interface easy to use, according to the normal incoming documents, see if you can return the correct results.

 (2) a combination of parameters: interface document according to the requirements for a purpose parameter combinations, such as unfilled if required by a flag whether the handover parameter values ​​corresponding to the class can function correctly. (This part is key) (3) interface security: 1, bypassing normal authentication. 2, bypass identity verification authorization. 3, the parameter is encrypted, the encryption rules are easy to crack. 4, the complexity of the verification password security rules, the password.

 (4) Verify exception: no input parameters as required in the interface document, to verify the reaction interface abnormal condition.

 

7, an interface test case template (may increase or decrease based on the actual design of the project)

  1, a test project for which project

  2, which function module module

  3, example id

  4, the interface name

  5, use cases for testing purposes are summarized title

   6, request method GET / POST

  7, the request url URL address

  8, request parameters

  9, pre-conditions dependent execution condition of the current request, not satisfied can not be executed correctly

  10, the results validate the expected results

  11, the request message can not write

  12, returned messages must be written, this should be your request to return real results

  13, the test results Pass / Fail

  14, testers

 

8 , test http Interface

  Get requests are common and Post request request. Get request measurement information is completed using a browser, which parameters can be written in the URL, as measured by tools such as Post request requires Postman, because the need to provide the client to the server; Get request to receive data normally, typically used to send the data request Post more, body you write large amounts of data.

   接口调用有两种传参方式:key-value形式,Json串传参形式。 key-value形式可以把参数拼接在url的后面由?相连,多个参数之间用&相连;如url?parameter1=key1&parameter2=key2… ;Json串传参不能把参数直接连在url中,需要写在请求的body里面,可借助工具Postman,打开请求的body写入Json格式参数(由花括号括起来的‘键:值’对)如 { “count”: 1, “start”: 0, “total”: 1 }

 

9我们怎么做接口测试?

  由于我们项目前后端调用主要是基于http协议的接口,所以测试接口时主要是通过工具或代码模拟http请求的发送与接收。工具有很多如:postman、jmeter、soupUI、Java+httpclient、robotframework+httplibrary等

 

Guess you like

Origin www.cnblogs.com/shaoloveyou/p/11003012.html