CN111159033B - Software testing method and device - Google Patents

Software testing method and device Download PDF

Info

Publication number
CN111159033B
CN111159033B CN201911357297.6A CN201911357297A CN111159033B CN 111159033 B CN111159033 B CN 111159033B CN 201911357297 A CN201911357297 A CN 201911357297A CN 111159033 B CN111159033 B CN 111159033B
Authority
CN
China
Prior art keywords
execution
target
information
logic
function
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.)
Active
Application number
CN201911357297.6A
Other languages
Chinese (zh)
Other versions
CN111159033A (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.)
Koubei Shanghai Information Technology Co Ltd
Original Assignee
Koubei Shanghai Information 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 Koubei Shanghai Information Technology Co Ltd filed Critical Koubei Shanghai Information Technology Co Ltd
Priority to CN201911357297.6A priority Critical patent/CN111159033B/en
Publication of CN111159033A publication Critical patent/CN111159033A/en
Application granted granted Critical
Publication of CN111159033B publication Critical patent/CN111159033B/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/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a software testing method, which comprises the following steps: acquiring execution information corresponding to an execution objective function in a tested software system; obtaining preset positioning logic for determining an objective function to be intercepted; according to the execution information and the preset positioning logic, obtaining an objective function to be intercepted, and intercepting the objective function to be intercepted; and constructing a target execution result aiming at the current execution of the target function, and outputting the target execution result. By adopting the method, the problem of intercepting the call request in full quantity is solved.

Description

Software testing method and device
Technical Field
The application relates to the technical field of software testing, in particular to a software testing method, a device and equipment. The application also relates to a software testing system.
Background
Software systems are increasingly complex and large, and one function often requires multiple systems to cooperate closely. For example, the code scanning payment function involves a plurality of systems including user verification, wind control calculation, two-dimensional code decoding, order management, funds management, and financial channel management. The complex software system interaction relationship enables the complexity of the software testing environment to be increased continuously, and the stability of the testing environment is directly caused to be poor, so that the accuracy of the testing result is affected. In addition, the test sharing test environment of different software systems is a common test scene, and the test of different software systems generally does not need to pay attention to an upstream system or a downstream system of the tested software system, and meanwhile, the operation or the test of the upstream system or the downstream system cannot be influenced.
Currently, for complex test environments, mock (simulation) technology is generally adopted, and mock is performed for a downstream system of a tested software system. The mock technology refers to an environment and an object simulating interaction so that a tested service is executed as expected. Take an order system for testing payment functions as an example. The order system as the tested software system needs to call a downstream funds transfer system and a wind control detection system, and if the funds transfer system is not available, the dock funds transfer system can: after the order system calls the real wind control detection system and the call is successful, the call request for the funds transfer system is intercepted, the call request is sent to a specific mock server, and the mock server returns a specific call result through a preset simulation logic, so that the unavailable funds transfer system is bypassed, and the test of the order system is completed.
The existing mock scheme has the following problems: intrusion into the software system under test. Along with examples tested with the order system described above. The target address of the request for calling the funds transfer system needs to be modified in the order system, and is generally modified through the configuration file of the order system, and the new configuration of the server needs to be restarted each time of modification to be effective, so that the convenience is poor. In addition, because the configuration file is the global configuration of the order system, the call requests sent to the funds transfer system after being modified are sent to the mock server according to the configuration file, namely, all call requests are intercepted without distinction, so that no request is sent to the real funds transfer system, and the funds transfer system is difficult to perform joint debugging test. Referring to fig. 1, a software system 101 running using test configuration information in a conventional mock test scheme is shown, and a received call request is indiscriminately sent to a mock server 102 indicated in the test configuration information, but not to a real downstream system 103; the soft system configuration is changed and the software system 104 running using the real environment configuration information sends the received call request to the real downstream system 103.
Therefore, how to implement non-intrusive testing, avoiding the full-scale interception of call requests is a problem to be solved.
Disclosure of Invention
According to the software testing method, under the condition that a tested software system is not invaded, accurate interception is conducted on functions executed by the tested software system for processing call requests, and the problem of intercepting the call requests in full quantity is avoided.
The embodiment of the application provides a software testing method, which comprises the following steps: acquiring execution information corresponding to an execution objective function in a tested software system; obtaining preset positioning logic for determining an objective function to be intercepted; according to the execution information and the preset positioning logic, obtaining an objective function to be intercepted, and intercepting the objective function to be intercepted; and constructing a target execution result aiming at the current execution of the target function, and outputting the target execution result.
Optionally, the obtaining, according to the execution information and the preset positioning logic, an objective function to be intercepted includes: if the execution information is matched with the preset positioning logic, the objective function is used as the objective function to be intercepted; otherwise, executing the objective function according to the function call relation in the tested software system.
Optionally, the constructing the target execution result for the current execution of the target function includes: obtaining a filtering condition for the objective function; and constructing the target execution result according to the execution information and the filtering condition.
Optionally, the constructing the target execution result according to the execution information and the filtering condition includes: if the content contained in the execution information is matched with the filtering condition, skipping executing codes in the objective function, and constructing an objective execution result aiming at the current execution of the objective function; otherwise, executing the objective function according to the real function call relation in the tested software system, and returning an execution result.
Optionally, the method further comprises: obtaining result assembly logic for constructing a target execution result; and constructing the target execution result according to the result assembly logic.
Optionally, the outputting the target execution result includes: and returning the target execution result to a calling party calling the target function as a return result of the current execution of the target function.
Optionally, the method further comprises: receiving configuration information of at least one simulation logic in preset positioning logic, filtering conditions and result assembly logic, and adjusting the at least one simulation logic according to the configuration information.
Optionally, the obtaining the execution information corresponding to the execution objective function in the tested software system includes: monitoring an execution message of an execution target function in a tested software system; and obtaining the execution information according to the execution message.
Optionally, the execution information includes a function identifier; the preset positioning logic is processing logic which is matched according to the function identification to position the target function to be intercepted.
Optionally, the execution information includes at least one of parameter information, parameter type, parameter data structure, and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information.
The embodiment of the application also provides another software testing method, which comprises the following steps: obtaining a target call request; executing an objective function in the tested software system according to the objective call request; transmitting execution information corresponding to the current execution of the objective function; and obtaining a target execution result aiming at the execution information.
The embodiment of the application also provides another software testing method, which comprises the following steps: obtaining a target call request; executing an objective function in the tested software system according to the objective call request; according to the execution information corresponding to the current execution of the target function and preset positioning logic used for determining the target function to be intercepted, the target function to be intercepted is obtained, and the target function to be intercepted is intercepted; obtaining a target execution result of the current execution of the target function according to the execution information and the filtering condition corresponding to the target function to be intercepted; and the target execution result is an execution result custom constructed according to the result assembly logic.
The embodiment of the application also provides a software testing system, which comprises: the system comprises a tested software system, a positioning module, a filtering module and an execution result constructing module; the tested software system is used for receiving a target call request, executing a target function in the tested software system according to the target call request, and obtaining a target execution result aiming at the current execution of the target function; the positioning module is used for obtaining execution information corresponding to an execution target function in a tested software system, obtaining the target function to be intercepted according to the execution information of the execution of the target function and preset positioning logic used for determining the target function to be intercepted, and intercepting the target function to be intercepted; the filtering module is used for obtaining a target execution result of the current execution of the target function according to the execution information and the filtering condition corresponding to the target function to be intercepted and outputting the target execution result; and the execution result constructing module is used for customizing and constructing the target execution result according to the result assembling logic.
Optionally, the method further comprises: a simulation logic control module; the analog logic control module is used for receiving configuration information aiming at analog logic control and adjusting the analog logic according to the configuration information; the simulation logic comprises at least one simulation logic of preset positioning logic, filtering conditions and result assembling logic.
The embodiment of the application also provides a software testing device, which comprises: the execution information obtaining unit is used for obtaining the execution information corresponding to the execution objective function in the tested software system; the positioning unit is used for obtaining preset positioning logic for determining an objective function to be intercepted; the interception unit is used for acquiring an objective function to be intercepted according to the execution information and the preset positioning logic, and intercepting the objective function to be intercepted; and the result return unit is used for constructing a target execution result aiming at the current execution of the target function and outputting the target execution result.
The embodiment of the application also provides electronic equipment, which comprises: a memory, and a processor; the memory is adapted to store a computer program which, when executed by the processor, performs the software testing method of any of claims 1-12.
Embodiments of the present application also provide a storage device storing a computer program which, when executed by a processor, performs the software testing method of any one of claims 1-12.
Compared with the prior art, the application has the following advantages:
According to the software testing method, device and equipment provided by the embodiment of the application, the execution information corresponding to the execution target function in the tested software system is obtained, and the target function to be intercepted is intercepted according to the execution information and the preset positioning logic; constructing a target execution result aiming at the current execution of the intercepted target function, and outputting the target execution result. The method can accurately intercept the function according to the execution information of the target function without invading the tested software system, and construct an execution result aiming at the intercepted function, thereby avoiding the problem of intercepting the call request in full quantity.
According to the other software testing method provided by the embodiment of the application, the target calling request is obtained, and the target function is executed according to the target calling request; and sending the execution information corresponding to the current execution of the target function to obtain a target execution result aiming at the execution information. Because the tested software system can provide function execution information when running in the computing equipment, the tested software system does not need to be additionally modified, a configuration file used for starting to run the tested software system does not need to be modified, and the problem of intrusion into the tested software system in the test is solved.
According to the other software testing method provided by the embodiment of the application, the target calling request is obtained; executing the target function in the tested software system according to the target call request; according to the execution information of the objective function and preset positioning logic, obtaining the objective function to be intercepted, and intercepting the objective function to be intercepted; and obtaining a target execution result which is customized and constructed according to result assembly logic aiming at the current execution of the target function according to the execution information and the filtering condition corresponding to the target function to be intercepted. Because the tested software system can provide function execution information when running in the computing equipment, the configuration file used for starting the tested software system to run is not required to be modified, and the target function can be accurately intercepted according to the preset positioning logic and the filtering condition instead of the full-scale interception, so that the problem of full-scale interception calling request is solved under the condition of not invading the tested software system.
The software testing system provided by the embodiment of the application comprises: the system comprises a tested software system, a positioning module, a filtering module and an execution result constructing module; the tested software system can provide function execution information when running in the computing equipment, so that a configuration file used for starting and running the tested software system is not required to be modified; the positioning module can accurately intercept the target function instead of performing full-scale interception according to preset positioning logic and filtering conditions, so that the test system which is non-invasive to the tested software system and can accurately intercept the call request is provided.
Drawings
FIG. 1 is a schematic diagram of a prior art software test mock scenario;
FIG. 2 is a schematic diagram of a system environment of a software testing method provided herein;
FIG. 3 is a process flow diagram of a software testing method provided in a first embodiment of the present application;
FIG. 4 is a schematic diagram of a system architecture of a software testing method according to a first embodiment of the present application;
fig. 5 is a schematic diagram of a precise interception processing procedure of the software testing method according to the first embodiment of the present application;
FIG. 6 is a process flow diagram of a software testing method provided in a second embodiment of the present application;
FIG. 7 is a process flow diagram of a software testing method according to a third embodiment of the present application;
FIG. 8 is a schematic diagram of a software testing system according to a fourth embodiment of the present application;
FIG. 9 is a schematic diagram of a software testing apparatus according to a fifth embodiment of the present application;
fig. 10 is a schematic diagram of an electronic device provided herein.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is, however, susceptible of embodiment in many other ways than those herein described and similar generalizations can be made by those skilled in the art without departing from the spirit of the application and the application is therefore not limited to the specific embodiments disclosed below.
The embodiment of the application provides a software testing method, a device, electronic equipment and storage equipment. The embodiment of the application also provides a software testing system. The following examples are described in detail one by one.
For ease of understanding, a system environment for a software testing method is first presented. Referring to fig. 2, the system environment shown in fig. 2 includes: the tested software system 201 receives a call request, if the call request is a specific call request for executing a test case, the mock module 202 intercepts the specific call request and returns a call result for the specific call request; otherwise, the call request is sent to the real downstream system 203, and is processed by the real downstream system 203, and a call result is returned. It can be seen that the software testing method has no influence on the real downstream system, so that in the public testing environment, each tested software system to be tested can share the testing environment and has no influence on each other.
The software testing method provided in the first embodiment of the present application is described below with reference to fig. 3 to 5.
The software testing method shown in fig. 3 comprises the following steps: step S301 to step S304.
Step S301, obtaining execution information corresponding to the execution target function in the tested software system.
In this embodiment, the software system to be tested runs on a JVM (JAVA virtual machine), and the execution information corresponding to the execution target function in the software system to be tested can be obtained through a JVM proxy mechanism, or the execution of a method that a JAVA listener listens to a JAVA code specific class can be generated. The method called JAVA code specific class provides functions for JAVA specific class. In one embodiment, the software testing method can be deployed as a JVM plug-in on a JAVA server with a JAVA environment, and a tested software system is deployed on the JAVA server. The method is deployed in a plug-in mode, the tested software system can be accessed without invasion, the tested software system is not influenced in the process of accurately intercepting the accessed tested software system, and the tested software is not influenced in the process of exiting the tested software system. The method specifically comprises the following steps: monitoring an execution message of an execution target function in a tested software system; and obtaining the execution information according to the execution message. Wherein, the execution information contains the function identification of the objective function. Referring to fig. 4, a system architecture of the software testing method shown in the drawing includes: the system comprises a tested software system 401, a MOCK test plug-in 402, wherein the tested software system and the MOCK test plug-in are deployed on a server 403 to be tested with a JAVA environment, and the server to be tested refers to a JAVA server running the tested software system. The tested software system 401 receives a target call request, executes a target function in the tested software system according to the target call request, monitors an execution event corresponding to the current execution of the target function by the MOCK test plug-in 402, intercepts the execution event, and obtains execution information corresponding to the execution event.
Step S302, obtaining preset positioning logic for determining an objective function to be intercepted.
The preset positioning logic is processing logic which performs matching according to the function identification to position the target function to be intercepted. For example, the preset positioning logic includes a class name of JAVA and a method name provided by a class code indicated by the class name, and if the class name and the method name are matched, a function corresponding to the method name is intercepted, where the function is an objective function to be intercepted. In this embodiment, the preset positioning logic is obtained by obtaining configuration information. In one embodiment, man-machine interaction is performed through an http interface, and input trigger aiming at the preset positioning logic is obtained. In practical application, the configuration function is provided to configure the preset positioning logic, for example, the preset positioning logic is added for the newly added objective function to be intercepted. The specific designated positioning logic in the preset positioning logic can be enabled or disabled through the configuration function, and global control can be performed on the preset positioning logic, namely each preset positioning logic in the preset positioning logic is enabled or disabled uniformly. The method comprises the steps that a valid preset positioning logic can trigger interception of an objective function matched with the preset positioning logic; and the invalid preset positioning logic does not perform interception processing.
Step S303, according to the execution information and the preset positioning logic, obtaining an objective function to be intercepted, and intercepting the objective function to be intercepted.
In this embodiment, if the execution information matches the preset positioning logic, the objective function is used as the objective function to be intercepted; otherwise, executing the objective function according to the function call relation in the tested software system. In the subsequent step, intercepting the target function to be intercepted, and constructing a customized target execution result aiming at the intercepted target function. For example, taking the test of the order system as an example, the order system of the software system under test, the downstream system thereof includes a funds transfer system. In the test process, the order system calls a specific method of a specific class of the funds transfer system, and an expected funds transfer result needs to be constructed according to the call of the specific method, and the method specifically comprises the following steps: and executing the order system to the specific method, monitoring and obtaining the execution information of the specific method aiming at the specific class by using a plug-in unit for implementing the software testing method, intercepting the execution of the specific method if the execution information is matched with preset positioning logic, customizing and assembling an execution result according to a result customizing and assembling logic after intercepting, and returning to a calling party of the specific method.
Step S304, constructing a target execution result aiming at the current execution of the target function, and outputting the target execution result.
In this embodiment, the target execution result is specifically constructed by: obtaining a filtering condition for the objective function; and constructing the target execution result according to the execution information and the filtering condition. The execution information comprises at least one of parameter information, parameter type, parameter data structure and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information. By filtering conditions, it is possible to further intercept specific scenarios of the objective function, for example, for specific users or specific amounts, execution of the objective function, and construct expected execution results. In one embodiment, the method specifically comprises the following steps: if the content contained in the execution information is matched with the filtering condition, skipping executing codes in the objective function, and constructing an objective execution result aiming at the current execution of the objective function; otherwise, executing the objective function according to the real function call relation in the tested software system, and returning an execution result. Further, the method comprises the steps of: obtaining result assembly logic for constructing a target execution result; and constructing the target execution result according to the result assembly logic. In this embodiment, the outputting the target execution result includes: and returning the target execution result to a calling party calling the target function as a return result of the current execution of the target function.
In this embodiment, the method further includes interactive configuration. Specifically, configuration information of at least one simulation logic in preset positioning logic, filtering conditions and result assembly logic is received, and the at least one simulation logic is adjusted according to the configuration information. In one embodiment, the input trigger for the at least one analog logic is obtained by performing man-machine interaction through an http interface. In practical application, the configuration function is provided to configure the at least one analog logic, for example, the preset positioning logic is added for the newly added objective function to be intercepted. The specified simulation logic of the at least one simulation logic may be validated or invalidated by a configuration function, or may be globally controlled, i.e. each simulation logic is validated or invalidated uniformly, with respect to the at least one simulation logic. In the prior art, if a call request needs to be sent to a mock server, configuration information used for operating a tested software system is modified, the tested software system needs to be restarted after the configuration information is modified, and the modified configuration is effective, so that the tested software system is invasive and complex in operation. In contrast, in this embodiment, the configuration function is capable of controlling the failure or the validation of the at least one simulation logic in real time, without affecting the operation of the tested software system.
In practical applications, the simulation logic may also include preset positioning logic, filtering conditions, and result assembling logic. And determining an objective function to be intercepted according to the preset positioning logic. A specific scenario of the intercepted objective function, such as a specific user or a specific amount of money for a specific user, is determined according to the filtering conditions. Specific scene information carried in a call request received by a tested software system is transferred to a target function layer by layer through a function call relation of the tested software system, so that interception can be carried out aiming at a specific call request, and full interception is not carried out indiscriminately. According to the result assembly logic, constructing an expected execution result, taking the example of order system test, intercepting the execution of a specific method of a funds transfer system to be intercepted, directly skipping the code of the specific method, not executing the call to the specific method, assembling the successful execution result according to the result assembly logic, and returning the successful call. Referring to fig. 4, a MOCK card 402 includes: the MOCK simulation logic interaction module 402-1 receives configuration information for at least one simulation logic of a preset positioning logic, a filtering condition, and a result assembling logic. The MOCK logic processing module 402-2 is configured to adjust the at least one analog logic according to the configuration information. The MOCK core processing module 402-3 determines an objective function to be intercepted according to a preset positioning logic through a positioning module; determining a specific scene of the intercepted objective function by a filtering module; judging by an execution judging module, if judging that the execution code of the intercepted objective function needs to be skipped, skipping the execution code, and constructing an expected execution result according to result assembly logic; otherwise, continuing to call the execution code of the target function.
Referring to fig. 5 again, a process for performing accurate interception for a specific service invocation scenario is shown. In the figure, S501, the tested software system receives a specific call request, and processes the specific call request according to an internal function call relationship. For example, the source code call relationship includes: invoking a class A method a in a class A method b; invoking a class A method d in a class A method a; the external downstream system of the software system under test is invoked in class a method d. S502, if preset positioning logic, filtering conditions and assembly result logic are effective, executing information of an objective function for processing a specific call request in a tested software system is obtained, for example, a JVM-sadbox plug-in can be used for monitoring execution of each method of each class in the tested software system, and the executing information is obtained. S503, according to preset positioning logic, such as execution of interception class A method a, intercepting an objective function to be intercepted; therefore, the positioning fails when the class A method b is executed, the code of the method b is directly executed, the class A method a is called in the process of executing the code of the method b, the preset positioning logic matched with the class A method a is judged, and the method a is used as an objective function to be intercepted. S504, judging whether to intercept the current execution of the objective function according to the filtering condition; for example, the filtering condition is the parameter information of the function, interception is performed for the scene with the parameter information of 1234, and because the input parameter information when the class A method b calls the class A method a is 1111, the interception is not performed, the code of the class A method a is further executed, and the class A method d is called; the class A method d is not matched with the preset positioning logic, so that interception is not performed, the code of the class A method d is further executed, the class A method a is called, the execution of the class A method a is intercepted again, the input parameter information of the current execution is 1234, the filtering condition is matched, the current execution of the class A method a is intercepted, a customized expected result B is assembled according to the result assembling logic, and the result B is returned.
Thus, the software testing method provided by the embodiment is described in detail, and the method intercepts the objective function to be intercepted according to the execution information and the preset positioning logic by obtaining the execution information corresponding to the execution objective function in the tested software system; constructing a target execution result aiming at the current execution of the intercepted target function, and outputting the target execution result. The method can accurately intercept the function according to the execution information of the target function without invading the tested software system, and construct an execution result aiming at the intercepted function, thereby avoiding the problem of intercepting the call request in full quantity.
Based on the above embodiments, a second embodiment of the present application provides another software testing method.
The software testing method provided in the second embodiment is described below with reference to fig. 6, and please refer to the corresponding parts of the above embodiments for description. The software testing method shown in fig. 6 comprises the following steps: step S601 to step S604.
Step S601, a target call request is obtained.
In this embodiment, the software system under test for implementing the method runs on a JAVA server having a JAVA environment. The JVM plug-in monitors the execution of functions in the tested software system in the process of running the tested software system on the JAVA server, so that the method has no influence on the tested software system in the process of accessing the tested software system for accurate interception, and has no influence on the tested software in the process of exiting the tested software system. The software system under test receives the target call request.
And step S602, executing the target function in the tested software system according to the target call request.
And the tested software system processes the target call request according to the internal function call relation according to the target call request. For example, the source code call relationship includes: invoking a class A method a in a class A method b; invoking a class A method d in a class A method a; the external downstream system of the software system under test is invoked in class a method d.
Step S603, sending execution information corresponding to the current execution of the objective function.
In this embodiment, the objective function of the tested software system is a code for implementing a class method, and a function to be monitored by the JVM plugin may register a monitoring event with the JVM plugin, and when the registered class method is called, a message is sent to the JVM plugin, where the message includes execution information corresponding to the current execution of the function. The execution information comprises at least one of function identification, parameter information, parameter type, parameter data structure and user attribute information.
Step S604, obtaining a target execution result for the execution information.
In this embodiment, if the execution information satisfies the simulation logic, a target execution result constructed according to the result assembly logic is obtained, otherwise, a processing result of the real downstream system is obtained. The simulation logic constructs simulation execution conditions of simulation execution results aiming at the objective functions, and comprises preset positioning logic for determining the objective functions to be intercepted and filtering conditions for filtering execution information of each execution of the objective functions to be intercepted. The result assembling logic is logic for constructing a target execution result.
Thus far, the software testing method provided by the second embodiment is described, and the method executes the objective function according to the objective call request by obtaining the objective call request; and sending the execution information corresponding to the current execution of the target function to obtain a target execution result aiming at the execution information. Because the tested software system can provide function execution information when running in the computing equipment, the tested software system does not need to be additionally modified, a configuration file used for starting to run the tested software system does not need to be modified, and the problem of intrusion into the tested software system in the test is solved.
Based on the above embodiments, a third embodiment of the present application provides another software testing method.
The software testing method provided in the third embodiment is described below with reference to fig. 7, and please refer to the corresponding parts of the above embodiments for description. The software testing method shown in fig. 7 comprises the following steps: step S701 to step S704.
Step S701, a target call request is obtained.
In this embodiment, the software system under test for implementing the method runs on a JAVA server having a JAVA environment. The JVM plug-in monitors the execution of functions in the tested software system in the process of running the tested software system on the JAVA server, so that the method has no influence on the tested software system in the process of accessing the tested software system for accurate interception, and has no influence on the tested software in the process of exiting the tested software system. The software system under test receives the target call request.
Step S702, executing the target function in the tested software system according to the target call request.
And the tested software system processes the target call request according to the internal function call relation according to the target call request. For example, the source code call relationship includes: invoking a class A method a in a class A method b; invoking a class A method d in a class A method a; the external downstream system of the software system under test is invoked in class a method d.
Step S703, obtaining an objective function to be intercepted according to the execution information corresponding to the current execution of the objective function and a preset positioning logic for determining the objective function to be intercepted, and intercepting the objective function to be intercepted.
The method specifically comprises the following steps: monitoring an execution message of an execution target function in a tested software system; acquiring the execution information according to the execution message; obtaining preset positioning logic for determining an objective function to be intercepted; intercepting the objective function according to the execution information and the preset positioning logic. Wherein, the execution information contains the function identification of the objective function. The target function of the tested software system is the code of the method for realizing the class, the function to be monitored by the JVM plug-in can register a monitoring event to the JVM plug-in, and when the registered class method is called, a message is sent to the JVM plug-in, and the message contains the execution information corresponding to the current execution of the function. The execution information comprises at least one of function identification, parameter information, parameter type, parameter data structure and user attribute information. The preset positioning logic is processing logic which performs matching according to the function identification to position the target function to be intercepted. For example, the preset positioning logic includes a class name of JAVA and a method name provided by a class code indicated by the class name, and if the class name and the method name are matched, a function corresponding to the method name is intercepted, where the function is an objective function to be intercepted. In this embodiment, the preset positioning logic is obtained by obtaining configuration information. In one embodiment, man-machine interaction is performed through an http interface, and input trigger aiming at the preset positioning logic is obtained. In practical application, the configuration function is provided to configure the preset positioning logic, for example, the preset positioning logic is added for the newly added objective function to be intercepted. The specific designated positioning logic in the preset positioning logic can be enabled or disabled through the configuration function, and global control can be performed on the preset positioning logic, namely each preset positioning logic in the preset positioning logic is enabled or disabled uniformly. The method comprises the steps that a valid preset positioning logic can trigger interception of an objective function matched with the preset positioning logic; and the invalid preset positioning logic does not perform interception processing. In this embodiment, if the execution information matches the preset positioning logic, the objective function is used as the objective function to be intercepted; otherwise, executing the objective function according to the function call relation in the tested software system. In the subsequent step, intercepting the target function to be intercepted, and constructing a customized target execution result aiming at the intercepted target function. For example, taking the test of the order system as an example, the order system of the software system under test, the downstream system thereof includes a funds transfer system. In the test process, the order system calls a specific method of a specific class of the funds transfer system, and an expected funds transfer result needs to be constructed according to the call of the specific method, and the method specifically comprises the following steps: and executing the order system to the specific method, monitoring and obtaining the execution information of the specific method aiming at the specific class by using a plug-in unit for implementing the software testing method, intercepting the execution of the specific method if the execution information is matched with preset positioning logic, customizing and assembling an execution result according to a result customizing and assembling logic after intercepting, and returning to a calling party of the specific method.
Step S704, obtaining a target execution result of the current execution of the objective function according to the execution information and the filtering condition corresponding to the objective function to be intercepted; and the target execution result is an execution result custom constructed according to the result assembly logic.
In this embodiment, the target execution result is specifically constructed by: obtaining a filtering condition for the objective function; and constructing the target execution result according to the execution information and the filtering condition. The execution information comprises at least one of parameter information, parameter type, parameter data structure and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information. By filtering conditions, it is possible to further intercept specific scenarios of the objective function, for example, for specific users or specific amounts, execution of the objective function, and construct expected execution results. In one embodiment, the method specifically comprises the following steps: if the content contained in the execution information is matched with the filtering condition, skipping executing codes in the objective function, and constructing an objective execution result aiming at the current execution of the objective function; otherwise, executing the objective function according to the real function call relation in the tested software system, and returning an execution result. Further, the method comprises the steps of: obtaining result assembly logic for constructing a target execution result; and constructing the target execution result according to the result assembly logic. In this embodiment, the outputting the target execution result includes: and returning the target execution result to a calling party calling the target function as a return result of the current execution of the target function.
In this embodiment, the method further includes interactive configuration. Specifically, configuration information of at least one simulation logic in preset positioning logic, filtering conditions and result assembly logic is received, and the at least one simulation logic is adjusted according to the configuration information. In one embodiment, the input trigger for the at least one analog logic is obtained by performing man-machine interaction through an http interface. In practical application, the configuration function is provided to configure the at least one analog logic, for example, the preset positioning logic is added for the newly added objective function to be intercepted. The specified simulation logic of the at least one simulation logic may be validated or invalidated by a configuration function, or may be globally controlled, i.e. each simulation logic is validated or invalidated uniformly, with respect to the at least one simulation logic. In the prior art, if a call request needs to be sent to a mock server, configuration information used for operating a tested software system is modified, the tested software system needs to be restarted after the configuration information is modified, and the modified configuration is effective, so that the tested software system is invasive and complex in operation. In contrast, in this embodiment, the configuration function is capable of controlling the failure or the validation of the at least one simulation logic in real time, without affecting the operation of the tested software system.
In practical applications, the simulation logic may also include preset positioning logic, filtering conditions, and result assembling logic. And determining an objective function to be intercepted according to the preset positioning logic. A specific scenario of the intercepted objective function, such as a specific user or a specific amount of money for a specific user, is determined according to the filtering conditions. Specific scene information carried in a call request received by a tested software system is transferred to a target function layer by layer through a function call relation of the tested software system, so that interception can be carried out aiming at a specific call request, and full interception is not carried out indiscriminately. According to the result assembly logic, constructing an expected execution result, taking the example of order system test, intercepting the execution of a specific method of a funds transfer system to be intercepted, directly skipping the code of the specific method, not executing the call to the specific method, assembling the successful execution result according to the result assembly logic, and returning the successful call. In one embodiment, if the execution information satisfies the simulation logic, a target execution result constructed according to the result assembly logic is obtained, otherwise, a processing result of the real downstream system is obtained. The simulation logic constructs simulation execution conditions of simulation execution results aiming at the objective functions, and comprises preset positioning logic for determining the objective functions to be intercepted and filtering conditions for filtering execution information of each execution of the objective functions to be intercepted. The result assembling logic is logic for constructing a target execution result.
Thus far, the software testing method provided by the third embodiment is described, and the method obtains the target call request; executing the target function in the tested software system according to the target call request; intercepting the objective function according to the execution information of the objective function and preset positioning logic; and obtaining a target execution result which is custom constructed according to result assembly logic aiming at the current execution of the target function according to the execution information and the filtering condition corresponding to the target function to be intercepted. Because the tested software system can provide function execution information when running in the computing equipment, the configuration file used for starting the tested software system to run is not required to be modified, and the target function can be accurately intercepted according to the preset positioning logic and the filtering condition instead of the full-scale interception, so that the problem of full-scale interception calling request is solved under the condition of not invading the tested software system.
Based on the foregoing embodiments, a fourth embodiment of the present application provides a software testing system. The system provided in the fourth embodiment is described below with reference to fig. 8, and reference is made to the description of the corresponding parts of the above embodiments for relevant parts. The software testing system shown in fig. 8 includes: the system comprises a tested software system 801, a positioning module 802, a filtering module 803 and an execution result constructing module 804; wherein, the liquid crystal display device comprises a liquid crystal display device,
The software system 801 under test is configured to receive a target call request, execute a target function in the software system under test according to the target call request, and obtain a target execution result for the current execution of the target function. In this embodiment, the software system under test for implementing the method runs on a JAVA server having a JAVA environment. The JVM plug-in monitors the execution of functions in the tested software system in the process of running the tested software system on the JAVA server, so that the method has no influence on the tested software system in the process of accessing the tested software system for accurate interception, and has no influence on the tested software in the process of exiting the tested software system. And the tested software system processes the target call request according to the internal function call relation according to the target call request. For example, the source code call relationship includes: invoking a class A method a in a class A method b; invoking a class A method d in a class A method a; the external downstream system of the software system under test is invoked in class a method d. The function of the tested software system, which needs to be monitored by the JVM plug-in, can register a monitoring event with the JVM plug-in, and when the method of the registered class is called, a message is sent to the JVM plug-in, wherein the message contains execution information corresponding to the current execution of the function. The execution information comprises at least one of function identification, parameter information, parameter type, parameter data structure and user attribute information. In this embodiment, if the execution information satisfies the simulation logic, a target execution result constructed according to the result assembly logic is obtained, otherwise, a processing result of the real downstream system is obtained. The simulation logic constructs simulation execution conditions of simulation execution results aiming at the objective functions, and comprises preset positioning logic for determining the objective functions to be intercepted and filtering conditions for filtering execution information of each execution of the objective functions to be intercepted. The result assembling logic is logic for constructing a target execution result.
The positioning module 802 is configured to obtain execution information corresponding to an execution target function in a tested software system, and obtain an objective function to be intercepted according to the execution information of the execution of the objective function and preset positioning logic for determining the objective function to be intercepted, so as to intercept the objective function to be intercepted. In this embodiment, the preset positioning logic is obtained by obtaining configuration information. In one embodiment, man-machine interaction is performed through an http interface, and input trigger aiming at the preset positioning logic is obtained. In practical application, the configuration function is provided to configure the preset positioning logic, for example, the preset positioning logic is added for the newly added objective function to be intercepted. The specific designated positioning logic in the preset positioning logic can be enabled or disabled through the configuration function, and global control can be performed on the preset positioning logic, namely each preset positioning logic in the preset positioning logic is enabled or disabled uniformly. The method comprises the steps that a valid preset positioning logic can trigger interception of an objective function matched with the preset positioning logic; and the invalid preset positioning logic does not perform interception processing.
The filtering module 803 is configured to obtain a target execution result of the current execution of the objective function according to the execution information and a filtering condition corresponding to the objective function to be intercepted, and output the target execution result. In this embodiment, the filtering module constructs the target execution result specifically by: obtaining a filtering condition for the objective function; and constructing the target execution result according to the execution information and the filtering condition. The execution information comprises at least one of parameter information, parameter type, parameter data structure and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information. By filtering conditions, it is possible to further intercept specific scenarios of the objective function, for example, for specific users or specific amounts, execution of the objective function, and construct expected execution results. In one embodiment, the method specifically comprises the following steps: if the content contained in the execution information is matched with the filtering condition, skipping executing codes in the objective function, and constructing an objective execution result aiming at the current execution of the objective function; otherwise, executing the target function according to the real function calling relation in the tested software system, and returning the execution result to the calling party of the target function.
The execution result construction module 804 is configured to custom construct the target execution result according to result assembly logic. Specifically, result assembly logic for constructing a target execution result is obtained; and constructing the target execution result according to the result assembly logic.
In this embodiment, the system further includes: a simulation logic control module; the analog logic control module is used for receiving configuration information aiming at analog logic control and adjusting the analog logic according to the configuration information; the simulation logic comprises at least one simulation logic of preset positioning logic, filtering conditions and result assembling logic. Specifically, configuration information of at least one simulation logic in preset positioning logic, filtering conditions and result assembly logic is received, and the at least one simulation logic is adjusted according to the configuration information. In one embodiment, the input trigger for the at least one analog logic is obtained by performing man-machine interaction through an http interface. In practical application, the configuration function is provided to configure the at least one analog logic, for example, the preset positioning logic is added for the newly added objective function to be intercepted. The specified simulation logic of the at least one simulation logic may be validated or invalidated by a configuration function, or may be globally controlled, i.e. each simulation logic is validated or invalidated uniformly, with respect to the at least one simulation logic. In the prior art, if a call request needs to be sent to a mock server, configuration information used for operating a tested software system is modified, the tested software system needs to be restarted after the configuration information is modified, and the modified configuration is effective, so that the tested software system is invasive and complex in operation. In contrast, in this embodiment, the configuration function is capable of controlling the failure or the validation of the at least one simulation logic in real time, without affecting the operation of the tested software system.
In practical applications, the simulation logic may also include preset positioning logic, filtering conditions, and result assembling logic. And determining an objective function to be intercepted according to the preset positioning logic. A specific scenario of the intercepted objective function, such as a specific user or a specific amount of money for a specific user, is determined according to the filtering conditions. Specific scene information carried in a call request received by a tested software system is transferred to a target function layer by layer through a function call relation of the tested software system, so that interception can be carried out aiming at a specific call request, and full interception is not carried out indiscriminately. According to the result assembly logic, constructing an expected execution result, taking the example of order system test, intercepting the execution of a specific method of a funds transfer system to be intercepted, directly skipping the code of the specific method, not executing the call to the specific method, assembling the successful execution result according to the result assembly logic, and returning the successful call.
Thus far, a software testing system provided by the fourth embodiment is described, the system including: the system comprises a tested software system, a positioning module, a filtering module and an execution result constructing module; the tested software system can provide function execution information when running in the computing equipment, so that a configuration file used for starting and running the tested software system is not required to be modified; the positioning module can accurately intercept the target function instead of performing full-scale interception according to preset positioning logic and filtering conditions, so that the test system which is non-invasive to the tested software system and can accurately intercept the call request is provided.
Corresponding to the first embodiment, a fifth embodiment of the present application provides a software testing apparatus. The device provided by the fifth embodiment is described below with reference to fig. 9. The device shown in fig. 9 comprises:
an execution information obtaining unit 901, configured to obtain execution information corresponding to an execution objective function in a software system under test;
a positioning unit 902, configured to obtain preset positioning logic for determining an objective function to be intercepted;
the intercepting unit 903 is configured to obtain an objective function to be intercepted according to the execution information and the preset positioning logic, and intercept the objective function to be intercepted;
and a result returning unit 904, configured to construct a target execution result for the current execution of the target function, and output the target execution result.
Optionally, the intercepting unit 903 is specifically configured to: if the execution information is matched with the preset positioning logic, the objective function is used as the objective function to be intercepted; otherwise, executing the objective function according to the function call relation in the tested software system.
Optionally, the result return unit 904 is specifically configured to: obtaining a filtering condition for the objective function; and constructing the target execution result according to the execution information and the filtering condition.
Optionally, the result return unit 904 is specifically configured to: if the content contained in the execution information is matched with the filtering condition, skipping executing codes in the objective function, and constructing an objective execution result aiming at the current execution of the objective function; otherwise, executing the objective function according to the real function call relation in the tested software system, and returning an execution result.
Optionally, the result return unit 904 is further configured to: obtaining result assembly logic for constructing a target execution result; and constructing the target execution result according to the result assembly logic.
Optionally, the result return unit 904 is specifically configured to: and returning the target execution result to a calling party calling the target function as a return result of the current execution of the target function.
Optionally, the apparatus further includes a configuration unit, where the configuration unit is configured to: receiving configuration information of at least one simulation logic in preset positioning logic, filtering conditions and result assembly logic, and adjusting the at least one simulation logic according to the configuration information.
Optionally, the execution information obtaining unit 901 is specifically configured to: monitoring an execution message of an execution target function in a tested software system; and obtaining the execution information according to the execution message.
Optionally, the execution information includes a function identifier; the preset positioning logic is processing logic which is matched according to the function identification to position the target function to be intercepted.
Optionally, the execution information includes at least one of parameter information, parameter type, parameter data structure, and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information.
Thus, the software testing device provided by the embodiment is described in detail, and the device intercepts the target function to be intercepted according to the execution information and the preset positioning logic by obtaining the execution information corresponding to the execution target function in the tested software system; constructing a target execution result aiming at the current execution of the intercepted target function, and outputting the target execution result. The method can accurately intercept the function according to the execution information of the target function without invading the tested software system, and construct an execution result aiming at the intercepted function, thereby avoiding the problem of intercepting the call request in full quantity.
Corresponding to the first embodiment, a sixth embodiment of the present application provides an electronic device. Fig. 10 is a schematic diagram of the electronic device, including: a memory, and a processor; the memory is adapted to store a computer program which, when executed by the processor, performs the software testing method of any of claims 1-12. The electronic equipment intercepts an objective function to be intercepted according to the execution information and preset positioning logic by acquiring the execution information corresponding to the execution objective function in the tested software system; constructing a target execution result aiming at the current execution of the intercepted target function, and outputting the target execution result. The method can accurately intercept the function according to the execution information of the target function without invading the tested software system, and construct an execution result aiming at the intercepted function, thereby avoiding the problem of intercepting the call request in full quantity.
In correspondence with the first embodiment, a seventh embodiment of the present application provides a storage device, and relevant portions may be referred to the corresponding descriptions of the above embodiments. The schematic diagram of the memory device is similar to fig. 10. The storage device stores a computer program which, when executed by a processor, performs the software testing method of any one of claims 1-12. According to the instruction stored in the storage device, the execution information corresponding to the execution target function in the tested software system is obtained, and the target function to be intercepted is intercepted according to the execution information and preset positioning logic; constructing a target execution result aiming at the current execution of the intercepted target function, and outputting the target execution result. The method can accurately intercept the function according to the execution information of the target function without invading the tested software system, and construct an execution result aiming at the intercepted function, thereby avoiding the problem of intercepting the call request in full quantity.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
1. Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
2. It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
While the preferred embodiment has been described, it is not intended to limit the invention thereto, and any person skilled in the art may make variations and modifications without departing from the spirit and scope of the present invention, so that the scope of the present invention shall be defined by the claims of the present application.

Claims (14)

1. A method of testing software, comprising:
acquiring execution information corresponding to an execution objective function in a tested software system;
obtaining preset positioning logic for determining an objective function to be intercepted; the preset positioning logic is obtained through configuration information;
according to the execution information and the preset positioning logic, obtaining an objective function to be intercepted, and intercepting the objective function to be intercepted;
constructing a target execution result aiming at the current execution of the target function, and outputting the target execution result; the target execution result is an expected result custom constructed according to result assembly logic;
the constructing the target execution result aiming at the current execution of the target function includes:
obtaining a filtering condition for the objective function; constructing the target execution result according to the execution information and the filtering condition; the execution information comprises at least one of parameter information, parameter type, parameter data structure and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information.
2. The method of claim 1, wherein the obtaining an objective function to be intercepted according to the execution information and the preset positioning logic comprises:
if the execution information is matched with the preset positioning logic, the objective function is used as the objective function to be intercepted; otherwise, executing the objective function according to the function call relation in the tested software system.
3. The method of claim 1, wherein constructing the target execution result based on the execution information and the filtering condition comprises:
if the content contained in the execution information is matched with the filtering condition, skipping executing codes in the objective function, and constructing an objective execution result aiming at the current execution of the objective function; otherwise, executing the objective function according to the real function call relation in the tested software system, and returning an execution result.
4. The method of claim 1, wherein the outputting the target execution result comprises: and returning the target execution result to a calling party calling the target function as a return result of the current execution of the target function.
5. A method according to claim 1 or 3, further comprising: receiving configuration information of at least one simulation logic in preset positioning logic, filtering conditions and result assembly logic, and adjusting the at least one simulation logic according to the configuration information.
6. The method according to claim 1, wherein the obtaining the execution information corresponding to the execution objective function in the tested software system includes:
monitoring an execution message of an execution target function in a tested software system;
and obtaining the execution information according to the execution message.
7. The method of claim 1, wherein the execution information includes a function identification; the preset positioning logic is processing logic which is matched according to the function identification to position the target function to be intercepted.
8. A method of testing software, comprising:
obtaining a target call request;
executing an objective function in the tested software system according to the objective call request;
transmitting execution information corresponding to the current execution of the objective function; the execution information comprises at least one of parameter information, parameter type, parameter data structure and user attribute information;
Obtaining a target execution result aiming at the execution information; the target execution result is an expected result which is obtained by intercepting the target function according to the execution information and preset positioning logic of the target function, and customizing and constructing according to result assembling logic according to the execution information and filtering conditions of the target function; the preset positioning logic is obtained through configuration information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information.
9. A method of testing software, comprising:
obtaining a target call request;
executing an objective function in the tested software system according to the objective call request;
according to the execution information corresponding to the current execution of the target function and preset positioning logic used for determining the target function to be intercepted, the target function to be intercepted is obtained, and the target function to be intercepted is intercepted; the preset positioning logic is obtained through configuration information;
obtaining a target execution result of the current execution of the target function according to the execution information and the filtering condition corresponding to the target function to be intercepted; the target execution result is an execution result of the customized construction according to the result assembly logic; the execution information comprises at least one of parameter information, parameter type, parameter data structure and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information.
10. A software testing system, comprising: the system comprises a tested software system, a positioning module, a filtering module and an execution result constructing module; wherein, the liquid crystal display device comprises a liquid crystal display device,
the tested software system is used for receiving a target call request, executing a target function in the tested software system according to the target call request, and obtaining a target execution result aiming at the current execution of the target function; the target execution result is an expected result custom constructed according to the result assembly logic
The positioning module is used for obtaining execution information corresponding to an execution target function in a tested software system, obtaining the target function to be intercepted according to the execution information of the execution of the target function and preset positioning logic used for determining the target function to be intercepted, and intercepting the target function to be intercepted; the preset positioning logic is obtained through configuration information;
the filtering module is used for obtaining a target execution result of the current execution of the target function according to the execution information and the filtering condition corresponding to the target function to be intercepted and outputting the target execution result; the execution information comprises at least one of parameter information, parameter type, parameter data structure and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information;
And the execution result constructing module is used for customizing and constructing the target execution result according to the result assembling logic.
11. The system of claim 10, further comprising: a simulation logic control module; the analog logic control module is used for receiving configuration information aiming at analog logic control and adjusting the analog logic according to the configuration information; the simulation logic comprises at least one simulation logic of preset positioning logic, filtering conditions and result assembling logic.
12. A software testing apparatus, comprising:
the execution information obtaining unit is used for obtaining the execution information corresponding to the execution objective function in the tested software system;
the positioning unit is used for obtaining preset positioning logic for determining an objective function to be intercepted; the preset positioning logic is obtained through configuration information;
the interception unit is used for acquiring an objective function to be intercepted according to the execution information and the preset positioning logic, and intercepting the objective function to be intercepted;
the result return unit is used for constructing a target execution result aiming at the current execution of the target function and outputting the target execution result; the target execution result is an expected result custom constructed according to result assembly logic;
The constructing the target execution result aiming at the current execution of the target function includes:
obtaining a filtering condition for the objective function; constructing the target execution result according to the execution information and the filtering condition; the execution information comprises at least one of parameter information, parameter type, parameter data structure and user attribute information; the filtering condition is set according to at least one of parameter information, parameter type, parameter data structure and user attribute information.
13. An electronic device, comprising:
a memory, and a processor; the memory is adapted to store a computer program which, when executed by the processor, performs the software testing method of any one of claims 1-9.
14. A storage device storing a computer program which, when executed by a processor, performs the software testing method of any one of claims 1-9.
CN201911357297.6A 2019-12-25 2019-12-25 Software testing method and device Active CN111159033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911357297.6A CN111159033B (en) 2019-12-25 2019-12-25 Software testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911357297.6A CN111159033B (en) 2019-12-25 2019-12-25 Software testing method and device

Publications (2)

Publication Number Publication Date
CN111159033A CN111159033A (en) 2020-05-15
CN111159033B true CN111159033B (en) 2023-07-04

Family

ID=70557968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911357297.6A Active CN111159033B (en) 2019-12-25 2019-12-25 Software testing method and device

Country Status (1)

Country Link
CN (1) CN111159033B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797020A (en) * 2020-07-03 2020-10-20 北京每日优鲜电子商务有限公司 Mock data method and device based on dynamic bytecode
CN113821449A (en) * 2021-11-22 2021-12-21 浙江口碑网络技术有限公司 System testing method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731695A (en) * 2013-12-19 2015-06-24 广州凯乐软件技术有限公司 Unit testing system and method supporting table-driven underlying input
CN107203465A (en) * 2016-03-18 2017-09-26 阿里巴巴集团控股有限公司 System interface method of testing and device
CN108959061A (en) * 2017-05-19 2018-12-07 腾讯科技(深圳)有限公司 Application function management method, terminal and device
CN110134582A (en) * 2019-04-03 2019-08-16 口碑(上海)信息技术有限公司 The processing of test case and data processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8954929B2 (en) * 2010-03-29 2015-02-10 Microsoft Corporation Automatically redirecting method calls for unit testing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731695A (en) * 2013-12-19 2015-06-24 广州凯乐软件技术有限公司 Unit testing system and method supporting table-driven underlying input
CN107203465A (en) * 2016-03-18 2017-09-26 阿里巴巴集团控股有限公司 System interface method of testing and device
CN108959061A (en) * 2017-05-19 2018-12-07 腾讯科技(深圳)有限公司 Application function management method, terminal and device
CN110134582A (en) * 2019-04-03 2019-08-16 口碑(上海)信息技术有限公司 The processing of test case and data processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
尹春娇.自动化单元测试中MOCK技术的研究与应用.《知网》.2012,全文. *

Also Published As

Publication number Publication date
CN111159033A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
US10061684B2 (en) Enhanced service validation
CN109308263B (en) Applet testing method, device and equipment
US10754717B2 (en) Fast and accurate identification of message-based API calls in application binaries
CN111159033B (en) Software testing method and device
CN108984234B (en) Calling prompt method for mobile terminal and camera device
WO2020211360A1 (en) Mock test method and system, electronic device, and computer non-volatile readable storage medium
US10803166B1 (en) Automated determination of application privileges
CN112068880A (en) Method and device for generating and controlling guide page
US20200004664A1 (en) Automatic mock enablement in a multi-module software system
CN110858242A (en) Page skipping method and device
CN110838929B (en) System error checking method and system error checking device
CN110781500A (en) Data wind control system and method
CN113656009A (en) Macro processing method and device, electronic equipment and storage medium
CN113094048A (en) Data display rule determining method, display method, device, equipment and medium
US10657280B2 (en) Mitigation of injection security attacks against non-relational databases
CN112506781A (en) Test monitoring method, test monitoring device, electronic device, storage medium, and program product
CN110417919A (en) A kind of flow abduction method and device
CN111258873A (en) Test method and device
US20120159456A1 (en) Instrumented application in a mobile device environment
CN113204477B (en) Application testing method and device, electronic equipment and storage medium
CN112948269B (en) Information processing method, information processing apparatus, electronic device, and readable storage medium
CN113901377B (en) Service calling method, device, storage medium and equipment of legacy system
CN112817566B (en) Information processing method, device and computer readable storage medium
US11671529B2 (en) Cross-channel configurable navigation
CN111737149B (en) Real machine platform, test method and test script processing method

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