An application testing method and apparatus
By analyzing the application crash data link structure and automated operations, the problem of non-intuitive crash cause analysis in the existing technology is solved, and the complete backtracking of user operations and the rapid location of crash causes are achieved.
Patent Information
- Application Number
- CN202110319764.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-25
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2041-03-25
AI Technical Summary
Existing technologies cannot intuitively restore all user behaviors before a crash, resulting in inconvenient analysis of the cause of the crash and making it difficult for non-R&D personnel to participate in locating the cause of the crash.
By parsing the link structure of application crash data, obtaining the operation data and attribute data of view components, and using automated operations and overlay layers to display attribute data, complete backtracking and reproduction of user operations before the crash can be achieved.
It can fully trace back the links and behaviors of user operations before the application crash in the form of playback, lowering the operation threshold and helping developers and testers quickly locate the cause of the crash and customize strategies.
Smart Images

Figure CN113760741B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an application testing method and device. Background Art
[0002] With the widespread adoption of smart devices, users who use apps for browsing the web, shopping, socializing, and other activities have become a mainstream demographic. Due to the large user base, these users are more likely to experience crashes, freezes, and other issues during normal app usage, resulting in inoperable apps. Developers must quickly identify, analyze, and address these crashes to ensure a seamless user experience.
[0003] The current crash collection methods mainly include: 1) installing the crash platform component to view; 2) customizing the APP operation log function to record crash information; 3) being discovered by testers or developers during the App development and testing phase and reproducing through the operation process.
[0004] During the implementation of the present invention, the inventors discovered that existing technologies suffer from at least the following issues: The crash cause is not intuitive enough, and can only vaguely parse the path the user accessed the page, or parse to an incorrect stack address, making it impossible to fully recover the user's behavior before the crash. Furthermore, some non-R&D personnel, lacking code knowledge, are unable to participate in locating the crash cause. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide an application testing method and apparatus, which can at least solve the problems in the prior art of the inconvenience of restoring all user behaviors before a crash and the difficulty of using the application.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided an application testing method, comprising:
[0007] The test end parses the link structure of the application crash data, determines the first-ranked node in the link structure, and obtains operation data corresponding to the node; wherein the operation data includes operation parameters for a view component;
[0008] performing automated operations on the one view component based on the operation parameters;
[0009] If the operation result is a crash, it is determined that the operation logic corresponding to the node is abnormal; otherwise, the operation continues with the next node in the link structure until a crash occurs.
[0010] Optionally, the application crash data further includes attribute data of the one view component;
[0011] While performing automated operation on the one view component based on the operation parameters, the method further includes: creating a prompt box for the one view component to display the attribute data in the prompt box.
[0012] Optionally, before the test end parses the link structure of the application crash data, the process includes:
[0013] Determining an application corresponding to the one view component, and creating an overlay layer on a display window of the application;
[0014] The automatically operating the view component based on the operation parameter includes:
[0015] Based on the operation data, displaying an operation area for the application on the layer;
[0016] In the operation area, the one view component is automatically operated based on the operation parameter.
[0017] Optionally, the test end analyzes the link structure of the application crash data, including:
[0018] The test end scans the identification code received from the server end, and based on the information in the identification code, pulls the application crash data from the server end and parses it to obtain a link structure;
[0019] Before the test end analyzes the link structure of the application crash data, the test end further includes:
[0020] The server receives the log file transmitted by the client, parses the log file to obtain application crash data and saves the data, and sets a primary key identifier for the application crash data;
[0021] Based on the primary key identifier, the access address of the server, and the interface information for accessing the server, an identification code is generated and sent to the test end; wherein the test end subscribes to the crash data of the application.
[0022] Optionally, before the server receives the log file transmitted by the client, the method further includes:
[0023] When the client detects that the application exits abnormally, the client stores the global data structure of the application in the form of a log file in the cache of the application;
[0024] In response to a restart operation of the application, it is determined whether a log file exists in the cache; if so, the log file is transmitted to the server.
[0025] Optionally, the method further includes:
[0026] The client receives an operation parameter for a view component in the application, stores the operation parameter in a first model format, and obtains operation data;
[0027] Acquire attribute parameters currently set for the one view component, store the attribute parameters in a second model format, and obtain attribute data;
[0028] The operation data and the attribute data are stored in a global data structure.
[0029] Optionally, storing the operation data and the attribute data in a global data structure includes:
[0030] The attribute data is stored in the operation data, and then the operation data is stored in a global data structure.
[0031] Optionally, the method further includes: initializing a global data structure in response to a startup operation on the application; and
[0032] In response to a background switching operation on the application, storing background switching parameters in the first model form, obtaining background switching operation data and storing the data in a global data structure; and
[0033] In response to a background wakeup operation on the application, storing the wakeup parameters in the first model format, obtaining background wakeup operation data and storing the data in a global data structure; and
[0034] In response to a normal exit operation of the application, the global data structure is cleared.
[0035] Optionally, it also includes: adding an information recording module in each view component of the application to trigger the recording of operation data and attribute data of each view component.
[0036] To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided an application testing device, comprising:
[0037] An acquisition module, configured for the test end to parse the link structure of the application crash data, determine the first-ranked node in the link structure, and obtain operation data corresponding to the node; wherein the operation data includes operation parameters for a view component;
[0038] An operation module, configured to automatically operate the one view component based on an operation parameter;
[0039] The determination module is configured to determine that the operation logic corresponding to the node is abnormal if the operation result is a crash, and otherwise continue to operate the next node in the link structure until a crash occurs.
[0040] Optionally, the application crash data further includes attribute data of the one view component;
[0041] The operation module is further used to create a prompt box for the one view component to display the attribute data in the prompt box.
[0042] Optionally, the system further includes a layer creation module, configured to: determine an application corresponding to the one view component, and create an overlay layer on a display window of the application; and
[0043] Based on the operation data, an operation area for the application is displayed on the layer; within the operation area, an automatic operation is performed on the one view component based on the operation parameters.
[0044] Optionally, the acquisition module is used to:
[0045] The test end scans the identification code received from the server end, and based on the information in the identification code, pulls the application crash data from the server end and parses it to obtain a link structure;
[0046] It also includes the server, including:
[0047] A file transfer module is used to receive a log file transmitted by a client, parse the log file to obtain application crash data and save it, and set a primary key identifier for the application crash data;
[0048] An identification code generation module is used to generate an identification code based on the primary key identifier, the access address of the server, and the interface information for accessing the server, and send the identification code to the test terminal; wherein the test terminal subscribes to the crash data of the application.
[0049] Optionally, a client is also included, including:
[0050] an exception monitoring module, configured to store the global data structure of the application in a log file in a cache of the application when an abnormal exit of the application is detected;
[0051] The transmission startup module is used to determine whether there is a log file in the cache in response to a restart operation of the application, and if so, transmit the log file to the server.
[0052] Optionally, the client further includes a data acquisition module, configured to:
[0053] receiving an operation parameter for a view component in the application, storing the operation parameter in a first model format, and obtaining operation data;
[0054] Acquire attribute parameters currently set for the one view component, store the attribute parameters in a second model format, and obtain attribute data;
[0055] The operation data and the attribute data are stored in a global data structure.
[0056] Optionally, the data acquisition module is used to: store the attribute data into the operation data, and then store the operation data into a global data structure.
[0057] Optionally, the method further includes: initializing a global data structure in response to a startup operation on the application; and
[0058] In response to a background switching operation on the application, storing background switching parameters in the first model form, obtaining background switching operation data and storing the data in a global data structure; and
[0059] In response to a background wakeup operation on the application, storing the wakeup parameters in the first model format, obtaining background wakeup operation data and storing the data in a global data structure; and
[0060] In response to a normal exit operation of the application, the global data structure is cleared.
[0061] Optionally, the client further includes an information recording module, configured to:
[0062] An information recording module is added to each view component of the application to trigger the recording of operation data and attribute data of each view component.
[0063] To achieve the above objective, according to another aspect of an embodiment of the present invention, an application testing electronic device is provided.
[0064] The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned application testing methods.
[0065] To achieve the above object, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, any of the above-mentioned application testing methods is implemented.
[0066] According to the solution provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: it can completely trace back the links and behaviors of user operations before the application crash in the form of playback, helping developers and testers (by scanning identification codes) to reproduce the bug that caused the application crash as soon as possible, so as to locate the cause and customize subsequent strategies as soon as possible.
[0067] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.
[0069] Figure 1 This is a schematic diagram of the main flow of an application testing method for a client according to an embodiment of the present invention;
[0070] Figure 2 This is a schematic diagram of the main process of an application testing method on the server side according to an embodiment of the present invention;
[0071] Figure 3 This is a schematic diagram of the main flow of an application testing method of a test terminal according to an embodiment of the present invention;
[0072] Figure 4 This is a schematic diagram of the link structure of application crash data;
[0073] Figure 5 is a flowchart of a specific application testing method according to an embodiment of the present invention;
[0074] FIG6( a ) is a schematic diagram of main modules of an application testing device at a test end according to an embodiment of the present invention;
[0075] FIG6( b ) is a schematic diagram of main modules of an application testing device at a server side according to an embodiment of the present invention;
[0076] FIG6( c ) is a schematic diagram of main modules of an application testing device for a client according to an embodiment of the present invention;
[0077] Figure 7 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
[0078] Figure 8 It is a schematic diagram of the structure of a computer system of a mobile device or server suitable for implementing the embodiments of the present invention. DETAILED DESCRIPTION
[0079] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may 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, descriptions of well-known functions and structures are omitted in the following description.
[0080] The current mainstream crash collection platforms include bugly, Umeng, Tingyun, etc., all of which use the same technical solution to present and process App crashes.
[0081] 1. When searching for the cause of a crash, upload the dSYM file and parse the error stack trace. The error stack trace here refers to the specific error content that caused the program to fail. This error content is stored in the log file at the system level as a memory address and is incomprehensible. Developers need to parse the log file and decrypt the previously saved error content to restore the error description.
[0082] 2. Customize business log output in business logic and upload local log files after a crash.
[0083] 3. Print the link stack of user operation pages to obtain the user's operation entry and access path. For example, a user opens the app homepage, enters the list page, clicks the link of a product in the list to enter the details page, then adds the product to the shopping cart and pays. The link is: homepage - list page - details page - shopping cart - payment page. Currently, all products on the market use text to describe the user operation process.
[0084] The above methods can often reveal the approximate cause of the application crash, but cannot reveal the user's specific operation method.
[0085] The terms used in this plan are explained as follows:
[0086] 1. Crash: refers to the abnormal freezing and flash back of the App during use.
[0087] 2. UIView, UIButton, UILabel, UIScrollView, UITableView, UICollectionView, etc., all refer to various interactive components needed in the App development process, which can be understood as views, buttons, scroll bars, picture pages, etc.
[0088] 3.dSYM file: refers to the obfuscated file generated when compiling the App, which can be used to parse the error address information thrown during a crash.
[0089] 4. Rewind: A feature currently available on mainstream crash detection platforms. This feature displays the user's action path in text format. Simply put, it's information in the format of "Home -> List -> Details." This helps developers reproduce bugs.
[0090] 5.NPE (null point exception): refers to the common null pointer error.
[0091] 6. Window coordinates: Starting from the upper left corner of the window, draw the x-axis and y-axis to indicate the position of the component in the window; component relative coordinates refer to starting from the upper left corner of the component, drawing the x-axis and y-axis to indicate the position of the component in the component.
[0092] 7. Log: A file used to record the app's running status or user operation process
[0093] 8.urlscheme: The address used within the app. It can be used to locate and call specific pages or functions.
[0094] See also Figure 1 , which shows a main flow chart of an application testing method of a client in an embodiment of the present invention, including the following steps:
[0095] S101: The client receives an operation parameter for a view component in an application, stores the operation parameter in a first model format, and obtains operation data;
[0096] S102: Acquire attribute parameters currently set for the one view component, store the attribute parameters in a second model format, and obtain attribute data;
[0097] S103: storing the operation data and the attribute data into a global data structure;
[0098] S104: When an abnormal exit of the application is detected, the global data structure of the application is stored in the cache of the application in the form of a log file;
[0099] S105: In response to the restart operation of the application, it is determined whether there is a log file in the cache, and if so, the log file is transmitted to the server.
[0100] This solution is applicable to multiple systems, such as iOS, Android, and Web. The implementation methods are similar. The iOS client is mainly used as an example for explanation.
[0101] In the above implementation, for step S101, an information recording module is first added to each commonly used view component involved in the application to trigger the recording of the current user's operation data and attribute data. Among them, view components are the direct objects that users interact with in the APP, such as UIView, UIButton, UILabel, UIScrollView, UITableView, UICollect ionView, etc., so the user's specific behavior can be directly reflected through operation data and attribute data. View components are basically extended from commonly used basic components, and the same functions can be added to new view components when the requirements are clear.
[0102] After a user operates a view component in the App, such as clicking, swiping up, turning the page, long pressing, etc., the corresponding operation parameters will be obtained. Taking click as an example, the following information needs to be recorded:
[0103] 1) Determine the coordinates of the location where the user clicks on the screen (x and y values relative to the screen origin)
[0104] 2) Determine the relative coordinates of the user's click position relative to the view component (x and y values relative to the component's origin)
[0105] 3) Interaction event type: click, slide, long press, etc.
[0106] 4) Interaction trigger interval: the time between the last action and the click.
[0107] 5) Interaction dwell time: the duration from the start to the end of an action such as sliding, long pressing, or clicking
[0108] In order to unify the format of the operation parameters, this solution pre-sets the first model for management. The specific code example of the first model of the interaction event is as follows:
[0109] @property(nonatomic,assign)CGPoint s_pos; / / screen coordinates
[0110] @property(nonatomic,assign)CGPoint c_pos; / / coordinates within the view component
[0111] @property(nonatomic,copy)UIGestureRecognizer*event; / / Event type (click, slide, long press, etc.)
[0112] @property(nonatomic,assign)NSInteger intervals; / / When an interaction event occurs, the instantaneous time from the end of the last action
[0113] @property(nonatomic,assign)NSInteger duration; / / The duration from the start to the end of the interaction event
[0114] @property(nonatomic,copy)BaseInfo*baseInfo; / / Business-related data assigned to the current component
[0115] For step S102, the above property(nonatomic, copy)BaseInfo*baseInfo; / / the business-related data assigned to the current component is the attribute data set for the view component.
[0116] Different users may input different parameters for the same view component. When the parameters do not conform to the format or other requirements of the view component, it may cause the application to crash. Similarly, this solution pre-sets a second model to uniformly save and manage the basic attribute parameters of the view component, such as name (component name defined during development), text, and url (text and image addresses assigned by logic at runtime). The specific code example of the second model of the interaction event is as follows:
[0117] @interface BaseInfo:NSObject
[0118] @property(nonatomic,copy)NSString*name; / / view component name
[0119] @property(nonatomic,copy)NSString*text; / / The value stored in the view component text (such as the text displayed by UILabel)
[0120] @property(nonatomic,copy)NSString*pic; / / The image address saved by the view component (such as the image address displayed by UIImageView)
[0121] For step S103, a global data structure within the scope of the App is pre-defined (a bidirectional linked list structure for easy backtracking playback), and encapsulated storage logic is added to the interactive event. When the user interacts with the view, the relevant information is saved in the global custom data structure.
[0122] An example of a global custom data structure within a specific app scope is as follows:
[0123] @interface LNode:NSObject
[0124] @property(nonatomic,copy)EventInfo*eventInfo; / / interaction data
[0125] @property(nonatomic)LNode*prev; / / previous node pointer
[0126] @property(nonatomic)LNode*next; / / next node pointer
[0127] -(instancetype)initWith:(NSObject*)obj prev:(LNode*)prev next:(LNode*)next;
[0128] @end
[0129] @interface List:NSObject
[0130] @property(nonatomic)int size; / / Number of nodes
[0131] @property(nonatomic)LNode*head; / / head pointer
[0132] @property(nonatomic)LNode*tail; / / tail pointer
[0133] -(BOOL)isEmpty; / / Judge whether the linked list is empty
[0134] -(void)pushFront:(NSObject*)obj; / / Insert data into the header
[0135] -(void)pushBack:(NSObject*)obj; / / Insert data at the end of the table
[0136] -(NSObject*)popFront; / / Delete data from the header
[0137] -(NSObject*)popBack; / / Delete data from the end of the table
[0138] -(void)traverse; / / Traverse the linked list
[0139] @end
[0140] After obtaining the user's operation data and attribute data for a view component in the application through the above two steps, these two data are stored in the global data structure. In practice, the attribute data can also be stored in the operation data first, and then the operation data is stored in the global data structure, such as @property(nonatomic, copy)BaseInfo*baseInfo in step S101.
[0141] For steps S104 and S105, the user will perform different processing on the App's operations at different stages, including launching the App, normal operation, switching to the background, waking up from the background, normal exit, and abnormal exit:
[0142] 1) When a user launches an App for the first time, the App's global data structure will be initialized.
[0143] 2) When a user normally operates an app, the user's operation data and attribute data for a view component within the app are stored in a global data structure. It should be noted that each storage only applies to the user's current operation on a view component. When the user operates the next view component, the above steps need to be repeated to determine the order of operation on the view components.
[0144] 3) When the user closes the App and switches it to the background, the background switching parameters are stored in the first model form to obtain background switching operation data. There is no attribute data here, so only the background switching operation data is stored in the global data structure.
[0145] 4) The user wakes up the App from the background, and the wake-up parameters are stored in the first model format to obtain the background wake-up operation data. Again, there is no attribute data here, and only the background wake-up data is stored in the global data structure. Subsequent operations are the same as step S102.
[0146] 5) The user exits the app normally and clears its global data structure.
[0147] 6) If the user exits the app abnormally, add a crash interception function to AppDelegate.m in conjunction with RunLoop. This does not clear the global data structure, but instead stores it in the app's log file in JSON format. In practice, mobile devices and other clients will automatically monitor for abnormal app exits and set up different caches for different apps to store log files.
[0148] When the user starts the App again, it will first determine whether there is a log file in the App's cache. If so, it means that an exception occurred in the App's last operation. The server's upload interface will be called to upload the log file to the server and clear the log file in the cache.
[0149] It should be noted that although the existing technology also uploads log files to the server when the App is started again, the content saved is different from that of this solution. The existing technology saves the error stack address information, while this solution saves information describing all user operation processes.
[0150] The method provided in the above embodiment saves the specific information of the view components in the user operation application by imitating the global data structure of the bidirectional linked list type. If the application crashes, it can be automatically uploaded to the server and stored in the database.
[0151] See also Figure 2 , shows a schematic diagram of the main process of an application testing method of the server according to an embodiment of the present invention, including the following steps:
[0152] S201: The server receives a log file transmitted by the client, parses the log file to obtain application crash data, saves the data, and sets a primary key identifier for the application crash data;
[0153] S202: Based on the primary key identifier, the access address of the server, and the interface information for accessing the server, an identification code is generated and sent to the test end; wherein the test end subscribes to the crash data of the application.
[0154] In the above implementation, for steps S201 and S202, the server receives and parses the log file uploaded by the client to obtain application crash data. The server first saves the application crash data to the database and generates a unique primary key ID for it, which serves as an index. The primary key ID here can be generated by adding 1 to the current maximum primary key ID. For example, if the current maximum primary key ID is 5, the primary key ID generated for the application crash data is 6.
[0155] The server-side display platform generates an identification code, including but not limited to a barcode or QR code, using the primary key ID + platform IP address + URL scheme or interface name. The identification code is then sent to the test client subscribed to the app service so that relevant personnel at the test client can view app crash information.
[0156] The method provided in the above embodiment stores the client's application crash data in the server's database to reduce the client's data storage pressure, and also facilitates the server to centrally collect application crash data from each client, providing a data basis for the test end to trace the crash.
[0157] See also Figure 3 , shows a schematic diagram of the main process of an application testing method of a test terminal according to an embodiment of the present invention, including the following steps:
[0158] S301: The test end parses the link structure of the application crash data, determines the first-ranked node in the link structure, and obtains operation data corresponding to the node; wherein the operation data includes operation parameters for a view component;
[0159] S302: performing an automated operation on the view component based on the operation parameters;
[0160] S303: If the operation result is a crash, determining that the operation logic corresponding to the node is abnormal;
[0161] S304: Otherwise, continue to operate the next node in the link structure until a crash occurs.
[0162] In the above implementation, for step S301, the test end encapsulates the logic, opens the application, scans the identification code, and pops up a prompt box to display information about whether to continue. In response to the user's selection of the continue operation, the subsequent crash reproduction operation continues. First, based on the "primary key ID + platform IP address + URL scheme or interface name" contained in the identification code, the server-side interface is called to pull the application crash data corresponding to the primary key ID from the server-side database.
[0163] For steps S302 to S304, first, a transparent non-interactive layer is covered on the top layer of the App window, and only basic interactive buttons are provided (such as pause, play, previous step: read the record of the pre node, next step: read the record of the next node).
[0164] Parse the application crash data to obtain its link structure, see Figure 4 As shown. Traverse the next node of the link structure and parse each interaction record:
[0165] a. Interaction information (clicks, swipes, long presses, etc.) recorded before the crash is displayed as a specially colored / marked action area in a transparent layer. The shapes of the action area include but are not limited to rectangles and circles. If a component that supports jumps is clicked, the jump logic of the regular app components below the transparent layer will be directly called.
[0166] b. If there is sliding information recorded before the crash, the scroll event of the sliding component below the current transparent layer is directly called to simulate the user's sliding operation.
[0167] c. If there is a dwell time in the recording, the simulated interface will stay there until the time is up and then trigger the user's next operation to continue playing.
[0168] d. The transparent layer is located next to the interactive area and displays the recorded attribute data in real time in the form of a prompt box, and provides a switch to turn it off.
[0169] The content described in the CD above is displayed in the same way as the user's actual operation, but is played back through internal logic. If the current node operation crashes, it indicates that the operation logic is abnormal. Otherwise, it will continue to the next node in the link structure until all nodes in the link structure are parsed and a crash occurs.
[0170] The method provided in the above embodiment reproduces the user's interaction process logic before the application crashes through a floating view on the test side, lowering the operation threshold. Roles who do not understand technology in the product project can also participate to locate the cause, assess risks, determine losses and customize subsequent strategies as soon as possible.
[0171] See also Figure 5 As shown in the figure, it includes the entire process from collecting data when users operate the app, to automatically uploading it to the server and storing it in the database when a crash occurs, and finally, the R&D personnel test the app, scan the identification code automatically generated by the collection platform, and fully reproduce the user's operation process. This solution includes three ends: client, server, and test end:
[0172] 1. The client adds an information logging module to each view component in the application. Based on the first and second models, it records the user's operation data and attribute data for each view component. When the user exits the application abnormally, the global data structure storing these two data is uploaded to the server in the form of a log file.
[0173] 2. The server parses the log file uploaded by the client, obtains the application crash data, creates a primary key ID for it, and then accesses the server interface name based on the primary key ID and the server's access address, generates an identification code, and transmits it to the test client that subscribes to the application;
[0174] 3. On the test side, open the app and scan the identification code to pull the app crash data from the server and determine the link structure it contains. A transparent, inoperable layer will appear at the top of the app window. On this layer, operate on the operation data of the first node in the link structure. If a crash occurs, it indicates that the operation logic corresponding to that node is incorrect. Otherwise, continue to the next node until a crash occurs.
[0175] The method provided by this embodiment of the present invention can fully replay the user's actions and links before the application crash, helping developers and testers (by scanning identification codes) quickly reproduce the bug that caused the application crash, thereby quickly locating the cause and customizing subsequent strategies. The entire method relies on log files uploaded by the client, so when a customer complaint is filed, the steps can be reproduced without the need for a follow-up consultation call.
[0176] In addition, the logic of the user interaction process can be expanded into an interactive hotspot function through the view pop-up layer to help product operators analyze user habits, customize product improvement plans, and even replace the tracking function.
[0177] 6( a ) shows a schematic diagram of the main modules of a test terminal application testing device provided by an embodiment of the present invention, including:
[0178] Acquisition module 601 is used for the test end to parse the link structure of application crash data, determine the first-ranked node in the link structure, and obtain operation data corresponding to the node; wherein the operation data includes operation parameters for a view component;
[0179] An operation module 602 is configured to automatically operate the one view component based on an operation parameter;
[0180] The determination module 603 is configured to determine that the operation logic corresponding to the node is abnormal if the operation result is a crash, and otherwise continue to operate the next node in the link structure until a crash occurs.
[0181] In the implementation device of the present invention, the application crash data further includes attribute data of the one view component;
[0182] The operation module 602 is further configured to create a prompt box for the one view component, so as to display the attribute data in the prompt box.
[0183] The implementation device of the present invention includes a layer creation module, which is used to: determine an application corresponding to the one view component, and create an overlay layer on the display window of the application; and
[0184] Based on the operation data, an operation area for the application is displayed on the layer; within the operation area, an automatic operation is performed on the one view component based on the operation parameters.
[0185] In the implementation device of the present invention, the acquisition module 601 is used to:
[0186] The test end scans the identification code received from the server end, and based on the information in the identification code, pulls the application crash data from the server end and parses it to obtain a link structure.
[0187] 6( b ), which shows a schematic diagram of the main modules of a server application testing device provided by an embodiment of the present invention, including:
[0188] The server includes:
[0189] The file transmission module 604 is used to receive the log file transmitted by the client, parse the log file to obtain the application crash data and save it, and set a primary key identifier for the application crash data;
[0190] The identification code generation module 605 is used to generate an identification code based on the primary key identifier, the access address of the server, and the interface information for accessing the server, and send the identification code to the test end; wherein the test end subscribes to the crash data of the application.
[0191] 6( c ) shows a schematic diagram of the main modules of a client application testing device provided by an embodiment of the present invention, including:
[0192] The exception monitoring module 606 is configured to store the global data structure of the application in the form of a log file in the cache of the application when detecting an abnormal exit of the application;
[0193] The transmission start module 607 is configured to, in response to a restart operation on the application, determine whether a log file exists in the cache, and if so, transmit the log file to the server.
[0194] The device according to the present invention further includes a data acquisition module 608 (not shown in the figure) for:
[0195] receiving an operation parameter for a view component in the application, storing the operation parameter in a first model format, and obtaining operation data;
[0196] Acquire attribute parameters currently set for the one view component, store the attribute parameters in a second model format, and obtain attribute data;
[0197] The operation data and the attribute data are stored in a global data structure.
[0198] In the implementation device of the present invention, the data acquisition module is used to: store the attribute data into the operation data, and then store the operation data into a global data structure.
[0199] The implementation device of the present invention further includes: initializing the global data structure in response to the startup operation of the application; and
[0200] In response to a background switching operation on the application, storing background switching parameters in the first model form, obtaining background switching operation data and storing the data in a global data structure; and
[0201] In response to a background wakeup operation on the application, storing the wakeup parameters in the first model format, obtaining background wakeup operation data and storing the data in a global data structure; and
[0202] In response to a normal exit operation of the application, the global data structure is cleared.
[0203] The implementation device of the present invention also includes an information recording module for:
[0204] An information recording module is added to each view component of the application to trigger the recording of operation data and attribute data of each view component.
[0205] In addition, the specific implementation content of the device in the embodiment of the present invention has been described in detail in the above method, so the repeated content will not be described again here.
[0206] Figure 7 An exemplary system architecture 700 is shown in which embodiments of the present invention may be applied.
[0207] like Figure 7 As shown, system architecture 700 may include test end devices 701, 702, and 703, a network 704, and a server 705 (for example only). Network 704 is used to provide a medium for communication links between test end devices 701, 702, and 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0208] The user can use the test end devices 701, 702, 703 to interact with the server 705 via the network 704 to receive or send messages, etc. Various communication client applications can be installed on the test end devices 701, 702, 703.
[0209] The test end devices 701 , 702 , and 703 may be various electronic devices having display screens and supporting web browsing, and the server 705 may be a server that provides various services.
[0210] It should be noted that the method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the device is generally set in the server 705 .
[0211] It should be understood that Figure 7 The number of test end devices, networks, and servers in the embodiment is merely illustrative. Any number of test end devices, networks, and servers may be provided as required.
[0212] Reference below Figure 8 , which shows a schematic structural diagram of a computer system 800 suitable for implementing a test terminal device according to an embodiment of the present invention. Figure 8 The test end device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0213] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the system 800 are also stored in the RAM 803. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0214] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, and the like; an output section 807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 808 including a hard disk; and a communication section 809 including a network interface card such as a LAN card or a modem. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 810 as needed, so that computer programs read therefrom can be installed into the storage section 808 as needed.
[0215] 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 comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from a removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are performed.
[0216] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A 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 thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0217] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a 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 box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0218] The modules described in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be provided within a processor. For example, a processor may be described as comprising an acquisition module, an operation module, and a determination module. The names of these modules do not, in some cases, limit the modules themselves. For example, an operation module may also be described as an "automatic operation module."
[0219] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiments, or may exist independently without being incorporated into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device includes:
[0220] The test end parses the link structure of the application crash data, determines the first-ranked node in the link structure, and obtains operation data corresponding to the node; wherein the operation data includes operation parameters for a view component;
[0221] performing automated operations on the one view component based on the operation parameters;
[0222] If the operation result is a crash, it is determined that the operation logic corresponding to the node is abnormal; otherwise, the operation continues with the next node in the link structure until a crash occurs.
[0223] According to the technical solution of the embodiment of the present invention, the links and behaviors of user operations before the application crash can be fully traced in the form of playback, helping developers and testers (by scanning identification codes) to reproduce the bug that caused the application crash as soon as possible, so as to locate the cause and customize subsequent strategies as soon as possible.
[0224] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. An application testing method, characterized in that: include: The test end determines an application corresponding to a view component and creates an overlay layer on a display window of the application; The link structure for parsing application crash data includes: the test end scanning an identification code received from a server end, and based on information in the identification code, pulling application crash data from the server end and parsing it to obtain a link structure; wherein the server end receives a log file transmitted by a client end, parses the log file to obtain application crash data and saves it, and sets a primary key identifier for the application crash data; based on the primary key identifier, the access address of the server end, and interface information for accessing the server end, generates an identification code and sends it to the test end; the test end subscribes to the application crash data; Determine the first-ranked node in the link structure, and obtain operation data corresponding to the node; wherein the operation data includes an operation parameter for a view component; The method includes: automatically operating the one view component based on the operation parameters, including: displaying an operation area for the application on the layer based on the operation data; and automatically operating the one view component within the operation area based on the operation parameters; If the operation result is a crash, it is determined that the operation logic corresponding to the node is abnormal; otherwise, the operation continues with the next node in the link structure until a crash occurs.
2. The method according to claim 1, characterized in that The application crash data also includes attribute data of the one view component; While performing automated operation on the one view component based on the operation parameters, the method further includes: creating a prompt box for the one view component to display the attribute data in the prompt box.
3. The method according to claim 1, characterized in that Before the server receives the log file transmitted by the client, the method further includes: When the client detects that the application exits abnormally, the client stores the global data structure of the application in the form of a log file in the cache of the application; In response to a restart operation of the application, it is determined whether a log file exists in the cache; if so, the log file is transmitted to the server.
4. The method according to claim 3, characterized in that The method further comprises: The client receives an operation parameter for a view component in the application, stores the operation parameter in a first model format, and obtains operation data; Acquire attribute parameters currently set for the one view component, store the attribute parameters in a second model format, and obtain attribute data; The operation data and the attribute data are stored in a global data structure.
5. The method according to claim 4, characterized in that Storing the operation data and the attribute data in a global data structure includes: The attribute data is stored in the operation data, and then the operation data is stored in a global data structure.
6. The method according to claim 4 or 5, characterized in that Also includes: In response to a startup operation on the application, initializing a global data structure; as well as In response to a background switching operation on the application, storing background switching parameters in the first model form, obtaining background switching operation data and storing the data in a global data structure; and In response to a background wakeup operation on the application, storing the wakeup parameters in the first model format, obtaining background wakeup operation data and storing the data in a global data structure; and In response to a normal exit operation of the application, the global data structure is cleared.
7. The method according to claim 4 or 5, characterized in that Also includes: An information recording module is added to each view component of the application to trigger the recording of operation data and attribute data of each view component.
8. An application testing device, characterized in that: include: An acquisition module is used for the test end to determine an application corresponding to a view component and create an overlay layer on the display window of the application; The link structure for parsing application crash data includes: the test end scanning an identification code received from a server end, and based on information in the identification code, pulling application crash data from the server end and parsing it to obtain a link structure; wherein the server end receives a log file transmitted by a client end, parses the log file to obtain application crash data and saves it, and sets a primary key identifier for the application crash data; based on the primary key identifier, the access address of the server end, and interface information for accessing the server end, generates an identification code and sends it to the test end; the test end subscribes to the application crash data; Determine the first-ranked node in the link structure, and obtain operation data corresponding to the node; wherein the operation data includes an operation parameter for a view component; An operation module, configured to automatically operate the one view component based on the operation parameters, including: displaying an operation area for the application on the layer based on the operation data; and automatically operating the one view component within the operation area based on the operation parameters; The determination module is configured to determine that the operation logic corresponding to the node is abnormal if the operation result is a crash, and otherwise continue to operate the next node in the link structure until a crash occurs.
9. An electronic device, characterized in that: include: 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 to 7.
10. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for reproducing application crash and mobile terminal
CN107391357A