Unlock instant, AI-driven research and patent intelligence for your innovation.

Mock test method and system for business logic interface

A business logic and testing method technology, applied in the field of software automation testing, can solve the problems such as the inability to quickly construct and maintain data in the automated interface test, the low efficiency of automated execution, and the inability to perceive and analyze the abnormality of the returned packets of the interface in a timely and effective manner. , to achieve the effect of shortening time, improving efficiency and reducing costs

Active Publication Date: 2018-11-16
CTRIP COMP TECH SHANGHAI
View PDF3 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The technical problem to be solved by the present invention is to overcome the fact that the interface automation test in the prior art cannot quickly construct and maintain the data of various complex logic scenarios, and the automation execution efficiency is low, and the abnormal situation of the interface return message cannot be timely and effectively perceived and analysis defects, providing a business logic interface mock test method and system

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Mock test method and system for business logic interface
  • Mock test method and system for business logic interface
  • Mock test method and system for business logic interface

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0060] Such as figure 1 As shown, the business logic interface mock testing method involved in this embodiment includes the following steps:

[0061] S101. Receive an SOA request of a business logic interface, and return test data corresponding to the business logic interface as expected data from a test tool.

[0062] In the specific implementation, test the SOA request of the business logic interface through the test tool, so as to obtain the test data corresponding to the business logic interface, and then use the test data as the expected data of the business logic interface, so that the business logic interface can be obtained through the test tool The expected values ​​corresponding to each scenario of the test, and then save these expected values ​​in the expected results of the automated test script.

[0063] S102. Obtain mock data corresponding to the service logic interface from the distributed cache as result data according to the service logic interface.

[0064]...

Embodiment 2

[0087] Such as Figure 5 As shown, the business logic interface mock test system involved in this embodiment includes a first acquisition module 1 , a second acquisition module 2 , a comparison module 3 and an assertion module 4 . Wherein, the first acquisition module 1 is used to receive the SOA request of the business logic interface, and returns the test data corresponding to the business logic interface as expected data from the test tool; the second acquisition module 2 is used to obtain The mock data corresponding to the business logic interface is obtained from the distributed cache as the result data; the comparison module 3 is used to compare the result data with the expected data; the assertion module 4 is used to output the comparison result according to the comparison module 3 Return the assertion corresponding to the business logic interface, the assertion includes that the result data matches the expected data, or the result data does not match the expected data,...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a mock test method and a mock test system for a business logic interface, wherein the method comprises: S1, receiving an SOA request of the business logic interface, and returning test data corresponding to the business logic interface from a test tool as expected data; S2, obtaining the mock data corresponding to the business logic interface from the distributed cache according to the business logic interface as the result data; S3, comparing the result data with the expected data; and S4, returning the assertion corresponding to the business logic interface accordingto the comparison result, wherein the assertion includes that the result data is matched with the expected data or the result data is not matched with the expected data. By performing the mock test onthe business logic interface, the invention greatly improves the efficiency of the interface test and the reuse rate of the regression test, reduces the cost of the management data, and shortens thetime of each release.

Description

technical field [0001] This field relates to the technical field of software automation testing, in particular to a business logic interface mock (virtual) testing method and system. Background technique [0002] Existing interface automation testing methods cannot quickly construct and maintain data of various complex logic scenarios, and usually verify that the parameters returned by the interface are passed through XPath (a language for finding information in XML (Extensible Markup Language) documents) path Such a single verification method has the following problems: the algorithm and business scenario class interface have many construction steps due to the strongly dependent data source, and the data source is unstable, resulting in high maintenance costs for automated data, resulting in a high failure rate for automated execution; it is difficult to guarantee API (Application Programming Interface, application programming interface) test interface parameters 100% cover...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3624G06F11/366
Inventor 汪辰王良玉张秋会
Owner CTRIP COMP TECH SHANGHAI