CN110851364A - Software testing method, system and related equipment - Google Patents

Software testing method, system and related equipment Download PDF

Info

Publication number
CN110851364A
CN110851364A CN201911102896.3A CN201911102896A CN110851364A CN 110851364 A CN110851364 A CN 110851364A CN 201911102896 A CN201911102896 A CN 201911102896A CN 110851364 A CN110851364 A CN 110851364A
Authority
CN
China
Prior art keywords
mock
interface
target
url information
data
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
CN201911102896.3A
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.)
Shenzhen kaniu Technology Co.,Ltd.
Original Assignee
Shenzhen Qianhai Handy Data Service Co Ltd
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 Shenzhen Qianhai Handy Data Service Co Ltd filed Critical Shenzhen Qianhai Handy Data Service Co Ltd
Priority to CN201911102896.3A priority Critical patent/CN110851364A/en
Publication of CN110851364A publication Critical patent/CN110851364A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Abstract

The embodiment of the invention provides a software testing method, a software testing system and related equipment, which are used for improving software testing efficiency. The method provided by the embodiment of the invention comprises the following steps: receiving an HTTP interface request sent by a client, wherein the HTTP interface request comprises target URL information; inquiring a target Mock interface corresponding to the target URL information according to a preset mapping relation table, wherein the preset mapping relation table records the association relation between at least two groups of URL information and the Mock interface; inquiring the switch state information of the target Mock interface; and if the switch state of the Mock interface is in an opening state, calling the target Mock interface to extract response data corresponding to the target URL information from a database, and returning the response data to the client.

Description

Software testing method, system and related equipment
Technical Field
The present invention relates to the field of software testing technologies, and in particular, to a software testing method, system, and related device.
Background
In the software HTTP interface test process, some specific data response returns often need to be simulated, for example, whether some return processing such as exceptions, boundary values, errors and the like of the HTTP interface is correct needs to be verified when a WEB front end or an APP client is tested.
In the existing scheme, each software directly configures various HTTP interfaces and Mock data in a source code of a WEB front end or an APP client. The flow is as shown in fig. 1, or the Mock service is started locally, and then the request is intercepted by starting Charles, Fiddler and other proxy tools and forwarded to the Mock service.
In the existing scheme, each software test needs to re-configure Mock data in a source code, or needs to re-configure HTTP interface request interception parameters and forwarding parameters in a local proxy server, so that the operation process is complicated and the efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a software testing method, a software testing system and related equipment, which are used for improving software testing efficiency.
The first aspect of the embodiments of the present invention further provides a software testing method, applied to a server, which may include:
receiving an HTTP interface request sent by a client, wherein the HTTP interface request comprises target URL information;
inquiring a target Mock interface corresponding to the target URL information according to a preset mapping relation table, wherein the preset mapping relation table records the association relation between at least two groups of URL information and the Mock interface;
inquiring the switch state information of the target Mock interface;
and if the switch state of the Mock interface is in an opening state, calling the target Mock interface to extract response data corresponding to the target URL information from a database, and returning the response data to the client.
Optionally, as a possible implementation manner, the switch state information of the Mock interface further includes Mock data type setting information, which is used to indicate Mock data of a target type that is enabled in preset multiple types of Mock data, and the invoking of the target Mock interface to extract response data corresponding to the target URL information from the database may include:
and calling the target Mock interface to extract the Mock data of the target type from a database as response data corresponding to the target URL information.
Optionally, as a possible implementation manner, if the switch state of the Mock interface is the off state, the HTTP interface request is forwarded to the interface corresponding to the target URL information.
Optionally, as a possible implementation manner, the software testing method in the embodiment of the present invention may further include:
setting a corresponding relation between each type of Mock interface and at least one type of Mock data;
and storing each type of Mock interface and the corresponding Mock data in the database in an associated mode.
Optionally, as a possible implementation manner, the software testing method in the embodiment of the present invention may further include:
and receiving a switching instruction, wherein the switching instruction is used for indicating the change of the switch state information of the Mock interface.
A second aspect of the embodiments of the present invention further provides a software testing system, which may include:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an HTTP interface request sent by a client, and the HTTP interface request comprises target URL information;
the first query unit is used for querying a target Mock interface corresponding to the target URL information according to a preset mapping relation table, and the preset mapping relation table records the association relation between at least two groups of URL information and the Mock interface;
the second query unit is used for querying the switch state information of the target Mock interface;
and the extracting unit is used for calling the target Mock interface to extract response data corresponding to the target URL information from a database and returning the response data to the client if the switch state of the Mock interface is in the opening state.
Optionally, as a possible implementation manner, the switch state information of the Mock interface further includes Mock data type setting information, which is used to indicate Mock data of a target type that is enabled in preset multiple types of Mock data, and the extracting unit includes:
and the calling module is used for calling the target Mock interface to extract the Mock data of the target type from a database as response data corresponding to the target URL information.
Optionally, as a possible implementation manner, the software testing system in the embodiment of the present invention may further include:
and the forwarding unit is used for forwarding the HTTP interface request to the interface corresponding to the target URL information if the switch state of the Mock interface is in a closed state.
Optionally, as a possible implementation manner, the software testing system in the embodiment of the present invention may further include:
the setting unit is used for setting the corresponding relation between each type of Mock interface and at least one type of Mock data;
and the storage unit is used for storing each type of Mock interface and corresponding Mock data in the database in an associated manner.
Optionally, as a possible implementation manner, the software testing system in the embodiment of the present invention may further include:
and the switching unit is used for receiving a switching instruction, and the switching instruction is used for indicating the change of the switch state information of the Mock interface.
A third aspect of embodiments of the present invention provides a computer apparatus, wherein the computer apparatus includes a processor, and the processor is configured to implement the steps of testing software according to any one of the first aspect and the first aspect when executing a computer program stored in a memory.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that: the computer program when executed by a processor performs the steps of the software testing according to any one of the first aspect and the first aspect.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the invention, a mapping relation table can be preset at the server side in advance, the preset mapping relation table records the association relation between at least two sets of URL information and the Mock interface, and the Mock data is preset in a database of the server side. After receiving an HTTP interface request sent by a client, inquiring a target Mock interface corresponding to target URL information and on-off state information of the target Mock interface; and if the switch state of the Mock interface is in the opening state, calling the target Mock interface to extract response data corresponding to the target URL information from the database, and returning the response data to the client. According to the embodiment of the invention, the automatic interception screening of the URL information and the automatic configuration of the interface with the URL information Mock are realized in the test process based on the preset mapping relation table of the server, the manual configuration at the client is not needed, and the software test efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a software testing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an embodiment of a software testing method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a software testing system according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an embodiment of a software testing system according to the present invention;
FIG. 5 is a diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a software testing method, a software testing system and related equipment, which are used for improving software testing efficiency.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the existing scheme, each software directly configures various HTTP interfaces and Mock data in a source code of a WEB front end or an APP client. In the embodiment of the invention, other auxiliary testing tools are not required to be installed, the configuration of the local environment of the tester is simplified, and after the tester is configured for one time, the quick switching between the Mock interface and the original target interface can be realized only by switching the switch, so that the effects of being used and taken immediately and quick verification are achieved. The test data configuration is stored in the server, and can be used by multiple persons at the same time and repeatedly used. A tester can create a plurality of pieces of Mock data for the same HTTP interface, and the return of the appointed Mock data can be realized by switching switches of the Mock interface.
For convenience of understanding, a specific flow in the embodiment of the present invention is described below, and referring to fig. 2, an embodiment of a software testing method in the embodiment of the present invention may include:
201. receiving an HTTP interface request sent by a client, wherein the HTTP interface request comprises target URL information;
after the development of each software is completed, a user can set an agent IP and an agent port of a server agent program in terminal equipment for installing the software, then can directly operate at a client (which can be a WEB front end or an APP client) to generate an HTTP interface request, and the terminal equipment automatically sends the HTTP interface request to a server. The HTTP interface request includes target URL information, and the specific URL information may be a URL or a URL PATH.
202. Inquiring a target Mock interface corresponding to the target URL information according to a preset mapping relation table;
in order to reduce configuration workload of a user side and improve testing efficiency, in the embodiment of the invention, a preset mapping relation table may be set in advance at a server side to record types of HTTP interface requests to be tested, specifically, a preset mapping relation table may be used to record URLs corresponding to all HTTP interface requests to be tested and/or association relations between URLs PATH and Mock interfaces, and the preset mapping relation table records association relations between at least two sets of URL information and Mock interfaces.
Optionally, the association relationship of the Mock interface in the mapping relationship table of the specific URL and/or URL PATH may be null, and the corresponding http request may all point to the actual target service interface.
203. Inquiring the switch state information of the target Mock interface;
in order to facilitate management of a plurality of Mock interfaces of the server, a switch can be set for each Mock interface, and the switch state of the Mock interface which needs to be used can be preset during software testing. One setting can be used continuously until the switch state of the relevant Mock interface is changed. After the server side inquires the target Mock interface, the server side can inquire the switch state information of the target Mock interface.
204. And if the switch state of the Mock interface is in the opening state, calling the target Mock interface to extract response data corresponding to the target URL information from the database, and returning the response data to the client.
Before using the Mock service, a user submits Mock data to a database through a web page or other modes in advance.
And if the switch state of the Mock interface is in the opening state, calling the target Mock interface to extract response data corresponding to the target URL information from the database, and returning the response data to the client.
Optionally, as a possible implementation manner, if the switch state of the Mock interface is the off state, the HTTP interface request is forwarded to the interface corresponding to the target URL information. Namely, the target URL information is forwarded to the original target interface corresponding to the target URL information according to the HTTP interface request sent by the client. In practical applications, the switch state of the Mock interface may not respond to the HTTP interface request if the switch state of the Mock interface is in the off state.
In the embodiment of the invention, a mapping relation table can be preset at the server side in advance, the preset mapping relation table records the association relation between at least two sets of URL information and the Mock interface, and the Mock data is preset in a database of the server side. After receiving an HTTP interface request sent by a client, inquiring a target Mock interface corresponding to target URL information and on-off state information of the target Mock interface; and if the switch state of the Mock interface is in the opening state, calling the target Mock interface to extract response data corresponding to the target URL information from the database, and returning the response data to the client. According to the embodiment of the invention, the automatic interception screening of the URL information and the automatic configuration of the interface with the URL information Mock are realized in the test process based on the preset mapping relation table of the server, the manual configuration at the client is not needed, and the software test efficiency is improved.
Optionally, as a possible implementation manner, in the process of submitting Mock data to the database, a corresponding relationship between each type of Mock interface and at least one type of Mock data may be set; and storing each type of Mock interface and the corresponding Mock data in a database in an associated mode. For example, the Mock data type corresponding to one Mock interface can be an abnormal value, a boundary value and an error value so as to realize the response test of the client to specific data.
Optionally, as a possible implementation manner, the switch state information of the Mock interface further includes Mock data type setting information, which is used to indicate Mock data of a target type that is enabled in preset multiple types of Mock data, and invoking the target Mock interface to extract response data corresponding to the target URL information from the database includes: and calling a target Mock interface to extract Mock data of a target type from the database as response data corresponding to the target URL information.
Optionally, as a possible implementation manner, the server may further receive a switching instruction, where the switching instruction is used to instruct the change of the switch state information of the Mock interface. In actual application, the test requirements of the user are constantly changed, and when the requirements are changed, the switching instruction can be submitted to the server through a web page or other modes, so that the server can switch the corresponding Mock interface switch and the type of the enabled Mock data according to the switching instruction.
In practical application, setting options can be provided for a user through an interactive interface, two-stage switch options are set in the interactive interface, a first-stage switch is used for controlling a main switch of multiple types of Mock data under a Mock interface, when the first-stage switch is in a closed state, all types of Mock data under the Mock interface are closed by default, and a second-stage switch is used for respectively controlling sub-switches of the multiple types of Mock data. And only the first-stage switch is in an open state, and one or more of the second-stage switches are in an open state, so that the Mock data of the corresponding type is started. Wherein, when a plurality of opening states, one of the data is returned randomly.
For the convenience of understanding, the software testing method in the embodiment of the present invention will be described below with reference to specific application examples. Referring to fig. 3, in the architecture of the software testing system in this embodiment, in particular, according to the technical solution of the present invention, the HTTP interface service and the Mock service are divided into a configuration module at the user side and a service processing module at the service side, where the service processing module includes an agent program, the Mock interface service and a data storage service.
Before testing an HTTPS protocol interface, a user needs to install an HTTPS proxy certificate (optional) when connecting a server proxy for the first time, and then needs to submit Mock data to a database through a web page or other modes. The data submitted into the database are generally the URL or URLPATH of the HTTP interface, the return data of the Mock interface, and whether the switch flag of each Mock interface is enabled. The HTTP interface in all embodiments of the present application generally refers to an interface using an HTTP protocol, and generally includes HTTP and HTTPs.
In the testing process, a user sets an agent IP and an agent port of a server-side agent program at a mobile phone terminal where a Web browser or an APP is located, the user requests an HTTP interface in the Web application or the APP, the server-side agent program receives the HTTP interface request from a user side, and a target URL or URLPATH of the request is matched with a database.
And if the server-side agent program is matched with the requested target URL or URL PATH in the database and the switch of the Mock interface is in an open state, forwarding the HTTP interface request to the Mock interface, and otherwise, directly requesting the original target interface. And when the matching is successful, the Mock interface matches corresponding response data with the database according to the URL or URLPATH of the request and returns to the user side according to the original request path, so that the user web side or APP receives the response data of the Mock interface.
After using the Mock service, the user only needs to close the proxy connection of the user or close the switch of the Mock interface.
In this embodiment, need not to install other test appurtenance, the configuration of tester local environment has been simplified, after the tester once configured, only need change over switch, just can realize the fast switch over of Mock interface and former target interface, reach and walk promptly, the effect of quick verification, test data configuration storage is at the server, but many people's simultaneous use, used repeatedly, many Mock data can be established for same HTTP interface to the tester, can realize the return of appointed Mock data through switching Mock interface switch.
Referring to fig. 4, an embodiment of the present invention further provides a software testing system, which includes:
a receiving unit 401, configured to receive an HTTP interface request sent by a client, where the HTTP interface request includes target URL information;
a first query unit 402, configured to query a target Mock interface corresponding to the target URL information according to a preset mapping relationship table, where an association relationship between at least two sets of URL information and the Mock interface is recorded in the preset mapping relationship table;
a second query unit 403, configured to query the switch state information of the target Mock interface;
and the extracting unit 404 is configured to, if the switch state of the Mock interface is the on state, call the target Mock interface to extract response data corresponding to the target URL information from the database, and return the response data to the client.
Optionally, as a possible implementation manner, the switch state information of the Mock interface further includes Mock data type setting information, which is used to indicate Mock data of a target type that is enabled in preset multiple types of Mock data, and the extraction unit includes:
and the calling module is used for calling the target Mock interface to extract Mock data of the target type from the database as response data corresponding to the target URL information.
Optionally, as a possible implementation manner, the software testing system in the embodiment of the present invention may further include:
and the forwarding unit is used for forwarding the HTTP interface request to the interface corresponding to the target URL information if the switch state of the Mock interface is in a closed state.
Optionally, as a possible implementation manner, the software testing system in the embodiment of the present invention may further include:
the setting unit is used for setting the corresponding relation between each type of Mock interface and at least one type of Mock data;
and the storage unit is used for storing each type of Mock interface and the corresponding Mock data in a database in an associated manner.
Optionally, as a possible implementation manner, the software testing system in the embodiment of the present invention may further include:
and the switching unit is used for receiving a switching instruction, and the switching instruction is used for indicating the change of the switch state information of the Mock interface.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 5 is a schematic diagram illustrating only a portion related to an embodiment of the present application for convenience of description, and please refer to a method portion of the embodiment of the present application for details not disclosed. Referring to fig. 5, the computer apparatus 5 includes: memory 510, processor 520, wired or wireless network module 530, and computer programs stored in the memory and executable on the processor. The processor, when executing the computer program, implements the steps in the various software testing method embodiments described above, such as steps 201 to 204 shown in fig. 2. Alternatively, the processor, when executing the computer program, implements the functions of each module or unit in the above-described device embodiments.
In some of the embodiments of the application, the processor, when executing the computer program stored in the memory, implements the steps of:
receiving an HTTP interface request sent by a client, wherein the HTTP interface request comprises target URL information;
inquiring a target Mock interface corresponding to the target URL information according to a preset mapping relation table, wherein the preset mapping relation table records the incidence relation between at least two groups of URL information and the Mock interface;
inquiring the switch state information of the target Mock interface;
and if the switch state of the Mock interface is in the opening state, calling the target Mock interface to extract response data corresponding to the target URL information from the database, and returning the response data to the client.
Optionally, in some embodiments of the application, the switch state information of the Mock interface further includes Mock data type setting information, which is used to indicate the Mock data of the enabled target type in the preset multiple types of Mock data, and the processor may be further configured to implement the following steps:
and calling a target Mock interface to extract Mock data of a target type from the database as response data corresponding to the target URL information.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps: and if the switch state of the Mock interface is in a closed state, forwarding the HTTP interface request to an interface corresponding to the target URL information.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
setting a corresponding relation between each type of Mock interface and at least one type of Mock data;
and storing each type of Mock interface and the corresponding Mock data in a database in an associated mode.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
and receiving a switching instruction, wherein the switching instruction is used for indicating the change of the switch state information of the Mock interface.
Those skilled in the art will appreciate that the configuration shown in fig. 5 does not constitute a limitation of the computer apparatus, and that the computer apparatus 5 may comprise more or less components than those shown, or some components may be combined, or a different arrangement of components, e.g. the computer apparatus may further comprise input-output devices, buses, etc.
The Processor may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the computer device by executing or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory 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 by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The present application further provides a computer-readable storage medium having a computer program stored thereon, which when executed by a processor, can implement the steps of:
receiving an HTTP interface request sent by a client, wherein the HTTP interface request comprises target URL information;
inquiring a target Mock interface corresponding to the target URL information according to a preset mapping relation table, wherein the preset mapping relation table records the incidence relation between at least two groups of URL information and the Mock interface;
inquiring the switch state information of the target Mock interface;
and if the switch state of the Mock interface is in the opening state, calling the target Mock interface to extract response data corresponding to the target URL information from the database, and returning the response data to the client.
Optionally, in some embodiments of the application, the switch state information of the Mock interface further includes Mock data type setting information, which is used to indicate the Mock data of the enabled target type in the preset multiple types of Mock data, and the processor may be further configured to implement the following steps:
and calling a target Mock interface to extract Mock data of a target type from the database as response data corresponding to the target URL information.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps: and if the switch state of the Mock interface is in a closed state, forwarding the HTTP interface request to an interface corresponding to the target URL information.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
setting a corresponding relation between each type of Mock interface and at least one type of Mock data;
and storing each type of Mock interface and the corresponding Mock data in a database in an associated mode.
Optionally, in some embodiments of the present application, the processor may be further configured to implement the following steps:
and receiving a switching instruction, wherein the switching instruction is used for indicating the change of the switch state information of the Mock interface.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units 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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units 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, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A software testing method is applied to a server side, and comprises the following steps:
receiving an HTTP interface request sent by a client, wherein the HTTP interface request comprises target URL information;
inquiring a target Mock interface corresponding to the target URL information according to a preset mapping relation table, wherein the preset mapping relation table records the association relation between at least two groups of URL information and the Mock interface;
inquiring the switch state information of the target Mock interface;
and if the switch state of the Mock interface is in an opening state, calling the target Mock interface to extract response data corresponding to the target URL information from a database, and returning the response data to the client.
2. The method according to claim 1, wherein the switch state information of the Mock interface further comprises Mock data category setting information for indicating the Mock data of the enabled target category in the preset multiple types of Mock data, and the invoking the target Mock interface to extract the response data corresponding to the target URL information from the database comprises:
and calling the target Mock interface to extract the Mock data of the target type from a database as response data corresponding to the target URL information.
3. The method according to claim 1, wherein if the switch state of the Mock interface is in an off state, the HTTP interface request is forwarded to the interface corresponding to the target URL information.
4. The method of any of claims 1 to 3, further comprising:
setting a corresponding relation between each type of Mock interface and at least one type of Mock data;
and storing each type of Mock interface and the corresponding Mock data in the database in an associated mode.
5. The method of claim 4, further comprising:
and receiving a switching instruction, wherein the switching instruction is used for indicating the change of the switch state information of the Mock interface.
6. A software testing system, comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an HTTP interface request sent by a client, and the HTTP interface request comprises target URL information;
the first query unit is used for querying a target Mock interface corresponding to the target URL information according to a preset mapping relation table, and the preset mapping relation table records the association relation between at least two groups of URL information and the Mock interface;
the second query unit is used for querying the switch state information of the target Mock interface;
and the extracting unit is used for calling the target Mock interface to extract response data corresponding to the target URL information from a database and returning the response data to the client if the switch state of the Mock interface is in the opening state.
7. The system according to claim 6, wherein the switch state information of the Mock interface further comprises Mock data kind setting information for indicating Mock data of an enabled target kind among preset plural kinds of Mock data, and the extracting unit comprises:
and the calling module is used for calling the target Mock interface to extract the Mock data of the target type from a database as response data corresponding to the target URL information.
8. The system of claim 6, further comprising:
and the forwarding unit is used for forwarding the HTTP interface request to the interface corresponding to the target URL information if the switch state of the Mock interface is in a closed state.
9. A computer arrangement, characterized in that the computer arrangement comprises a processor for implementing the steps of the method according to any one of claims 1 to 5 when executing a computer program stored in a memory.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program when executed by a processor implementing the steps of the method according to any one of claims 1 to 5.
CN201911102896.3A 2019-11-12 2019-11-12 Software testing method, system and related equipment Pending CN110851364A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911102896.3A CN110851364A (en) 2019-11-12 2019-11-12 Software testing method, system and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911102896.3A CN110851364A (en) 2019-11-12 2019-11-12 Software testing method, system and related equipment

Publications (1)

Publication Number Publication Date
CN110851364A true CN110851364A (en) 2020-02-28

Family

ID=69601778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911102896.3A Pending CN110851364A (en) 2019-11-12 2019-11-12 Software testing method, system and related equipment

Country Status (1)

Country Link
CN (1) CN110851364A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478941A (en) * 2020-03-05 2020-07-31 平安银行股份有限公司 Mock automatic operation method and device, computer equipment and storage medium
CN112363938A (en) * 2020-11-12 2021-02-12 平安普惠企业管理有限公司 Data processing method and device, electronic equipment and storage medium
CN112383434A (en) * 2020-11-17 2021-02-19 Oppo广东移动通信有限公司 Interface simulation method and device for network request, electronic equipment and storage medium
CN112559350A (en) * 2020-12-16 2021-03-26 杭州数梦工场科技有限公司 Debugging method, device and equipment for front-end development page and storage medium
CN112887434A (en) * 2021-04-13 2021-06-01 上海哔哩哔哩科技有限公司 Data processing method and device
CN113381911A (en) * 2021-06-09 2021-09-10 上海臣星软件技术有限公司 Test method, device, equipment and storage medium
CN113411234A (en) * 2021-06-17 2021-09-17 杭州遥望网络科技有限公司 Interface testing method, system and computer readable storage medium
CN113704657A (en) * 2021-08-30 2021-11-26 平安普惠企业管理有限公司 Front end deployment method, device, equipment and storage medium
WO2021238596A1 (en) * 2020-05-26 2021-12-02 腾讯科技(深圳)有限公司 Interface calling method and apparatus, and computer-readable storage medium
CN113938473A (en) * 2021-10-12 2022-01-14 平安银行股份有限公司 Automatic Mock method, device, equipment and storage medium based on flow
CN114238099A (en) * 2021-12-09 2022-03-25 北京五八信息技术有限公司 Method and device for gray scale test, electronic equipment and readable medium
CN114238065A (en) * 2020-09-09 2022-03-25 马上消费金融股份有限公司 Test processing method, device, equipment and readable storage medium
CN114928556A (en) * 2022-03-22 2022-08-19 中国人寿保险股份有限公司 Interface service test method and related equipment
CN114928556B (en) * 2022-03-22 2024-04-30 中国人寿保险股份有限公司 Interface service testing method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294179A (en) * 2016-08-22 2017-01-04 上海亿账通互联网科技有限公司 Analog detection method in process of application development and server
CN106528400A (en) * 2016-09-22 2017-03-22 深圳峰创智诚科技有限公司 MOCK testing method and device
CN109656807A (en) * 2018-11-01 2019-04-19 平安科技(深圳)有限公司 Interface mock test method, device, equipment and storage medium based on information security
CN110309058A (en) * 2019-05-24 2019-10-08 平安银行股份有限公司 Business end test method, device, computer installation and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294179A (en) * 2016-08-22 2017-01-04 上海亿账通互联网科技有限公司 Analog detection method in process of application development and server
CN106528400A (en) * 2016-09-22 2017-03-22 深圳峰创智诚科技有限公司 MOCK testing method and device
CN109656807A (en) * 2018-11-01 2019-04-19 平安科技(深圳)有限公司 Interface mock test method, device, equipment and storage medium based on information security
CN110309058A (en) * 2019-05-24 2019-10-08 平安银行股份有限公司 Business end test method, device, computer installation and computer storage medium

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478941A (en) * 2020-03-05 2020-07-31 平安银行股份有限公司 Mock automatic operation method and device, computer equipment and storage medium
CN111478941B (en) * 2020-03-05 2023-08-22 平安银行股份有限公司 Mock automatic operation method and device, computer equipment and storage medium
US11809882B2 (en) 2020-05-26 2023-11-07 Tencent Technology (Shenzhen) Company Limited Interface calling method and apparatus, and computer-readable storage medium
WO2021238596A1 (en) * 2020-05-26 2021-12-02 腾讯科技(深圳)有限公司 Interface calling method and apparatus, and computer-readable storage medium
CN114238065A (en) * 2020-09-09 2022-03-25 马上消费金融股份有限公司 Test processing method, device, equipment and readable storage medium
CN112363938A (en) * 2020-11-12 2021-02-12 平安普惠企业管理有限公司 Data processing method and device, electronic equipment and storage medium
CN112383434A (en) * 2020-11-17 2021-02-19 Oppo广东移动通信有限公司 Interface simulation method and device for network request, electronic equipment and storage medium
CN112383434B (en) * 2020-11-17 2023-08-08 Oppo广东移动通信有限公司 Interface simulation method and device for network request, electronic equipment and storage medium
CN112559350A (en) * 2020-12-16 2021-03-26 杭州数梦工场科技有限公司 Debugging method, device and equipment for front-end development page and storage medium
CN112887434A (en) * 2021-04-13 2021-06-01 上海哔哩哔哩科技有限公司 Data processing method and device
CN112887434B (en) * 2021-04-13 2023-05-23 上海哔哩哔哩科技有限公司 Data processing method and device
CN113381911A (en) * 2021-06-09 2021-09-10 上海臣星软件技术有限公司 Test method, device, equipment and storage medium
CN113411234B (en) * 2021-06-17 2022-08-16 杭州遥望网络科技有限公司 Interface testing method, system and computer readable storage medium
CN113411234A (en) * 2021-06-17 2021-09-17 杭州遥望网络科技有限公司 Interface testing method, system and computer readable storage medium
CN113704657A (en) * 2021-08-30 2021-11-26 平安普惠企业管理有限公司 Front end deployment method, device, equipment and storage medium
CN113938473A (en) * 2021-10-12 2022-01-14 平安银行股份有限公司 Automatic Mock method, device, equipment and storage medium based on flow
CN114238099A (en) * 2021-12-09 2022-03-25 北京五八信息技术有限公司 Method and device for gray scale test, electronic equipment and readable medium
CN114928556A (en) * 2022-03-22 2022-08-19 中国人寿保险股份有限公司 Interface service test method and related equipment
CN114928556B (en) * 2022-03-22 2024-04-30 中国人寿保险股份有限公司 Interface service testing method and related equipment

Similar Documents

Publication Publication Date Title
CN110851364A (en) Software testing method, system and related equipment
WO2021008413A1 (en) Fault prompting method for internet of things device, and related apparatus
CN108696399B (en) Business service test method and device
WO2020029495A1 (en) Information pushing method and home appliance
CN103581706B (en) The application installation method of intelligent television and system
CN110213380B (en) Message pushing method and device, computer equipment and storage medium
US20170277526A1 (en) Software categorization method and electronic device
CN105611422A (en) Online live broadcast method based on multi-media list and apparatus thereof
CN107168765A (en) A kind of method and system of remote compilation software
CN110753091A (en) Cloud platform management method and device
US9684711B2 (en) System and method for providing agent service to user terminal
CN113093596A (en) Control instruction processing method and device
CN111147402A (en) Method and device for customizing factory setting items of switch, switch and system
CN109753424B (en) AB test method and device
CN104618388A (en) Quick registration and login method and corresponding reset server and information server
CN114691390A (en) User mode program processing method and device, storage medium and processor
CN112738019B (en) Method and device for displaying device information, storage medium and electronic device
CN110457202B (en) TPC-E testing method for quickly establishing ODBC connection and driver equipment
CN105991730A (en) Information processing method, server, and mobile terminal
CN102722404A (en) Management system, device and method for application software in intelligent terminal
CN109951549B (en) Network page access method and device and computer readable storage medium
CN112150030A (en) Account management method based on multiple units and multiple identities, terminal equipment and storage medium
CN103078879A (en) Certification system and method for user registration
CN110875895A (en) Method, system, equipment and vehicle for realizing intelligent terminal software login
CN110769462B (en) Network access control method and device

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
TA01 Transfer of patent application right

Effective date of registration: 20210427

Address after: 518000 room 602, building B, Kingdee Software Park, Keji South 12th Road, high tech Zone, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen kaniu Technology Co.,Ltd.

Address before: 518000 Guangdong city of Shenzhen province Qianhai Shenzhen Hong Kong cooperation zone before Bay Road No. 1 building 201 room A (located in Shenzhen Qianhai business secretary Co. Ltd.)

Applicant before: Shenzhen Qianhai handy Data Service Co.,Ltd.

TA01 Transfer of patent application right