Interface testing method and system, electronic device, and storage medium

A technology of interface testing and interface, which is applied in the field of testing, can solve the problems of low efficiency and accuracy of interface testing, and achieve the effect of improving test accuracy, avoiding overhead, and improving accuracy

Pending Publication Date: 2019-01-11
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF4 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] The technical problem to be solved by the present invention is to provide an interface testing method and system, electronic equipment, and a storage medium in order to overcome the defects of low efficiency and accuracy of interface testing in the prior art

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
  • Interface testing method and system, electronic device, and storage medium
  • Interface testing method and system, electronic device, and storage medium
  • Interface testing method and system, electronic device, and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0072] This embodiment provides a general interface testing method, such as figure 1 As shown, the interface testing method of the present embodiment includes the following steps:

[0073] Step 101. Obtain the result data of the interface execution test case.

[0074] Among them, the test cases include:

[0075] Interface test configuration parameters, including interface address, call timeout, call method, call protocol name, etc.;

[0076] Interface call parameters, including various data types, such as JSON, xml, etc., are used as input parameters for organizational testing;

[0077] The interface parameter strategy is used to analyze specific parameters using different strategies according to the parameter type, and to check and convert the format and type of the input parameters;

[0078] The returned result type is convenient for specific analysis of the returned result data; in order to achieve targeted analysis of the result data of the relevant use c...

Embodiment 2

[0091] On the basis of Embodiment 1, this embodiment provides a possible implementation manner of parsing result data whose data type is basic data. Step 104 specifically includes:

[0092] Determine whether the data value in the result data is the same as the data value in the expected result.

[0093] If the judgment is negative, the test result in step 105 is that the test fails.

[0094] If the judgment is yes, the test result in step 105 is that the test is passed.

[0095] In this embodiment, data matching is performed on basic data such as string data, Boolean data, integer data, and long data, so as to ensure that key information is not missed in the judgment process and improve the accuracy of the test.

Embodiment 3

[0097] On the basis of Embodiment 1, this embodiment provides a possible implementation manner for parsing result data whose data type is set data. Step 104 specifically includes:

[0098] Determine whether the data length, data sequence, and data value of the result data are the same as those of the expected result.

[0099] If the judgment is negative, it means that at least one parameter of the two data length, data sequence and data value is different, and the test result in step 105 is that the test fails.

[0100] If the judgment is yes, it means that the data length, data sequence and data value of the two are the same, and the test result in step 105 is that the test is passed.

[0101] In this embodiment, for order-sensitive set data, such as List data, not only the data is fully matched, but also the length and order of the data are matched, which avoids misjudgment caused by the order and improves the accuracy of the test.

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 an interface testing method and system, an electronic device and a storage medium. The interface testing method comprises the following steps: obtaining the result data of an interface execution test case; judging whether the data format of the result data is the same as the data standard format of the interface; selecting an assertion strategy corresponding to the data type of the result data when the judgment is yes; parsing the result data according to the assertion strategy and generating test results. The invention is applicable to the testing of various types of interfaces. The format of the interface is analyzed first. If the returned format is abnormal, the format of the interface analysis is considered to be wrong, and the test result that the interface test does not pass the test can be obtained, thereby avoiding the cost of related further comparison. If the format is confirmed to be correct, different types of result data can be parsed to achieve fine and focused judgment of the results, which improves the accuracy of the assertion and further improves the accuracy of the test.

Description

technical field [0001] The invention relates to the technical field of testing, in particular to an interface testing method and system, electronic equipment, and a storage medium. Background technique [0002] In the conventional interface testing process, for the complex and business-diverse interface data returned by the test interface, testers often need to do automatic analysis according to specific requirements in order to perform targeted assertion analysis on the interface data. If the automatic analysis of complex data cannot be realized, the entire automated assertion process will not be sustainable, which will affect the normal progress of the automated test process and reduce test efficiency. [0003] In the existing technology, the automatic analysis of complex data is completed in the following way: convert the data returned by the interface into a sequenced string, and compare it with the expected return result of the interface to determine whether the two mat...

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/3684G06F11/3688
Inventor 王昌孙胜方焦晋科
Owner BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products