CN110727588A - Network application testing method, system, computer equipment and readable storage medium - Google Patents

Network application testing method, system, computer equipment and readable storage medium Download PDF

Info

Publication number
CN110727588A
CN110727588A CN201910933292.7A CN201910933292A CN110727588A CN 110727588 A CN110727588 A CN 110727588A CN 201910933292 A CN201910933292 A CN 201910933292A CN 110727588 A CN110727588 A CN 110727588A
Authority
CN
China
Prior art keywords
target
test
service request
interceptor
state
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.)
Granted
Application number
CN201910933292.7A
Other languages
Chinese (zh)
Other versions
CN110727588B (en
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.)
Zhejiang Dasou Vehicle Software Technology Co Ltd
Original Assignee
Zhejiang Dasou Vehicle Software Technology 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 Zhejiang Dasou Vehicle Software Technology Co Ltd filed Critical Zhejiang Dasou Vehicle Software Technology Co Ltd
Priority to CN201910933292.7A priority Critical patent/CN110727588B/en
Publication of CN110727588A publication Critical patent/CN110727588A/en
Application granted granted Critical
Publication of CN110727588B publication Critical patent/CN110727588B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application relates to a testing method, a testing system, a computer device and a readable storage medium for network application. The method comprises the following steps: the test tool sends a target test instruction to the network application; the network application sends a target service request aiming at the third-party server to the interceptor according to the target test instruction; the interceptor redirects the target service request to the test server; the test server determines a target return value corresponding to the target service request in a pre-stored corresponding relationship between the service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relationship between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction; and the test tool determines a test result according to the target return value and a target value corresponding to a pre-stored target test instruction. By the method and the device, the test accuracy can be improved.

Description

Network application testing method, system, computer equipment and readable storage medium
Technical Field
The present application relates to the field of network application detection technologies, and in particular, to a method and a system for testing a network application, a computer device, and a readable storage medium.
Background
With the development of network application technology, the variety of network applications is increasing, and technicians need to test the network applications before the network applications are put into use. Currently, technicians often use test tools to test network applications. The network application may send a service request to the third party server according to the test instruction sent by the test tool. The third-party server can determine a return value according to the service request, send the return value to the client, send the return value to the test tool by the client, judge whether the return value is the same as a target value corresponding to the test instruction stored in advance by the test tool, and obtain a test result according to a judgment result.
However, if the calculation method for determining the return value in the third-party server is different from the calculation method for determining the target value by the test tool, the return value determined by the third-party server according to the service request sent by the network application is different from the target value determined by the test tool, so that the test tool obtains an incorrect test result, and the test accuracy of the test tool is low. Meanwhile, the test tool provides test data for the third-party server to influence the operation of the third-party server.
Disclosure of Invention
In view of the above, it is necessary to provide a method, a system, a computer device and a readable storage medium for testing a network application.
In a first aspect, a method for testing a web application is provided, where the method is applied to a web application testing system, where the web application testing system includes a testing tool, a web application, an interceptor, and a testing server, and the method includes:
the testing tool sends a target testing instruction to the network application;
the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor redirecting the target service request to the test server;
the test server determines a target return value corresponding to the target service request in a pre-stored corresponding relationship between the service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relationship between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the test tool determines a test result according to the target return value and a target value corresponding to the target test instruction which is stored in advance.
Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third-party server is different from the calculation method for determining the target value by the test tool can be avoided. And further the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the test server, so that the third-party server is ensured to only process the service request sent by the network application when the network application processes the actual service, and the service performance of the third-party server is further improved.
As an optional implementation manner, the test server pre-stores a return value corresponding to each service request, and the return value is determined according to a data structure of the return value corresponding to the service request pre-stored in the network application and a preset return value setting rule.
Before testing the network application, a return value is pre-configured for the test server according to a data structure of the return value of the service request pre-stored in the network application, so that the stability and the accuracy of the return test value in the test process of the test server are ensured.
As an optional implementation manner, before the interceptor redirects the target service request to the test server, the method further includes:
the interceptor judges whether the state of the test server is an open state, and if the state of the test server is the open state, the interceptor redirects the target service request to the test server;
and if the state of the test server is a closed state, the interceptor sends the target service request to the third-party server.
The target service request is redirected to the test server through the interceptor, so that a network application test result is not influenced by the third-party server, the test accuracy is improved, and meanwhile, if the test server is in a closed state, the third-party server is continuously called and plays a role in auxiliary test.
As an optional implementation manner, the target service request includes a target interface and a target method, and the interceptor redirects the target service request to the test server, including:
the interceptor judges whether the state of the target interface is an open state, and if the state of the target interface is the open state, the interceptor redirects the target service request to the test server;
if the interface state of the target interface is a closed state, the interceptor judges whether the state of the target method is an open state, and if the state of the target method is the open state, the interceptor redirects the target service request to the test server.
After the interceptor receives the target service request, the on-off state of the interface and the method of the test server needs to be judged, if the interface and the method of the test server are in the on state, the service request is redirected to the test server, and the accurate operation of the test process is ensured through the judgment and redirection process of the interceptor.
As an optional implementation, the method further comprises:
and if the state of the target method is a closed state, the interceptor sends the target service request to the third-party server.
If the interface and the method state of the test server are in a closed state, the interceptor sends the target service request to the third-party server, so that the test process is completely carried out, and the third-party server also has the function of auxiliary test.
In a second aspect, a network application testing system is provided, which includes a testing tool, a network application, an interceptor and a testing server;
the testing tool is used for sending a target testing instruction to the network application;
the network application is used for sending a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor is used for redirecting the target service request to the test server;
the test server is used for determining a target return value corresponding to the target service request in a pre-stored corresponding relationship between the service request and the return value, and transmitting the target return value to the test tool through the interceptor and the network application, wherein the corresponding relationship between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the test tool is also used for determining a test result according to the target return value and a target value corresponding to the target test instruction which is stored in advance.
Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third-party server is different from the calculation method for determining the target value by the test tool can be avoided. And further the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the test server, so that the third-party server is ensured to only process the service request sent by the network application when the network application processes the actual service, and the service performance of the third-party server is further improved.
As an optional implementation manner, the test server pre-stores a return value corresponding to each service request, where the return value is determined according to a data structure of the return value corresponding to the service request pre-stored in the network application and a preset return value setting rule.
Before testing the network application, a return value is pre-configured for the test server according to a data structure of the return value of the service request pre-stored in the network application, so that the stability and the accuracy of the return test value in the test process of the test server are ensured.
As an optional implementation manner, the interceptor is configured to determine whether a state of the test server is an open state, and redirect the target service request to the test server if the state of the test server is the open state;
the interceptor is further configured to send the target service request to the third-party server if the state of the test server is a closed state.
The target service request is redirected to the test server through the interceptor, so that a network application test result is not influenced by the third-party server, the test accuracy is improved, and meanwhile, if the test server is in a closed state, the third-party server is continuously called and plays a role in auxiliary test.
As an optional implementation manner, the target service request includes a target interface and a target method, and the interceptor is configured to determine whether a state of the target interface is an open state, and redirect the target service request to the test server if the state of the target interface is the open state;
the interceptor is further configured to determine whether the state of the target method is an open state if the interface state of the target interface is an closed state, and redirect the target service request to the test server if the state of the target method is an open state.
After the interceptor receives the target service request, the on-off state of the interface and the method of the test server needs to be judged, if the interface and the method of the test server are in the on state, the service request is redirected to the test server, and the accurate operation of the test process is ensured through the judgment and redirection process of the interceptor.
As an optional implementation manner, the interceptor is configured to send the target service request to the third-party server if the status of the target method is an off status.
If the interface and the method state of the test server are in a closed state, the interceptor sends the target service request to the third-party server, so that the test process is completely carried out, and the third-party server also has the function of auxiliary test.
In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
the testing tool sends a target testing instruction to the network application;
the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor redirecting the target service request to the test server;
the test server determines a target return value corresponding to the target service request in a pre-stored corresponding relationship between the service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relationship between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the test tool determines a test result according to the target return value and a target value corresponding to the target test instruction which is stored in advance.
Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third-party server is different from the calculation method for determining the target value by the test tool can be avoided. And further the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the test server, so that the third-party server is ensured to only process the service request sent by the network application when the network application processes the actual service, and the service performance of the third-party server is further improved.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
the testing tool sends a target testing instruction to the network application;
the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor redirecting the target service request to the test server;
the test server determines a target return value corresponding to the target service request in a pre-stored corresponding relationship between the service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relationship between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the test tool determines a test result according to the target return value and a target value corresponding to the target test instruction which is stored in advance.
The embodiment of the application provides a testing method, a testing system, computer equipment and a readable storage medium for network application, wherein a testing tool sends a target testing instruction to the network application, the network application sends a target service request according to the target testing instruction and redirects the target service request to a testing server through an interceptor, the testing server determines a target return value corresponding to the target service request in a pre-stored corresponding relation between the service request and the return value, and transmits the target return value to the testing tool through the interceptor and the network application, and the testing tool determines a testing result according to pre-configuration. Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third-party server is different from the calculation method for determining the target value by the test tool can be avoided. And further the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the test server, so that the third-party server is ensured to only process the service request sent by the network application when the network application processes the actual service, and the service performance of the third-party server is further improved.
Drawings
Fig. 1 is an architecture diagram of a network application testing system according to an embodiment of the present application;
fig. 2 is a flowchart of a method for testing a network application according to an embodiment of the present application;
fig. 3 is a flowchart of an example of a testing method for a network application according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a network application testing system according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The embodiment of the application provides a testing method of network application, which can be applied to a network application testing system. Fig. 1 is an architecture diagram of a network application testing system according to an embodiment of the present application. As shown in fig. 1, the network test system includes a test tool, a network application, an interceptor, and a test server. The system comprises a testing tool, a network application and a control tool, wherein the testing tool is used for sending a target testing instruction to the network application; the network application is used for sending a target service request aiming at the third-party server to the interceptor according to the received target test instruction; the interceptor is used for redirecting the target service request to the test server; the test server is used for determining a target return value corresponding to the target service request according to the corresponding relation between the prestored service request and the return value, transmitting the target return value to the test tool through the interceptor and the network application, and the test tool is also used for determining a test result according to the target return value and a target value corresponding to the prestored target test instruction. The test server may be a Mock (a micro service) type test server, a dubbo (a service framework) type test server, or other types of test servers, and the embodiment of the present application is not limited. The embodiment of the application is described by taking a test server of a Mock type as an example, and other situations are similar to the test server. The network test system may also include a third party server. And the third-party server is used for receiving the target service request sent by the interceptor and determining a return value corresponding to the target service request according to a determination algorithm of the return value. The third-party server may be a dubbo type test server, and may also be another type of test server, which is not limited in the embodiment of the present application. In the embodiment of the application, a third-party server is taken as an example of a dubbo type third-party server, and other situations are similar to the dubbo type third-party server.
The embodiment of the application provides a testing method for network application, as shown in fig. 2, the specific processing procedures are as follows:
step 201: the test tool sends target test instructions to the network application.
In implementation, when a technician needs to test a certain function (hereinafter referred to as a target function) of a network application, the technician may click a test button corresponding to the target function in a test interface of a test tool, and the test tool receives a test request instruction for the target function. The test tool may then send test instructions for the function (i.e., target test instructions) to the network application. Optionally, the test tool may be: semblanc, Lxia (test tool named by company name), etc., and the present application is not particularly limited. Optionally, the web application is application software that operates on the internet or an intranet using a web browser, and may be: taobao network applications, etc., and the present application is not limited in particular.
Step 202: and the network application sends a target service request aiming at the third-party server to the interceptor according to the target test instruction.
In implementation, after receiving a target test instruction sent by a test tool, the network application may generate a target service request of a dubbo protocol type for the third-party server according to the target test instruction, and send the service request to the interceptor.
Step 203: the interceptor redirects the target service request to the test server.
In implementation, after receiving a target service request sent by a network application, an interceptor converts the target service request of the dubbo protocol type into a target service request of the http protocol type and sends the target service request of the http protocol type to a test server. In the embodiment of the application, the dubbo protocol is converted into the http protocol type as an example, and the dubbo protocol can also be converted into other types of protocols. The embodiments of the present application are not limited.
The target service request comprises a target interface and a target method, and the processing process of redirecting the target service request to the test server by the interceptor is as follows:
step one, the interceptor judges whether the on-off state of the target interface is an on state.
In implementation, the interceptor may determine whether the switch state of the target interface is an on state in the pre-stored configuration information. And if the interface switch state of the target interface is the opening state, the interceptor executes the step two. And if the on-off state of the target interface is the off state, the interceptor executes the steps from three to five.
And step two, the interceptor redirects the target service request to the test server.
In implementation, if the switch state of the target interface is the on state, the switch state of the target method included in the target interface is also the on state, so that the interceptor does not need to judge the state of the target method any more, and can directly redirect the target service request to the test server.
And step three, the interceptor judges whether the switching state of the target method is an opening state.
In implementation, if the interface switch state of the target interface is the off state, the interceptor needs to further determine whether the switch state of the target method is the on state. And if the switch state of the target method is the opening state, the interceptor executes the step four. And if the switch state of the target method is the closing state, the interceptor executes the step five.
Step four, the interceptor redirects the target service request to the test server.
In an implementation, the interceptor may redirect the target service request to the test server if the switch state of the target method is an on state.
And step five, the interceptor sends the target service request to a third-party server.
In an implementation, if the switch state of the target method is an off state, the interceptor may send the target service request to the third party server.
As an optional implementation manner, before the interceptor redirects the target service request to the test server, the interceptor may further process the target server request according to the state of the test server, where the specific processing process is as follows:
step one, the interceptor judges whether the on-off state of the test server is an on state.
In implementation, after receiving a target service request sent by a network application, the interceptor may determine whether the switch state of the test server is an on state in the pre-stored configuration information. And if the switch state of the test server is the opening state, the interceptor executes the step two. And if the switch state of the test server is the closing state, the interceptor executes the step three.
And step two, the interceptor redirects the target service request to the test server.
In implementation, if the switch state of the test server is in the on state, indicating that the test server is enabled, the interceptor may redirect the target service request to the test server.
And step three, the interceptor sends the target service request to a third-party server.
In implementation, if the switch state of the test server is the off state, which indicates that the test server is not enabled, the interceptor may send the target service request to the third-party server to ensure the integrity of the network application test.
Step 204: and the test server determines a target return value corresponding to the target service request in the pre-stored corresponding relationship between the service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application.
The corresponding relation between the service request and the return value is established according to each test instruction and the target value corresponding to each test instruction.
In implementation, the test server may store a correspondence between the service request and the return value in advance. The corresponding relationship between the service request and the return value can be established by technicians according to preset test instructions and target values corresponding to the test instructions. The test tool stores the corresponding relation between the test instruction preset by the technician and the target value. When the technician configures the test server, the technician may set the return value of the service request corresponding to the test instruction as the target value corresponding to the test instruction, so that the target value of the test instruction is consistent with the return value of the service request corresponding to the test instruction.
After receiving the target service request sent by the interceptor, the test server may determine a target return value corresponding to the target service request in a pre-stored correspondence between the service request and the return value, and send the target return value to the interceptor. And the interceptor packages the target return value into a dubbo result object and transmits the dubbo result object to the test tool through the network application.
As an optional implementation manner, the test server pre-stores a return value corresponding to each service request, where the return value is determined according to a data structure of the return value corresponding to the service request pre-stored in the network application and a preset return value setting rule.
In implementation, a jar (Java Archive) package of a third-party server is stored in the network application, the jar package includes a plurality of service requests and a data structure of a return value corresponding to each service request, and when a technician configures the return value preset in the test server, the technician can configure the return value of each service request in the test server according to the data structure of the return value of each service request and a corresponding return value setting rule.
It should be noted that, since the service request includes an interface and a method, the correspondence between the service request and the return value is the correspondence between the interface, the method, and the return value. The return value may be a numerical value, a character string, or the like, and the data structure of the return value may be json (a data structure), or may be other types of data structures, which is not limited in this embodiment of the application.
Step 205: and the test tool determines a test result according to the target return value and a target value corresponding to a pre-stored target test instruction.
In implementation, a target value corresponding to a target test instruction preset by a technician may be stored in the test tool in advance, and after receiving the target return value, the test tool may determine whether the target value corresponding to the target test instruction is the same as the target return value. And if the target value is the same as the target return value, the test result is that the target function of the network application is normal. And if the target value is not the same as the target return value, the test result is that the target function of the network application is abnormal.
An example of a testing method for a network application is also provided in the embodiments of the present application, as shown in fig. 3, the processing procedure is as follows:
step 301, the test tool sends a target test instruction to the network application.
Step 302, the network application sends a target service request aiming at the third-party server to the interceptor according to the target test instruction. The target service request comprises a target interface and a target method.
Step 303, the interceptor determines whether the on-off state of the test server is an on state.
If the test server's switch state is on, the interceptor proceeds to step 304.
If the switch status of the test server is off, the interceptor proceeds to step 307.
In step 304, the interceptor determines whether the on-off state of the target interface is an on state.
If the switch state of the target interface is on, the interceptor proceeds to step 306.
If the interface switch state of the target interface is the off state, the interceptor performs step 305.
In step 305, the interceptor determines whether the switch state of the target method is on.
If the switch state of the target method is the on state, the interceptor performs step 306.
If the switch state of the target method is the off state, the interceptor proceeds to step 307
Step 306, the interceptor redirects the target service request to the test server.
Step 307, the interceptor sends the target service request to the third party server.
The processing procedure of step 301 to step 307 is similar to the processing procedure of step 201 to step 205, and is not described herein again.
The embodiment of the application provides a testing method of a network application, wherein a testing tool sends a target testing instruction to the network application, the network application sends a target service request according to the target testing instruction, the target service request is redirected to a testing server through an interceptor, the testing server determines a target return value corresponding to the target service request in a prestored corresponding relation between the service request and the return value, the target return value is transmitted to the testing tool through the interceptor and the network application, and the testing tool determines a testing result according to the preset configuration. Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third-party server is different from the calculation method for determining the target value by the test tool can be avoided. And further the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the test server, so that the third-party server is ensured to only process the service request sent by the network application when the network application processes the actual service, and the service performance of the third-party server is further improved.
An embodiment of the present application further provides a network application testing system, as shown in fig. 4, the system includes:
a testing tool 410 for sending target testing instructions to a web application 420;
the network application 420 is used for sending a target service request aiming at the third-party server to the interceptor 430 according to the target test instruction;
an interceptor 430 for redirecting the target service request to a test server 440;
the test server 440 is configured to determine a target return value corresponding to the target service request from the pre-stored correspondence between the service request and the return value, and transmit the target return value to the test tool 410 through the interceptor 430 and the network application 420, where the correspondence between the service request and the return value is established according to each test instruction and the target value corresponding to each test instruction;
the testing tool 410 is further configured to determine a testing result according to the target return value and a target value corresponding to a pre-stored target testing instruction.
As an optional implementation manner, the test server 440 pre-stores a return value corresponding to each service request, where the return value is determined according to a preset return value setting rule and a data structure of the return value corresponding to the service request pre-stored in the network application 420.
As an optional implementation manner, the interceptor 430 is configured to determine whether the switch state of the test server 440 is an on state, and redirect the target service request to the test server 440 if the switch state of the test server 440 is the on state;
the interceptor 430 is further configured to send the target service request to the third party server if the switch status of the test server 440 is in the off state.
As an optional implementation manner, the target service request includes a target interface and a target method, and the interceptor 430 is configured to determine whether an on/off state of the target interface is an on state, and redirect the target service request to the test server 440 if the on/off state of the target interface is the on state;
the interceptor 430 is further configured to determine whether the switch state of the target method is an on state if the interface switch state of the target interface is an off state, and redirect the target service request to the test server 440 if the switch state of the target method is an on state.
As an optional embodiment, the interceptor 430 is configured to send the target service request to the third party server if the switch status of the target method is the off status.
The embodiment of the application provides a test system of network application, a test tool sends a target test instruction to the network application, the network application sends a target service request according to the target test instruction and redirects the target service request to a test server through an interceptor, the test server determines a target return value corresponding to the target service request in a prestored corresponding relation between the service request and the return value, transmits the target return value to the test tool through the interceptor and the network application, and the test tool determines a test result according to preset configuration. Because the return value corresponding to the target service request in the test server is established according to each test instruction and the target value corresponding to each test instruction, the situation that the test tool obtains an error test result due to the fact that the calculation method for determining the return value in the third-party server is different from the calculation method for determining the target value by the test tool can be avoided. And further the test accuracy can be improved. Meanwhile, the interceptor redirects the service request for testing of the network application to the test server, so that the third-party server is ensured to only process the service request sent by the network application when the network application processes the actual service, and the service performance of the third-party server is further improved.
In one embodiment, a computer device, as shown in fig. 5, includes a memory and a processor, the memory stores a computer program that can be executed on the processor, and the processor implements the steps of the method for testing a network application of any one of the above items when executing the computer program.
In one embodiment, a computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method for testing a web application of any of the above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for testing a network application is applied to a network application testing system, the network application testing system comprises a testing tool, the network application, an interceptor and a testing server, and the method comprises the following steps:
the testing tool sends a target testing instruction to the network application;
the network application sends a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor redirecting the target service request to the test server;
the test server determines a target return value corresponding to the target service request in a pre-stored corresponding relationship between the service request and the return value, and transmits the target return value to the test tool through the interceptor and the network application, wherein the corresponding relationship between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the test tool determines a test result according to the target return value and a target value corresponding to the target test instruction which is stored in advance.
2. The method according to claim 1, wherein the test server pre-stores a return value corresponding to each service request, and the return value is determined according to a data structure of the return value corresponding to the service request pre-stored in the network application and a preset return value setting rule.
3. The method of claim 1, wherein before the interceptor redirects the target service request to the test server, the method further comprises:
the interceptor judges whether the state of the test server is an open state, and if the state of the test server is the open state, the interceptor redirects the target service request to the test server;
and if the state of the test server is a closed state, the interceptor sends the target service request to the third-party server.
4. The method according to claim 1 or 3, wherein the target service request includes a target interface and a target method, and the interceptor redirects the target service request to the test server, comprising:
the interceptor judges whether the state of the target interface is an open state, and if the state of the target interface is the open state, the interceptor redirects the target service request to the test server;
if the interface state of the target interface is a closed state, the interceptor judges whether the state of the target method is an open state, and if the state of the target method is the open state, the interceptor redirects the target service request to the test server.
5. The method of claim 4, further comprising:
and if the state of the target method is a closed state, the interceptor sends the target service request to the third-party server.
6. The network application test system is characterized by comprising a test tool, a network application, an interceptor and a test server;
the testing tool is used for sending a target testing instruction to the network application;
the network application is used for sending a target service request aiming at a third-party server to the interceptor according to the target test instruction;
the interceptor is used for redirecting the target service request to the test server;
the test server is used for determining a target return value corresponding to the target service request in a pre-stored corresponding relationship between the service request and the return value, and transmitting the target return value to the test tool through the interceptor and the network application, wherein the corresponding relationship between the service request and the return value is established according to each test instruction and a target value corresponding to each test instruction;
and the test tool is also used for determining a test result according to the target return value and a target value corresponding to the target test instruction which is stored in advance.
7. The system according to claim 6, wherein the test server pre-stores a return value corresponding to each service request, and the return value is determined according to a data structure of the return value corresponding to the service request pre-stored in the network application and a preset return value setting rule.
8. The system according to claim 6, wherein the interceptor is configured to determine whether the state of the test server is an on state, and redirect the target service request to the test server if the state of the test server is the on state;
the interceptor is further configured to send the target service request to the third-party server if the state of the test server is a closed state.
9. The system according to claim 6 or 8, wherein the target service request includes a target interface and a target method, the interceptor is configured to determine whether a state of the target interface is an open state, and redirect the target service request to the test server if the state of the target interface is the open state;
the interceptor is further configured to determine whether the state of the target method is an open state if the interface state of the target interface is an closed state, and redirect the target service request to the test server if the state of the target method is an open state.
10. The system of claim 9, wherein the interceptor is configured to send the target service request to the third party server if the status of the target method is an off status.
CN201910933292.7A 2019-09-29 2019-09-29 Network application testing method, system, computer equipment and readable storage medium Active CN110727588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910933292.7A CN110727588B (en) 2019-09-29 2019-09-29 Network application testing method, system, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910933292.7A CN110727588B (en) 2019-09-29 2019-09-29 Network application testing method, system, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110727588A true CN110727588A (en) 2020-01-24
CN110727588B CN110727588B (en) 2023-12-12

Family

ID=69219649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910933292.7A Active CN110727588B (en) 2019-09-29 2019-09-29 Network application testing method, system, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110727588B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100079A (en) * 2020-11-02 2020-12-18 北京淇瑀信息科技有限公司 Test method and system based on simulation data calling and electronic equipment
CN113836008A (en) * 2021-09-13 2021-12-24 支付宝(杭州)信息技术有限公司 Method and system for fuzz testing of virtual machine monitor
CN114978970A (en) * 2022-04-07 2022-08-30 上海钧正网络科技有限公司 Data testing system, method, equipment and medium based on user-defined mock platform

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050010661A1 (en) * 2003-07-08 2005-01-13 Southam Blaine R. Systems and methods for testing network services
US20110161825A1 (en) * 2009-12-31 2011-06-30 Tierney Chris Systems and methods for testing multiple page versions across multiple applications
US20120324057A1 (en) * 2009-12-07 2012-12-20 Alexandre Macris Method for providing a target application
CN107368405A (en) * 2016-05-11 2017-11-21 腾讯科技(北京)有限公司 Test system, method of testing, mock platforms, blocker and client
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN109582556A (en) * 2017-09-29 2019-04-05 阿里巴巴集团控股有限公司 Test method, the device and system of a kind of application program in running of mobile terminal situation
CN109688202A (en) * 2018-12-04 2019-04-26 北京腾云天下科技有限公司 A kind of processing method of interface data, calculates equipment and storage medium at device
CN110262979A (en) * 2019-06-27 2019-09-20 苏宁消费金融有限公司 A kind of simulation third party's data source test method based on MOCK platform

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050010661A1 (en) * 2003-07-08 2005-01-13 Southam Blaine R. Systems and methods for testing network services
US20120324057A1 (en) * 2009-12-07 2012-12-20 Alexandre Macris Method for providing a target application
US20110161825A1 (en) * 2009-12-31 2011-06-30 Tierney Chris Systems and methods for testing multiple page versions across multiple applications
CN107368405A (en) * 2016-05-11 2017-11-21 腾讯科技(北京)有限公司 Test system, method of testing, mock platforms, blocker and client
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN109582556A (en) * 2017-09-29 2019-04-05 阿里巴巴集团控股有限公司 Test method, the device and system of a kind of application program in running of mobile terminal situation
CN109688202A (en) * 2018-12-04 2019-04-26 北京腾云天下科技有限公司 A kind of processing method of interface data, calculates equipment and storage medium at device
CN110262979A (en) * 2019-06-27 2019-09-20 苏宁消费金融有限公司 A kind of simulation third party's data source test method based on MOCK platform

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100079A (en) * 2020-11-02 2020-12-18 北京淇瑀信息科技有限公司 Test method and system based on simulation data calling and electronic equipment
CN113836008A (en) * 2021-09-13 2021-12-24 支付宝(杭州)信息技术有限公司 Method and system for fuzz testing of virtual machine monitor
CN113836008B (en) * 2021-09-13 2023-10-27 支付宝(杭州)信息技术有限公司 Method and system for performing fuzzy test on virtual machine monitor
CN114978970A (en) * 2022-04-07 2022-08-30 上海钧正网络科技有限公司 Data testing system, method, equipment and medium based on user-defined mock platform
CN114978970B (en) * 2022-04-07 2023-11-24 上海钧正网络科技有限公司 Data testing system, method, equipment and medium based on custom mock platform

Also Published As

Publication number Publication date
CN110727588B (en) 2023-12-12

Similar Documents

Publication Publication Date Title
CN110727588A (en) Network application testing method, system, computer equipment and readable storage medium
KR102157712B1 (en) Information leakage detection method and device
CN110138669B (en) Interface access processing method and device, computer equipment and storage medium
CN110445636B (en) Management platform-based micro-service early warning method and device and computer equipment
CN108400978B (en) Vulnerability detection method and device, computer equipment and storage medium
CN109412896B (en) Method and device for testing uploading function, computer equipment and storage medium
CN108256322B (en) Security testing method and device, computer equipment and storage medium
CN110113440B (en) Request response method, device and terminal
KR20190107373A (en) Fuzzing method and device for network protocol vulnerability detection
CN111343630A (en) Network connection state detection method, computer device, and storage medium
CN112162924A (en) Interface automation test method and device, computer equipment and storage medium
CN108011898B (en) Vulnerability detection method and device, computer equipment and storage medium
CN110704312A (en) Pressure testing method and device, computer equipment and storage medium
CN114157551B (en) Fusing identification method, device, equipment and storage medium suitable for micro-service
CN113282400B (en) Application publishing method, device, equipment and storage medium based on interface routing
CN110569987A (en) Automatic operation and maintenance method, operation and maintenance equipment, storage medium and device
CN111752819B (en) Abnormality monitoring method, device, system, equipment and storage medium
KR101625890B1 (en) Test automation system and test automation method for detecting change for signature of internet application traffic protocol
CN107634969B (en) Data interaction method and device
CN107872493B (en) Information processing method, terminal and server
US10896251B2 (en) Method for authenticating software
CN110166528B (en) Method and device for preventing node change notification from being lost and computer equipment
CN114070624A (en) Message monitoring method and device, electronic equipment and medium
CN108306999B (en) Domain name resolution method and device
CN113343222B (en) Java project engineering safety verification method and device, computer equipment and 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
GR01 Patent grant
GR01 Patent grant