CN112115038A - Application testing method and device and storage medium - Google Patents

Application testing method and device and storage medium Download PDF

Info

Publication number
CN112115038A
CN112115038A CN201910543749.3A CN201910543749A CN112115038A CN 112115038 A CN112115038 A CN 112115038A CN 201910543749 A CN201910543749 A CN 201910543749A CN 112115038 A CN112115038 A CN 112115038A
Authority
CN
China
Prior art keywords
user behavior
script
application
target
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910543749.3A
Other languages
Chinese (zh)
Inventor
吴正山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910543749.3A priority Critical patent/CN112115038A/en
Publication of CN112115038A publication Critical patent/CN112115038A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses an application testing method, a device and a storage medium, wherein, user behavior information in the running process of a target application is monitored and recorded through a user terminal, when an abnormal running event of the target application is detected, a script generating request containing the recorded user behavior information is sent to a server, the server is instructed to generate a user behavior script according to the recorded user behavior information, then the user behavior script returned by the server is received, the target application is restarted, and finally a script execution tool is called to execute an operation instruction in the user behavior script, so that the user behavior before the abnormal running event of the target application is simulated, the abnormal running event is reproduced, therefore, compared with the prior art, the scheme for positioning the reason of the abnormal running event of the application according to the limited abnormal information, the invention can reproduce the abnormal running event with high probability, the technical staff is assisted in analyzing the reason of the abnormal operation of the application, and the difficulty in positioning the reason of the abnormal operation of the application is reduced.

Description

Application testing method and device and storage medium
Technical Field
The invention relates to the field of terminal application testing, in particular to an application testing method, an application testing device and a storage medium.
Background
At present, with the popularization and development of terminals, user terminals such as mobile phones and tablet computers have become indispensable tools in daily study and life of people, and the current user terminals can provide various software application functions besides basic conversation and short message functions.
In the prior art, due to the complexity of applications, the applications may be abnormal in the running process due to various reasons and cannot normally realize functions. In order to analyze the cause of the application running exception, a related technician usually collects limited exception information, such as registers and call stack information of all threads when the application is abnormal, and then analyzes and judges the cause of the application running exception.
In the research and practice process of the prior art, the inventor of the present invention finds that, in the prior art, the abnormality information that can be acquired may not accurately assist the technician in accurately determining the cause of the error, so that the technician is difficult to locate the true cause of the application where the abnormality occurs.
Disclosure of Invention
The embodiment of the invention provides an application testing method, an application testing device and a storage medium, which can reduce the difficulty of positioning the reason of abnormal operation of an application.
The embodiment of the invention provides an application test method, which comprises the following steps:
monitoring user behavior information in the running process of a target application, and recording the user behavior information;
when the target application is detected to have an abnormal operation event, sending a script generation request to a server, wherein the script generation request contains recorded user behavior information, the script generation request is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information;
receiving the user behavior script returned by the server and restarting the target application;
and calling a script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application.
The invention also provides an application test method, which comprises the following steps:
receiving an application test request, wherein the application test request comprises a user terminal identifier and is used for indicating a user terminal needing to be tested;
when the application test request is received, determining a target user terminal to be tested according to a user terminal identifier contained in the application test request;
acquiring target user behavior information before a target application on the target user terminal generates an abnormal operation event, and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script;
and providing the user behavior script for the target user terminal, so that the target user terminal restarts the target application, and calling a script execution tool aiming at the restarted target application to execute an operation instruction in the user behavior script.
An embodiment of the present invention further provides an application testing apparatus, including:
the monitoring module is used for monitoring user behavior information in the running process of the target application and recording the user behavior information;
the reporting module is used for sending a script generation request to a server when detecting that the target application has an abnormal operation event, wherein the script generation request contains recorded user behavior information, the script generation request is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information;
the acquisition module is used for receiving the user behavior script returned by the server and restarting the target application;
and the test module is used for calling a script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application.
In an embodiment, when recording the user behavior information, the listening module is configured to:
when user behavior information in the running process of a target application is monitored, determining a target behavior identifier of the user behavior information according to a corresponding relation between preset user behavior information and a behavior identifier;
recording the target behavior identification and time information corresponding to the user behavior;
when detecting that the target application has an abnormal operation event and sending a script generation request to a server, the reporting module is configured to:
when the target application is detected to have an abnormal operation event, sending a script generation request containing a recorded target behavior identifier and time information corresponding to user behavior to the server;
the script generation request is used for instructing the server to convert the recorded target behavior identifier into the user behavior information, generating an operation instruction corresponding to the user behavior information, and arranging the generated operation instruction according to the sequence of the time information corresponding to the user behavior to obtain the user behavior script.
In one embodiment, when the script execution tool is invoked to execute the operation instructions in the user behavior script, the test module is configured to:
acquiring a time interval between two adjacent user behaviors according to the recorded time information corresponding to the user behaviors;
and calling the script execution tool, and sequentially executing the operation instructions in the user behavior script according to the acquired time interval.
In one embodiment, before invoking a script execution tool to execute the operation instructions in the user behavior script, the test module is further configured to:
acquiring application running environment information before the abnormal running event occurs, and recovering the application running environment before the abnormal running event occurs according to the application running environment information;
and when the script execution tool is called to execute the operation instruction in the user behavior script, the test module is used for:
and calling the script execution tool in the recovered application running environment to execute the operation instruction in the user behavior script.
In an embodiment, the application testing apparatus further includes a report module, configured to send a report generation request to the server if the abnormal operation event occurs again in the process that the testing module executes the user behavior script, where the report generation request includes a generated test log, and the report generation request is used to instruct the server to generate a test report according to the generated test log; and receiving the test report returned by the server.
An embodiment of the present invention further provides an application testing apparatus, including:
the device comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving an application test request, and the application test request comprises a user terminal identification and is used for indicating a user terminal needing to be tested;
the identification module is used for determining a target user terminal to be tested according to a user terminal identifier contained in the application test request when the application test request is received;
the construction module is used for acquiring target user behavior information before a target application on the target user terminal generates an abnormal operation event and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script;
and the issuing module is used for providing the user behavior script for the target user terminal, so that the target user terminal restarts the target application, and calls a script execution tool aiming at the restarted target application to execute an operation instruction in the user behavior script.
In an embodiment, when acquiring target user behavior information before a target application on the target user terminal has an abnormal operation event, the identification module is configured to:
acquiring a user behavior log corresponding to the abnormal operation event, wherein the user behavior log comprises a behavior identifier recorded by the target user terminal before the abnormal operation event occurs and time information corresponding to the user behavior;
acquiring target user behavior information of the target user terminal before the abnormal operation event occurs in the target application according to the recorded behavior identifier and the corresponding relation between the preset user behavior information and the behavior identifier;
and when generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script, the construction module is configured to:
and generating an operation instruction corresponding to the target user behavior information, and arranging the generated operation instruction according to the sequence of the time information corresponding to the recorded user behavior to obtain the user behavior script.
In an embodiment, the application testing apparatus further includes a storage module, configured to receive, before the receiving module receives the application testing request, a behavior identifier and corresponding time information, recorded before an abnormal operation event occurs, provided by the user terminal when the abnormal operation event occurs in the target application; and generating a user behavior log according to the received behavior identification and the corresponding time information.
In an embodiment, the application testing apparatus further includes a reporting module, configured to receive a report generation request sent by the user terminal when the same abnormal operation event occurs to the target application after the issuing module provides the user behavior script to the user terminal, where the report generation request includes a test log that has been generated by the user terminal; analyzing the test log in the report generation request, and generating a test report according to an analysis result; and providing the generated test report to the user terminal.
In addition, an embodiment of the present invention further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to perform any step in the application testing method provided in the embodiment of the present invention.
The embodiment of the invention monitors and records the user behavior information in the running process of the target application through the user terminal, when the abnormal running event of the target application is detected, a script generation request containing the recorded user behavior information is sent to the server, the server is instructed to generate the user behavior script according to the recorded user behavior information, then the user behavior script returned by the server is received, the target application is restarted, and finally the script execution tool is called to execute the operation instruction in the user behavior script, so that the user behavior before the abnormal running event of the target application is simulated, the abnormal running event is reproduced, and therefore, compared with the prior art which locates the reason of the abnormal running of the application according to the limited abnormal information, the invention can reproduce the abnormal running event with high probability and assist technical personnel to analyze the reason of the abnormal running of the application, the difficulty of positioning the reason of the abnormal operation of the application is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of a scenario of an application testing method according to an embodiment of the present invention;
FIG. 2a is a flow chart of an application testing method according to an embodiment of the present invention;
FIG. 2b is a diagram illustrating a correspondence between user behavior and behavior identifiers in an embodiment of the present invention;
FIG. 2c is a schematic diagram of a recording format of time information according to an embodiment of the present invention;
FIG. 2d is a schematic diagram illustrating user behavior and corresponding time information obtained by parsing according to an embodiment of the present invention;
FIG. 3a is another schematic flow chart of an application testing method according to an embodiment of the present invention;
FIG. 3b is a schematic diagram of an application test interface provided by an embodiment of the present invention;
FIG. 3c is a schematic diagram of a selection sub-interface provided by an embodiment of the present invention;
FIG. 4 is a schematic flow chart of an application testing method according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an application testing apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of an application testing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a user terminal according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides an application test method, an application test device and a storage medium.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of an application testing system according to an embodiment of the present invention, including: the system comprises a user terminal and a server, wherein the user terminal and the server can be connected through a communication network, and the communication network comprises a wireless network and a wired network, wherein the wireless network comprises one or more of a wireless wide area network, a wireless local area network, a wireless metropolitan area network and a wireless personal network. The network includes network entities such as routers, gateways, etc., which are not shown in the figure. The user terminal can perform information interaction with the server through the communication network, and the pressure test of the application on the user terminal is realized.
The application testing device provided by the invention can be specifically integrated in the user terminal or the server shown in fig. 1, for example, when the application testing device is integrated in the user terminal, the user terminal can monitor the user behavior information in the running process of the target application and record the user behavior information; when the target application is detected to have an abnormal operation event, sending a script generation request to the server, wherein the script generation request contains recorded user behavior information and is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information; then, receiving a user behavior script returned by the server, and restarting the target application; finally, aiming at the restarted target application, calling a script execution tool to execute an operation instruction in the user behavior script so as to simulate the user behavior of the target application before the abnormal operation event occurs and reproduce the abnormal operation event, thereby being capable of reproducing the abnormal operation event with high probability and assisting technicians to analyze the real reason of the abnormal operation of the application.
For another example, when the application testing apparatus is integrated in a server, the server is enabled to receive an application testing request, where the application testing request includes a user terminal identifier for indicating a user terminal that needs to be tested; when an application test request is received, determining a target user terminal to be tested according to a user terminal identifier contained in the application test request; acquiring target user behavior information before a target application on a target user terminal generates an abnormal operation event, and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script; the user behavior script is provided for the target user terminal, so that the target user terminal restarts the target application, and the script execution tool is called to execute the operation instruction in the user behavior script, so that the user behavior before the abnormal operation event of the target application occurs is simulated, and the abnormal operation event is reproduced, therefore, the abnormal operation event can be reproduced at a high probability, and technicians are assisted in analyzing the real reason of the abnormal operation of the application.
It should be noted that the scenario diagram of the application testing system shown in fig. 1 is only an example, and the application testing system and the scenario described in the embodiment of the present invention are for more clearly illustrating the technical solution of the embodiment of the present invention, and do not form a limitation on the technical solution provided in the embodiment of the present invention.
The following are detailed below. The order of the following examples is not intended to limit the preferred order of the examples.
The first embodiment,
In the present embodiment, a description will be made from the perspective of an application test apparatus specifically integrated in a user terminal.
The embodiment of the invention provides an application test method, which is suitable for a user terminal and comprises the following steps: monitoring user behavior information in the running process of a target application, and recording the monitored user behavior information; when an abnormal operation event of the target application is detected, sending a script generation request to the server, wherein the script generation request contains recorded user behavior information, the script generation request is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information; receiving a user behavior script returned by the server and restarting the target application; and calling a script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application.
As shown in fig. 2a, the specific flow of the application test method may be as follows:
in 201, user behavior information in the running process of the target application is monitored, and the monitored user behavior information is recorded.
The application testing device can monitor user behavior information of a target application on the integrated user terminal in the running process in real time, wherein the user behavior information is used for describing user behaviors executed by a user and comprises but is not limited to key input, touch screen input, voice input, gesture input and the like of the user. In addition, when the application testing device monitors the user behavior information, the monitored user behavior information is recorded.
It should be noted that the target application may be any application on the user terminal, and may be an application running in the foreground or an application running in the background, and in popular terms, no matter the user terminal runs the application in the foreground or runs the application in the background, the application testing device may monitor the user behavior information on the user terminal as long as there is an application running.
For example, the user terminal foreground runs a music playing application a, and the application testing device monitors the user behavior information: the method comprises the steps of clicking a volume key +, a hardware back, and the like, and accordingly, the testing device is applied to record the monitored user behavior information.
Specifically, "recording monitored user behavior information" includes:
(1) when user behavior information in the running process of a target application is monitored, determining a target behavior identifier of the user behavior information according to a corresponding relation between preset user behavior information and a behavior identifier;
(2) and recording the target behavior identification and the time information corresponding to the user behavior.
In the embodiment of the invention, in order to more efficiently record the monitored user behavior information, the user behavior information is not recorded, but the corresponding behavior identifier is recorded to replace the user behavior information.
For this reason, the corresponding relationship between the user behavior and the behavior identifier is preset in the embodiment of the present invention, and it should be noted that, the corresponding relationship between the user behavior information and the behavior identifier may be set by a person skilled in the art according to actual needs, and the embodiment of the present invention is not limited to this specifically. In addition, the display form of the behavior identifier in the embodiment of the present invention is not particularly limited, and a numerical sequence number or a letter sequence number may be used as the behavior identifier to represent the corresponding user behavior information.
For example, referring to fig. 2b, a digital serial number is used as a behavior identifier, and a corresponding relationship between user behavior information and the behavior identifier is shown in the form of a mapping table, wherein,
behavior flag "5001" corresponds to user behavior information "slide up";
behavior flag "5002" corresponds to user behavior information "slide left";
behavior flag "5003" corresponds to user behavior information "slide right";
behavior flag "5004" corresponds to user behavior information "slide down";
behavior flag "5005" corresponds to user behavior information "click";
behavior flag "5006" corresponds to user behavior information "long press";
behavior identification "5007" corresponds to user behavior information "select view control";
the behavior identifier "5101" corresponds to user behavior information "hardware back is clicked";
behavior identifier "5102" corresponds to user behavior information "hardware menu is clicked;
behavior identification "5103" corresponds to user behavior information "volume key +" is clicked;
the behavior flag "5104" corresponds to the user behavior information "volume key clicked-";
the behavior flag "5105" corresponds to the user behavior information "search key".
In the embodiment of the invention, when monitoring the user behavior information of the target application in the running process on the integrated user terminal, the application testing device determines the target behavior identifier corresponding to the monitored user behavior information according to the corresponding relation between the preset user behavior information and the behavior identifier, thereby converting the monitored user behavior information into the corresponding behavior identifier.
Then, the application testing device can record the determined target behavior identifier and the time information corresponding to the user behavior described by the monitored user behavior information, wherein the time information corresponding to the user behavior describes the occurrence time of the user behavior. Therefore, one piece of associated target behavior identification and time information describe the user behavior occurring at the corresponding moment.
It should be noted that, in the embodiment of the present invention, the recording form of the time information is not specifically limited, and a person skilled in the art may adopt an appropriate recording form according to actual needs, for example, please refer to fig. 2c, in the embodiment of the present invention, the time information is recorded in the form of milliseconds, and different "user behaviors" are separated by "# # #", as shown in fig. 2c, wherein,
record "15551485987745103" indicates that the user action "volume button clicked +" occurred 2019-04-1317: 43: 18;
record "15551485991845103" indicates that the user action "volume button clicked +" occurred 2019-04-1317: 43: 19;
record "15551486064235103" indicates that the user action "volume button clicked +" occurred 2019-04-1317: 43: 26;
record "15551486151755104" indicates that the user action "volume key clicked-" occurred 2019-04-1317: 43: 35;
the record "15551486154695104" indicates that the user action "clicked volume button-" occurred 2019-04-1317: 43: 35.
In 202, when detecting that an abnormal operation event occurs in the target application, sending a script generation request to the server, where the script generation request includes the recorded user behavior information, and the script generation request is used to instruct the server to generate a user behavior script according to the recorded user behavior information, where the user behavior script includes an operation instruction corresponding to the recorded user behavior information.
It will be appreciated that applications are written by humans, which are not perfect, and that during the running of an application, the application may run abnormally for a variety of reasons, including but not limited to application crashes and application unresponsiveness.
In the implementation of the invention, when the target application on the integrated user terminal of the application testing device has an abnormal operation event, the application testing device generates a script generation request containing the recorded user behavior information, sends the generated script generation request to the server, and instructs the server to generate the user behavior script according to the recorded user behavior information according to the preset script writing rule. The user behavior script comprises an operation instruction corresponding to each piece of recorded user behavior information, and the user behavior described by each piece of recorded user behavior information can be reproduced at the user terminal by using the operation instruction.
For example, when a music playing application a running on the user terminal crashes, the application testing device detects an abnormal running event that the music playing application a crashes, and provides the recorded user behavior information (i.e., the user behavior information recorded before the music playing application a crashes) to the server, so that the server compiles the corresponding user behavior script according to the user behavior information recorded before the music playing application a crashes.
Specifically, "when the target application is detected to have the abnormal operation event, the script generation request is sent to the server," including:
when the abnormal operation event of the target application is detected, sending a script generation request containing the recorded target behavior identification and time information corresponding to the user behavior to a server;
the script generation request is used for indicating the server to convert the recorded target behavior identifier into user behavior information, generating an operation instruction corresponding to the user behavior information, and arranging the generated operation instruction according to the sequence of the time information corresponding to the user behavior to obtain the user behavior script.
In the embodiment of the invention, the corresponding relation between the user behavior information and the behavior identifier which is the same as that of the user terminal is preset in the server, so that after the server receives the script generation request sent by the user terminal, the target behavior identifier contained in the script generation request can be analyzed into the corresponding user behavior information according to the corresponding relation between the user behavior and the behavior identifier.
For example, referring to fig. 2d, after acquiring the record shown in fig. 2c provided by the application testing apparatus, the server analyzes the record to obtain user behavior information and corresponding time information monitored by the user terminal before the abnormal operation event occurs, where the user clicks a volume key + in 2019-04-1317: 43:18, clicks a volume key + in 2019-04-1317: 43:19, clicks a volume key + in 2019-04-1317: 43:26, clicks a volume key + in 2019-04-1317: 43:35, and clicks a volume key-in 2019-04-1317: 43: 35.
In addition, after the server analyzes and obtains the user behavior information and the corresponding time information which are monitored by the user terminal before the abnormal operation event occurs, the user behavior information is further converted into a corresponding operation instruction based on a preset script writing rule, so that the user behavior described by the user behavior information can be reproduced by the user terminal executing the operation instruction.
And then, the server arranges the operation instructions corresponding to the user behavior information according to the sequence of the time information to obtain the user behavior script. Thus, the order in which the operation instructions in the user behavior script are expected to reproduce the user behavior is made consistent with the user behavior that has actually occurred.
For example, when the server writes the user behavior script, the server may convert the user behavior into a corresponding operation instruction based on the monkey runner command set, and further obtain the user behavior script.
In 203, the user behavior script returned by the server is received and the target application is restarted.
The application testing device may receive the user behavior script returned by the server after the server generates the corresponding user behavior script. The user behavior script carries description information of a script writing rule adopted by the server to generate the user behavior script, and therefore the user terminal is instructed to call the corresponding script execution basis through the description information to execute the user behavior script.
In 204, for the restarted target application, a script execution tool is called to execute the operation instruction in the user behavior script.
After receiving the user behavior script returned by the server, the application testing device can call the script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application, so that the user behavior before the target application generates the abnormal operation event is simulated, the pressure test is carried out on the target application, the abnormal operation event is further reproduced, and technicians are assisted in analyzing the reason of the abnormal operation event of the target application.
For example, the description information included in the user behavior script indicates that the server generates the user behavior script based on the monkey runner command set, and correspondingly, the application testing device calls the monkey runner tool to sequentially execute each operation instruction in the user behavior script, so as to simulate the user behavior of the target application before the abnormal operation event occurs, and implement the pressure test on the target application to reproduce the abnormal operation event.
Optionally, "call script execution tool to execute the operation instruction in the user behavior script", includes:
(1) acquiring a time interval between two adjacent user behaviors according to the recorded time information corresponding to the user behaviors;
(2) and calling a script execution tool, and sequentially executing the operation instructions in the user behavior script according to the acquired time interval.
It should be noted that, when a user actually performs a user action, the time interval between two adjacent users is not a single layer, for example, the user performs the user action B after 5 seconds after performing the user action a, and performs the user action C after 9 seconds after performing the user action B. In order to further improve the probability of the abnormal operation event, the execution of the user behavior script simulates the real-occurring user behavior in the embodiment of the invention.
When the application testing device calls the script execution tool to execute the user behavior script, firstly, the time interval between two adjacent user behaviors is acquired according to the recorded time information corresponding to the user behaviors, then, the script execution tool is called, and the operation instructions in the user behavior script are sequentially executed according to the acquired time interval.
For example, there are sequentially adjacent user behavior a, user behavior B, and user behavior C, where the time interval between the user behavior a and the user behavior B is 5 seconds, and the time interval between the user behavior B and the user behavior C is 9 seconds, so that the application test apparatus invokes the script execution tool, first executes the operation instruction in the user behavior script to reproduce the user behavior a, executes the operation instruction in the user behavior script to reproduce the user behavior B after 5 seconds, and executes the operation instruction in the user behavior script to reproduce the user behavior C after 9 seconds.
Optionally, before the step of invoking the script execution tool to execute the operation instruction in the user behavior script, the method further includes:
acquiring application running environment information before an abnormal running event occurs, and recovering the application running environment before the abnormal running event occurs according to the application running environment information;
and the step of calling the script execution tool to execute the operation instruction in the user behavior script comprises the following steps:
and calling the script execution tool in the recovered application running environment to execute the operation instruction in the user behavior script.
In the embodiment of the invention, in order to further improve the probability of the abnormal operation event, the application testing device does not immediately call the script execution tool to execute the operation instruction in the user behavior script after receiving the user behavior script returned by the server, but first obtains the application operation environment information before the abnormal operation event occurs to the target application, and the application operation environment information describes the application operation environment before the abnormal operation event occurs to the target application. And then, the application testing device judges whether the current application running environment is consistent with the application running environment before the target application generates the abnormal running event, if so, the script execution tool is directly called to execute the operation instruction in the user behavior script, otherwise, the application running environment before the target application generates the abnormal running event is recovered according to the application running environment information, and then the script execution tool is called to execute the operation instruction in the user behavior script.
The application operating environment information includes, but is not limited to, software functions and hardware functions enabled by the user terminal, and adopted software configuration parameters and hardware configuration parameters.
Optionally, in the process of executing the user behavior script, the method further includes:
(1) if the abnormal operation event occurs again in the target application, sending a report generation request to the server, wherein the report generation request comprises the generated test log and is used for indicating the server to generate a test report according to the generated test log;
(2) and receiving a test report returned by the server.
In the embodiment of the invention, the application testing device also monitors the testing process of the target application, namely the execution process of the user behavior script, when the same abnormal operation event occurs again in the target application, the generated testing log is obtained, a report generation request comprising the testing log is generated, and the report generation request is provided for the server, so that the server can generate the testing report according to the testing log, and the reason of the abnormal operation event is positioned. The server can generate the test report based on the test log according to the test report generation rule defined by expert knowledge.
The application test device receives the test report returned by the server after the server generates the test report. And then, the test report can be used for assisting technicians in repairing the target application and avoiding the same abnormal operation event from happening again.
As can be seen from the above, in the embodiment of the present invention, the user behavior information in the running process of the target application is monitored, and the user behavior information is recorded; when the target application is detected to have an abnormal operation event, sending a script generation request to the server, wherein the script generation request contains recorded user behavior information and is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information; then, receiving a user behavior script returned by the server, and restarting the target application; finally, aiming at the restarted target application, a script execution tool is called to execute an operation instruction in the user behavior script, so that the user behavior before the target application generates the abnormal operation event is simulated, and the abnormal operation event is reproduced.
Example II,
In the present embodiment, description will be made from the viewpoint of an application test apparatus specifically integrated in a server.
The embodiment of the invention provides an application testing method, which is suitable for a server and comprises the following steps: receiving an application test request, wherein the application test request comprises a user terminal identifier and is used for indicating a user terminal needing to be tested; when an application test request is received, determining a target user terminal to be tested according to a user terminal identifier contained in the application test request; acquiring target user behavior information before a target application on a target user terminal generates an abnormal operation event, and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script; and providing the user behavior script for the target user terminal, so that the target user terminal restarts the target application, and calling a script execution tool to execute the operation instruction in the user behavior script.
As shown in fig. 3a, the specific flow of the application test method may be as follows:
in 301, an application test request is received, where the application test request includes a user terminal identifier for indicating a user terminal that needs to be tested.
The application testing device can receive the application testing request in a plurality of different modes.
For example, the application testing apparatus may provide an application testing interface to the technician through the integrated electronic device, where the application testing interface includes a request input interface, as shown in fig. 3b, the request input interface may be in the form of an input box, and the technician may enter a user terminal identifier of the user terminal that needs to perform the application test in the request input interface in the form of the input box and input confirmation information (e.g., directly pressing an enter key of a keyboard) to input the application testing request, where the application testing request includes the user terminal identifier of the user terminal that needs to perform the application test.
For another example, the application test interface shown in fig. 3B further includes an "open" control, on one hand, when the application test apparatus detects that the open control is triggered, a selection sub-interface (as shown in fig. 3C) is displayed on the application test interface in an overlapping manner, and the selection sub-interface provides icons of user terminals capable of performing application tests, such as icons of user terminals, e.g., user terminal a, user terminal B, user terminal C, user terminal D, user terminal E, and user terminal F, for technicians to search for and select icons of user terminals needing to perform application tests; on the other hand, after selecting the icon of the user terminal to be tested, the technician may trigger the confirmation control provided by the selection sub-interface to input an application test request to the application test device, where the application test request includes the user terminal identifier of the user terminal corresponding to the user terminal icon selected by the user.
In 302, when the application test request is received, a target ue that needs to be tested is determined according to a ue identifier included in the application test request.
When the application test device receives the application test request, the application test request can be analyzed, so that the carried user terminal identification is analyzed, and the user terminal indicated by the user terminal identification is determined as a target user terminal to be tested.
In 303, target user behavior information before the target application on the target user terminal has an abnormal operation event is obtained, and an operation instruction corresponding to the target user behavior information is generated to obtain a user behavior script.
It should be noted that, in the embodiment of the present invention, the user terminal monitors user behavior information during the running process of the target application, where the user behavior information is used to describe a user behavior performed by the user, and the user behavior information includes, but is not limited to, a key input, a touch screen input, a voice input, a gesture input, and the like of the user. In addition, when the user terminal monitors the user behavior information, the user terminal records the monitored user behavior information.
It should be noted that the target application may be any application on the user terminal, and may be an application running in the foreground or an application running in the background, and in popular terms, no matter the user terminal runs the application in the foreground or runs the application in the background, as long as there is an application running, the user terminal can monitor the user behavior information in the application running process.
For example, the user terminal foreground runs a music playing application a, and monitors the user behavior information: the user terminal records the monitored user behavior information correspondingly, wherein the user behavior information comprises volume key + "," volume key- "," hardware back "and the like.
In addition, the user terminal provides the recorded user behavior information to the server when detecting that the target application has an abnormal operation event.
Correspondingly, when the application testing device acquires the target user behavior information before the target application on the target user terminal generates the abnormal operation event, the application testing device can acquire the target user behavior information before the target application generates the abnormal operation event from the user behavior information provided by the user terminal.
After acquiring the target user behavior information before the target application on the target user terminal has the abnormal operation event, the application testing device further generates an operation instruction corresponding to the target user behavior information to obtain a user behavior script.
The server generates a user behavior script according to preset script writing rules and target user behavior information. The user behavior script comprises an operation instruction corresponding to each item mark user behavior information, and the user behavior described by each item mark user behavior information can be reproduced at the user terminal by using the operation instruction. And then, obtaining a user behavior script according to the converted operation instruction.
It should be noted that, in the embodiment of the present invention, no specific limitation is imposed on the script writing rule adopted, and a person skilled in the art may select the script according to actual needs, for example, when the application test device integrated with the server writes the user behavior script, the user behavior may be converted into a corresponding operation instruction based on the monkey runner command set, so as to obtain the user behavior script.
Specifically, "acquiring the target user behavior information before the abnormal operation event occurs to the target application on the target user terminal" includes:
(1) acquiring a user behavior log corresponding to the abnormal operation event, wherein the user behavior log comprises a behavior identifier recorded by a target user terminal before the abnormal operation event occurs and time information corresponding to the user behavior;
(2) acquiring target user behavior information of a target user terminal before a target application generates an abnormal operation event according to the recorded behavior identifier and the corresponding relation between the preset user behavior information and the behavior identifier;
and "generating an operation instruction corresponding to the target user behavior information to obtain the user behavior script" includes:
and generating an operation instruction corresponding to the target user behavior information, and arranging the generated operation instruction according to the sequence of the time information corresponding to the recorded user behavior to obtain the user behavior script.
In the embodiment of the present invention, the same correspondence between the user behavior information and the behavior identifier is preset in the user terminal and the server, and it should be noted that, the correspondence between the user behavior information and the behavior identifier may be set by a person skilled in the art according to actual needs, and the embodiment of the present invention is not particularly limited thereto. In addition, the display form of the behavior identifier in the embodiment of the present invention is not particularly limited, and a numerical sequence number or a letter sequence number may be used as the behavior identifier to represent the corresponding user behavior information.
For example, a digital serial number is used as a behavior identifier, where the behavior identifier "5001" corresponds to a user behavior "slide up", the behavior identifier "5002" corresponds to a user behavior "slide left", the behavior identifier "5003" corresponds to a user behavior "slide right", and the behavior identifier "5004" corresponds to a user behavior "slide down", and so on.
When the user terminal records the user behavior information, the user behavior information is converted into the corresponding behavior identifier according to the corresponding relation between the preset user behavior information and the behavior identifier. Then, for the user behavior described by the user behavior information, the user terminal records the corresponding behavior identifier and the corresponding time information, and the time information is used for describing the occurrence time of the user behavior. Thus, a piece of associated behavior identification and time information describes the user behavior occurring at the corresponding moment. And when the target application has an abnormal operation event, the user terminal provides the recorded behavior identifier and the corresponding time information to the server.
On the other hand, "before receiving the application test request", the method further comprises the following steps:
(1) receiving a behavior identifier which is provided by a user terminal when the target application has an abnormal operation event and is recorded before the abnormal operation event and corresponding time information;
(2) and generating a user behavior log according to the received behavior identification and the corresponding time information.
The application testing device integrated in the server receives the behavior identification and the corresponding time information which are provided by the user terminal when the target application has the abnormal operation event and are recorded before the abnormal operation event, and generates a user behavior log according to the received behavior identification and the corresponding time information, namely, the user behavior information and the corresponding time information of the user terminal before the abnormal operation event occurs are stored in the form of the user behavior log.
Correspondingly, when the application testing device integrated with the server acquires the target user behavior information of the target application on the target user terminal before the abnormal operation event occurs, the user behavior log corresponding to the abnormal operation event can be acquired, the behavior identifier recorded by the user terminal before the abnormal operation event occurs and the corresponding time information are analyzed, and then the target user behavior information of the target application on the target user terminal before the abnormal operation event occurs is acquired according to the preset corresponding relation between the user behavior information and the behavior identifier.
Therefore, when the application testing device generates the user behavior script corresponding to the target user behavior information, the application testing device can firstly generate the operation instruction corresponding to the target user behavior information, and then arrange the generated operation instruction according to the sequence of the recorded time information corresponding to the user behavior to obtain the user behavior script. Thus, the order in which the operation instructions in the user behavior script are expected to reproduce the user behavior is made consistent with the user behavior that has actually occurred.
In 304, the user behavior script is provided to the target user terminal, so that the target user terminal restarts the target application, and the script execution tool is invoked for the restarted target application to execute the operation instruction in the user behavior script.
In the embodiment of the invention, the application testing device provides the generated user behavior script to the user terminal after generating the user behavior script. The user behavior script carries description information of a script writing rule adopted by the server to generate the user behavior script, and therefore the user terminal is instructed to call the corresponding script execution basis through the description information to execute the user behavior script.
After the user terminal acquires the user behavior script provided by the server, the user terminal executes the operation instruction in the user behavior script according to the script execution tool indicated by the description information in the user behavior script, so that the user behavior before the target application generates the abnormal operation event is reproduced, the target application is subjected to pressure test, the abnormal operation event is further reproduced, and technicians are assisted in analyzing the reason of the abnormal operation event.
For example, the user terminal recognizes that the application testing device integrated with the server generates the user behavior script based on the monkey runner command set according to the description information contained in the user behavior script, and correspondingly, the user terminal calls the monkey runner tool to sequentially execute each operation instruction in the user behavior script, so that the user behavior before the target application generates the abnormal operation event is simulated one by one, the pressure test of the target application is realized, and the abnormal operation event is reproduced.
Optionally, after "providing the user behavior script to the user terminal", the method further includes:
(1) receiving a report generation request sent by a user terminal when the same abnormal operation event occurs in a target application, wherein the report generation request comprises a test log generated by the user terminal;
(2) analyzing the test log in the report generation request, and generating a test report according to an analysis result;
(3) and providing the generated test report to the user terminal.
In the embodiment of the present invention, the application testing apparatus further monitors a testing process of the target application, that is, an execution process of the user behavior script, acquires a generated test log when the target application has the same abnormal operation event again, generates a report generation request including the test log, and provides the report generation request to the server.
Correspondingly, when the application testing device integrated with the server receives a report generation request sent by the user terminal when the same abnormal operation event occurs in the target application, the test log in the report generation request is analyzed according to the test report generation rule defined by expert knowledge to obtain an analysis result, and a corresponding test report is generated according to the analysis result.
Then, the application testing device integrated with the server provides the generated test report to the user terminal, so that a technician can use the test report to assist in repairing the target application and avoid the same abnormal operation event from happening again.
As can be seen from the above, in the embodiment of the present invention, an application test request is received, where the application test request includes a user terminal identifier, and is used to indicate a user terminal that needs to be tested; when an application test request is received, determining a target user terminal to be tested according to a user terminal identifier contained in the application test request; acquiring target user behavior information before a target application on a target user terminal generates an abnormal operation event, and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script; the method and the device can reproduce the abnormal operation event with high probability, assist technical staff to analyze the true reason of the abnormal operation of the application and reduce the difficulty of positioning the reason of the abnormal operation of the application compared with the prior art that the reason of the abnormal operation of the application is positioned according to limited abnormal information.
Example III,
The method according to the preceding embodiment is illustrated in further detail below by way of example.
As shown in fig. 4, the specific flow of the application test method may be as follows:
401, the user terminal monitors user behavior information in the running process of the target application, determines a target behavior identifier corresponding to the user behavior information according to a preset corresponding relationship between the user behavior information and the behavior identifier, and records the determined target behavior identifier and time information corresponding to the user behavior.
The user terminal monitors user behavior information in the running process of the target application, wherein the user behavior information is used for describing user behaviors executed by a user, and the user behaviors include but are not limited to key input, touch screen input, voice input, gesture input and the like of the user. In addition, when the user terminal monitors the user behavior information, the monitored user behavior information is recorded.
It should be noted that the target application may be any application on the user terminal, and may be an application running in the foreground or an application running in the background, and in popular terms, no matter the user terminal runs the application in the foreground or runs the application in the background, as long as there is an application running, the user terminal can monitor the user behavior information in the application running process.
For example, the user terminal foreground runs a music playing application a, and monitors the user behavior information: the method comprises the steps of clicking a volume key +, "clicking a volume key-," "clicking a hardware back", and the like, and correspondingly, recording the monitored user behavior information.
In the embodiment of the invention, in order to more efficiently record the monitored user behavior information, the user behavior information is not recorded, but the corresponding behavior identifier is recorded to replace the user behavior information.
For this reason, the corresponding relationship between the user behavior information and the behavior identifier is preset in the embodiment of the present invention, and it should be noted that the corresponding relationship between the user behavior information and the behavior identifier may be set by a person skilled in the art according to actual needs, and the embodiment of the present invention is not limited to this specifically. In addition, the display form of the behavior identifier in the embodiment of the present invention is not particularly limited, and a numerical sequence number or a letter sequence number may be used as the behavior identifier to represent the corresponding user behavior information.
For example, referring to fig. 2b, a digital serial number is used as a behavior identifier, and a corresponding relationship between user behavior information and the behavior identifier is shown in the form of a mapping table, wherein,
behavior flag "5001" corresponds to user behavior information "slide up";
behavior flag "5002" corresponds to user behavior information "slide left";
behavior flag "5003" corresponds to user behavior information "slide right";
behavior flag "5004" corresponds to user behavior information "slide down";
behavior flag "5005" corresponds to user behavior information "click";
behavior flag "5006" corresponds to user behavior information "long press";
behavior identification "5007" corresponds to user behavior information "select view control";
the behavior identifier "5101" corresponds to user behavior information "hardware back is clicked";
behavior identifier "5102" corresponds to user behavior information "hardware menu is clicked;
behavior identification "5103" corresponds to user behavior information "volume key +" is clicked;
the behavior flag "5104" corresponds to the user behavior information "volume key clicked-";
the behavior flag "5105" corresponds to the user behavior information "search key".
In the embodiment of the invention, when the user terminal monitors the user behavior information, the target behavior identifier corresponding to the monitored user behavior information is determined according to the preset corresponding relation between the user behavior information and the behavior identifier, so that the monitored user behavior information is converted into the corresponding behavior identifier.
Then, the user terminal can record the determined target behavior identifier and the time information corresponding to the user behavior described by the monitored user behavior information, wherein the time information corresponding to the user behavior describes the occurrence time of the user behavior. Therefore, one piece of associated target behavior identification and time information describe the user behavior occurring at the corresponding moment.
It should be noted that, in the embodiment of the present invention, the recording form of the time information is not specifically limited, and a person skilled in the art may adopt an appropriate recording form according to actual needs, for example, please refer to fig. 2c, in the embodiment of the present invention, the time information is recorded in the form of milliseconds, and different "user behaviors" are separated by "# # #", as shown in fig. 2c, wherein,
record "15551485987745103" indicates that the user action "volume button clicked +" occurred 2019-04-1317: 43: 18;
record "15551485991845103" indicates that the user action "volume button clicked +" occurred 2019-04-1317: 43: 19;
record "15551486064235103" indicates that the user action "volume button clicked +" occurred 2019-04-1317: 43: 26;
record "15551486151755104" indicates that the user action "volume key clicked-" occurred 2019-04-1317: 43: 35;
the record "15551486154695104" indicates that the user action "clicked volume button-" occurred 2019-04-1317: 43: 35.
402, when detecting that the target application has an abnormal operation event, the user terminal provides the recorded target behavior identifier and the corresponding time information to the server.
It will be appreciated that applications are written by humans, which are not perfect, and that during the running of an application, the application may run abnormally for a variety of reasons, including but not limited to application crashes and application unresponsiveness.
In the implementation of the invention, when the user terminal detects that the target application has an abnormal operation event, the recorded target behavior identifier and the corresponding time information are provided for the server. For example, a communication connection may be established between the user terminal and the server in a wired or wireless manner, so that when an abnormal operation event of the target application is detected, the recorded target behavior identifier and the corresponding time information are provided to the server through the communication connection between the user terminal and the server.
And 403, the server generates a user behavior log according to the target behavior identifier provided by the user terminal and the corresponding time information.
The server receives a target behavior identifier which is provided by the user terminal when the target application has an abnormal operation event and is recorded before the abnormal operation event and corresponding time information, and generates a user behavior log according to the received target behavior identifier and the corresponding time information, namely, the user behavior information of the user terminal before the abnormal operation event and the corresponding time information are stored in the form of the user behavior log.
404, the server receives the application test request, and determines the user terminal as a target user terminal to be tested according to the user terminal identifier included in the application test request.
Wherein the server may receive the application test request in a number of different ways.
For example, the server may provide an application test interface to the technician, where the application test interface includes a request input interface, as shown in fig. 3b, the request input interface may be in the form of an input box, and the technician may enter a user terminal identifier of the user terminal that needs to perform the application test in the request input interface in the form of the input box and input confirmation information (e.g., directly pressing an enter key of a keyboard) to input the application test request, where the application test request includes the user terminal identifier of the user terminal that needs to perform the application test.
For another example, the application test interface shown in fig. 3B further includes an "open" control, on one hand, when the application test apparatus detects that the open control is triggered, a selection sub-interface (as shown in fig. 3C) is displayed on the application test interface in an overlapping manner, and the selection sub-interface provides icons of user terminals capable of performing application tests, such as icons of user terminals, e.g., user terminal a, user terminal B, user terminal C, user terminal D, user terminal E, and user terminal F, for technicians to search for and select icons of user terminals needing to perform application tests; on the other hand, after selecting the icon of the user terminal to be tested, the technician may trigger the confirmation control provided by the selection sub-interface to input an application test request to the application test device, where the application test request includes the user terminal identifier of the user terminal corresponding to the user terminal icon selected by the user.
In the embodiment of the invention, when the server receives the application test request, the application test request is analyzed to obtain the carried user terminal identification, and the user terminal indicated by the user terminal identification is determined as the target user terminal to be tested.
405, the server obtains a user behavior log corresponding to the user terminal, and analyzes the user behavior log according to a preset corresponding relationship between the user behavior information and the behavior identifier to obtain the user behavior information recorded before the target application on the user terminal has the abnormal operation event and time information corresponding to the user behavior.
In the embodiment of the present invention, the same correspondence between the user behavior information and the behavior identifier is preset in the user terminal and the server, and it should be noted that, the correspondence between the user behavior information and the behavior identifier may be set by a person skilled in the art according to actual needs, and the embodiment of the present invention is not particularly limited thereto. In addition, the display form of the behavior identifier in the embodiment of the present invention is not particularly limited, and a numerical sequence number or a letter sequence number may be used as the behavior identifier to represent the corresponding user behavior information.
For example, a digital serial number is used as a behavior identifier, where the behavior identifier "5001" corresponds to a user behavior "slide up", the behavior identifier "5002" corresponds to a user behavior "slide left", the behavior identifier "5003" corresponds to a user behavior "slide right", and the behavior identifier "5004" corresponds to a user behavior "slide down", and so on.
Correspondingly, the server can analyze the user behavior log according to the preset corresponding relationship between the user behavior information and the behavior identifier to obtain the recorded user behavior and the corresponding time information before the target application on the user terminal has the abnormal operation event.
406, the server generates an operation instruction corresponding to the user behavior information, and arranges the generated operation instruction according to the sequence of the recorded time information corresponding to the user behavior to obtain a user behavior script.
The server can convert the user behavior information into corresponding operation instructions according to preset script writing rules, so that the user terminal can reproduce the corresponding user behavior by executing the operation instructions.
After the server generates the operation instructions corresponding to the target user behaviors, the generated operation instructions are arranged according to the sequence of the recorded time information corresponding to the user behaviors to obtain the user behavior script. Thus, the order in which the operation instructions in the user behavior script are expected to reproduce the user behavior is made consistent with the user behavior that has actually occurred.
It should be noted that the script writing rule adopted in the embodiment of the present invention is not specifically limited, and may be selected by a person having ordinary skill in the art according to actual needs, for example, when the server writes the user behavior script, the server may convert the user behavior information into a corresponding operation instruction based on the monkey runner command set, so as to obtain the user behavior script.
And 407, the server provides the generated user behavior script to the user terminal.
In the embodiment of the invention, the server provides the generated user behavior script to the user terminal after generating the user behavior script. The user behavior script carries description information of a script writing rule adopted by the server to generate the user behavior script, and therefore the user terminal is instructed to call the corresponding script execution basis through the description information to execute the user behavior script.
And 408, the user terminal restarts the target application and calls a script execution tool to execute the operation instruction in the user behavior script according to the restarted target application.
After the user terminal acquires the user behavior script provided by the server, the user terminal executes the operation instruction in the user behavior script according to the script execution tool indicated by the description information in the user behavior script, so that the user behavior before the target application generates the abnormal operation event is reproduced, the target application is subjected to pressure test, the abnormal operation event is further reproduced, and technicians are assisted in analyzing the reason of the abnormal operation event.
For example, the user terminal recognizes that the application testing device integrated with the server generates the user behavior script based on the monkey runner command set according to the description information contained in the user behavior script, and correspondingly, the user terminal calls the monkey runner tool to sequentially execute each operation instruction in the user behavior script, so that the user behavior before the target application generates the abnormal operation event is simulated one by one, the pressure test of the target application is realized, and the abnormal operation event is reproduced.
Example four,
In order to better implement the above method, an embodiment of the present invention further provides an application testing apparatus, which may be specifically integrated in a user terminal such as a mobile phone, a tablet computer, and a notebook computer.
For example, as shown in fig. 5, the application testing apparatus may include a monitoring module 501, a reporting module 502, an obtaining module 503, and a testing module 504, as follows:
the monitoring module 501 is configured to monitor user behavior information in a running process of a target application, and record the monitored user behavior information;
the reporting module 502 is configured to send a script generation request to the server when detecting that the target application has an abnormal operation event, where the script generation request includes recorded user behavior information, and the script generation request is used to instruct the server to generate a user behavior script according to the recorded user behavior information, where the user behavior script includes an operation instruction corresponding to the recorded user behavior information;
an obtaining module 503, configured to receive a user behavior script returned by the server, and restart the target application;
and the test module 504 is used for calling a script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application.
In one embodiment, in recording the monitored user behavior, the monitoring module 501 is configured to:
when user behavior information in the running process of a target application is monitored, determining a target behavior identifier of the user behavior information according to a corresponding relation between preset user behavior information and a behavior identifier;
recording a target behavior identifier and time information corresponding to user behavior;
when detecting that the target application has an abnormal operation event, and sending a script generation request to the server, the reporting module 502 is configured to:
when the abnormal operation event of the target application is detected, sending a script generation request containing the recorded target behavior identification and time information corresponding to the user behavior to a server;
the script generation request is used for indicating the server to convert the recorded target behavior identifier into user behavior information, generating an operation instruction corresponding to the user behavior information, and arranging the generated operation instruction according to the sequence of the time information corresponding to the user behavior to obtain the user behavior script.
In one embodiment, when the script execution tool is invoked to execute the operation instructions in the user behavior script, the test module 504 is configured to:
acquiring a time interval between two adjacent user behaviors according to the recorded time information corresponding to the user behaviors;
and calling a script execution tool, and sequentially executing the operation instructions in the user behavior script according to the acquired time interval.
In one embodiment, before invoking the script execution tool to execute the operation instructions in the user behavior script, the test module 504 is further configured to:
acquiring application running environment information before an abnormal running event occurs, and recovering the application running environment before the abnormal running event occurs according to the application running environment information;
while invoking the script execution tool to execute the operation instructions in the user behavior script, the test module 504 is configured to:
and calling the script execution tool in the recovered application running environment to execute the operation instruction in the user behavior script.
In an embodiment, the application testing apparatus further includes a reporting module, configured to send a report generation request to the server if the target application has the abnormal operation event again in a process that the testing module 504 executes the user behavior script, where the report generation request includes a generated test log, and the report generation request is used to instruct the server to generate a test report according to the generated test log; and receiving the test report returned by the server.
It should be noted that the application testing apparatus provided in the embodiment of the present invention and the application testing method suitable for the user terminal in the above embodiments belong to the same concept, and the specific implementation process thereof is described in the above method embodiments, and is not described herein again.
Example V,
In order to better implement the above method, an embodiment of the present invention further provides another application testing apparatus, which may be specifically in a server.
For example, as shown in fig. 6, the application testing apparatus may include a receiving module 601, an identifying module 602, a constructing module 603, and a sending module 604, as follows:
a receiving module 601, configured to receive an application test request, where the application test request includes a user terminal identifier and is used to indicate a user terminal that needs to be tested;
the identification module 602 is configured to, when receiving an application test request, determine a target user equipment to be tested according to a user equipment identifier included in the application test request;
the construction module 603 is configured to obtain target user behavior information before an abnormal operation event occurs to a target application on a target user terminal, and generate an operation instruction corresponding to the target user behavior information to obtain a user behavior script;
the issuing module 604 is configured to provide the user behavior script to the target user terminal, so that the target user terminal restarts the target application, and invokes a script execution tool to execute an operation instruction in the user behavior script for the restarted target application.
In an embodiment, when acquiring target user behavior information before a target application on a target user terminal has an abnormal operation event, the identifying module 602 is configured to:
acquiring a user behavior log corresponding to the abnormal operation event, wherein the user behavior log comprises a behavior identifier recorded by a target user terminal before the abnormal operation event occurs and time information corresponding to the user behavior;
acquiring target user behavior information of a target user terminal before a target application generates an abnormal operation event according to the recorded behavior identifier and the corresponding relation between the preset user behavior information and the behavior identifier;
when generating an operation instruction corresponding to the target user behavior information to obtain the user behavior script, the building module 603 is configured to:
and generating an operation instruction corresponding to the target user behavior information, and arranging the generated operation instruction according to the sequence of the time information corresponding to the recorded user behavior to obtain the user behavior script.
In an embodiment, the application testing apparatus further includes a storage module, configured to receive, before the receiving module 601 receives the application testing request, a behavior identifier and corresponding time information, which are provided by the user terminal when the target application has an abnormal operation event and recorded before the abnormal operation event occurs, of the target application; and generating a user behavior log according to the received behavior identification and the corresponding time information.
In an embodiment, the application testing apparatus further includes a reporting module, configured to receive a report generation request sent by the user terminal when the same abnormal operation event occurs in the target application after the issuing module 604 provides the user behavior script to the user terminal, where the report generation request includes a test log that has been generated by the user terminal; analyzing the test log in the report generation request, and generating a test report according to an analysis result; and providing the generated test report to the user terminal.
It should be noted that the application testing apparatus provided in the embodiment of the present invention and the application testing method suitable for the server in the above embodiments belong to the same concept, and specific implementation processes thereof are described in the above method embodiments and are not described herein again.
Example six,
The embodiment of the invention also provides a user terminal which can be a mobile phone, a tablet computer, a notebook computer and other equipment. Fig. 7 is a schematic diagram showing a structure of a user terminal according to an embodiment of the present invention, specifically:
the user terminal may include components such as a processor 701 of one or more processing cores, memory 702 of one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will appreciate that the user terminal architecture shown in fig. 7 does not constitute a limitation of the user terminal and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 701 is a control center of the user terminal, connects various parts of the entire user terminal using various interfaces and lines, and performs various functions of the user terminal and processes data by operating or executing software programs and/or modules stored in the memory 702 and calling data stored in the memory 702.
The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by operating the software programs and modules stored in the memory 702. Further, the memory 702 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.
The user terminal further includes a power source 703 for supplying power to each component, and preferably, the power source 703 may be logically connected to the processor 701 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
The user terminal may further include an input unit 704, and the input unit 704 may be used to receive input numeric or character information and generate a keyboard, mouse, joystick, optical or trackball signal input in relation to user settings and function control.
Although not shown, the user terminal may further include a display unit and the like, which will not be described in detail herein. Specifically, in this embodiment, the processor 701 in the user terminal loads the executable file corresponding to the process of one or more application programs into the memory 702 according to the following instructions, and the processor 701 runs the application program stored in the memory 702, thereby implementing various functions as follows:
monitoring user behavior information in the running process of a target application, and recording the monitored user behavior information; when an abnormal operation event of the target application is detected, sending a script generation request to the server, wherein the script generation request contains recorded user behavior information, the script generation request is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information; receiving a user behavior script returned by the server and restarting the target application; and calling a script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application.
It should be noted that the user terminal provided in the embodiment of the present invention and the application test method applied to the user terminal in the above embodiment belong to the same concept, and the specific implementation process thereof is detailed in the above method embodiment and is not described herein again.
Example seven,
An embodiment of the present invention further provides a server, as shown in fig. 8, which shows a schematic structural diagram of a user terminal according to an embodiment of the present invention, specifically:
the server may include components such as a processor 801 of one or more processing cores, memory 802 of one or more computer-readable storage media, a power supply 803, and an input unit 804. Those skilled in the art will appreciate that the server architecture shown in FIG. 8 is not meant to be limiting, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 801 is a control center of the server, connects various parts of the entire server using various interfaces and lines, performs various functions of the server and processes data by running or executing software programs and/or modules stored in the memory 802, and calling data stored in the memory 802.
The memory 802 may be used to store software programs and modules, and the processor 801 executes various functional applications and data processing by operating the software programs and modules stored in the memory 802. Further, the memory 802 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 access to the memory 802.
The server further includes a power supply 803 for supplying power to the various components, and preferably, the power supply 803 may be logically connected to the processor 801 via a power management system, so that functions of managing charging, discharging, and power consumption are performed via the power management system.
Specifically, in this embodiment, the processor 801 in the server loads the executable file corresponding to the process of one or more application programs into the memory 802 according to the following instructions, and the processor 801 runs the application programs stored in the memory 802, thereby implementing various functions as follows:
receiving an application test request, wherein the application test request comprises a user terminal identifier and is used for indicating a user terminal needing to be tested; when an application test request is received, determining a target user terminal to be tested according to a user terminal identifier contained in the application test request; acquiring target user behavior information before a target application on a target user terminal generates an abnormal operation event, and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script; and providing the user behavior script for the target user terminal, so that the target user terminal restarts the target application, and calling a script execution tool to execute the operation instruction in the user behavior script.
It should be noted that the server provided in the embodiment of the present invention and the application testing method applied to the server in the above embodiment belong to the same concept, and the specific implementation process thereof is described in the above method embodiment, and is not described herein again.
Example eight,
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present invention provides a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor of a user terminal to execute the application testing method applicable to the user terminal provided in the embodiment of the present invention, for example, the instructions may perform the following steps:
monitoring user behavior information in the running process of a target application, and recording the monitored user behavior information; when an abnormal operation event of the target application is detected, sending a script generation request to the server, wherein the script generation request contains recorded user behavior information, the script generation request is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information; receiving a user behavior script returned by the server and restarting the target application; and calling a script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application.
Furthermore, an embodiment of the present invention provides a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor of a server to execute the application testing method applied to the server provided in the embodiment of the present invention, for example, the instructions may perform the following steps:
receiving an application test request, wherein the application test request comprises a user terminal identifier and is used for indicating a user terminal needing to be tested; when an application test request is received, determining a target user terminal to be tested according to a user terminal identifier contained in the application test request; acquiring target user behavior information before a target application on a target user terminal generates an abnormal operation event, and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script; and providing the user behavior script for the target user terminal, so that the target user terminal restarts the target application, and calling a script execution tool to execute the operation instruction in the user behavior script.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The storage medium provided by the embodiment of the present invention can achieve the beneficial effects that can be achieved by the corresponding application test method provided by the embodiment of the present invention, which are detailed in the foregoing embodiments and will not be described herein again.
The foregoing detailed description of the application test method, apparatus and storage medium provided by the embodiments of the present invention has been presented, and the principles and embodiments of the present invention are described herein using specific examples, and the description of the foregoing embodiments is only used to help understand the method and core ideas of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. An application testing method, comprising:
monitoring user behavior information in the running process of a target application, and recording the user behavior information;
when the target application is detected to have an abnormal operation event, sending a script generation request to a server, wherein the script generation request contains recorded user behavior information, the script generation request is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information;
receiving the user behavior script returned by the server and restarting the target application;
and calling a script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application.
2. The application testing method of claim 1, wherein the step of recording the user behavior information comprises:
when user behavior information in the running process of a target application is monitored, determining a target behavior identifier of the user behavior information according to a corresponding relation between preset user behavior information and a behavior identifier;
recording the target behavior identification and time information corresponding to the user behavior;
when the target application is detected to have an abnormal operation event, the step of sending a script generation request to a server includes:
when the target application is detected to have an abnormal operation event, sending a script generation request containing a recorded target behavior identifier and time information corresponding to user behavior to the server;
the script generation request is used for instructing the server to convert the recorded target behavior identifier into the user behavior information, generating an operation instruction corresponding to the user behavior information, and arranging the generated operation instruction according to the sequence of the time information corresponding to the user behavior to obtain the user behavior script.
3. The application testing method of claim 2, wherein the step of invoking a script execution tool to execute the operation instructions in the user behavior script comprises:
acquiring a time interval between two adjacent user behaviors according to the recorded time information corresponding to the user behaviors;
and calling the script execution tool, and sequentially executing the operation instructions in the user behavior script according to the acquired time interval.
4. The application testing method of claim 1, wherein the step of invoking a script execution tool to execute the operation instructions in the user behavior script is preceded by the step of:
and acquiring the application running environment information before the abnormal running event occurs, and recovering the application running environment before the abnormal running event occurs according to the application running environment information.
The step of calling a script execution tool to execute the operation instruction in the user behavior script comprises the following steps:
and calling the script execution tool in the recovered application running environment to execute the operation instruction in the user behavior script.
5. The application testing method of any one of claims 1-4, wherein in the process of executing the user behavior script, further comprising:
if the abnormal operation event occurs again in the target application, sending a report generation request to the server, wherein the report generation request comprises a generated test log, and the report generation request is used for indicating the server to generate a test report according to the generated test log;
and receiving the test report returned by the server.
6. An application testing method, comprising:
receiving an application test request, wherein the application test request comprises a user terminal identifier and is used for indicating a user terminal needing to be tested;
when the application test request is received, determining a target user terminal to be tested according to a user terminal identifier contained in the application test request;
acquiring target user behavior information before a target application on the target user terminal generates an abnormal operation event, and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script;
and providing the user behavior script for the target user terminal, so that the target user terminal restarts the target application, and calling a script execution tool aiming at the restarted target application to execute an operation instruction in the user behavior script.
7. The application testing method of claim 6, wherein the step of obtaining the target user behavior information before the target application on the target user terminal has the abnormal operation event comprises:
acquiring a user behavior log corresponding to the abnormal operation event, wherein the user behavior log comprises a behavior identifier recorded by the target user terminal before the target application generates the abnormal operation event and time information corresponding to user behavior;
acquiring target user behavior information of the target user terminal before the target application has the abnormal operation event according to the recorded behavior identifier and the corresponding relation between preset user behavior information and the behavior identifier;
the step of generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script includes:
and generating an operation instruction corresponding to the target user behavior information, and arranging the generated operation instruction according to the sequence of the time information corresponding to the recorded user behavior to obtain the user behavior script.
8. An application testing apparatus, comprising:
the monitoring module is used for monitoring user behavior information in the running process of the target application and recording the user behavior information;
the reporting module is used for sending a script generation request to a server when detecting that the target application has an abnormal operation event, wherein the script generation request contains recorded user behavior information, the script generation request is used for indicating the server to generate a user behavior script according to the recorded user behavior information, and the user behavior script comprises an operation instruction corresponding to the recorded user behavior information;
the acquisition module is used for receiving the user behavior script returned by the server and restarting the target application;
and the test module is used for calling a script execution tool to execute the operation instruction in the user behavior script aiming at the restarted target application.
9. An application testing apparatus, comprising:
the device comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving an application test request, and the application test request comprises a user terminal identification and is used for indicating a user terminal needing to be tested;
the identification module is used for determining a target user terminal to be tested according to a user terminal identifier contained in the application test request when the application test request is received;
the construction module is used for acquiring target user behavior information before a target application on the target user terminal generates an abnormal operation event and generating an operation instruction corresponding to the target user behavior information to obtain a user behavior script;
and the issuing module is used for providing the user behavior script for the target user terminal, so that the target user terminal restarts the target application, and calls a script execution tool aiming at the restarted target application to execute an operation instruction in the user behavior script.
10. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the application testing method according to claims 1 to 5; or to perform the steps in the application testing method as claimed in claims 6 and 7.
CN201910543749.3A 2019-06-21 2019-06-21 Application testing method and device and storage medium Pending CN112115038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910543749.3A CN112115038A (en) 2019-06-21 2019-06-21 Application testing method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910543749.3A CN112115038A (en) 2019-06-21 2019-06-21 Application testing method and device and storage medium

Publications (1)

Publication Number Publication Date
CN112115038A true CN112115038A (en) 2020-12-22

Family

ID=73796647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910543749.3A Pending CN112115038A (en) 2019-06-21 2019-06-21 Application testing method and device and storage medium

Country Status (1)

Country Link
CN (1) CN112115038A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291277A (en) * 2020-12-29 2021-01-29 腾讯科技(深圳)有限公司 Malicious software detection method, device, equipment and storage medium
CN112988580A (en) * 2021-03-11 2021-06-18 挂号网(杭州)科技有限公司 Test process reproduction method, device, equipment and storage medium
CN113221122A (en) * 2021-05-21 2021-08-06 珠海金山网络游戏科技有限公司 Vulnerability reproduction method and device
CN113608990A (en) * 2021-10-08 2021-11-05 上海豪承信息技术有限公司 Terminal performance detection method, device, storage medium and program product
CN117331754A (en) * 2023-10-17 2024-01-02 书行科技(北京)有限公司 Abnormality problem reduction method, abnormality problem reduction system, electronic device, and computer storage medium
CN117435475A (en) * 2023-09-27 2024-01-23 书行科技(北京)有限公司 Reproduction method and device of operation scene, electronic equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105320572A (en) * 2014-06-27 2016-02-10 腾讯科技(深圳)有限公司 Browser abnormity processing method, device and system
CN108268364A (en) * 2018-01-19 2018-07-10 百度在线网络技术(北京)有限公司 Anomalous event back method, device and equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105320572A (en) * 2014-06-27 2016-02-10 腾讯科技(深圳)有限公司 Browser abnormity processing method, device and system
CN108268364A (en) * 2018-01-19 2018-07-10 百度在线网络技术(北京)有限公司 Anomalous event back method, device and equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291277A (en) * 2020-12-29 2021-01-29 腾讯科技(深圳)有限公司 Malicious software detection method, device, equipment and storage medium
CN112988580A (en) * 2021-03-11 2021-06-18 挂号网(杭州)科技有限公司 Test process reproduction method, device, equipment and storage medium
CN113221122A (en) * 2021-05-21 2021-08-06 珠海金山网络游戏科技有限公司 Vulnerability reproduction method and device
CN113608990A (en) * 2021-10-08 2021-11-05 上海豪承信息技术有限公司 Terminal performance detection method, device, storage medium and program product
CN113608990B (en) * 2021-10-08 2022-02-01 上海豪承信息技术有限公司 Terminal performance detection method, device and storage medium
CN117435475A (en) * 2023-09-27 2024-01-23 书行科技(北京)有限公司 Reproduction method and device of operation scene, electronic equipment and readable storage medium
CN117331754A (en) * 2023-10-17 2024-01-02 书行科技(北京)有限公司 Abnormality problem reduction method, abnormality problem reduction system, electronic device, and computer storage medium
CN117331754B (en) * 2023-10-17 2024-04-19 书行科技(北京)有限公司 Abnormality problem reduction method, abnormality problem reduction system, electronic device, and computer storage medium

Similar Documents

Publication Publication Date Title
CN112115038A (en) Application testing method and device and storage medium
US20190227917A1 (en) Adaptive system for mobile device testing
CN112187585B (en) Network protocol testing method and device
CN111124919A (en) User interface testing method, device, equipment and storage medium
US7496795B2 (en) Method, system, and computer program product for light weight memory leak detection
CN111104315A (en) Test script generation method and device and computer readable storage medium
CN109359020A (en) Start time test method and device, computer installation and storage medium
CN109726830A (en) Equipment routing inspection method, apparatus, electronic equipment and storage medium
CN101751329A (en) Method and system for realizing automatic testing
CN115658529A (en) Automatic testing method for user page and related equipment
CN106713011B (en) Method and system for obtaining test data
US7840948B2 (en) Automation of keyboard accessibility testing
CN113568833A (en) Test case determination method and device, computer equipment and readable storage medium
US10831634B1 (en) Replication of user interface events
CN111414309A (en) Automatic test method of application program, computer equipment and storage medium
CN111026651B (en) Test method, device, storage medium and electronic equipment
CN109634838A (en) Position method, apparatus, storage medium and the electronic equipment of application failure
CN108984380A (en) A kind of server test method, device and medium based on linux system
CN111475423A (en) Data entry method and device, electronic equipment and readable storage medium
CN110795330A (en) Monkey pressure testing method and device
CN109684525B (en) Document display method and device, storage medium and test equipment
CN113535029A (en) Operation recording method, terminal, computer device and computer-readable storage medium
CN113468069A (en) Application testing method and device, computer equipment and storage medium
CN111444091A (en) Test case generation method and device
CN114217926A (en) Multi-process service instance deployment method, device, equipment and readable storage medium

Legal Events

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