Application program testing method, device, equipment and storage medium
By detecting the application's running environment and replacing the data receiving address, sending data to the test server in real time, solving the problems of low testing efficiency and delay in the existing technology, and achieving efficient application testing.
Patent Information
- Application Number
- CN202210050046.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2042-01-17
AI Technical Summary
In the prior art, application testing efficiency is low, some solutions require modification of source code, and there is a long delay when the data is sent to the test server, which cannot meet the testing needs.
By obtaining the data receiving address of the target application and detecting its operating environment, replacing the original data receiving address as the data test receiving address using the pre-stored mapping relationship, and sending data to the test server in real time to avoid source code modification and delay.
It achieves the efficiency of application testing, simplifies the testing process, avoids complex source code changes, and is highly adaptable in various test scenarios, meeting the testing needs of the target application.
Smart Images

Figure CN114398279B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to an application testing method, device, equipment and storage medium. Background Art
[0002] After the application is developed, it needs to be tested before it can be put on the market. During the test, the application data needs to be sent to the test server, and the application is tested on the test server based on the received data.
[0003] In the prior art, a variety of solutions can be used to send application data to a test server. However, some of these solutions require developers to modify the source code of the application, and some solutions have a long delay when sending the application data to the test server. Therefore, the prior art cannot meet the testing requirements of the application well and has the problem of low testing efficiency. Summary of the invention
[0004] An object of one embodiment of the present specification is to provide an application testing method, apparatus, device, and storage medium to improve the testing efficiency of the application.
[0005] To solve the above technical problems, an embodiment of this specification is implemented as follows:
[0006] In a first aspect, an embodiment of this specification provides an application testing method, which is applied to a target application, including:
[0007] After the target application is started, a data receiving address of the target data recorded in the target application is obtained as an original data receiving address, and whether the target application is in a specific operating environment is detected; wherein the target data includes data generated by the target application during operation;
[0008] If so, obtain a pre-stored mapping relationship between the original data receiving address and the data test receiving address; wherein the original data receiving address points to the data processing scenario; the data test receiving address points to the data test scenario; the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match;
[0009] Determine the data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replace the original data receiving address with the data test receiving address in the target application;
[0010] After the target application generates the target data, the target data is sent to a corresponding data test server in real time according to the data test receiving address corresponding to the target data; the data test server is used to test the target application based on the target data.
[0011] In a second aspect, another embodiment of the present specification provides an application testing device, applied to a target application, including:
[0012] an environment detection unit, configured to, after the target application is started, obtain a data receiving address of target data recorded in the target application as an original data receiving address, and detect whether the target application is in a specific operating environment; wherein the target data includes data generated by the target application during operation;
[0013] A mapping acquisition unit, for acquiring a pre-stored mapping relationship between the original data receiving address and the data test receiving address, wherein the original data receiving address points to a data processing scenario; the data test receiving address points to a data test scenario; the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match;
[0014] An address replacement unit, configured to determine the data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replace the original data receiving address with the data test receiving address in the target application;
[0015] The first sending unit is used to send the target data to a corresponding data test server in real time according to the data test receiving address corresponding to the target data after the target application generates the target data; the data test server is used to test the target application based on the target data.
[0016] In a third aspect, another embodiment of the present specification provides an application testing device, comprising: a memory, a processor, and computer executable instructions stored on the memory and executable on the processor, wherein the computer executable instructions, when executed by the processor, implement the steps of the application testing method as described in the first aspect above.
[0017] In a fourth aspect, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the application testing method described in the first aspect above are implemented.
[0018] In this embodiment, the target application generates target data during operation, and the original data receiving address of the target data can be obtained, and based on the mapping relationship between the original data receiving address and the data test receiving address, the data test receiving address corresponding to the target data is determined, and the original data receiving address is replaced with the data test receiving address, and then after the target data is generated, according to the data test receiving address corresponding to the target data, the target data is sent to the corresponding data test server in real time, and the data test server can test the target application based on the target data. It can be seen that through this embodiment, by replacing the original data receiving address of the target data with the corresponding data test receiving address, the target data generated by the target application during operation is sent to the data test server in real time, thereby testing the target application, the implementation method is simple, and there is no need to make complex changes to the source code of the target application, and the target data of the target application can be sent to the data test server in real time without a large time delay, thereby effectively improving the efficiency of testing the target application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in one or more embodiments of the present specification, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0020] Figure 1 A flowchart of an application testing method provided in an embodiment of this specification;
[0021] Figure 2 A flowchart of an application testing method provided by another embodiment of this specification;
[0022] Figure 3 A schematic diagram of a data analysis interface for a data point provided in an embodiment of this specification;
[0023] Figure 4 A schematic diagram of the structure of an application testing device provided in an embodiment of this specification;
[0024] Figure 5 A schematic diagram of the structure of an application testing device provided in one embodiment of this specification. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0026] An object of one embodiment of the present specification is to provide an application testing method, apparatus, device, and storage medium to improve the testing efficiency of the application.
[0027] Figure 1 This is a flow chart of an application testing method provided in an embodiment of this specification. The method is applied to a target application and executed by the target application, specifically by an electronic device installed with the target application. The electronic device may be a mobile phone, a computer, a tablet computer, etc. Figure 1 As shown, the process includes:
[0028] Step S102, after the target application is started, obtaining the data receiving address of the target data recorded in the target application as the original data receiving address, and detecting whether the target application is in a specific operating environment; wherein the target data includes the data generated by the target application during operation;
[0029] Step S104: if yes, then obtain a pre-stored mapping relationship between the original data receiving address and the data test receiving address; wherein the original data receiving address points to the data processing scenario; the data test receiving address points to the data test scenario; the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match;
[0030] Step S106, determining a data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replacing the original data receiving address with the data test receiving address in the target application;
[0031] Step S108, after the target application generates the target data, the target data is sent to the corresponding data test server in real time according to the data test receiving address corresponding to the target data; the data test server is used to test the target application based on the target data.
[0032] In this embodiment, the target application generates target data during operation, and the original data receiving address of the target data can be obtained, and based on the mapping relationship between the original data receiving address and the data test receiving address, the data test receiving address corresponding to the target data is determined, and the original data receiving address is replaced with the data test receiving address, and then after the target data is generated, according to the data test receiving address corresponding to the target data, the target data is sent to the corresponding data test server in real time, and the data test server can test the target application based on the target data. It can be seen that through this embodiment, by replacing the original data receiving address of the target data with the corresponding data test receiving address, the target data generated by the target application during operation is sent to the data test server in real time, thereby testing the target application, the implementation method is simple, and there is no need to make complex changes to the source code of the target application, and the target data of the target application can be sent to the data test server in real time without a large time delay, thereby effectively improving the efficiency of testing the target application.
[0033] In the above step S102, after the target application is started, the data receiving address of the target data recorded in the target application is obtained as the original data receiving address. Specifically, after the target application is installed in the electronic device, various data will be generated during operation, such as buried point data, user operation data, etc., and these data can all be part of the target data. Buried point data refers to the data generated after the buried point in the target application is triggered. For example, after the buried point for obtaining the network status is triggered, the obtained network status data is the buried point data.
[0034] In one scenario, the target application's installation package APK (Android application package) or software development kit SDK needs to record the data receiving address of the target data, so that when the user operates the target application, the target application sends the generated target data to the corresponding server. For example, for buried data, it is necessary to record the address of the server that receives the buried data, which can be a dedicated buried server corresponding to the target application; for the operation data performed by the user on the target application, it is necessary to record the address of the server that receives the operation data, which can be the background server of the target application. Among them, for different user operations, the corresponding data receiving addresses may be different or the same.
[0035] Therefore, in the above step S102, after the target application is started, the data receiving address of the target data recorded in the target application is obtained, and the obtained data receiving address is used as the original data receiving address. The original data receiving address may include the address of the background server corresponding to the target data after the target application is normally launched and released, and may also include the address of the dedicated point-of-sale server corresponding to the target application after the target application is normally launched and released. These servers can be collectively referred to as data processing servers corresponding to the target data. Accordingly, the original data receiving address is the address of the data processing server corresponding to the target data.
[0036] In the above step S102, it is also detected whether the target application is in a specific operating environment. In one embodiment, the detection of whether the target application is in a specific operating environment is specifically:
[0037] (1) detecting whether a specific application is installed in the target device where the target application is located, and if so, determining that the target application is in a specific operating environment;
[0038] or,
[0039] (2) Detect whether a specific file is stored in the target device where the target application is located. If so, determine that the target application is in a specific operating environment.
[0040] Specifically, the electronic device where the target application is located is the target device, and if the target device has a specific application installed, the target application is determined to be in a specific operating environment. Alternatively, if the target device has a specific file stored, the target application is determined to be in a specific operating environment.
[0041] Among them, detecting whether a specific application is installed in the target device where the target application is located can be: detecting whether an application whose installation package name is a specific package name and whose installation package signature is a specific signature is installed in the target device where the target application is located. If so, it is determined that the specific application is installed in the target device.
[0042] Specifically, when an application whose installation package name is a specific package name and whose installation package signature is a specific signature is installed in the target device, it is determined that the specific application is installed in the target device. Conversely, when an application whose installation package name is the specific package name and whose installation package signature is a specific signature is not installed in the target device, it is determined that the specific application is not installed in the target device.
[0043] In a specific embodiment, the target application records two sets of character strings, namely, a character string of a specific package name and a character string of a specific signature. After the target application is started in the target device, the registry of the target device is checked to determine whether an application with a package name of the specific package name recorded and an installation package signature of the specific signature recorded is installed in the target device. If installed, it is determined that the specific application is installed in the target device. If not installed, it is determined that the specific application is not installed in the target device. The signature of the installation package can be obtained by the MD5 (Message-Digest Algorithm) algorithm.
[0044] Among them, detecting whether a specific file is stored in the target device where the target application is located can be: detecting whether a file with a specific name is stored in a specific file directory in the target device; if so, it is determined that the specific file is stored in the target device; conversely, if the target device does not store a file with a specific name in the specific file directory, it is determined that the specific file is not stored in the target device.
[0045] Specifically, when a file with a specific name is stored in a specific file directory in the target device, it is determined that the specific file is stored in the target device. Conversely, when no file with a specific name is stored in the specific file directory in the target device, it is determined that the specific file is not stored in the target device.
[0046] In a specific embodiment, two groups of character strings are recorded inside the target application, namely, a character string of a specific file directory and a character string of a specific name. After the target application is started in the target device, the file storage list of the target device is checked to determine whether a file with a specific name is stored in the specific file directory in the target device. If so, it is determined that the specific file is stored in the target device. If not, it is determined that the specific file is not stored in the target device.
[0047] In the above step S104, when the target application is in a specific operating environment, a mapping relationship between the pre-stored original data receiving address and the data test receiving address is obtained, wherein the original data receiving address points to the data processing scenario, the data test receiving address points to the data test scenario, and the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match.
[0048] On the one hand, the original data receiving address of the target data can be the address of the server that receives the target data during the operation of the target application. Therefore, the original data receiving address points to the data processing scenario. For example, if the original data receiving address is the address for receiving the embedded data, then the original data receiving address points to the processing scenario of the embedded data. For another example, if the original data receiving address is the address for receiving the order operation performed by the user in the target application, then the original data receiving address points to the scenario for processing the order process. For another example, if the original data receiving address is the address for receiving the refund operation performed by the user in the target application, then the original data receiving address points to the scenario for processing the refund process.
[0049] On the other hand, the data test receiving address corresponding to the target data can be the address of the server that receives the target data sent by the target application during the test of the target application. Therefore, the data test receiving address points to the data test scenario. For example, if the data test receiving address is the address for receiving the embedded data, then the data test receiving address points to the test scenario for the embedded data. For another example, if the data test receiving address is the address for receiving the order placement operation performed by the user in the target application, then the original data receiving address points to the scenario for testing the order process. For another example, if the data test receiving address is the address for receiving the refund operation performed by the user in the target application, then the data test receiving address points to the scenario for testing the refund process.
[0050] It can be seen from this that there is a corresponding relationship between the data processing scenario corresponding to the original data receiving address and the data testing scenario corresponding to the data test receiving address. If certain target data needs to be sent to the original data receiving address for order processing after the target application is put into operation, then when the target application is tested, the target data should be sent to the data test receiving address for order testing.
[0051] Based on this correspondence, in this embodiment, various data testing servers corresponding to each data processing scenario of the original data receiving address are first deployed, and the data testing addresses of various data testing servers are determined. Then, a mapping relationship between the original data receiving address and the data test receiving address is established. In this mapping relationship, the data processing scenarios and data testing scenarios pointed to by the mutually mapped original data receiving addresses and data test receiving addresses match. For example, the original data receiving address for order processing and the data test receiving address for order testing have a mapping relationship, and the data processing scenarios and data testing scenarios pointed to by the two match.
[0052] In one embodiment, the mapping relationship between the pre-stored original data receiving address and the data test receiving address is obtained as follows:
[0053] (1) Obtaining a mapping relationship between a pre-stored original data receiving address and a data test receiving address from a software development kit (SDK) of a target application;
[0054] or,
[0055] (2) when a specific application is installed in the target device, obtaining a mapping relationship between a pre-stored original data receiving address and a data test receiving address from the specific application;
[0056] or,
[0057] (3) When a specific file is stored in the target device, a mapping relationship between a pre-stored original data receiving address and a data test receiving address is obtained from the specific file.
[0058] In this embodiment, the mapping relationship between the original data receiving address and the data test receiving address can be obtained by any one of the above three methods. Specifically, in the above method (1), the target device where the target application is located has a software development kit SDK of the target application installed, and the target application can obtain the pre-stored mapping relationship between the original data receiving address and the data test receiving address from the SDK. In the above method (2), when a specific application is installed in the target device, the target application can obtain the pre-stored mapping relationship between the original data receiving address and the data test receiving address from the specific application. In the above method (3), when a specific file is stored in the target device, the target application can obtain the pre-stored mapping relationship between the original data receiving address and the data test receiving address from the specific file.
[0059] After the mapping relationship is obtained, in the above step S106, the data test receiving address corresponding to the target data is determined according to the original data receiving address of the target data and the above mapping relationship. Specifically, for a certain target data, the original data receiving address of the target data is searched in the above mapping relationship, and the data test receiving address corresponding to the found original data receiving address is used as the data test receiving address corresponding to the target data.
[0060] For example, if the original data receiving address of a certain target data is address 1, the original data receiving address of the target data, i.e., address 1, is searched in the above mapping relationship, and the data test receiving address corresponding to the original data receiving address found, such as address A, is used as the data test receiving address corresponding to the target data. Through the above search process, when there are multiple target data, the data test receiving address corresponding to each target data can be determined respectively.
[0061] Next, in step S106, the original data receiving address is replaced with the data test receiving address in the target application. Specifically, after the data test receiving address corresponding to each target data is determined respectively, for each target data, the original data receiving address of the target data is replaced with the data test receiving address corresponding to the target data, so that the data test receiving address corresponding to each target data is recorded in the target application.
[0062] Next, in step S108, after the target application generates the target data, the target data is sent in real time to the corresponding data test server according to the data test receiving address corresponding to the target data. The data test server is used to test the target application based on the target data.
[0063] Specifically, after the target data is generated, the target data is sent to the corresponding data test server in real time according to the data test receiving address corresponding to the target data. By sending data in real time, the delay of data transmission can be reduced. The data test server is used to test the target application based on the target data, thereby improving the testing efficiency of the application.
[0064] Furthermore, the type of target data is not limited in this embodiment, and it may be tracking data, user operation data, or various data generated during the operation of the target application. Furthermore, when there are multiple original data receiving addresses, each original data receiving address has a corresponding data test receiving address, that is, for each data processing scenario, there is a matching data test scenario. Therefore, for the target application, through this embodiment, the target application can be tested in various test scenarios, such as testing the target application regarding tracking, testing the target application regarding the user ordering process, testing the target application regarding the user refund process, etc.
[0065] It can be seen that through this embodiment, not only the test efficiency of the application program can be improved, but also various application test scenarios can be adapted to meet the test requirements of the target application in various test scenarios.
[0066] Furthermore, the method in this embodiment may also include:
[0067] In response to a user's exit instruction for the target application, the data receiving address corresponding to the target data is restored from the data test receiving address to the original data receiving address;
[0068] After the restore is successful, exit the target application.
[0069] Specifically, when the target application receives the user's exit instruction, the target application restores the data receiving address corresponding to each target data from the aforementioned replaced data test receiving address to the corresponding original data receiving address according to the exit instruction, and exits the target application after the restoration is successful.
[0070] Before exiting the target application, the data receiving address corresponding to the target data is restored from the data test receiving address back to the original data receiving address, so that the same original data receiving address is obtained each time the target application is started. As shown above, the original data receiving address may include the address of the background server corresponding to the target data after the target application is normally launched and released, and may also include the address of the dedicated tracking server corresponding to the target application after the target application is normally launched and released, that is, the address of the data processing server corresponding to the target data.
[0071] Furthermore, in this embodiment, if it is determined that the target application is not in the above-mentioned specific operating environment, after the target application generates the target data, the target data is sent to the corresponding data processing server in real time according to the original data receiving address of the target data to perform data processing on the target data.
[0072] That is to say, if the target application is not in the above-mentioned specific operating environment, the target data will be sent to the corresponding data processing server in real time according to the original data receiving address of the target data. For example, according to the original data receiving address corresponding to the order data, the order data will be sent to the corresponding order processing server in real time for order processing.
[0073] It can be seen that each time the target application is started, the data receiving address of the target data recorded in the target application is obtained as the original data receiving address. The original data receiving address may include the address of the background server corresponding to the target data after the target application is normally launched and released, and may also include the address of the dedicated tracking server corresponding to the target application after the target application is normally launched and released, that is, the address of the data processing server corresponding to the target data. If the target application detects that it is in a specific operating environment, the target application replaces the original data receiving address with the data test receiving address, thereby sending the target data to the data test server to test the target application. When the target application exits, the data receiving address corresponding to the target data is restored from the data test receiving address to the original data receiving address.
[0074] Among them, when the target device has a specific application or a specific file, the target application is in a specific operating environment. Therefore, if you want to send the target data to the original background server of the target data, you only need to uninstall the specific application or specific file in the target device. After uninstallation, when the target application is started, since it detects that it is not in the specific operating environment, the target application sends the target data to the server corresponding to the original data receiving address, thereby performing the normal application operation process.
[0075] In one scenario, the specific file or specific application is a file or application that is only available to backend developers when testing the target application during the development process. Therefore, when the target application is released online, the electronic device on which the user runs the target application must not have the specific file or specific application, and the target application must not be in a specific operating environment. Therefore, there is no need to modify the code of the target application, and the target application can send the target data to the server corresponding to the original data receiving address, thereby performing the normal application operation process.
[0076] It can be seen that in this embodiment, a specific environment detection is performed when the target application is started, and the address is restored when the target application exits, so that the target application can take into account both the test environment and the normal operation after online release, and there is no need to change the code of the target application, thereby improving the development efficiency of the target application. Moreover, during the test of the target application, only the specific file or specific application needs to be uninstalled in the target device to enable the target application to communicate with the original background server, without changing the code of the target application, thereby improving the test efficiency of the target application.
[0077] Figure 2 This is a flow chart of an application testing method provided by another embodiment of this specification, and the flow is executed by the target application, such as Figure 2 As shown, the process includes:
[0078] Step S202, after the target application is started, obtaining a data receiving address of the target data recorded in the target application as an original data receiving address;
[0079] Step S204, detecting whether the target application is in a specific operating environment;
[0080] If so, execute step S206; otherwise, execute step S216.
[0081] Step S206, obtaining a pre-stored mapping relationship between the original data receiving address and the data test receiving address;
[0082] Step S208, determining a data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replacing the original data receiving address with the data test receiving address in the target application;
[0083] Step S210, after the target application generates the target data, the target data is sent to the corresponding data test service in real time according to the data test receiving address corresponding to the target data;
[0084] Step S212, in response to the user's exit instruction for the target application, the data receiving address corresponding to the target data is restored from the data test receiving address to the original data receiving address;
[0085] Step S214, after the restoration is successful, exit the target application;
[0086] Step S216, after the target application generates the target data, the target data is sent to the corresponding data processing server in real time according to the original data receiving address of the target data, so as to perform data processing on the target data.
[0087] Figure 2 Please refer to the previous article for the detailed explanation of the process, which will not be repeated here.
[0088] Furthermore, in this embodiment, the data testing server for testing the target application is specifically used for:
[0089] (1) After receiving the target data, generate response data of the target data according to the pre-configured test requirements, and send the response data to the target application to test the target application;
[0090] or,
[0091] (2) After receiving the target data, a data analysis interface is displayed to the user through the corresponding client, and in response to the data analysis dimension selected by the analyst on the data analysis interface, data analysis is performed on the received target data to test the target application.
[0092] In one case, after receiving the target data of the target application, the data testing server generates the response data of the target data according to the test requirements pre-configured by the tester, and sends the response data to the target application to test the target application. For example, if the pre-configuration is to respond to a refund request with a rejection, then when the target data is a refund request, the data testing server automatically generates a rejection message and sends it to the target application, thereby testing whether there is a logical problem in the refund processing flow of the target application.
[0093] In another case, after receiving the target data of the target application, the data testing server stores the target data in the database and displays the data analysis interface to the user through the corresponding client. The user, i.e., the tester, can select the data analysis dimension on the data analysis interface. The data testing server performs data analysis on the received target data in response to the data analysis dimension selected by the analyst on the data analysis interface to test the target application. For example, if the target data is the automatic flashback data of the target application, then after receiving the automatic flashback data, the data testing server stores it in the database. When the data testing server receives the data analysis dimension selected by the tester based on the data analysis interface, such as analyzing the number of automatic flashbacks per day, the data testing server analyzes the stored automatic flashback data to determine the number of automatic flashbacks of the target application per day, and displays the analysis results on the data analysis interface, so that the tester can debug the target application.
[0094] In a specific example, the above-mentioned target data is embedded data, and embedded data of different functions correspond to different original data receiving addresses. Therefore, embedded data of different functions also correspond to different data test receiving addresses. For example, the embedded data generated by the user identity authentication module in the target application corresponds to original data receiving address 1, corresponding to data test receiving address A, and the embedded data generated by the payment module in the target application corresponds to original data receiving address 2, corresponding to data test receiving address B.
[0095] In this example, the data testing server can receive the tracking data of multiple target applications. After receiving the tracking data, the data testing server can display the tracking data analysis interface on the corresponding client. Figure 3 A schematic diagram of a data analysis interface for a buried point provided in an embodiment of this specification is shown in FIG. Figure 3 As shown, in this interface, four options are provided: product name, model, tracking module, and tracking time. Through the product name option, the tracking data generated by different target applications can be filtered. Through the model option, the tracking data sent by different types of target devices after running the target application can be filtered. Through the tracking module option, the tracking data stored in different tracking modules can be filtered. Each tracking module corresponds to one of the aforementioned data test receiving addresses. Through the tracking time option, the tracking data generated in different time ranges can be filtered. Figure 3 The four options of product name, model, tracking module, and tracking time shown in can be used separately or in combination to filter the received tracking data.
[0096] In summary, the method in this embodiment can at least achieve the following technical effects:
[0097] (1) Through this embodiment, by replacing the original data receiving address of the target data with the corresponding data test receiving address, the target data generated by the target application during operation is sent to the data test server in real time, so as to test the target application. The implementation method is simple and does not require complex changes to the source code of the target application. In addition, the target data of the target application can be sent to the data test server in real time without a large time delay, thereby effectively improving the efficiency of testing the target application.
[0098] (2) Through this embodiment, the target application can be tested in various test scenarios, such as testing the target application on tracking points, testing the target application on the user order process, testing the target application on the user refund process, etc.;
[0099] (3) In this embodiment, a specific environment detection is performed when the target application is started, and address restoration is performed when the target application exits, so that the target application can take into account both the test environment and the normal operation after being released online, and there is no need to change the code of the target application, thereby improving the development efficiency of the target application. Moreover, during the test of the target application, only the specific file or specific application needs to be uninstalled in the target device to enable the target application to communicate with the original background server, without changing the code of the target application, thereby improving the test efficiency of the target application.
[0100] Figure 4 This is a schematic diagram of the structure of an application testing device provided in an embodiment of this specification. The device is applied to a target application, such as Figure 4 As shown, the device comprises:
[0101] The environment detection unit 41 is used to obtain the data receiving address of the target data recorded in the target application as the original data receiving address after the target application is started, and detect whether the target application is in a specific operating environment; wherein the target data includes the data generated by the target application during operation;
[0102] A mapping acquisition unit 42 is used to acquire a pre-stored mapping relationship between the original data receiving address and the data test receiving address; wherein the original data receiving address points to the data processing scenario; the data test receiving address points to the data test scenario; the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match;
[0103] An address replacement unit 43 is used to determine the data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replace the original data receiving address with the data test receiving address in the target application;
[0104] The first sending unit 44 is used to send the target data to a corresponding data test server in real time according to the data test receiving address corresponding to the target data after the target application generates the target data; the data test server is used to test the target application based on the target data.
[0105] Optionally, the environment detection unit is specifically used to: detect whether a specific application is installed in the target device where the target application is located, and if so, determine that the target application is in a specific operating environment; or detect whether a specific file is stored in the target device where the target application is located, and if so, determine that the target application is in a specific operating environment.
[0106] Optionally, the environment detection unit is also specifically used to: detect whether an application whose installation package name is a specific package name and whose installation package signature is a specific signature is installed in the target device, and if so, determine that the specific application is installed in the target device; detect whether a file with a specific name is stored in a specific file directory in the target device, and if so, determine that the specific file is stored in the target device.
[0107] Optionally, the mapping acquisition unit is specifically used to: obtain a pre-stored mapping relationship between the original data receiving address and the data test receiving address from the software development kit SDK of the target application; or, when the specific application is installed in the target device, obtain a pre-stored mapping relationship between the original data receiving address and the data test receiving address from the specific application; or, when the specific file is stored in the target device, obtain a pre-stored mapping relationship between the original data receiving address and the data test receiving address from the specific file.
[0108] Optionally, the device further comprises an address restoration unit, which is used to: in response to a user's exit instruction for the target application, restore the data receiving address corresponding to the target data from the data test receiving address back to the original data receiving address; after successful restoration, exit the target application.
[0109] Optionally, the device also includes a second sending unit, which is used to: if it is determined that the target application is not in the specific operating environment, after the target application generates the target data, send the target data to a corresponding data processing server in real time according to the original data receiving address of the target data, so as to perform data processing on the target data.
[0110] Optionally, the data testing server is specifically used to: after receiving the target data, generate response data for the target data according to pre-configured test requirements, and send the response data to the target application to test the target application; or, after receiving the target data, display a data analysis interface to the user through a corresponding client, and perform data analysis on the received target data in response to a data analysis dimension selected by an analyst on the data analysis interface to test the target application.
[0111] In this embodiment, the target application generates target data during operation, and the original data receiving address of the target data can be obtained, and based on the mapping relationship between the original data receiving address and the data test receiving address, the data test receiving address corresponding to the target data is determined, and the original data receiving address is replaced with the data test receiving address, and then after the target data is generated, according to the data test receiving address corresponding to the target data, the target data is sent to the corresponding data test server in real time, and the data test server can test the target application based on the target data. It can be seen that through this embodiment, by replacing the original data receiving address of the target data with the corresponding data test receiving address, the target data generated by the target application during operation is sent to the data test server in real time, thereby testing the target application, the implementation method is simple, and there is no need to make complex changes to the source code of the target application, and the target data of the target application can be sent to the data test server in real time without a large time delay, thereby effectively improving the efficiency of testing the target application.
[0112] The application testing device provided in one embodiment of this specification can implement each process in the aforementioned application testing method embodiment and achieve the same functions and effects, which will not be repeated here.
[0113] Furthermore, an embodiment of the present specification also provides an application testing device, Figure 5 A schematic diagram of the structure of an application testing device provided in an embodiment of this specification, such as Figure 5 As shown, the device includes: a memory 601, a processor 602, a bus 603 and a communication interface 604. The memory 601, the processor 602 and the communication interface 604 communicate via the bus 603. The communication interface 604 may include an input and output interface, which includes but is not limited to a keyboard, a mouse, a display, a microphone, a loudspeaker, etc. In one embodiment, the application test device may be a target device running a target application.
[0114] Figure 5In the embodiment, the memory 601 stores computer executable instructions that can be run on the processor 602. When the computer executable instructions are executed by the processor 602, the following process is implemented:
[0115] After the target application is started, a data receiving address of the target data recorded in the target application is obtained as an original data receiving address, and whether the target application is in a specific operating environment is detected; wherein the target data includes data generated by the target application during operation;
[0116] If so, obtain a pre-stored mapping relationship between the original data receiving address and the data test receiving address; wherein the original data receiving address points to the data processing scenario; the data test receiving address points to the data test scenario; the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match;
[0117] Determine the data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replace the original data receiving address with the data test receiving address in the target application;
[0118] After the target application generates the target data, the target data is sent to a corresponding data test server in real time according to the data test receiving address corresponding to the target data; the data test server is used to test the target application based on the target data.
[0119] Optionally, when the computer executable instructions are executed by the processor, detecting whether the target application is in a specific operating environment includes: detecting whether a specific application is installed in the target device where the target application is located, and if so, determining that the target application is in the specific operating environment; or detecting whether a specific file is stored in the target device where the target application is located, and if so, determining that the target application is in the specific operating environment.
[0120] Optionally, when the computer executable instructions are executed by the processor, it is detected whether a specific application is installed in the target device where the target application is located, including: detecting whether an application whose installation package name is a specific package name and whose installation package signature is a specific signature is installed in the target device, and if so, determining that the specific application is installed in the target device; detecting whether a specific file is stored in the target device where the target application is located, including: detecting whether a file with a specific name is stored in a specific file directory in the target device, and if so, determining that the specific file is stored in the target device.
[0121] Optionally, when the computer executable instructions are executed by the processor, a mapping relationship between a pre-stored original data receiving address and a data test receiving address is obtained, including: obtaining the mapping relationship between the pre-stored original data receiving address and the data test receiving address from a software development kit SDK of the target application; or, in a case where the specific application is installed in the target device, obtaining the mapping relationship between the pre-stored original data receiving address and the data test receiving address from the specific application; or, in a case where the specific file is stored in the target device, obtaining the mapping relationship between the pre-stored original data receiving address and the data test receiving address from the specific file.
[0122] Optionally, when the computer executable instructions are executed by the processor, they also include: in response to a user's exit instruction for the target application, restoring the data receiving address corresponding to the target data from the data test receiving address back to the original data receiving address; after the restoration is successful, exiting the target application.
[0123] Optionally, when the computer executable instructions are executed by the processor, if it is determined that the target application is not in the specific operating environment, then after the target application generates the target data, the target data is sent in real time to a corresponding data processing server according to the original data receiving address of the target data to perform data processing on the target data.
[0124] Optionally, when the computer-executable instructions are executed by the processor, the data testing server is specifically used to: after receiving the target data, generate response data for the target data according to pre-configured test requirements, and send the response data to the target application to test the target application; or, after receiving the target data, display a data analysis interface to the user through the corresponding client, and perform data analysis on the received target data in response to the data analysis dimensions selected by the analyst on the data analysis interface to test the target application.
[0125] In this embodiment, the target application generates target data during operation, and the original data receiving address of the target data can be obtained, and based on the mapping relationship between the original data receiving address and the data test receiving address, the data test receiving address corresponding to the target data is determined, and the original data receiving address is replaced with the data test receiving address, and then after the target data is generated, according to the data test receiving address corresponding to the target data, the target data is sent to the corresponding data test server in real time, and the data test server can test the target application based on the target data. It can be seen that through this embodiment, by replacing the original data receiving address of the target data with the corresponding data test receiving address, the target data generated by the target application during operation is sent to the data test server in real time, thereby testing the target application, the implementation method is simple, and there is no need to make complex changes to the source code of the target application, and the target data of the target application can be sent to the data test server in real time without a large time delay, thereby effectively improving the efficiency of testing the target application.
[0126] The application testing device provided in an embodiment of this specification can implement each process in the aforementioned application testing method embodiment and achieve the same functions and effects, which will not be repeated here.
[0127] Furthermore, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented:
[0128] After the target application is started, a data receiving address of the target data recorded in the target application is obtained as an original data receiving address, and whether the target application is in a specific operating environment is detected; wherein the target data includes data generated by the target application during operation;
[0129] If so, obtain a pre-stored mapping relationship between the original data receiving address and the data test receiving address; wherein the original data receiving address points to the data processing scenario; the data test receiving address points to the data test scenario; the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match;
[0130] Determine the data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replace the original data receiving address with the data test receiving address in the target application;
[0131] After the target application generates the target data, the target data is sent to a corresponding data test server in real time according to the data test receiving address corresponding to the target data; the data test server is used to test the target application based on the target data.
[0132] Optionally, when the computer executable instructions are executed by the processor, it detects whether the target application is in a specific operating environment, including: detecting whether a specific application is installed in the target device where the target application is located, and if so, determining that the target application is in the specific operating environment; or detecting whether a specific file is stored in the target device where the target application is located, and if so, determining that the target application is in the specific operating environment.
[0133] Optionally, when the computer executable instructions are executed by the processor, it is detected whether a specific application is installed in the target device where the target application is located, including: detecting whether an application whose installation package name is a specific package name and whose installation package signature is a specific signature is installed in the target device, and if so, determining that the specific application is installed in the target device; detecting whether a specific file is stored in the target device where the target application is located, including: detecting whether a file with a specific name is stored in a specific file directory in the target device, and if so, determining that the specific file is stored in the target device.
[0134] Optionally, when the computer executable instructions are executed by the processor, a mapping relationship between a pre-stored original data receiving address and a data test receiving address is obtained, including: obtaining the mapping relationship between the pre-stored original data receiving address and the data test receiving address from the software development kit SDK of the target application; or, when the specific application is installed in the target device, obtaining the mapping relationship between the pre-stored original data receiving address and the data test receiving address from the specific application; or, when the specific file is stored in the target device, obtaining the mapping relationship between the pre-stored original data receiving address and the data test receiving address from the specific file.
[0135] Optionally, when the computer executable instructions are executed by the processor, they also include: in response to a user's exit instruction for the target application, restoring the data receiving address corresponding to the target data from the data test receiving address back to the original data receiving address; after the restoration is successful, exiting the target application.
[0136] Optionally, when the computer executable instructions are executed by the processor, if it is determined that the target application is not in the specific operating environment, then after the target application generates the target data, the target data is sent in real time to a corresponding data processing server according to the original data receiving address of the target data to perform data processing on the target data.
[0137] Optionally, when the computer executable instructions are executed by the processor, the data testing server is specifically used to: after receiving the target data, generate response data for the target data according to pre-configured test requirements, and send the response data to the target application to test the target application; or, after receiving the target data, display a data analysis interface to the user through the corresponding client, and perform data analysis on the received target data in response to the data analysis dimensions selected by the analyst on the data analysis interface to test the target application.
[0138] In this embodiment, the target application generates target data during operation, and the original data receiving address of the target data can be obtained, and based on the mapping relationship between the original data receiving address and the data test receiving address, the data test receiving address corresponding to the target data is determined, and the original data receiving address is replaced with the data test receiving address, and then after the target data is generated, according to the data test receiving address corresponding to the target data, the target data is sent to the corresponding data test server in real time, and the data test server can test the target application based on the target data. It can be seen that through this embodiment, by replacing the original data receiving address of the target data with the corresponding data test receiving address, the target data generated by the target application during operation is sent to the data test server in real time, thereby testing the target application, the implementation method is simple, and there is no need to make complex changes to the source code of the target application, and the target data of the target application can be sent to the data test server in real time without a large time delay, thereby effectively improving the efficiency of testing the target application.
[0139] The storage medium provided in an embodiment of this specification can implement each process in the aforementioned application testing method embodiment and achieve the same functions and effects, which will not be repeated here.
[0140] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0141] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the virtual device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0142] The above description is only an embodiment of this specification and is not intended to limit this document. For those skilled in the art, the embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. An application testing method, characterized in that: Applied to target applications, including: After the target application is started, a data receiving address of the target data recorded in the target application is obtained as an original data receiving address, and whether the target application is in a specific operating environment is detected; wherein the target data includes data generated by the target application during operation; If so, obtain a pre-stored mapping relationship between the original data receiving address and the data test receiving address; wherein the original data receiving address points to the data processing scenario; the data test receiving address points to the data test scenario; the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match; Determine the data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replace the original data receiving address with the data test receiving address in the target application; After the target application generates the target data, the target data is sent to a corresponding data test server in real time according to the data test receiving address corresponding to the target data; the data test server is used to test the target application based on the target data.
2. The method according to claim 1, characterized in that Detecting whether the target application is in a specific operating environment includes: Detecting whether a specific application is installed in the target device where the target application is located, and if so, determining that the target application is in a specific operating environment; or, It is detected whether a specific file is stored in the target device where the target application is located. If so, it is determined that the target application is in a specific operating environment.
3. The method according to claim 2, characterized in that Detecting whether a specific application is installed in a target device where the target application is located, including: detecting whether an application whose installation package name is a specific package name and whose installation package signature is a specific signature is installed in the target device, and if so, determining that the specific application is installed in the target device; Detecting whether a specific file is stored in the target device where the target application is located includes: detecting whether a file with a specific name is stored in a specific file directory in the target device, and if so, determining that the specific file is stored in the target device.
4. The method according to claim 2, characterized in that: Obtaining the mapping relationship between the pre-stored original data receiving address and the data test receiving address, including: Acquire a mapping relationship between a pre-stored original data receiving address and a data test receiving address from a software development kit SDK of the target application; or, In a case where the specific application is installed in the target device, acquiring a pre-stored mapping relationship between the original data receiving address and the data test receiving address from the specific application; or, In the case that the specific file is stored in the target device, a mapping relationship between a pre-stored original data receiving address and a data test receiving address is obtained from the specific file.
5. The method according to claim 1, characterized in that The method further comprises: In response to a user's exit instruction for the target application, restoring the data receiving address corresponding to the target data from the data test receiving address back to the original data receiving address; After the restoration is successful, exit the target application.
6. The method according to claim 5, characterized in that If it is determined that the target application is not in the specific operating environment, after the target application generates the target data, the target data is sent to the corresponding data processing server in real time according to the original data receiving address of the target data to process the target data.
7. The method according to claim 1, characterized in that The data testing server is specifically used for: After receiving the target data, generating response data of the target data according to pre-configured test requirements, and sending the response data to the target application to test the target application; or, After receiving the target data, a data analysis interface is displayed to the user through a corresponding client, and in response to a data analysis dimension selected by an analyst on the data analysis interface, data analysis is performed on the received target data to test the target application.
8. An application testing device, characterized in that: Applied to target applications, including: an environment detection unit, configured to, after the target application is started, obtain a data receiving address of target data recorded in the target application as an original data receiving address, and detect whether the target application is in a specific operating environment; wherein the target data includes data generated by the target application during operation; A mapping acquisition unit, for acquiring a pre-stored mapping relationship between the original data receiving address and the data test receiving address, wherein the original data receiving address points to a data processing scenario; the data test receiving address points to a data test scenario; the data processing scenario and the data test scenario pointed to by the mutually mapped original data receiving address and the data test receiving address match; An address replacement unit, configured to determine the data test receiving address corresponding to the target data according to the original data receiving address of the target data and the mapping relationship, and replace the original data receiving address with the data test receiving address in the target application; The first sending unit is used to send the target data to a corresponding data test server in real time according to the data test receiving address corresponding to the target data after the target application generates the target data; the data test server is used to test the target application based on the target data.
9. The device according to claim 8, characterized in that The environment detection unit is specifically used for: Detecting whether a specific application is installed in the target device where the target application is located, and if so, determining that the target application is in a specific operating environment; or, It is detected whether a specific file is stored in the target device where the target application is located. If so, it is determined that the target application is in a specific operating environment.
10. The device according to claim 9, characterized in that The mapping acquisition unit is specifically used for: Acquire a mapping relationship between a pre-stored original data receiving address and a data test receiving address from a software development kit SDK of the target application; or, In a case where the specific application is installed in the target device, acquiring a pre-stored mapping relationship between the original data receiving address and the data test receiving address from the specific application; or, In the case that the specific file is stored in the target device, a mapping relationship between a pre-stored original data receiving address and a data test receiving address is obtained from the specific file.
11. The device according to claim 8, characterized in that The device also includes an address restoration unit, which is used to: In response to a user's exit instruction for the target application, restoring the data receiving address corresponding to the target data from the data test receiving address back to the original data receiving address; After the restoration is successful, exit the target application.
12. The device according to claim 11, characterized in that The device also includes a second sending unit, configured to: If it is determined that the target application is not in the specific operating environment, after the target application generates the target data, the target data is sent to the corresponding data processing server in real time according to the original data receiving address of the target data to process the target data.
13. An application testing device, characterized in that: include: A memory, a processor, and computer executable instructions stored in the memory and executable on the processor, wherein the computer executable instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 7.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
