Information acquisition method, information generation method, electronic equipment and computer program product
By listening to the actions executed by the application and generating action information described in natural language, the problem of difficult to reproduce and simulate the operation process of business functions in the prior art is solved, and efficient abnormal repair and business stability guarantee is achieved.
Patent Information
- Application Number
- CN202510293082.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-27
AI Technical Summary
The prior art is difficult to accurately and efficiently reproduce and simulate the operation process of business functions through information collection, which makes it difficult to timely discover the causes of operation abnormalities and affect the normal operation of the business.
An application information acquisition method is proposed. By listening to the actions executed by the application, the action information described in natural language is generated, and the information is recorded and uploaded in the actual trigger order, so as to build a test case reproduction operation process.
It realizes an intuitive reflection of the application running process, simplifies the construction of test scenarios, improves the efficiency of exception repair, and reduces development and operation and maintenance costs.
Smart Images

Figure CN120216368A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical fields such as information collection, and specifically relates to a method for obtaining information of an application program, a method for generating a test case, an electronic device, and a computer program product. Background Art
[0002] In order to avoid anomalies during the operation of business functions, the service provider can reproduce and simulate the process of using the business functions by testing the business functions, so as to timely discover the possible causes of anomalies.
[0003] The testing of business functions can be achieved through the constructed test scenarios, and the construction of test scenarios can be achieved through the operation data formed during the operation of the business functions collected. However, the information collected by the current information collection method cannot intuitively reflect the operation process of the business functions. Therefore, it is impossible to accurately and efficiently reproduce and simulate the operation process of the business functions through test scenarios, resulting in difficulty in timely discovering the possible causes of operation anomalies and being unfavorable to the normal operation of the business. Summary of the Invention
[0004] The present disclosure provides a method for obtaining information of an application program, a method for generating a test case, an electronic device, a readable storage medium, and a computer program product.
[0005] A first aspect of the present disclosure proposes a method for obtaining information of an application program, including: in response to monitoring that the application program executes a specified action, obtaining action information formed by the application program, where the action information can describe the action type corresponding to the specified action through natural language; recording the action information according to the actual triggering order of the specified action; and in response to meeting the upload condition, uploading the recorded action information.
[0006] According to some embodiments of the present disclosure, the method further includes: in response to receiving a specified operation instruction, starting to monitor the actions executed by the application program.
[0007] According to some embodiments of the present disclosure, the specified operation instruction is used to first trigger the application program to enter a specified page.
[0008] According to some embodiments of the present disclosure, monitoring the actions executed by the application program specifically means: monitoring the actions executed on each page of multiple pages of the application program.
[0009] According to some embodiments of the present disclosure, in response to monitoring that the application program executes a specified action, obtaining action information formed by the application program includes: in response to monitoring that the application program executes a specified action, obtaining the monitoring information generated by the application program; and generating action information through the monitoring information.
[0010] According to some embodiments of the present disclosure, generating action information from the monitoring information includes: extracting an information item for describing the action type of the specified action from the monitoring information, and determining the action information based on the extracted information item and a pre-stored information item-action information mapping relationship.
[0011] According to some embodiments of the present disclosure, when recording the action information in the actual triggering order of the specified action, one or more of the page identifier of the page that triggers the specified action and the control information of the control that executes the specified action are also recorded.
[0012] According to some embodiments of the present disclosure, recording the action information in the actual triggering order of the specified action specifically means: recording the action information belonging to the same account ID in the actual triggering order of the specified action.
[0013] According to some embodiments of the present disclosure, the actual triggering order is obtained by one or more of the time stamp of the specified action and the page identifier of the page that triggers the specified action.
[0014] According to some embodiments of the present disclosure, the action information recorded in the actual triggering order of the specified action is recorded in the device running the application program.
[0015] According to some embodiments of the present disclosure, the method further includes: in response to meeting a stop condition, stopping recording the action information, where the stop condition includes one or more of the process of the application program being ended, the application program logging out, and the application program crashing.
[0016] According to some embodiments of the present disclosure, the upload condition includes one or more of reaching a specified time period, receiving an upload instruction, and the application program crashing.
[0017] According to some embodiments of the present disclosure, the code for implementing the information acquisition method is integrated in a software development kit, and the application program implements the information acquisition method by calling the software development kit.
[0018] A second aspect of the present disclosure provides a method for generating test cases, including: obtaining action information according to the information acquisition method of the application program according to any of the above embodiments; and generating test cases based on the action information.
[0019] A third aspect of the present disclosure provides an electronic device, including: a memory storing execution instructions; and a processor that executes the execution instructions stored in the memory, such that the processor executes the method according to any of the above embodiments.
[0020] A fourth aspect of the present disclosure provides a readable storage medium storing a computer program, which, when executed by a processor, is used to implement the method according to any of the above embodiments.
[0021] A fifth aspect of the present disclosure provides a computer program product including a computer program, which, when executed by a processor, is used to implement the method according to any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings illustrate exemplary embodiments of the present disclosure and, together with the description, are used to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are part of this specification.
[0023] Figure 1 FIG. shows an application scenario diagram of a method for obtaining information of an application program according to some embodiments of the present disclosure.
[0024] Figures 2 - 8 FIG. shows an overall flowchart of a method M100 for obtaining information of an application program according to some embodiments of the present disclosure.
[0025] Figure 9 FIG. shows an overall flowchart of a method M200 for generating test cases according to some embodiments of the present disclosure.
[0026] Figure 10 FIG. is a schematic block diagram of a structure of an apparatus for obtaining information of an application program according to an embodiment of the present disclosure.
[0027] Figure 11 FIG. is a schematic block diagram of a structure of an apparatus for generating test cases according to an embodiment of the present disclosure.
[0028] Figure 12 FIG. is a schematic block diagram of a structure of an electronic device 1000 according to an embodiment of the present disclosure.
[0029] Figure 13 FIG. is a schematic block diagram of a structure of an electronic device 2000 according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0030] The present disclosure will be further described in detail below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the relevant content and do not limit the present disclosure. Additionally, it should be noted that for the convenience of description, only the parts related to the present disclosure are shown in the drawings.
[0031] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The technical solutions of the present disclosure will be described in detail below with reference to the drawings and embodiments.
[0032] Unless otherwise specified, the exemplary embodiments / examples shown will be understood to provide exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, without departing from the technical concept of the present disclosure, the features of various embodiments / examples can be additionally combined, separated, interchanged, and / or rearranged.
[0033] The terms used herein are for the purpose of describing specific embodiments and are not restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are also intended to include the plural forms. In addition, when the terms "comprise" and / or "include" and their variants are used in this specification, it is stated that there are the stated features, wholes, steps, operations, components, assemblies, and / or groups thereof, but it does not exclude the presence or addition of one or more other features, wholes, steps, operations, components, assemblies, and / or groups thereof. It should also be noted that, as used herein, the terms "substantially", "about", and other similar terms are used as approximate terms rather than degree terms, and thus they are used to explain the inherent deviations of measured values, calculated values, and / or provided values that would be recognized by those of ordinary skill in the art.
[0034] When an enterprise newly develops a business function and deploys it to the online environment for users to use, some abnormal situations may occur during the operation of the business function, such as errors occurring during operation. These situations may be caused by user operations or may be due to problems in the operation logic of the business itself.
[0035] In order to prevent abnormal operation of the business function when users use the APP (application), the operation and maintenance personnel or developers can construct the running scenario of the APP to conduct simulation running tests on the APP, so that when abnormal operation is found through the test, the logic or function of the APP can be corrected to ensure that the APP will not have abnormal situations again under the same operations. Because the information collected during the operation of the APP can actually reflect the actual usage mode of the business function, The constructed test scenario can be built based on the actual operation mode of the information collected during the operation of the APP, or it can be the graphic and text information submitted by the user on the feedback page describing the operation exception. However, the collected information and the feedback graphic and text information cannot intuitively describe the operation process. Especially in an overall operation process with exceptions, when the operation and maintenance personnel face the operation data of the operation process with exceptions, they cannot directly understand the meaning and need to perform operations such as data conversion to understand the meaning of the operation data. For example, the collected information (operation data) is some stack information. And the above graphic and text information cannot accurately describe the cause of the exception. Therefore, the collected information and the feedback graphic and text information are actually not specific enough, which will lead to a large number of attempts to reproduce the operation exception of the APP, resulting in unnecessary increases in development costs and time costs, and it is difficult to meet the demand for the timeliness of exception repair.
[0036] For this reason, the present disclosure proposes a method for obtaining information of an application program.
[0037] Figure 1 The schematic diagram of the application scenario for obtaining information of an application program according to some embodiments of the present disclosure is shown. In this application scenario, it may include a client 10 and a server 20.
[0038] The client 10 can communicate with the server 20 to perform data sending and receiving or instruction sending and receiving. In the present disclosure, both the client 10 and the server 20 respectively include at least one processor and at least one memory.
[0039] Exemplarily, the client 10 can be a terminal device held by a user, and the server 20 can include a server of an online product operator. The client 10 can collect operation data of the application program running locally, so as to obtain the operation data of the application program. The server 20 is used to receive the operation data uploaded by the client 10, and the background developers or operation and maintenance personnel of the application program can download the operation data for analyzing the exceptions occurring in the application program and constructing corresponding test cases to reproduce and test the operation process of the application program.
[0040] In Figure 1 the shapes and structures of the client 10 and the server 20 shown should not be construed as limiting the protection scope of the present disclosure. In the present disclosure, the "terminal device" can be different types of electronic devices. For example, the terminal device can be a mobile phone, a tablet computer, a laptop computer, or a desktop computer, etc. In addition, the server can be a server with a physical form or a cloud server, and the present disclosure does not limit the type of the server.
[0041] Figure 2The overall flowchart of the information acquisition method M100 of the application program according to some embodiments of the present disclosure is shown. As Figure 2 The method shown includes step S110, step S120, and step S130. Among them, the method can be executed by the client, and the client can be an electronic device such as a mobile phone or a computer.
[0042] S110, in response to monitoring that the application program executes a specified action, obtain the action information formed by the application program. Among them, the action information can describe the action type corresponding to the specified action through natural language.
[0043] Monitoring is used to detect and respond to changes in certain events or states through a pre-set specific mechanism, so as to determine what action the application program has executed. The specified action, as the action to be monitored, can include only a part of all the actions that the application program can execute, or can include all the actions that the application program can execute.
[0044] The monitoring party for monitoring the application program can monitor data of types such as user interaction, system messages, network status, location changes, and sensor data. Developers can register listeners for components of the application program, and the listeners can be used to capture corresponding events and execute predefined code logic. Lifecycle monitoring is used to monitor changes in the lifecycle state of the application program, so as to be able to timely determine that the state of the application program has changed among states such as startup, pause, and destruction. Sensor monitoring is used to monitor changes in data of sensors built in the device, so as to implement functions such as automatic brightness adjustment.
[0045] The monitoring party for monitoring the application program can be the application program itself, or an independent monitoring program or monitoring module configured by the client. The monitored action information can be text or other forms of media that briefly describe the action type executed by the application program in the system language of the client through human natural language. Compared with machine language, natural language can be understood by developers without translation and conversion. Compared with some action information fed back by the monitoring party that requires code conversion or specific processing to interpret the specific information meaning and is in disordered order, it enables developers or operation and maintenance personnel to intuitively understand what action each piece of action information represents for the application program. The action information can be in text format or other data formats that can be opened by a text editor, so that developers or operation and maintenance personnel can conveniently and quickly open the file recording the action information.
[0046] The action type can be the action content when the user is the execution subject for action description, or it can be the action type that controls the application to perform actions with the script or pre-configured running logic as the execution subject. For example, when the user needs to find pictures containing a specific pattern among a series of pictures, the user uses a self-made script to automatically control the application to perform operations such as page flipping, image recognition, and downloading pictures containing the specific pattern.
[0047] The action type is pre-configured. For example, the action type can include various actions that can be executed and operated by the user and the script, such as "jump to the login page", "enter the account number", "enter the password", "login", etc. The specified action can include multiple different actions. For example, it can include the action of clicking the jump button b1 on page p1, and the jump button b1 is used to jump to the login page. When the action of clicking the login button b1 is monitored, the application can generate action information containing the text "jump to login" by calling the corresponding callback method to indicate that the application has performed the action of jumping to login. Among them, "jump to login" is the action described in natural language.
[0048] S120, record the action information according to the actual trigger order of the specified action.
[0049] When it is monitored that the application performs the specified action, the trigger time when the specified action starts to be executed can be obtained. The actual trigger order can be the order obtained after sorting by the trigger time. Whenever an action information is obtained, the action information is added to the recorded action information according to the trigger time, so that the recorded action information is recorded in order according to the actual trigger order.
[0050] Exemplarily, if the execution subject (abbreviation: execution subject) of the application clicks the jump button b1 on page p1 at time t1, and then enters text in the account input box k1 on the login page p2 at time t2 later than t1, after the corresponding action information of these two specified actions is generated by the application, the file for recording the action information will contain two action information m1 and m2. The recording position of m1 is before m2 and adjacent to m2. m1 includes "jump to login", and m2 includes "enter the account number". Usually, the generation of the action information of a specified action is faster than the execution of the next specified action. Therefore, as the execution subject continues to operate the application, the action information corresponding to the specified action will also be generated one by one and recorded at the end of the file, that is, the latest generated action information usually corresponds to the specified action that is the latest in the actual trigger order.
[0051] If the same specified action corresponds to multiple action types, multiple action information can be generated accordingly. At this time, these action information can be recorded sequentially according to the specified level of the action type. For example, the execution subject clicks the button b3 on the page p3 at time t3, and b3 is used to trigger two specified actions: downloading a file and displaying a download progress interface simultaneously. Then the application generates two action information m3 and m4, including the texts "file download" and "download progress display" in sequence. If the specified level of downloading the file is higher than that of displaying the download progress, in the file recording the action information, the position of the action information m3 is before m4.
[0052] S130, in response to meeting the upload condition, upload the recorded action information.
[0053] The upload condition is used to enable the client to determine whether it is necessary to upload all the currently recorded action information. When the upload condition is met, the client can upload the file recording the action information. The upload address can be the server. After receiving the action information, the server can analyze the action information. For example, it can use the action information to understand the operation steps of the execution subject, and then conduct tests and anomaly repairs by building a test process with the same operation steps.
[0054] The information acquisition method of the application program proposed according to the embodiments of the present disclosure can monitor the action execution process of the program in real time and collect process information when the application program is running online. The collected information is mainly based on the action type, recorded in the order of action execution, and can be displayed in text form, with strong readability, which can intuitively reflect the operation process of the business function, facilitating the service provider to quickly and conveniently understand the execution process of the application program and reducing the communication cost of the service provider. When an anomaly occurs in the application program, if it is an application program operated by the user, the operation steps of the user before and during the anomaly can be known without the user having to describe the operation process in detail; if it is an application program operated by a script, the execution steps of the program before and during the anomaly can also be known. This can facilitate testers to accurately and efficiently construct a test scenario, reproduce the program execution steps through the test scenario, and then quickly determine the cause of the anomaly, reducing the time cost for the service provider to repair the anomaly.
[0055] Figure 3 Shows the overall flowchart of the information acquisition method M100 of the application program according to some embodiments of the present disclosure. Refer to Figure 3 , the information acquisition method M100 may further include step S101. Step S101 can be executed before step S110.
[0056] S101, in response to receiving a specified operation instruction, start listening to the actions executed by the application program.
[0057] The above-specified operation instruction is an operation command issued by the client to the application, used to trigger the monitoring of the application. Exemplarily, the above-specified operation instruction is used to trigger the application to enter a specified page for the first time. That is to say, when the application is opened and enters the specified page for the first time, the monitor starts to monitor the actions of the application. The above-specified page can be the home page or other pages. For example, when the application is opened, it will default to enter the home page, then the monitoring starts when the application is opened, that is, the monitoring of the application starts from the moment the application is opened, so that more comprehensive information content can be collected.
[0058] After starting the monitoring, the application can be continuously monitored until the conditions for triggering the stop of monitoring are met, such as the application being closed. The above-specified operation instruction may be issued to the application multiple times during a single use of the application, but the monitoring of the application may start only when the operation instruction is received for the first time. When the operation instruction is received again later, since the monitoring process is ongoing, the monitoring of the application will not be triggered again.
[0059] It can be understood that during the development of the application, the methods of the actions that need to be monitored can be pre-registered in the application, such as registering the monitoring of some methods in the pages or views of the application.
[0060] Registering monitoring can include creating a monitor, specifying the type of action (event) to be monitored, and associating the monitor with the event source. When the monitored action is triggered, the response can be made by calling the callback method in the monitor, and the callback method is customized by the developer. In different development environments, monitoring can be implemented through different components or mechanisms. For example, in the iOS environment, monitoring can be implemented through Notification.
[0061] Figure 4 The overall flowchart of the information acquisition method M100 of the application in some embodiments of the present disclosure is shown. Refer to Figure 4 In step S101, the specific way to monitor the actions performed by the application can be: monitoring the actions performed by each page among multiple pages of the application.
[0062] An application usually has multiple pages, and the business functions provided by different pages are different. The same specified action may be able to be triggered and executed on multiple different pages. For example, jump buttons b1 for jumping to the home page are set on multiple non-home pages. Therefore, the specified action of clicking the jump button b1 can be triggered on multiple different pages. In order to globally monitor the specified action, it is possible to monitor multiple pages or even all pages of the application, so that as long as any page executes the specified action, it can be monitored, and at the same time, it is also possible to know which page executed the specified action.
[0063] Figure 5 FIG. shows a schematic overall flow diagram of an information acquisition method M100 of an application according to some embodiments of the present disclosure. Refer to Figure 5 In step S110, in response to monitoring that the application executes a specified action, action information formed by the application is obtained, which may specifically include the following steps S111 and S112.
[0064] S111, in response to monitoring that the application executes a specified action, monitoring information generated by the application is obtained.
[0065] S112, action information is generated through the monitoring information.
[0066] In response to the triggering of a monitoring event, the application may first generate relatively complex monitoring information, and then generate relatively concise action information through the monitoring information. The monitoring information may include multiple information items, and the fields corresponding to different information items are different, such as event type, business name, account identifier, page identifier, device identifier, trigger time, network operator identifier, system version, and so on. Some algorithm rules can be used to process the monitoring information to filter out the information that needs to be recorded.
[0067] Figure 6 FIG. shows a schematic overall flow diagram of an information acquisition method M100 of an application according to some embodiments of the present disclosure. Refer to Figure 5 In step S112, the manner of generating action information through the monitoring information may specifically be: extracting the information item for describing the action type of the specified action from the monitoring information, and determining the action information based on the extracted information item and the pre-stored information item-action information mapping relationship.
[0068] The data format of the monitoring information can be known, and the types of information items and the action information can all be known. Therefore, information items related to the description of the action type, such as event type, service name, page identifier, etc., can be extracted from the monitoring information first. Then, based on the pre-constructed mapping relationship used to describe the relationship between different information items and different action information, it is determined what kind of action information these information items correspond to. The running logic of step S112 can be set in a callback function, and the action information can be directly obtained by calling the callback method.
[0069] It can be understood that at least part of the content in the monitoring information (such as the extracted information items) can also be input into a generative pre-trained model to obtain the action information output by the model.
[0070] When recording action information in the actual triggering order of the specified action, one or more of the page identifier of the page that triggers the specified action and the control information of the control that executes the specified action can also be recorded.
[0071] Among them, the page identifier can be used to distinguish which page the specified action occurs on. For example, an application includes multiple pages, and only one operable control is provided on each page. The uses and functions of the controls in different pages are the same. Therefore, when a user or script operates the application and executes a specified action on these controls, the action types in the obtained action information are also the same. At this time, the page identifier can be used to determine which page the action type in different action information occurs on, so as to determine the operation process of the user or script on the application. Specifically, the page identifier can be obtained through some methods under the UIKit framework (a low-level technology for page development).
[0072] The control information is used to determine the control operated when executing the specified action. The control information can include information such as the control identifier and the control type. For example, an application includes one or more pages, and multiple operable controls are provided on each page. The uses and functions of the controls in the same page are the same. Therefore, when operating the application and executing a specified action on these controls, the action types in the obtained action information are also the same. At this time, the control identifier and the control type can be used to determine which control the action type in different action information is implemented by, so as to determine the operation process of the user or script on the application.
[0073] It can be understood that when recording action information in the actual triggering order of the specified action, the time stamp that triggers the specified action can also be recorded. The page identifier, the control information, and the time stamp can all be recorded in the file that records the action information, so that when uploading the file, the page identifier, the control information, and the time stamp will be uploaded to the server together with the action information.
[0074] The following is the action information recorded in a document under an implementation method when browsing news through an operating application: {HomeViewController (Button: @"Jump to Login") -> LoginViewController (TextFiled: @"Enter account number") -> LoginViewController (TextFiled: @"Enter password") -> LoginViewController (Button: @"Log in to account") -> HomeViewController (ScrollView: @"Page scrolling") -> HomeViewController (Cell: @"Jump to news page") -> NewsViewController (ScrollView: @"Page scrolling") -> NewsViewController (Button: @"Return to home page") -> HomeViewController (Button: @"Log out")}.
[0075] Among them, HomeViewController represents the identifier of the home page, LoginViewController represents the identifier of the account login page, and NewsViewController represents the identifier of the news display page. Button represents the identifier of the button, TextFiled represents the identifier of the text input box, ScrollView represents the identifier of the page scroll bar, and Cell represents the identifier of the view (table view or collection view).
[0076] According to the action information recorded in the above document, the operation process can be determined as follows: After opening the application, click the button on the home page to jump to the login page, then enter the account number and password in sequence, then click the login button and complete the account login, then the page automatically jumps to the home page after login, drag the scroll bar to scroll the page, then click the news view on the page to jump to the news page, and then drag the scroll bar to view the news. Finally, click the button to return to the home page and click the button to log out.
[0077] Figure 7 The overall flowchart of the information acquisition method M100 of the application program according to some embodiments of the present disclosure is shown. Refer to Figure 7 , in step S120, the method of recording action information according to the actual triggering order of the specified action can specifically be: recording the action information belonging to the same account ID according to the actual triggering order of the specified action.
[0078] Since the applications on the same client may have logged in to multiple different accounts and been used, in order to distinguish the operation processes of different accounts, when recording action information, it can be stored in the form of a dictionary, for example, storing action information in the form of key-value pairs. Among them, the key can be the account ID, and the value is the information collected after the corresponding event is monitored and the information collection is triggered, that is, the action information.
[0079] When the application is opened and enters the home page, if the application defaults to logging in to the account used when it was closed last time, the application can directly create a file on the client that contains the account ID and the timestamp of the opening time. The action information of different accounts is distinguished by the account ID, and the records of the same user at different times are distinguished by the timestamp. After the file is created, the action information formed by operating the application will be recorded in the file in the order of operations. If the application is used in the unlogged state, the created file can be named with a randomly generated ID and the timestamp of the opening time.
[0080] The format of the file for recording action information can be the plist format. The plist file is a file format used to store serialized objects and can be used to save data structures such as dictionaries, arrays, strings, and numbers. The plist file can represent the data content in XML (Extensible Markup Language) format or binary format.
[0081] The actual trigger order can be obtained by specifying one or more of the timestamp of the action, the page identifier of the page that triggers the specified action. The timestamp of the specified action represents the trigger time of the specified action. Sorting the action information in the order of the trigger time can correctly restore the operation order. In addition, if there is only one controllable control on each page of the application, for example, the application is used to display images, one or more images are displayed on each page, and there is a button to jump to the next page, then the trigger order of the specified action can be represented only by the page identifier.
[0082] Exemplarily, the action information recorded according to the actual trigger order of the specified action can be recorded in the device running the application. That is to say, the file for recording action information is created in the client, and after the action information is generated, it will be written into the client. This makes it unnecessary to interact with the server (business side) for file creation, monitoring of specified actions, generation and recording of action information, and all are completed inside the client.
[0083] Figure 8 Shows the overall flowchart of the information acquisition method M100 of the application in some embodiments of the present disclosure. Refer toFigure 8 Moreover, the information acquisition method M100 may further include step S121. Step S121 is executed before step S130 and may be executed after step S120.
[0084] S121, in response to meeting a stop condition, stop recording action information. The stop condition includes one or more of the process of the application being ended, the application logging out, and the application crashing.
[0085] As the specified action is performed on the operating application, the action information recorded in the file gradually increases. When the application is running in the foreground or background, if the application is directly ended by operating the client, or the application crashes and is automatically closed, the recording of action information stops. At this time, the file recording the action information can be stored as a complete file in the client. If the application is opened again, a new file will be created to record the action information; or, the recording of action information can also continue in the file of the same account, that is, the action information formed by opening the application multiple times for the same account can be recorded on the same file. Until the file is uploaded, a new file will be created to record the action information when the application is opened next time.
[0086] If the control application logs out, the recording of action information can also be stopped until after logging in to the account and starting to record the action information of the specified actions occurring after logging in. That is to say, in this case, only the action information in the logged-in state is generated and recorded.
[0087] When the upload condition is met, the file recording the action information can be uploaded. In step S130, the upload condition may include one or more of reaching a specified time period, receiving an upload instruction, and the application crashing.
[0088] For example, all files recording action information that have not been uploaded are actively uploaded every n natural days. Another example is that when the server needs to collect the running data of the application, it sends an upload instruction to the client, and the client responds to the upload instruction and uploads the information with permission. Another example is that if the application crashes during use, it indicates that there are exceptions in the running logic of the application that need to be repaired. At this time, the information can be automatically uploaded with permission, and the service provider can download this information through the interface on the server and analyze the cause of the exception, so as to build test cases and repair the running logic of the program.
[0089] The upload method can be implemented through the websocket (long link) method under the AFNetworking network framework, or by calling the interface or the Hypertext Transfer Protocol (HTTP) method.
[0090] The client can delete the files with action information regularly, for example, regularly delete the uploaded files. The operation of deleting files also does not require the server to instruct, but is performed by the client itself.
[0091] The code for implementing the information acquisition method M100 may be integrated into a software development kit, and the application program implements the information acquisition method on the application program itself by calling the software development kit.
[0092] The code is integrated into a software development kit (SDK) so that each application that calls the SDK can use the method to obtain action information without the need to configure the logic code of the information acquisition method for each application separately.
[0093] The code implementation for monitoring the specified action can be implemented through the method swizzling technique. Method swizzling is a technique for modifying the behavior of a class at runtime, allowing developers to replace or extend existing methods without changing the source code. By using method swizzling at runtime to replace the implementation of one method with the implementation of another method, runtime conflicts caused by method overlap can be avoided.
[0094] It is understandable that both are used to collect running data, but the difference between monitoring and tracking is that the implementation of tracking requires writing corresponding detection and response codes in the code logic of the page, while monitoring can be implemented through a separate module in the application.
[0095] Figure 9 FIG. 2 shows a schematic diagram of the overall process of a method M200 for generating a test case according to some embodiments of the present disclosure. Figure 9 The method shown includes step S210 and step S220. The method may be executed by a server, which may include electronic devices such as computers and servers.
[0096] S210, obtaining action information according to the information obtaining method of the application program, wherein the information obtaining method of the application program may be the information obtaining method M100 described in any of the above-mentioned implementation modes.
[0097] The server of the server - side can regularly receive files uploaded actively by the client that record action information, or receive files uploaded actively by the client according to the instructions issued by the server - side, or receive files uploaded actively by the client after the application crashes that record action information.
[0098] S220. Generate test cases based on the action information.
[0099] If the recording of the action information is forced to stop due to application exceptions or crashes, then scripts or other means can be used to automatically call the code logic in the code library according to the page identifier, control identifier, and action type in the action information and generate the test logic for at least some of the specified actions, and combine the test logic into a complete test case according to the recording order of the action information for reproducing the application crash scenario. Testers can reproduce the operation process of the application through the test cases, so as to be able to create application exceptions or crashes that occurred on the client side at the test - side, and then identify the causes of the exceptions or crashes.
[0100] Based on any of the above - mentioned embodiments, the present disclosure also provides an information acquisition device for an application. Figure 10 It is a structural schematic block diagram of an information acquisition device for an application according to an embodiment of the present disclosure. As Figure 10 shown, the information acquisition device for the application includes: an action information generation module 110, an action information recording module 120, and an action information uploading module 130. The information acquisition device for the application can be integrated into the client.
[0101] The action information generation module 110 is used to obtain action information formed by the application in response to monitoring that the application executes a specified action. Among them, the action information can describe the action type corresponding to the specified action through natural language.
[0102] The action information recording module 120 is used to record the action information according to the actual triggering order of the specified action.
[0103] The action information uploading module 130 is used to upload the recorded action information in response to meeting the upload conditions.
[0104] The above - mentioned information acquisition device for the application can be in the form of computer software, and each module of the above - mentioned information acquisition device for the application can be implemented by computer software modules. The implementation processes of the functions and roles of each module in the above - mentioned information acquisition device for the application are specifically detailed in the implementation processes of the corresponding steps in the above - mentioned method, and will not be elaborated here.
[0105] Based on any of the above - mentioned embodiments, the present disclosure also provides a test - case generation device. Figure 11It is a structural schematic block diagram of a test case generation device according to an embodiment of the present disclosure. As Figure 11 shown, the test case generation device includes: an action information acquisition module 210 and a test case generation module 220. The test case generation device may be integrated in a server or a service side.
[0106] The action information acquisition module 210 is configured to acquire action information according to the information acquisition method of the application program. Among them, the information acquisition method of the application program may be the information acquisition method M100 described in any of the above embodiments.
[0107] The test case generation module 220 is configured to record the action information according to the actual triggering order of the specified actions.
[0108] The above test case generation device may be in the form of computer software, and each module of the above test case generation device may be implemented by computer software modules. The implementation processes of the functions and roles of each module in the above test case generation device are specifically described in the implementation processes of the corresponding steps in the above method, and will not be elaborated here.
[0109] The execution subject of the information acquisition method of the application program in the specific embodiment of the present disclosure may be a client, and the client may be an electronic device such as a mobile phone or a computer. Therefore, based on any of the above embodiments, the present disclosure further provides an electronic device 1000, and the electronic device 1000 may execute the information acquisition method of the application program in any of the above embodiments described in the present disclosure. Figure 12 It is a structural schematic block diagram of an electronic device 1000 according to an embodiment of the present disclosure. The hardware structure of the electronic device 1000 may be implemented using a bus architecture. The bus architecture may include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, a memory 1300, and / or hardware modules together. The bus 1100 may also connect various other circuits 1400 such as peripheral devices, voltage regulators, power management circuits, external antennas, etc. The electronic device 1000 is further configured with a screen 1500 for displaying the page of the application program. The screen 1500 may be a touch screen.
[0110] The bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Component (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one connection line is used in this figure, but it does not mean that there is only one bus or one type of bus.
[0111] Among them, the processor 1200 can be a Central Processing Unit (CPU). The processor 1200 can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and other chips, or a combination of the above various types of chips.
[0112] The memory 1300 can be used as a non-transitory computer-readable storage medium, and can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions of the computer programs in the embodiments of the present disclosure. The processor 1200 realizes the information acquisition method of the application program by running the non-transitory software programs, instructions, and modules stored in the memory 1300.
[0113] The execution subject of the test case generation method in the specific implementation manner of the present disclosure can be a server or a service side, and the server and the service side can be electronic devices such as a computer. Therefore, based on any of the above embodiments, the present disclosure further provides an electronic device 2000, and the electronic device 2000 can execute the test case generation method of the application program in any of the above embodiments described in the present disclosure. Figure 13It is a schematic block diagram of an electronic device 2000 according to an embodiment of the present disclosure. The hardware structure of the electronic device 2000 can be implemented using a bus architecture. The bus architecture can include any number of interconnecting buses and bridges, depending on the specific application of the hardware and overall design constraints. The bus 2100 connects various circuits including one or more processors 2200, a memory 2300, and / or hardware modules together. The bus 2100 can also connect various other circuits 2400 such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.
[0114] The bus 2100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Component (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, only one connecting line is shown in this figure, but it does not mean that there is only one bus or one type of bus.
[0115] Among them, the processor 2200 can be a Central Processing Unit (CPU). The processor 2200 can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or a combination of the above types of chips.
[0116] The memory 2300 can be used as a non-transitory computer-readable storage medium, and can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions of the computer program in the embodiments of the present disclosure. The processor 2200 realizes the method for generating test cases by running the non-transitory software programs, instructions, and modules stored in the memory 2300.
[0117] The present disclosure also provides a readable storage medium storing a computer program which, when executed by a processor, is used to implement the above method. The "readable storage medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples of the readable storage medium include the following: an electrical connection part with one or more wirings (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.
[0118] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, the processes or functions of the present disclosure are executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM, or other programmable devices.
[0119] The computer program or instructions can be stored in a readable storage medium or transmitted from one readable storage medium to another. For example, the computer program or instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless manner. The readable storage medium can be any available medium that can be accessed or a data storage device such as a server or data center integrating one or more available media. The available medium can be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it can also be an optical medium, such as a digital video disc; or it can be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or can include both volatile and non-volatile types of storage media.
[0120] Those skilled in the art should understand that the embodiments of the present disclosure can be provided as a method, a system, or a computer program product. Therefore, the present disclosure can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.
[0121] This disclosure is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to the disclosure. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate means for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or in multiple blocks.
[0122] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or in multiple blocks.
[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or in multiple blocks.
[0124] In the description of this specification, the description with reference to terms such as "one embodiment / way", "some embodiments / ways", "example", "specific example", or "some examples", etc. means that the specific features, structures, or characteristics described in connection with the embodiment / way or example are included in at least one embodiment / way or example of this disclosure. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment / way or example. Moreover, the specific features, structures, or characteristics described can be combined in a suitable manner in any one or more embodiments / ways or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments / ways or examples described in this specification and the features of different embodiments / ways or examples.
[0125] In addition, the terms "first" and "second" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0126] Those skilled in the art should understand that the above embodiments are merely for clearly illustrating the present disclosure and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications can be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
[0127] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0128] For example, when a user's active request is received, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of the present disclosure based on the prompt message.
[0129] As an optional but non-limiting implementation manner, when a user's active request is received, the manner of sending a prompt message to the user may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0130] It can be understood that the above process of notifying and obtaining the user's authorization is merely illustrative and does not limit the implementation manners of the present disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manners of the present disclosure.
[0131] Meanwhile, it can be understood that the data involved in the technical solutions of the present disclosure (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related provisions.
Claims
1. A method for obtaining information of an application, characterized in that: include: In response to monitoring that the application program performs a specified action, obtaining action information formed by the application program, wherein the action information can describe an action type corresponding to the specified action in a natural language; Record the action information according to the actual triggering order of the specified actions; as well as In response to satisfying the upload condition, the recorded action information is uploaded.
2. The information acquisition method according to claim 1, characterized in that: The method further comprises: In response to receiving the specified operation instruction, the action executed by the application program is monitored.
3. The information acquisition method according to claim 2, characterized in that: The specified operation instruction is used to trigger the application to enter a specified page for the first time.
4. The information acquisition method according to claim 2, characterized in that: Monitor the actions performed by the application, specifically: An action performed by each of the plurality of pages of the application is monitored.
5. The information acquisition method according to claim 1, characterized in that: In response to monitoring that an application program executes a specified action, obtaining action information formed by the application program includes: In response to monitoring that an application program executes a specified action, obtaining monitoring information generated by the application program; and The action information is generated according to the monitoring information.
6. The information acquisition method according to claim 5, characterized in that: Generating action information through the monitoring information includes: An information item for describing the action type of the designated action is extracted from the monitoring information, and the action information is determined based on the extracted information item and a pre-stored information item-action information mapping relationship.
7. The information acquisition method according to any one of claims 1, 4-6, characterized in that: When recording the action information according to the actual triggering sequence of the designated actions, one or more of the page identifier of the page that triggers the designated action and the control information of the control that executes the designated action are also recorded.
8. A method for generating a test case, characterized in that: include: Acquire the action information according to the information acquisition method of the application program according to any one of claims 1 to 7; as well as A test case is generated according to the action information.
9. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory so that the processor executes the method according to any one of claims 1 to 8.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 8.