Method and apparatus for application testing

By analyzing user behavior data to generate operation links and reproducing user operations, the problem of difficult-to-locate mobile application crashes in the prior art is solved, and development efficiency and user experience are improved.

CN113760728BActive Publication Date: 2025-06-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110089195.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-22
Publication Date
2025-06-20
Estimated Expiration
2041-01-22

AI Technical Summary

Technical Problem

The prior art is difficult to reproduce user operations when mobile applications crash, resulting in cumbersome positioning problems and reducing development efficiency and user experience.

Method used

By obtaining and parsing user behavior data, generating operation links, further generating test scripts, reproducing user operations to locate the cause of application crash.

Benefits of technology

It accurately locates the cause of application crashes, improves development efficiency and user experience, and ensures the authenticity and accuracy of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760728B_ABST
    Figure CN113760728B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for testing an application, which relates to the field of computer technology. A specific implementation of the method includes: obtaining user behavior data of the application; parsing the user behavior data to obtain an operation link of the user for the application; generating a test script corresponding to the application according to the operation link; reproducing the operation of the user for the application according to the test script, and determining crash information of the application to test the application. This implementation reduces the difficulty for developers to locate and analyze problems when the application crashes, and improves the test efficiency of the application after gray-scale or online launch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method for testing an application. Background Art

[0002] With the popularization and development of mobile devices, mobile applications and their functions have been continuously enriched, greatly improving the user experience.

[0003] However, users will inevitably encounter problems during use, and mobile applications may occasionally crash. For the above problems, the current main solution is to report the crash data at the moment when the mobile application crashes during gray-scale or online use. R & D personnel locate the problem by analyzing the logs and try to solve the problem so as to gray-scale or go online again.

[0004] Since the existing technology only reports data at the moment when the application crashes, it is difficult to reproduce the actual operations of users, resulting in a very cumbersome process for developers to locate problems. This reduces the development efficiency of the application and also reduces the user experience. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method and device for testing an application, which can accurately locate the cause of the application crash by reproducing user operations.

[0006] To achieve the above object, according to one aspect of the embodiments of the present invention, a method for testing an application is provided, including:

[0007] Obtaining user behavior data of the application;

[0008] Parsing the user behavior data to obtain an operation link of the user for the application;

[0009] Generating a test script corresponding to the application according to the operation link;

[0010] Reproducing the operation of the user for the application according to the test script, and determining the crash information of the application to test the application.

[0011] Optionally, the parsing the user behavior data to obtain an operation link of the user for the application includes:

[0012] Determining one or more first operation types corresponding to the user behavior data;

[0013] Classifying the user behavior data according to the one or more first operation types to obtain operation data corresponding to each of the first operation types;

[0014] Map the operation data to the global test log according to the second operation type and the first operation type included in the preset global test log;

[0015] Sort the operation data according to the generation time of each piece of operation data to generate the operation link.

[0016] Optionally, generating the test script corresponding to the application according to the operation link includes:

[0017] Deduplicate the operation link and generate the test script according to the deduplication result.

[0018] Optionally, the method further includes:

[0019] Perform start point splitting on the operation link;

[0020] Then perform loop splitting on the split operation link to split at least two consecutive operations in the operation link to obtain at least two operation combinations, and each operation combination includes one or more operations;

[0021] Perform a deduplication operation on the at least two operation combinations to obtain the shortest operation link,

[0022] Generate the test script according to the shortest operation link.

[0023] Optionally, reproducing the operation of the user on the application according to the test script includes:

[0024] Run the test script generated by the shortest operation link;

[0025] When there is a problem with the test script, update the shortest operation link according to the deduplication operation, and update the test script according to the updated operation link;

[0026] Determine the crash information of the application according to the updated test script.

[0027] Optionally, parsing the user behavior data to obtain the operation link of the user on the application includes:

[0028] Extract the key information in the user behavior data, and the key information includes any one or more of the following: user identifier, the operating system corresponding to the application, the version information of the application, the crash time of the application, and the stack information when the application crashes;

[0029] Obtain the operation link according to the key information.

[0030] Optionally, the method further includes:

[0031] Parsing the user behavior data of multiple users to obtain click-through rates of the multiple users for multiple functions of the application;

[0032] Determining whether the operation percentage is less than a preset threshold, and if so, adjusting the release strategy of the application to increase the click-through rate of the multiple users for the multiple functions.

[0033] According to a second aspect of an embodiment of the present invention, there is provided a test device for an application, including: an acquisition module, a parsing module, a generation module, and a test module; wherein,

[0034] The acquisition module is configured to acquire user behavior data of the application;

[0035] The parsing module is configured to parse the user behavior data to obtain an operation link of a user for the application;

[0036] The generation module is configured to generate a test script corresponding to the application according to the operation link;

[0037] The test module is configured to reproduce the operation of the user for the application according to the test script, determine crash information of the application, so as to test the application.

[0038] Optionally,

[0039] The parsing module is configured to determine one or more first operation types corresponding to the user behavior data;

[0040] Classifying the user behavior data according to the one or more first operation types to obtain operation data corresponding to each of the first operation types;

[0041] Mapping the operation data to the global test log according to a second operation type included in a preset global test log and the first operation type;

[0042] Sorting the operation data according to the generation time of each piece of operation data to generate the operation link.

[0043] Optionally,

[0044] The generation module is configured to remove duplicates from the operation link, and generate the test script according to the deduplication result; perform start point splitting on the operation link;

[0045] Then, perform circular segmentation on the segmented operation link to split at least two consecutive operations in the operation link, obtaining at least two operation combinations, where each operation combination includes one or more operations;

[0046] Perform a duplicate removal operation on the at least two operation combinations to obtain the shortest operation link, and generate the test script according to the shortest operation link.

[0047] Optionally,

[0048] The test module is configured to run the test script generated by the shortest operation link;

[0049] When a problem occurs in the test script, update the shortest operation link according to the duplicate removal operation, and update the test script according to the updated operation link;

[0050] Determine the crash information of the application according to the updated test script.

[0051] According to the third aspect of the embodiments of the present invention, a server is provided, including:

[0052] One or more processors;

[0053] A storage device for storing one or more programs,

[0054] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods in a test method for an application provided in the first aspect above.

[0055] According to the fourth aspect of the embodiments of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, it implements any of the methods in a test method for an application provided in the first aspect above.

[0056] One embodiment of the above invention has the following advantages or beneficial effects: Since the technical solution provided in this application is based on the user behavior data of the application to obtain the operation link of the user for the application, that is, the operation link of the application can relatively completely reflect the user behavior. Then, according to this operation link, the generated test script corresponding to the application can completely reproduce the operations of the user for the application. And by reproducing the operations of the user for the application, the determined crash information of the application can relatively truly and accurately reflect the reasons for crashes during the user operation process.

[0057] The further effects of the above non-conventional optional methods will be described in combination with specific embodiments below. Description of the Drawings

[0058] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:

[0059] Figure 1 It is a schematic diagram of the main process of the method for testing an application according to an embodiment of the present invention;

[0060] Figure 2 It is a schematic diagram of the process for real-time reporting of user behavior data provided by an embodiment of the present invention;

[0061] Figure 3 It is a schematic diagram of the process for outputting a test script that can be automatically executed provided by an embodiment of the present invention;

[0062] Figure 4 It is a schematic diagram of the segmentation result for parsing the user operation link provided by an embodiment of the present invention;

[0063] Figure 5 It is a schematic diagram of the process for updating a test script provided by an embodiment of the present invention;

[0064] Figure 6 It is a schematic diagram of the main modules of the device for testing an application according to an embodiment of the present invention;

[0065] Figure 7 It is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;

[0066] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. Detailed implementation manners

[0067] The following makes an explanation of the exemplary embodiments of the present invention with reference to the accompanying drawings. Various details of the embodiments of the present invention are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0068] As Figure 1 shown, an embodiment of the present invention provides a method for testing an application, and the method may include the following steps S101 to step S104:

[0069] Step S101: Obtain user behavior data of the application;

[0070] The form of the application may be a mobile terminal (app), a mini-program, a front-end web page, etc. A specific implementation manner of this step may be as Figure 2As shown, through the third-party software development kit (SDK) in the mobile application for data logging, the logged data is captured and decoded, that is Figure 2 the process of obtaining the Crash file and parsing the Crash file as shown. After the parsing is completed, key information such as user ID, operating system, crash time, application version, Crash stack information, etc. can be obtained from the parsing results. These key information constitute the user behavior data of this step. Further, as Figure 2 shown, the user behavior data can be sent to the message middleware through the server API for persistent storage of the user behavior data on the server side. Among them, the way to transmit the user behavior data can be offline transmission or real-time transmission.

[0071] In the embodiments of the present invention, the above process of obtaining user behavior data can be implemented at least by the following programming languages:

[0072]

[0073]

[0074] Step S102: Parse the user behavior data to obtain the operation link of the user for the application.

[0075] In the embodiments of the present invention, the operation link of the user can be obtained in the following way: Extract the key information in the user behavior data, and the key information includes any one or more of the following: user identifier, the operating system corresponding to the application, the version information of the application, the crash time of the application, the stack information when the application crashes; Obtain the operation link according to the key information.

[0076] In the embodiments of the present invention, step S102 can be implemented in the following way: Determine one or more first operation types corresponding to the user behavior data; Classify the user behavior data according to the one or more first operation types to obtain the operation data corresponding to each first operation type; Map the operation data to the global test log according to the second operation type included in the preset global test log and the first operation type; Sort the operation data according to the generation time of each operation data to generate the operation link.

[0077] Among them, the operation data corresponding to the first operation type refers to the user behavior data belonging to the first operation type. It has been mentioned above that the user behavior data includes user ID, operating system, crash time, application version, Crash stack information, etc. Correspondingly, the operation data corresponding to the first operation type may include the user ID, operating system, crash time, application version, Crash stack information, etc. belonging to the first operation type.

[0078] The user behavior data also includes click data of each first operation type of the user (the click data refers to the start time point when the user performs an operation of the first operation type. For example, the start time point when the user adds an item to the shopping cart in a shopping application). Classifying the click data can obtain the start time node of each first operation type. According to the unique mapping relationship between the second operation type and the first operation type in the global test log, map the operation data of the first operation type to the global test log. Sort all the operation data according to the start time nodes of each operation data, so as to obtain the complete user operation link.

[0079] The above mapping relationship, such as Figure 3 shown, the user behavior log (i.e., the aforementioned user behavior data) contains multiple groups of operation data of the first operation type. Each group of operation data includes information such as ID (ACTION_ID), user click data (ACTION_INFO), click time (ACTION_TIME), etc. The global test log contains multiple groups of operation data of the second operation type. Each group of operation data includes data time (EVENT_TIME), data information (ACTIVITY), data category (ITEM_MESSAGE). According to the unique mapping relationship between the first operation type and the second operation type, output an automatically executable test script for testing. If there is a problem, return to correct the script and test again. Among them, the first operation type and the second operation type do not specifically refer to the number of operation types, but are used to distinguish the sources of operation types, that is, the first operation type refers to the operation type from the user behavior log; the second operation type refers to the operation type from the global test log. The specific implementation method of mapping the operation data to the global test log: for each first operation type corresponding to the user behavior data, execute: determine the operation data corresponding to the second operation type that is the same as the first operation type from the global test log, and fill the operation data corresponding to the first operation type into the operation data corresponding to the second operation type that is the same as the first operation type.

[0080] Taking the currently widely used shopping software as an example, when the application crashes during the online shopping process of a user, relevant user click data is automatically reported, including but not limited to data related to adding to cart, payment, product detail page, comments, after-sales service, and refund. All click data of different types is classified, that is, the above user click data can be classified into types such as adding to cart, payment, product detail page, comments, after-sales service, and refund. And the data is rearranged according to the click time of each click data in the user click data, so as to obtain a complete user operation link. For example, the user click data of a user in a certain operation and the classification of the user click data can obtain the classification result shown in Table 1. Further arranging the data in Table 1 according to the click time, the operation link arranged by time shown in Table 2 can be obtained: adding to cart - product detail page - user comment - product detail page - adding to cart - user comment - payment.

[0081] Table 1

[0082] Operation Type Number of Clicks Time Add to Cart 2 15:43 15:58 Product Detail Page 2 15:45 15:54 User Comment 2 15:60 16:03 Payment 1 16:08

[0083] Table 2

[0084] Operation Type Operation Time Add to Cart 15:43 Product Detail Page 15:45 User Comment 15:60 Product Detail Page 15:54 Add to Cart 15:58 User Comment 16:03 Payment 16:08

[0085] Step S103: Generate a test script corresponding to the application according to the operation link;

[0086] In the embodiment of the present invention, the test script corresponding to the application can be generated in the following two ways:

[0087] Method 1: Directly generate a test script according to the operation execution order given by the operation link. For example, for the operation link provided in Table 2 above: adding to cart - product detail page - user comment - product detail page - adding to cart - user comment - payment, the test operations included in the generated test script and the order of the test operations are exactly the same as this link, that is, the test script sequentially executes the adding to cart operation, the product detail page click operation, the user comment click operation, the product detail page click operation, the adding to cart operation, the user comment click operation, and the payment operation.

[0088] Method 2: Remove duplicates from the operation link, and generate the test script according to the result of removing duplicates.

[0089] Specifically, perform a starting point segmentation on the operation link; then perform a circular segmentation on the segmented operation link to split at least two consecutive operations in the operation link into at least two operation combinations, and each operation combination includes one or more operations; perform a duplicate removal operation on the at least two operation combinations to obtain the shortest operation link, and generate the test script according to the shortest operation link.

[0090] Among them, the starting point refers to an operation node corresponding to an operation type preset for an application. For example, for a shopping software, its starting point can be an operation node of the operation type of clicking on the product details page, that is, each time the user clicks on the product details page, a starting point appears. This starting point can be set accordingly according to specific requirements.

[0091] Among them, loop splitting means that for each of the multiple link segments obtained by splitting from the starting point: when there are at least two link sub-segments in this link segment, and a continuous plurality of operations in each link sub-segment appear in other link segments, then split at the junction position between two adjacent link sub-segments.

[0092] Take Figure 4 the operation link shown as an example for illustration. As Figure 4 shown, the two operation links obtained based on step S102 are respectively: A - B - C - A - B - C - D - E; A - E - G - A - B - C - B - C. Among them, the starting points of these two operation links are both A. Then, perform starting point splitting on the above two operation links to obtain A - B - C, A - B - C - D - E, A - E - G, A - B - C - B - C. Further perform loop splitting, and the results can be obtained: A - B - C, A - B - C - D - E, A - E - G, A - B - C, B - C. After removing duplicates, A - B - C - D - E and A - E - G are obtained.

[0093] Another example is that by splitting a certain link from the starting point, multiple link segments are obtained: A - B - C, A - B - C - D - E, A - E - G, A - B - C - B - C - D - F. Then, during subsequent loop splitting, since A - B - C, A - B - C - D - E, and A - E - G do not meet the conditions for loop splitting (that is, they do not meet the condition that there are at least two link sub-segments, and a continuous plurality of operations in each link sub-segment appear in other link segments), only the link segment A - B - C - B - C - D - F that meets the conditions for loop splitting is split. Among them, in the link segment A - B - C - B - C - D - F, the two link sub-segments A - B - C and B - C appear in other link segments. Then, perform loop splitting at the junction position between A - B - C and B - C. The result after loop splitting the link segment A - B - C - B - C - D - F is: A - B - C, B - C - D - F.

[0094] According to the above embodiments, since duplicate removal is performed on the actual link of the user, including technical means such as starting point segmentation and loop segmentation, a shortest operation link that can simulate the actual operation effect of the user is obtained. Compared with the actual link of the user, its testing process is relatively simple and clear. Therefore, it is possible to maximize the testing efficiency on the premise of ensuring the simulation of user behavior.

[0095] When performing application testing through the above shortest link, since duplicate click data in the actual user link is deleted in the shortest link, it may cause problems in the operation of the test script. Therefore, in the embodiments of the present invention, in order to smoothly test the application, the test script generated by running the shortest operation link is executed; when the test script has problems, according to the duplicate removal operation, the shortest operation link is updated, and according to the updated operation link, the test script is updated; according to the updated test script, the crash information of the application is determined.

[0096] Still taking the link in Figure 4 as an example, if Figure 4 the finally generated operation links A - B - C - D - E and A - E - G in

[0097] do not achieve the test effect of the actual user operation link, we need to update the above links according to the actual user link and retest. Figure 5 The specific update method can be as shown in

[0098] Step S501: Add one or a group of duplicate removal operations to the current link segment to update the current link segment;

[0099] For example, Figure 5 if there is a problem with the test script corresponding to the shortest link A - B - C - D - E after duplicate removal, this step can add a duplicate removal operation such as A or a group of duplicate removal operations such as A - B - C on the basis of A - B - C - D - E. Since in the actual link, the A or A - B - C is before A - B - C - D - E, then the added A or A - B - C in this step is added before A - B - C - D - E to get A - A - B - C - D - E or A - B - C - A - B - C - D - E.

[0100] Step S502: When there is a problem with the test script corresponding to the updated link segment, use the updated link segment as the current link segment and execute Step S501;

[0101] For example, if there is still a problem with the test script corresponding to the updated link segment A-A-B-C-D-E obtained in step S501 above, based on step S501, a deduplication operation such as B or a set of deduplication operations such as B-C can be added to this link segment A-A-B-C-D-E.

[0102] Step S503: When the test script corresponding to the updated link segment can determine the crash information of the application, end the current process.

[0103] For example, if the test script corresponding to the updated link segment A-A-B-C-D-E obtained in step S501 above can determine the crash information of the application, then no more duplicate operations will be added to A-A-B-C-D-E.

[0104] It can be seen from this example that users often make many repeated clicks during the actual operation process, which results in many duplicate links in the actual operation link of the user. Generally, the specific reasons for application problems have nothing to do with these duplicate links. By deduplicating the actual operation link of the user, the parts irrelevant to the problem can be removed during the test, greatly improving the test efficiency on the basis of ensuring the test effect.

[0105] Step S104: According to the test script, reproduce the user's operation on the application, determine the crash information of the application, so as to test the application.

[0106] In Figure 1 In the illustrated embodiment, since the technical solution provided by the present application is based on the user behavior data of the application to obtain the operation link of the user on the application, that is, the operation link of the application can relatively completely reflect the user behavior. Then, according to this operation link, the generated test script corresponding to the application can completely reproduce the user's operation on the application, and the crash information of the application determined by reproducing the user's operation on the application can relatively truly and accurately reflect the reason for the crash during the user operation process.

[0107] In the embodiment of the present invention, the method may further include: parsing the user behavior data of multiple users to obtain the operation percentages of the multiple functions of the application by the multiple users; determining whether the operation percentage is less than a preset threshold, and if so, adjusting the release strategy of the application to increase the operation percentage of the multiple users on the multiple functions.

[0108] The operation percentage refers to the percentage of the number of functions used in the operation process of the gray-scale users during the test to the total number of functions included in the application. For example, if the total number of functions included in an application is 5 and the number of functions used in the operation process of the gray-scale users is 3, the operation percentage is The preset threshold can be adjusted or set accordingly according to actual requirements.

[0109] Among them, specifically adjusting the release strategy of the application can be to increase the number of gray-scale users.

[0110] To better conduct gray-scale release, we must try our best to improve the coverage rate of the functions operated by gray-scale users. For example, a certain app includes the following eight functions: comment, add to cart, payment, refund, product details, upload, storage, and send. In the gray-scale test of this program, we preset the function ratio of this gray-scale test (i.e., the preset threshold) to be 75%, that is, through the gray-scale test, at least 75% of the total number of functions of the application must be used by the gray-scale population, so as to discover problems to the greatest extent. By analyzing the behavior data of a certain gray-scale user, we can obtain a complete user operation link: comment - add to cart - product details - payment - refund. After calculation, the number of functions operated by this user is 5, that is, the coverage rate of the functions operated by the user (i.e., the operation percentage) is 62.5%, which is less than the preset threshold of 75%. At this time, we need to appropriately expand the gray-scale population. After expansion, the operation link of another user is obtained as product details - add to cart - payment - upload - send - comment - refund. After calculation, combined with the operation link of the previous user, the function coverage rate is 87.5%, which exceeds the preset threshold of 75% and reaches the gray-scale test target.

[0111] According to the above embodiments, by analyzing the user behavior logs of the gray-scale test, the function coverage rate (i.e., the operation percentage) of the operations of the gray-scale users during the test is obtained. Controlling this function coverage rate is beneficial for developers to discover problems to the greatest extent during the gray-scale test and to adjust the gray-scale strategy targeted, avoiding the risk of concentrated outbreak of problems after the application is launched to a certain extent.

[0112] As Figure 6 shown, an embodiment of the present invention provides a test device 600 for an application, including: an acquisition module 601, an analysis module 602, a generation module 603, and a test module 604; among them,

[0113] The acquisition module 601 is used to acquire the user behavior data of the application;

[0114] The analysis module 602 is used to analyze the user behavior data to obtain the operation link of the user for the application;

[0115] The generating module 603 is configured to generate a test script corresponding to the application according to the operation link.

[0116] The testing module 604 is configured to reproduce the user's operations on the application according to the test script, determine the crash information of the application, so as to test the application.

[0117] In an embodiment of the present invention, the parsing module 602 is configured to determine one or more first operation types corresponding to the user behavior data, classify the user behavior data according to the one or more first operation types, obtain operation data corresponding to each of the first operation types, map the operation data to the global test log according to the second operation type and the first operation type included in the preset global test log, sort the operation data according to the generation time of each operation data, and generate the operation link.

[0118] In an embodiment of the present invention, the generating module 603 is configured to remove duplicates from the operation link and generate the test script according to the result of duplicate removal.

[0119] In an embodiment of the present invention, the generating module 603 is further configured to perform start point splitting on the operation link, and then perform loop splitting on the split operation link, so as to split at least two consecutive operations in the operation link to obtain at least two operation combinations, each operation combination includes one or more operations, perform duplicate removal operations on the at least two operation combinations to obtain the shortest operation link, and generate the test script according to the shortest operation link.

[0120] In an embodiment of the present invention, the testing module 604 is configured to run the test script generated by the shortest operation link;

[0121] When a problem occurs in the test script, the generating module 603 updates the shortest operation link according to the duplicate removal operation, and updates the test script according to the updated operation link.

[0122] In an embodiment of the present invention, the parsing module 602 is configured to extract key information from the user behavior data, and the key information includes any one or more of the following: user identifier, the operating system corresponding to the application, the version information of the application, the crash time of the application, the stack information when the application crashes;

[0123] The generating module 603 is configured to obtain the operation link according to the key information.

[0124] In one embodiment of the present invention, the parsing module 602 is configured to parse the user behavior data of multiple users to obtain the operation percentages of the multiple users for multiple functions of the application, determine whether the operation percentages are less than a preset threshold, and if so, adjust the release strategy of the application to increase the operation percentages of the multiple users for the multiple functions.

[0125] An embodiment of the present invention further provides a server, including: one or more processors; a storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the test method of the application provided in any of the above embodiments.

[0126] An embodiment of the present invention further provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, it implements the test method of the application provided in any of the above embodiments.

[0127] Figure 7 An exemplary system architecture 700 is shown to which the test method of an application or the test device of an application according to an embodiment of the present invention can be applied.

[0128] As Figure 7 shown, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is used to provide a medium for a communication link between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0129] Users can use the terminal devices 701, 702, 703 to interact with the server 705 through the network 704 to receive or send messages, etc. For example, the server 705 can obtain and store the user behavior data of the terminal devices 701, 702, 703. The server 705 can provide the test results to the terminal devices 701, 702, 703 so that users can view the test results through the terminal devices. Various communication client applications may be installed on the terminal devices 701, 702, 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0130] The terminal devices 701, 702, 703 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.

[0131] The server 705 may be a server that provides various services. For example, it can be a background management server (merely an example) that supports the operation behaviors of any applications of the user on the terminal devices 701, 702, and 703 or the user behavior data. The background management server can analyze and process the user behavior data of the applications that can be obtained, generate a test script, and test any application of the terminal devices 701, 702, and 703 based on the test script, and can feedback the processing results (such as the test results - merely an example) to the terminal devices.

[0132] It should be noted that a test method for an application provided by an embodiment of the present invention is generally executed by the server 705. Correspondingly, a test device for an application is generally disposed in the server 705.

[0133] It should be understood that Figure 7 the numbers of the terminal devices, the network, and the server in

[0134] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 8 Next, refer to Figure 8 which shows a schematic structural diagram of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention.

[0135] As Figure 8 shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 802 or the programs loaded from the storage section 808 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0136] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. The drive 810 is also connected to the I / O interface 805 as required. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as required, so that the computer program read from it can be installed into the storage section 808 as required.

[0137] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above functions defined in the system of the present invention are performed.

[0138] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0139] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, and the above-mentioned module, segment of a program, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0140] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes an acquisition module, a parsing module, a generation module, and a test and correction module. Among them, the names of these modules do not constitute a limitation on the module itself in some cases. For example, the parsing module can also be described as "a module for parsing the user operation link".

[0141] As another aspect, the present invention also provides a computer-readable medium, which can be included in the device described in the above embodiments; or can exist separately without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: acquiring user behavior data of an application; parsing the user behavior data to obtain an operation link of the user for the application; generating a test script corresponding to the application according to the operation link; reproducing the operation of the user for the application according to the test script, and determining the crash information of the application to test the application.

[0142] According to the technical solution of the embodiments of the present invention, when an application crashes, a complete user operation link is obtained through the buried point data and parsed, so as to obtain a test link that can not only reproduce the user operation but also optimize the test efficiency. And an automatically executable test script is generated through the mapping relationship from user behavior to test log. If there are problems during the test, it is returned for correction and then executed again. In addition, through the analysis of the user behavior log, the function coverage rate of the current gray-scale test application can be obtained, and the gray-scale strategy can be adjusted in real time.

[0143] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A testing method for an application, characterized in that, including: Obtain the user behavior data of the application; Parse the user behavior data to obtain the operation link of the user for the application; Generate a test script corresponding to the application according to the operation link; Reproduce the operation of the user for the application according to the test script, determine the crash information of the application, so as to test the application; The parsing of the user behavior data to obtain the operation link of the user for the application includes: Determine one or more first operation types corresponding to the user behavior data; Classify the user behavior data according to the one or more first operation types to obtain operation data corresponding to each first operation type; Map the operation data to the global test log according to the second operation type included in the preset global test log and the first operation type; Sort the operation data according to the generation time of each operation data to generate the operation link.

2. The method according to claim 1, characterized in that, The generating a test script corresponding to the application according to the operation link includes: Deduplicate the operation link, and generate the test script according to the deduplication result.

3. The method according to claim 2, characterized in that, Perform start point splitting on the operation link; Then perform loop splitting on the split operation link to split at least two consecutive operations in the operation link to obtain at least two operation combinations, and each operation combination includes one or more operations; Perform a deduplication operation on the at least two operation combinations to obtain the shortest operation link, and generate the test script according to the shortest operation link.

4. The method according to claim 3, characterized in that, The reproducing the operation of the user for the application according to the test script includes: Run the test script generated by the shortest operation link; When there is a problem with the test script, update the shortest operation link according to the deduplication operation, and update the test script according to the updated operation link; Determine the crash information of the application according to the updated test script.

5. The method according to claim 1, characterized in that, The parsing of the user behavior data to obtain the operation link of the user for the application includes: Extract the key information in the user behavior data, and the key information includes any one or more of the following: user identification, the operating system corresponding to the application, the version information of the application, the crash time of the application, the stack information when the application crashes; Obtain the operation link according to the key information.

6. The method according to claim 1, characterized in that, It also includes: Parse the user behavior data of multiple users to obtain the operation percentages of multiple functions of the multiple users for the application; Determine whether the operation percentage is less than a preset threshold. If so, adjust the release strategy of the application to increase the click-through rate of the multiple users for the multiple functions.

7. A testing device for an application, characterized in that, including: An acquisition module, a parsing module, a generation module, and a test module; wherein, The acquisition module is used to obtain the user behavior data of the application; The parsing module is used to parse the user behavior data to obtain the operation link of the user for the application; The generation module is used to generate a test script corresponding to the application according to the operation link; The test module is used to reproduce the operations of the user on the application according to the test script, determine the crash information of the application, and test the application; The parsing module is further configured to: Determine one or more first operation types corresponding to the user behavior data; Classify the user behavior data according to the one or more first operation types to obtain operation data corresponding to each of the first operation types; Map the operation data to the global test log according to the second operation type included in the preset global test log and the first operation type; Sort the operation data according to the generation time of each piece of operation data to generate the operation link.

8. An electronic device for application testing, characterized in that, Comprising: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-6.

9. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, the method according to any one of claims 1-6 is implemented.

Citation Information

Patent Citations

  • Method and device for reproducing application crash and mobile terminal

    CN107391357A