当前位置:网站首页>Interface test series - interface test practice of transfer transaction business scenarios

Interface test series - interface test practice of transfer transaction business scenarios

2022-06-09 02:24:00 Testerhome official

Source of the article : This article is excerpted from TesterHome Written by community enthusiasts 《2021 Interface test white paper 》.

01 Why The interface test

One 、 Increase of efficiency

key word :QA Responsible for completing the requirement test with quality and quantity guaranteed Improve efficiency on the premise of ensuring quality , Quality assurance , First of all, we need to find out the test scope of this requirement , Targeted use of different test methods , Interface testing is one of them ; Ensure efficiency , Reducing cost and increasing efficiency is an old topic of growth , It's also QA Always pursue , Promoting technology self-test is one way , Using automation instead of labor is also a way , But either way , We need to ensure the correct implementation of the main business process , Automation is the solution to this problem .

Two 、 Increase understanding of the business

key word : Be clear about the purpose of the requirements and the technical realization scheme
Recent high frequency words : Test shift left .
When the demand is approved , Just understand the purpose of the demand , from QA Give advice from an angle ; When reviewing the same technical proposal ,QA We also need to start from our own point of view , Starting from risk awareness , Point out the possible problems in the technical scheme , If QA Don't know anything about technology , During the technical review , There's no way to start .

key word : And RD Building a common language
The premise of communication is : Need to have a common topic . When RD When you don't understand the details ,RD I would say “ That's it , You do as I say ”——QA In a passive position . An impressive thing , A colleague pointed out RD Logical errors in code , From then on, some things will go very smoothly .

3、 ... and 、 Relatively high input-output

From the automation pyramid , Interface testing is a good way of input-output .

02 How How do you do it? ? Timing of application

One 、 During requirements testing

1.1 Zhongtai itself needs to connect with many business parties , The development workload of some demand business parties will be large , The middle stage only needs to do some configuration or little code development . This is the time , If the middle stage QA Also follow the test schedule on the business side , There will be unreasonable allocation of resources . Interface testing can solve this problem to a certain extent . Zhongtai RD After the test , Zhongtai QA Complete the interface test ; Business RD During the measurement , Zhongtai QA Just cooperate with the business QA Just test it ;

1.2 Big projects take a long time , And this time , Testers are usually multi person , If the process doesn't work , It affects a single time x Number of personnel . At present, some operations are being implemented during joint commissioning ,QA Conduct interface test ; After the test , Perform functional tests . This ensures that the main process is open ,QA You can also enter the state faster . ** Two 、 After the demand goes online , Supplementary use cases ** Process regression and monitoring are used most in automation scenarios , Sort out the business at intervals , And precipitate it in the form of documents and automated use cases .

03 During requirements testing

With XXX Take the project as an example ,XXX The business line adds a recycling business model , In order to set up a new business line id、 There are few changes in configuration of state machine , The business side needs to do a lot of development work .

04 Functional disassembly

UI Interaction : Don't involve A functional test : Business side test The interface test : Order creation , Order status flow Buried point : nothing Functional regression : nothing , New business lines

05 Technical review

Retrial compensation mechanism Abnormal scenarios such as parameter verification

06 Interface use case design

newly build 、 The circulation 、 retry 、 idempotent ,
Examples of actual situation of interface test :

07 Implementation of interface test

One 、 Use RD Single test code

There are the following disadvantages :
Management is not convenient
It cannot be reused in other projects
Cannot submit to gitlab

Two 、 Invest manpower in writing automation use cases

3、 ... and 、 Automated test platform

Two 、 3、 ... and The comparison is as follows :

Using platform , Reduces repetitive work outside of coding , Use cases can be assembled freely , There will be no people After the handover , The previous code is obsolete .

08 APITest Interface test platform

Two entrances : Demand dimension 、 Engineering dimension , Solve the demand test and after the service goes online , There are two scenarios for supplementary use cases .
give an example : Demand entry

** To do a good job in interface testing , You can't isolate the interface .** On business scenarios , Is the interface 、mq、sql sentence 、redis And so on . Separate interface test , Only isolated points can be covered , Cannot cover the whole A process . To do a good job in interface testing , To connect the test platform, you need to put the tools used on a plane . at present apitest The idea is as follows For a use case , Use case aggregation is the use case set .

09 Schematic diagram of test set

Use cases are executed sequentially in the use case set , At present, it is not supported to interrupt the whole use case set if a single use case fails .

10 A parameterized

** When it comes to automation , You will encounter the problem of parameter passing .** All companies qa Because the tools in contact are not equally , The idea will be different .apitest It's using jsonPath How to resolve input and output parameters , Let data flow between use cases .

11 Assertion

apitest Also use jsonPath Analyze the results , To assert .

12 Test report

The test report is as follows , In two parts : Overview and details . The overview shows the information of the use case set dimension , Details show the execution results and assertion results of a single step .

13 Beetle linkage

There are two ways to trigger the use case set : Timing execution 、 Trigger execution . Scheduled execution will not be described in detail , Trigger execution beetle Active invocation of ,apitest Will return a unique execution record id, follow-up beetle Call the result query interface to get the test report of the use case set .

Next episode Trailer : Transfer transaction business scenario interface test practice

This article is excerpted from Testerhome Written by community enthusiasts 《2021 Interface test white paper 》, Click the link to view and download the full version 《2021 Interface test white paper 》.

 Today's knowledge has been absorbed ~

原网站

版权声明
本文为[Testerhome official]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090212373785.html