CN114546854A - Interface testing method and device, electronic equipment and storage medium - Google Patents

Interface testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114546854A
CN114546854A CN202210158708.4A CN202210158708A CN114546854A CN 114546854 A CN114546854 A CN 114546854A CN 202210158708 A CN202210158708 A CN 202210158708A CN 114546854 A CN114546854 A CN 114546854A
Authority
CN
China
Prior art keywords
interface
field
test
iteration
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210158708.4A
Other languages
Chinese (zh)
Inventor
兰海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202210158708.4A priority Critical patent/CN114546854A/en
Publication of CN114546854A publication Critical patent/CN114546854A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The invention relates to an interface test technology, and discloses an interface test method, which comprises the following steps: extracting an iteration interface identifier in the interface field iteration request, and determining an interface configuration parameter corresponding to the iteration interface identifier which is the same as the interface identifier as a first interface configuration parameter according to the interface identifier; extracting an iteration type and a corresponding iteration field parameter in the interface field iteration request, and performing field iteration processing on a field in the first interface configuration parameter to obtain a second interface configuration parameter; carrying out parameter replacement on the second interface configuration parameters by using the test field parameters, and carrying out entry parameter updating on each interface test case by using the replaced second interface configuration parameters; and testing the interface by using the updated interface test case to obtain a test result. The invention also relates to a block chaining technique, the interface configuration parameters can be stored in block chain link points. The invention also provides an interface testing device, equipment and a medium. The invention can improve the efficiency of interface test.

Description

Interface testing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to interface testing technologies, and in particular, to an interface testing method and apparatus, an electronic device, and a storage medium.
Background
At present, interface testing by using an interface case is a common interface testing method. However, in the existing interface case testing method, when an interface is iterated, each interface test case corresponding to the interface needs to be reconfigured with parameters, which consumes a long time and causes the efficiency of interface testing to be low.
Disclosure of Invention
The invention provides an interface testing method, an interface testing device, electronic equipment and a storage medium, and mainly aims to improve the efficiency of interface testing.
Acquiring interface configuration parameters of different interfaces to obtain an interface configuration parameter set, wherein each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier;
receiving an interface field iteration request, extracting an iteration interface identifier in the interface field iteration request, and screening interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iteration interface identifier to obtain first interface configuration parameters;
extracting an iteration type and a corresponding iteration field parameter in the interface field iteration request, and performing field iteration processing on a field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter, wherein the iteration type comprises field addition, field deletion and field value change;
acquiring an interface test case set corresponding to the interface field iteration request, wherein each interface test case in the interface test case set has a corresponding test field parameter;
performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain a target test parameter corresponding to the test field parameter;
performing entry-reference updating on each interface test case in the interface test case set by using the target test parameters to obtain a target interface test case;
and testing the interface by using the target interface test case to obtain a test result.
Optionally, the screening, according to the interface identifier and the iterative interface identifier, the interface configuration parameters in the interface configuration parameter set to obtain first interface configuration parameters includes:
determining an interface identifier which is the same as the iteration interface identifier as a target interface identifier;
and selecting the interface configuration parameters corresponding to the target interface identification in the interface configuration parameter set to obtain the first interface configuration parameters.
Optionally, the performing field iteration processing on the field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter includes:
when the iteration type is field addition, adding all fields in the iteration field parameters and corresponding field values into the first interface configuration parameters to obtain second interface configuration parameters;
when the iteration type is field deletion, deleting a field in the first interface configuration parameter which is the same as a field in the iteration field parameter and a corresponding field value to obtain a second interface configuration parameter;
and when the iteration type is field value change, replacing the field value of each field in the first interface configuration parameter with the field value corresponding to the same field in the iteration field parameter to obtain the second interface configuration parameter.
Optionally, the performing, by the test field parameter, parameter replacement on the second interface configuration parameter to obtain a target test parameter corresponding to the test field parameter includes:
and replacing the value corresponding to the same field in the second interface configuration parameter with the value corresponding to each field in the test field parameters to obtain the target test parameters.
Optionally, the obtaining a target interface test case by performing entry parameter updating on each interface test case in the interface test case set by using the target test parameter includes:
determining the test field parameters corresponding to the target test parameters as target test field parameters;
and replacing the target test parameters with interface input parameters in the interface test case corresponding to the target test field parameters to obtain the target interface test case.
Optionally, the testing the interface by using the target interface test case to obtain a test result includes:
selecting an interface to which the first configuration parameter belongs from all the interfaces to obtain a target interface;
calling and testing the target interface by using the target interface test case to obtain a case test result;
and summarizing all the case test results to obtain the interface test result.
Optionally, the invoking test on the target interface by using the target interface test case to obtain a case test result includes:
calling the target interface by using the target interface test case to obtain calling return data of the target interface;
and obtaining expected result data corresponding to the target interface test case, and comparing the call return data with the expected result data to obtain the case test result.
In order to solve the above problem, the present invention further provides an interface testing apparatus, including:
the interface field iteration module is used for acquiring interface configuration parameters of different interfaces to obtain an interface configuration parameter set, wherein each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier; receiving an interface field iteration request, extracting an iteration interface identifier in the interface field iteration request, and screening interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iteration interface identifier to obtain first interface configuration parameters; extracting an iteration type and a corresponding iteration field parameter in the interface field iteration request, and performing field iteration processing on a field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter, wherein the iteration type comprises field addition, field deletion and field value change;
the interface entry parameter updating module is used for acquiring an interface test case set corresponding to the interface field iteration request, wherein each interface test case in the interface test case set has a corresponding test field parameter; performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain a target test parameter corresponding to the test field parameter; performing entry-reference updating on each interface test case in the interface test case set by using the target test parameters to obtain a target interface test case;
and the interface test module is used for testing the interface by using the target interface test case to obtain a test result.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and the processor executes the computer program stored in the memory to realize the interface testing method.
In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored, the at least one computer program being executed by a processor in an electronic device to implement the interface testing method described above.
According to the embodiment of the invention, field iteration processing is carried out on the field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter, so as to obtain a second interface configuration parameter; performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain a target test parameter corresponding to the test field parameter; the target test parameters are used for performing entry parameter updating on each interface test case in the interface test case set to obtain a target interface test case, when the interface is iterated, only the field in the first interface configuration parameters needs to be iterated to obtain second interface configuration parameters, the parameters of each interface test case do not need to be reconfigured, the parameters can be updated only by uniformly calling the second interface configuration parameters, the updating speed of the interface test cases during interface iteration is increased, and the efficiency of interface testing is further increased.
Drawings
Fig. 1 is a schematic flowchart of an interface testing method according to an embodiment of the present invention;
fig. 2 is a block diagram of an interface testing apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device implementing an interface testing method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides an interface test method. The execution subject of the interface testing method includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, which can be configured to execute the method provided by the embodiments of the present application. In other words, the interface testing method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: the cloud server can be an independent server, or can be a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Referring to fig. 1, a flow diagram of an interface testing method according to an embodiment of the present invention is shown, where in the embodiment of the present invention, the interface testing method includes:
s1, obtaining interface configuration parameters of different interfaces to obtain an interface configuration parameter set, wherein each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier;
optionally. In the embodiment of the invention, the interface needs a method interface for interface parameter testing, and the interface configuration parameters are interface parameter fields of the corresponding interface and corresponding default field values.
Further, in the embodiment of the present invention, in order to facilitate identification and invocation of different interface configuration parameters, each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier, and the interface identifier may be an interface name, an interface ID, or the like.
In another embodiment of the present invention, the interface configuration parameters may be stored in the blockchain nodes, and the data access efficiency is improved by using the characteristic of high throughput of the blockchain nodes.
S2, receiving an interface field iteration request, extracting an iteration interface identifier in the interface field iteration request, and screening interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iteration interface identifier to obtain first interface configuration parameters;
in the embodiment of the present invention, an interface field iteration request is a request for iterative modification of a parameter field of an interface, where the interface iteration request includes: the interface identification of iteration, the type of iteration and the corresponding iteration field parameters.
In detail, in the embodiment of the present invention, the screening the interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iterative interface identifier to obtain the first interface configuration parameter includes:
determining an interface identifier which is the same as the iteration interface identifier as a target interface identifier;
and selecting the interface configuration parameters corresponding to the target interface identification in the interface configuration parameter set to obtain the first interface configuration parameters.
S3, extracting iteration types in the interface field iteration request and iteration field parameters corresponding to the iteration types, and performing field iteration processing on fields in the first interface configuration parameters according to the iteration types and the corresponding iteration field parameters to obtain second interface configuration parameters, wherein the iteration types comprise field addition, field deletion and field value change.
In detail, in the embodiment of the present invention, performing field iteration processing on a field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter, includes:
when the iteration type is field addition, adding all fields in the iteration field parameters and corresponding field values into the first interface configuration parameters to obtain second interface configuration parameters;
for example: and if the iteration type is field addition, the field in the iteration field parameter is 'name' field, and the field value corresponding to the 'name' field is '123', adding the 'name' field and the corresponding field value '123' into the first interface configuration parameter to obtain the second interface configuration parameter.
When the iteration type is field deletion, deleting a field in the first interface configuration parameter which is the same as a field in the iteration field parameter and a corresponding field value to obtain a second interface configuration parameter;
for example: and if the iteration type is field deletion and the field in the iteration field parameter is a name field, deleting the name field in the first interface configuration parameter and the corresponding field value 123 to obtain the second interface configuration parameter.
And when the iteration type is field value change, replacing the field value of each field in the first interface configuration parameter with the field value corresponding to the same field in the iteration field parameter to obtain the second interface configuration parameter.
For example: and if the iteration type is field value change, a field in the iteration field parameter is a 'name' field, a field value corresponding to the 'name' field is '123', and a field value corresponding to the 'name' field in the first interface configuration parameter is '345', replacing the field value '345' corresponding to the 'name' field in the first interface configuration parameter with '123', and obtaining the second interface configuration parameter.
S4, obtaining an interface test case set corresponding to the interface field iteration request, wherein each interface test case in the interface test case set has corresponding test field parameters.
In the embodiment of the present invention, the interface test case is an interface test case of an interface corresponding to the interface field iteration request, and includes: the method comprises the following steps of case name, calling mode, interface input parameters, operation steps and expected result data, wherein the case name is the name of an interface test case, the calling mode is the interface calling mode corresponding to the interface test case, the interface input parameters are pre-configured interface input parameters, the operation steps are the steps of an interface corresponding to the interface test case, and the expected result data are the preset data returned after the interface corresponding to the interface test case is called. The test field parameter is an interface field to be tested and a corresponding field value.
For example: the interface of the case A to be tested needs to be tested has 10 fields, but not every field needs to be tested, and two fields may need to be tested, so the interface parameter of the case A to be tested sets the field values of the two fields to be tested to the values to be tested under normal conditions, the other eight fields and the corresponding field values are default values, and the test field parameters in the embodiment of the invention are the fields to be tested and the set field values of the test corresponding to every field.
S5, replacing the second interface configuration parameter with the test field parameter to obtain a target test parameter corresponding to the test field parameter;
in detail, in the embodiment of the present invention, the performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain the interface parameter of the interface test case corresponding to the test field parameter includes:
and replacing the value corresponding to the same field in the second interface configuration parameter with the value corresponding to each field in the test field parameters to obtain the target test parameters.
For example: the test field parameters are commonly provided with two fields, namely a "name" field and an "address" field, the field value corresponding to the "name" field in the test field parameters is "123", the field value corresponding to the "address" field in the test field parameters is "234", the field value of the "name" field in the second interface configuration parameters is "456", and the field value of the "address" field in the second interface configuration parameters is "567", then the field value of the "name" field in the second configuration parameters is replaced by "456", and the field value of the "address" field is replaced by "567", then the second interface configuration parameters after replacement are used as the target test parameters corresponding to the test field parameters.
S6, performing entry-reference updating on each interface test case in the interface test case set by using the target test parameters to obtain a target interface test case;
in detail, in the embodiment of the present invention, performing entry parameter updating on each interface test case in the interface test case set by using the target test parameter includes:
determining the test field parameters corresponding to the target test parameters as target test field parameters;
and replacing the target test parameters with interface input parameters in the interface test case corresponding to the target test field parameters to obtain the target interface test case.
According to the embodiment of the invention, the second interface configuration parameter is subjected to parameter replacement by using the test field parameter, only the field to be tested and the corresponding value need to be replaced, and other default fields do not need to be configured independently, so that the configuration speed of the interface parameter of the interface test case is improved, and the test efficiency of the interface test case is further improved.
And S7, testing the interface by using the target interface test case to obtain a test result.
Specifically, in the embodiment of the present invention, the testing the interface by using the target interface test case to obtain a test result includes:
selecting an interface to which the first configuration parameter belongs from all the interfaces to obtain a target interface;
calling and testing the target interface by using the target interface test case to obtain a case test result;
and summarizing all the case test results to obtain the interface test result.
Further, in the embodiment of the present invention, the invoking test on the target interface by using the target interface test case to obtain a case test result includes:
calling the target interface by using the target interface test case to obtain calling return data of the target interface;
and obtaining expected result data corresponding to the target interface test case, and comparing the call return data with the expected result data to obtain the case test result.
For example: when the call return data is consistent with the expected result data, the corresponding case test result is normal; and when the call return data is consistent with the expected result data, the corresponding use case test result is abnormal.
In the embodiment of the invention, when the field is added, the field is deleted and the field value changes in the iterative process of the interface, only the maintenance of the interface configuration field is needed for iterative processing, and each individual interface test case is not needed to be maintained, so that the efficiency of the interface test case test is improved.
Fig. 2 is a functional block diagram of the interface testing apparatus according to the present invention.
The interface test apparatus 100 of the present invention can be installed in an electronic device. According to the implemented functions, the interface testing apparatus may include an interface field iteration module 101, an interface entry parameter updating module 102, and an interface testing module 103, which may also be referred to as a unit, and refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform fixed functions, and are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the interface field iteration module 101 is configured to obtain interface configuration parameters of different interfaces to obtain an interface configuration parameter set, where each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier; receiving an interface field iteration request, extracting an iteration interface identifier in the interface field iteration request, and screening interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iteration interface identifier to obtain first interface configuration parameters; extracting an iteration type and a corresponding iteration field parameter in the interface field iteration request, and performing field iteration processing on a field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter, wherein the iteration type comprises field addition, field deletion and field value change;
the interface entry parameter updating module 102 is configured to obtain an interface test case set corresponding to the interface field iteration request, where each interface test case in the interface test case set has a corresponding test field parameter; performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain a target test parameter corresponding to the test field parameter; performing entry-reference updating on each interface test case in the interface test case set by using the target test parameters to obtain a target interface test case;
the interface test module 103 is configured to test the interface by using the target interface test case to obtain a test result.
In detail, when the modules in the interface testing apparatus 100 according to the embodiment of the present invention are used, the same technical means as the interface testing method described in fig. 1 are used, and the same technical effect can be produced, which is not described herein again.
Fig. 3 is a schematic structural diagram of an electronic device implementing the interface testing method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as an interface test program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of an interface test program, etc., but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., interface test programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The communication bus 12 may be a PerIPheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
Fig. 3 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power source may also include any component of one or more dc or ac power sources, recharging devices, power failure classification circuits, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Optionally, the communication interface 13 may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further include a user interface, which may be a Display (Display), an input unit (such as a Keyboard (Keyboard)), and optionally, a standard wired interface, or a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The interface test program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs, which when executed in the processor 10, implement:
acquiring interface configuration parameters of different interfaces to obtain an interface configuration parameter set, wherein each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier;
receiving an interface field iteration request, extracting an iteration interface identifier in the interface field iteration request, and screening interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iteration interface identifier to obtain a first interface configuration parameter;
extracting an iteration type and a corresponding iteration field parameter in the interface field iteration request, and performing field iteration processing on a field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter, wherein the iteration type comprises field addition, field deletion and field value change;
acquiring an interface test case set corresponding to the interface field iteration request, wherein each interface test case in the interface test case set has a corresponding test field parameter;
performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain a target test parameter corresponding to the test field parameter;
performing entry-reference updating on each interface test case in the interface test case set by using the target test parameters to obtain a target interface test case;
and testing the interface by using the target interface test case to obtain a test result.
Specifically, the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer program, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable medium may be non-volatile or volatile. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:
acquiring interface configuration parameters of different interfaces to obtain an interface configuration parameter set, wherein each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier;
receiving an interface field iteration request, extracting an iteration interface identifier in the interface field iteration request, and screening interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iteration interface identifier to obtain first interface configuration parameters;
extracting an iteration type and a corresponding iteration field parameter in the interface field iteration request, and performing field iteration processing on a field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter, wherein the iteration type comprises field addition, field deletion and field value change;
acquiring an interface test case set corresponding to the interface field iteration request, wherein each interface test case in the interface test case set has a corresponding test field parameter;
replacing the second interface configuration parameter with the test field parameter to obtain a target test parameter corresponding to the test field parameter;
performing entry-reference updating on each interface test case in the interface test case set by using the target test parameters to obtain a target interface test case;
and testing the interface by using the target interface test case to obtain a test result.
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An interface testing method, the method comprising:
acquiring interface configuration parameters of different interfaces to obtain an interface configuration parameter set, wherein each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier;
receiving an interface field iteration request, extracting an iteration interface identifier in the interface field iteration request, and screening interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iteration interface identifier to obtain first interface configuration parameters;
extracting an iteration type and a corresponding iteration field parameter in the interface field iteration request, and performing field iteration processing on a field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter, wherein the iteration type comprises field addition, field deletion and field value change;
acquiring an interface test case set corresponding to the interface field iteration request, wherein each interface test case in the interface test case set has a corresponding test field parameter;
performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain a target test parameter corresponding to the test field parameter;
performing entry-reference updating on each interface test case in the interface test case set by using the target test parameters to obtain a target interface test case;
and testing the interface by using the target interface test case to obtain a test result.
2. The interface testing method of claim 1, wherein the screening the interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iterative interface identifier to obtain first interface configuration parameters comprises:
determining an interface identifier which is the same as the iteration interface identifier as a target interface identifier;
and selecting the interface configuration parameters corresponding to the target interface identification in the interface configuration parameter set to obtain the first interface configuration parameters.
3. The interface testing method of claim 1, wherein the performing field iteration processing on the field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter comprises:
when the iteration type is field addition, adding all fields in the iteration field parameters and corresponding field values into the first interface configuration parameters to obtain second interface configuration parameters;
when the iteration type is field deletion, deleting a field in the first interface configuration parameter which is the same as a field in the iteration field parameter and a corresponding field value to obtain a second interface configuration parameter;
and when the iteration type is field value change, replacing the field value of each field in the first interface configuration parameter with the field value corresponding to the same field in the iteration field parameter to obtain the second interface configuration parameter.
4. The interface testing method according to claim 1, wherein the performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain a target test parameter corresponding to the test field parameter includes:
and replacing the value corresponding to the same field in the second interface configuration parameter with the value corresponding to each field in the test field parameters to obtain the target test parameters.
5. The interface testing method according to claim 1, wherein said updating the entry parameter of each of the interface test cases in the interface test case set by using the target test parameter to obtain a target interface test case comprises:
determining the test field parameters corresponding to the target test parameters as target test field parameters;
and replacing the target test parameters with interface input parameters in the interface test case corresponding to the target test field parameters to obtain the target interface test case.
6. The interface testing method of claim 2, wherein the testing the interface by using the target interface test case to obtain a test result comprises:
selecting an interface to which the first configuration parameter belongs from all the interfaces to obtain a target interface;
calling and testing the target interface by using the target interface test case to obtain a case test result;
and summarizing all the case test results to obtain the interface test result.
7. The interface testing method of claim 6, wherein said performing a call test on said target interface using said target interface test case to obtain a case test result comprises:
calling the target interface by using the target interface test case to obtain calling return data of the target interface;
and obtaining expected result data corresponding to the target interface test case, and comparing the call return data with the expected result data to obtain the case test result.
8. An interface testing apparatus, comprising:
the interface field iteration module is used for acquiring interface configuration parameters of different interfaces to obtain an interface configuration parameter set, wherein each interface configuration parameter in the interface configuration parameter set has a corresponding interface identifier; receiving an interface field iteration request, extracting an iteration interface identifier in the interface field iteration request, and screening interface configuration parameters in the interface configuration parameter set according to the interface identifier and the iteration interface identifier to obtain first interface configuration parameters; extracting an iteration type and a corresponding iteration field parameter in the interface field iteration request, and performing field iteration processing on a field in the first interface configuration parameter according to the iteration type and the corresponding iteration field parameter to obtain a second interface configuration parameter, wherein the iteration type comprises field addition, field deletion and field value change;
the interface entry parameter updating module is used for acquiring an interface test case set corresponding to the interface field iteration request, wherein each interface test case in the interface test case set has a corresponding test field parameter; performing parameter replacement on the second interface configuration parameter by using the test field parameter to obtain a target test parameter corresponding to the test field parameter; performing entry-reference updating on each interface test case in the interface test case set by using the target test parameters to obtain a target interface test case;
and the interface test module is used for testing the interface by using the target interface test case to obtain a test result.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the interface testing method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the interface testing method according to any one of claims 1 to 7.
CN202210158708.4A 2022-02-21 2022-02-21 Interface testing method and device, electronic equipment and storage medium Pending CN114546854A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210158708.4A CN114546854A (en) 2022-02-21 2022-02-21 Interface testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210158708.4A CN114546854A (en) 2022-02-21 2022-02-21 Interface testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114546854A true CN114546854A (en) 2022-05-27

Family

ID=81677202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210158708.4A Pending CN114546854A (en) 2022-02-21 2022-02-21 Interface testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114546854A (en)

Similar Documents

Publication Publication Date Title
CN112134739B (en) Link state tracking method and device, electronic equipment and computer storage medium
CN112506779A (en) Software interface testing method and device, electronic equipment and storage medium
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN112506559A (en) Gray scale publishing method and device based on gateway, electronic equipment and storage medium
CN111694844A (en) Enterprise operation data analysis method and device based on configuration algorithm and electronic equipment
CN111787171A (en) Automatic outbound method, device, electronic equipment and computer readable storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN112580079A (en) Authority configuration method and device, electronic equipment and readable storage medium
CN113434397B (en) Task system testing method and device, electronic equipment and storage medium
CN115687384A (en) UUID (user identifier) identification generation method, device, equipment and storage medium
CN114897624A (en) Policy data merging method, device, equipment and storage medium
CN114185588A (en) Incremental package generation method, device, equipment and storage medium
CN114896164A (en) Interface optimization method and device, electronic equipment and storage medium
CN114510400A (en) Task execution method and device, electronic equipment and storage medium
CN115145870A (en) Method and device for positioning reason of failed task, electronic equipment and storage medium
CN114911479A (en) Interface generation method, device, equipment and storage medium based on configuration
CN114817408A (en) Scheduling resource identification method and device, electronic equipment and storage medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN113918296A (en) Model training task scheduling execution method and device, electronic equipment and storage medium
CN114036068A (en) Update detection method, device, equipment and storage medium based on privacy security
CN114721952A (en) Method, device, equipment and storage medium for synchronously deploying multiple sets of test environments
CN114626103A (en) Data consistency comparison method, device, equipment and medium
CN113918305A (en) Node scheduling method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination