Stability testing method, stability testing system, electronic equipment, computer storage medium and computer program product
By injecting dynamic library components into the application to obtain view control dependency information and layout information, and generating control traversal operation strategies, it solves the problem of high dependence on the operating system by traditional stability testing, and improves the reliability and targeting of the test.
Patent Information
- Application Number
- CN202510280580.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-07-29
AI Technical Summary
Traditional stability testing solutions have a high degree of dependence on the operating system specific configuration of electronic devices, resulting in poor reliability of stability testing.
By pre-injecting dynamic library components into the application, obtaining view control dependency information, generating view control layout information, and generating control traversal operation strategies based on layout information, performing stability tests, and generating test results.
It improves the reliability and pertinence of control traversal operations, improves the reliability of test results of stability tests, and reduces dependence on operating system specific configurations.
Smart Images

Figure CN120386718A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technologies, and in particular, to a stability testing method, a stability testing system, an electronic device, a computer storage medium, and a computer program product. Background Art
[0002] Generally speaking, the stability testing of an application is a key link in testing the application before the release of the application to ensure that the application can run stably in the electronic device environment with various configurations. In the stability testing, it is necessary to perform stability testing on devices with different models, different operating system versions, different hardware configurations, and different screen sizes and resolutions.
[0003] The traditional stability testing scheme has a high degree of dependence on specific configurations of the operating system of the electronic device, resulting in poor reliability of the stability testing. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a stability testing method, a stability testing system, an electronic device, a computer storage medium, and a computer program product to solve the above problems.
[0005] According to a first aspect of the embodiments of the present invention, there is provided a stability testing method, including: calling a service data interface in an application according to a target test task to obtain view control dependency information of the application; generating view control layout information of each page view of the application at least according to the view control dependency information; generating a control traversal operation strategy corresponding to the target test task according to the view control layout information; and performing a stability test on the application according to the control traversal operation strategy to generate a test result.
[0006] In another implementation manner of the present invention, calling a service data interface in an application to obtain view control dependency information of the application includes: generating a server request through a dynamically linked library component pre-injected in the application; and listening, by the dynamically linked library component, for view control dependency information sent by the service data interface in the application when responding to the server request.
[0007] In another implementation manner of the present invention, generating view control layout information of each page view of the application at least according to the view control dependency information includes: obtaining each page view matching the view control dependency information; identifying view control position information of each page view from a screenshot result of each page view; and associating the view control dependency information and the view control position information of each page view to obtain view control layout information.
[0008] In another implementation manner of the present invention, from the screenshot results of the respective page views, the view control position information of each page view is identified, including: sending the screenshot results of each page view as an image to be recognized to an image recognition server, and receiving the view control position information of each page view returned by the image recognition server, where the image recognition server is used to perform position recognition of view controls on the image to be recognized.
[0009] In another implementation manner of the present invention, the view control dependency information and the view control position information of each page view are associated to obtain view control layout information, including: according to the attribute information of each view control in each page view, associating the control dependency relationship of each view control with the control position of each view control to obtain the position association relationship of each view control; generating view control layout information according to the position association relationship of each view control.
[0010] In another implementation manner of the present invention, according to the view control layout information, a control traversal operation strategy corresponding to the target test task is generated, including: sending the view control layout information to an operation strategy server, and obtaining the control traversal operation strategy returned by the operation strategy server, where the operation strategy server is used to parse the view control layout information to obtain traversal operation rules, and generate a control traversal operation strategy corresponding to the target test task according to the traversal operation rules.
[0011] In another implementation manner of the present invention, parsing the view control layout information to obtain traversal operation rules includes: determining multiple page view levels indicated by the target test task; parsing the view control layout information to generate at least one view control operation for jumping between the multiple page view levels; generating the at least one view control operation into a control traversal operation strategy.
[0012] In another implementation manner of the present invention, performing a stability test on the application according to the control traversal operation strategy to generate a test result, including: sending the control traversal operation strategy to an electronic device installed with the application, so that the electronic device performs at least one view control operation indicated by the control traversal operation strategy; obtaining the execution result of the at least one view control operation through a monitoring component of the application; associating the exception type of the execution result of the at least one view control operation with the at least one view control operation to generate a test result.
[0013] According to a second aspect of an embodiment of the present invention, a stability testing method is provided, including: when a service data interface in an application program is called in response to a target test task, returning view control dependency information of the application program; obtaining at least one view control operation indicated by a control traversal operation policy corresponding to the target test task, where the control traversal operation policy is generated according to view control layout information of each page view of the application program, and the view control layout information is generated at least according to the view control dependency information; and presenting an execution result of the at least one view control operation.
[0014] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including: an obtaining module, which, according to a target test task, calls a service data interface in an application program to obtain view control dependency information of the application program; a first generating module, which generates view control layout information of each page view of the application program at least according to the view control dependency information; a second generating module, which generates a control traversal operation policy corresponding to the target test task according to the view control layout information; and a testing module, which performs a stability test on the application program according to the control traversal operation policy to generate a test result.
[0015] According to a fourth aspect of an embodiment of the present invention, an electronic device is provided, including: an interface module, which, when a service data interface in an application program is called in response to a target test task, returns view control dependency information of the application program; an obtaining module, which obtains at least one view control operation indicated by a control traversal operation policy corresponding to the target test task, where the control traversal operation policy is generated according to view control layout information of each page view of the application program, and the view control layout information is generated at least according to the view control dependency information; and a presenting module, which presents an execution result of the at least one view control operation.
[0016] According to a fifth aspect of an embodiment of the present invention, a stability testing system is provided, including: the electronic device according to the third aspect or the fourth aspect, and a terminal device installed with the application program.
[0017] According to a sixth aspect of an embodiment of the present invention, an electronic device is provided, including: a processor, a memory, a communication interface, and a communication bus, where the processor, the memory, and the communication interface complete mutual communication through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the method according to the first aspect or the second aspect.
[0018] According to a seventh aspect of an embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, it implements the method according to the first aspect or the second aspect.
[0019] According to an eighth aspect of the embodiments of the present invention, there is provided a computer program product including computer instructions which, when executed by a processor, implement the method described in the first aspect or the second aspect.
[0020] In the solution of the embodiments of the present invention, the call operation of the service data interface in the application program does not require the underlying data of the application program itself and can obtain the view control dependency information of the application program. In addition, according to the view control layout information, a control traversal operation strategy corresponding to the target test task is generated, which is beneficial to accurately determining the control traversal operation strategy for the target test task, improving the reliability and pertinence of the control traversal operation. Furthermore, when performing a stability test on the application program according to the control traversal operation strategy, the reliability of the test result of the stability test can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings.
[0022] Figure 1 FIG. is a schematic architecture diagram of a test system applicable to the stability test according to some embodiments of the present invention.
[0023] Figure 2 FIG. is a flowchart of the steps of a stability test method according to some embodiments of the present invention.
[0024] Figure 3 For Figure 2 a schematic block diagram of the application program configuration process of the embodiments.
[0025] Figure 4 FIG. is a flowchart of the steps of a stability test method according to some other embodiments of the present invention.
[0026] Figure 5 FIG. is a schematic interaction diagram of a stability test system according to some other embodiments of the present invention.
[0027] Figure 6 FIG. is a block diagram of the structure of an electronic device according to some other embodiments of the present invention.
[0028] Figure 7 FIG. is a block diagram of the structure of an electronic device according to some other embodiments of the present invention.
[0029] Figure 8Schematic structural diagram of an electronic device according to other embodiments of the present invention. Detailed implementation manners
[0030] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art shall fall within the protection scope of the embodiments of the present invention.
[0031] The following further illustrates the specific implementation of the embodiments of the present invention with reference to the accompanying drawings of the embodiments of the present invention.
[0032] Generally speaking, the stability test of an application program is a key link in testing the application before the release of the application program to ensure that the application program can run stably in the electronic device environment with various configurations. In the stability test, it is necessary to perform stability tests on devices with different models, different operating system versions, different hardware configurations, and different screen sizes and resolutions. For example, in the stability test, the function test of the application program can be performed on various models of electronic devices to ensure that core functions such as login, data query, and information submission can be used normally without obvious loopholes. For another example, in the stability test, a continuous running test can be performed to observe whether there are problems such as memory leakage and excessive resource occupation in the electronic device, which may cause the application program to freeze or even crash. For another example, in the stability test, the response speed and stability of the application program during a large amount of data processing or multi-user concurrent operations can be detected. For another example, in the stability test, the network environment can be tested. Under the network conditions of different signal strengths, check whether the network connection of the application program is stable and whether the data transmission is normal. For another example, in the stability test, a compatibility test can be performed to test the compatibility between the application program and the device itself, and also test the interaction compatibility with other common application programs on the electronic device.
[0033] In some cases, when performing a stability test, the control position information of the application program can be obtained by injecting components such as a JS engine into the application program, and then a test operation strategy can be generated based on the control information. However, for application programs developed for mobile operating systems such as the IOS system, due to the closedness or personalization limitations of the mobile operating system, the control position information of the application program cannot be reliably obtained through the injected components, resulting in the inability to generate a reliable test operation strategy.
[0034] Generally speaking, when the dependence on a specific configuration of the operating system of an electronic device is relatively high, the reliability of the stability test is poor. Each embodiment of the present invention can improve the reliability of the stability test.
[0035] Next, a test system applicable to the stability test according to some embodiments of the present invention will be described in conjunction with Figure 1 As shown, the test system includes a platform server 20 and execution nodes 30 managed by the platform server 20. A user 10 can access the platform server 20 through a web client, an App client, etc., so as to further access cloud real machines 31, 32, 33, and 34 managed by the execution nodes 30. Figure 1
[0036] In some examples, the platform server 20 includes a file storage module 21, a message management module 22, a web service module, and a websocket service module 24. Among them, through the ability of the web service module called by the web client through a transport layer protocol such as the http protocol, the user 10 can perform operations in the web client, such as on a web page, such as an operation for selecting a matching cloud real machine. The cloud real machine refers to a remote terminal device for testing. For example, the test target of the platform server 20 conducts application testing before the application is released to ensure that the application can run stably in the electronic device environment with various configurations. In this case, the multiple cloud real machines connected by each execution node of the platform server 20 can be intelligent terminals of different manufacturers and different models located in different geographical locations. In addition, the cloud real machine can include, but is not limited to, embedded devices such as mobile phones and tablet computers, and desktop devices such as PC machines. The above-mentioned embedded devices can be configured with the same or different underlying operating environments. For example, they can be configured with the same or different embedded operating systems, or different versions of the same embedded operating system. For example, they can be configured with the same or different processor architectures, and chips with specific functions from the same or different manufacturers. The above-mentioned cloud real machines can also be installed with the same or different application programs, or different versions of the same application program, such as beta versions or release versions, etc. The above-mentioned application programs can be correspondingly stored in the file storage module 21. For example, the file storage module 21 stores metadata of the application program, and the file storage module is associated with a storage medium such as an object-oriented storage medium. When the file storage module 21 receives an access request, it can pull the corresponding target file from the object-oriented storage medium. The message management module 22 can be an intermediary connecting the above-mentioned cloud real machine and the platform server 20, and is used to process messages such as operations on the screen of the cloud real machine and status changes of the mobile phone. For example, before the user 10 establishes a connection with the cloud real machine through the web client, the ability of the web service module 23 (for example, as an http proxy) can be called to access the corresponding data. For example, after the user 10 establishes a connection with the cloud real machine through the web client, the ability of the websocket service module 24 (for example, as a websocket proxy) can be called to access the corresponding data, or data such as video streams pushed by the websocket service module 24 can be received.
[0037] In some examples, the web client includes a client that interacts with the server through web pages, such as a browser in a computer. The operations of the user based on the web client can be conventional web operations, such as web operations implemented through input devices such as a mouse and a keyboard. The App client includes an application installed in a smart terminal. For example, an App pre-installed in an Android mobile phone. The operations of the user based on the App client can be conventional smart terminal operations, such as gesture operations like swiping, touch clicking, etc. Among them, the server can be implemented by an independent server or by a server cluster composed of multiple servers.
[0038] Figure 2 Illustrates a stability test method according to some embodiments of the present invention. Figure 2 The stability test method includes:
[0039] S210: According to the target test task, call the service data interface in the application to obtain the view control dependency information of the application.
[0040] It should be understood that the application can be configured and installed in the terminal device and communicate with the server. The target test task includes test cases and test requirements for performing stability tests. For example, the target test can be for functional modules such as the UI module or for the general stability of the application.
[0041] It should also be understood that the application is usually configured with a service data interface to transfer data between the application and the components of the background server. The view control dependency information is originally used to render and configure the human-computer interaction components of the application in the terminal device. By calling the service data interface, the configuration data related to the dependency relationship of the view control can be indirectly obtained. For example, the backend MOCK interface can be simulated to communicate with the service data interface to be compatible with the function of the service data interface.
[0042] S220: Generate the view control layout information of each page view of the application at least according to the view control dependency information.
[0043] It should be understood that the view control layout information reflects the specific distribution and organization method of each view control in each page view, including the position, hierarchical structure, arrangement order, etc. of the control. For example, the page view can contain multiple buttons, text boxes, and lists, and the layout information characterizes the position relationship and dependency relationship between each view control.
[0044] It should also be understood that the above-described view control dependency information describes the logical dependency relationships between view controls. The view control layout information is based on the above logical dependency relationships. That is to say, the view control layout information can be directly generated from the view control dependency information, or it can be generated by combining other information related to user operations. In addition, the other information combined includes, but is not limited to, the position information, size information, type information, etc. of the view controls.
[0045] S230: Generate a control traversal operation strategy corresponding to the target test task according to the view control layout information.
[0046] It should be understood that the view control layout information comprehensively reflects the distribution and distribution state of each view control in the page view. The test requirements of the target test task are directly or indirectly related to the view control layout information. That is, the target test task is at least partially related to the view control layout information. Correspondingly, determining the view control layout information related to the target test task is beneficial to efficiently generating a control traversal operation strategy.
[0047] It should also be understood that the control traversal operation strategy includes considering attributes such as the type, position, and dependency relationship of the view controls to ensure that the application can be comprehensively and effectively tested. In some examples, the control traversal operation strategy is to click, input, or operate each control on the page in a certain order to simulate the actual operation behavior of the user. In other examples, according to different test scenarios and requirements, the order, frequency, and operation method of the control operation traversal can be flexibly adjusted, and the execution results of the traversal operation are recorded by monitoring components as the execution results of the control traversal operation strategy.
[0048] S240: Perform a stability test on the application according to the control traversal operation strategy and generate a test result.
[0049] It should be understood that the above control traversal operation strategy is used to perform a stability test on the application using an automated test tool or manual operation. During the stability test, by monitoring the running state of the application, record whether abnormal states such as crashes, freezes, and response timeouts occur.
[0050] It should also be understood that after the stability test is completed, a test report can be generated as the test result according to the monitoring results of the recorded running state. The test result includes at least one of the information such as the environment configuration information for the stability test, the view control operation information being tested, the description information of the abnormal state, and the statistical information.
[0051] In the solution of the embodiment of the present invention, for the operation of calling the service data interface in the application, without the underlying data of the application itself, the view control dependency information of the application can be obtained. In addition, according to the view control layout information, a control traversal operation strategy corresponding to the target test task is generated, which is beneficial to accurately determine the control traversal operation strategy for the target test task, improving the reliability and pertinence of the control traversal operation. Furthermore, when performing a stability test on the application according to the control traversal operation strategy, the reliability of the test result of the stability test can be improved.
[0052] In some embodiments, when calling the service data interface in the application to obtain the view control dependency information of the application, a server request can be generated through a dynamically linked library component pre-injected into the application. Then, the dynamically linked library component listens for the view control dependency information sent by the service data interface in the application when responding to the server request. That is to say, by generating a server request through the pre-injected dynamically linked library component, the acquisition path of the underlying data of the application itself is bypassed, and the view control dependency information of the application is indirectly obtained by effectively using the development interfaces of the application itself.
[0053] Specifically, the dynamically linked library component can be pre-injected into the application. As Figure 3 shown, the dynamically linked library component 311 can be configured to generate a server request and listen for the view control dependency information sent by the service data interface in the application 312 when responding to the server request. In the 310 stage, the application can be installed in an operating system such as the IOS system, Android system, or HarmonyOS system, and the dynamically linked library component can be associated with the operating system through the method of re-signing, so as to be bound to the application. In the 320 stage, the application bound with the dynamically linked library component can be installed in the operating system. In the 330 stage, the application can be started in the operating system, thereby starting the dynamically linked library component at the same time. In the 340 stage, the service logic in the dynamically linked library component can be created to generate a server request and listen for the view control dependency information sent by the service data interface in the application when responding to the server request.
[0054] In other embodiments, the view control layout information reflects the specific distribution and organization method of each view control in each page view, including the position, hierarchical structure, arrangement order, etc. of the controls. For example, the page view can contain multiple buttons, text boxes, and lists, and the layout information characterizes the position relationship and dependency relationship between each view control. In some examples, the view control layout information can be directly generated through the view control dependency information.
[0055] In some other examples, other information related to user operations can be combined to generate view control layout information. The other information combined includes, but is not limited to, the position information, size information, type information, etc. of the view controls. Without loss of generality, when generating the view control layout information of each page view of the application at least according to the view control dependency information, each page view that matches the view control dependency information can be obtained. Then, from the screenshot results of each page view, the view control position information of each page view can be identified. Then, the view control dependency information and the view control position information of each page view are associated to obtain the view control layout information. That is to say, identifying the view control position information of each page view from the screenshot results of each page view is beneficial to obtaining the actual page view situation. Especially in a closed mobile operating system, the view control position information is not necessarily reliably presented or obtained in an a priori manner. Through the view control position information, reliable view control layout information can be assisted in obtaining.
[0056] In some examples, as an example of identifying the view control position information of each page view from the screenshot results of each page view, the screenshot results of each page view can be sent to the image recognition server as the image to be recognized, and the view control position information of each page view returned by the image recognition server can be received.
[0057] For example, a screenshot request can be sent to the terminal device with the help of a dynamic library component. The screenshot results of each page view can be obtained by accessing the camera component of the operating system through the dynamic library component and returned to the platform server.
[0058] It should be understood that the image recognition server can be configured with a machine model with computer vision capabilities, such as a deep neural network model, to perform the position recognition of view controls on the image to be recognized. For example, the machine model can be configured to perform Optical Character Recognition (OCR) operations. That is to say, assisting in the recognition of view controls through the image recognition server is beneficial to simplifying the local configuration of the stability test platform.
[0059] In some examples, when associating the view control dependency information and the view control position information of each page view, according to the attribute information of each view control in each page view, the control dependency relationship of each view control can be associated with the control position of each view control to obtain the position association relationship of each view control. Then, according to the position association relationship of each view control, the view control layout information is generated.
[0060] Specifically, the attribute information of the view control includes information such as the type, name, and status of the control. By analyzing the attribute information, the dependency relationship between the various view controls can be determined. That is to say, in the UI component of the application, the display status, available status, etc. of a view control often depend on certain conditions of other view controls. In addition, according to the specific position of each view control in the page view obtained, it is helpful to determine the operation elements of the actual user operation required by the operation traversal strategy. By associating the control dependency relationship with the control position, the distribution, hierarchy and mutual relationship of each view control in the page can be obtained.
[0061] For example, if the display state of a drop-down menu control depends on the click of a button, and given the specific positions of the two controls in the page view, a positional association relationship can be established between the two. Therefore, by processing all view controls, the complete positional association relationship of each view control can be obtained, and view control layout information can be generated based on the positional association relationship of each view control.
[0062] In other words, the attribute information of each view control is a shared attribute between the control dependency relationship and the control position information. The attribute information of each view control is helpful in associating the control dependency relationship and the control position information. The obtained position association relationship of each view control is helpful in reliably generating the view control layout information.
[0063] In other embodiments, when generating a control traversal operation strategy corresponding to a target test task based on view control layout information, the view control layout information can be sent to an operation strategy server, and the operation strategy server can return the control traversal operation strategy. The operation strategy server is used to parse the view control layout information, obtain traversal operation rules, and generate a control traversal operation strategy corresponding to the target test task based on the traversal operation rules. In other words, the operation strategy server is configured with a control traversal operation strategy algorithm and can generate a control traversal operation strategy based on the view control layout information, thereby simplifying the local configuration of the stability testing platform.
[0064] In some examples, as an example of parsing view control layout information to obtain traversal operation rules, multiple page view levels indicated by the target test task can be determined, and then the view control layout information can be parsed to generate at least one view control operation that jumps between the multiple page view levels, and then the at least one view control operation is generated as a control traversal operation strategy.
[0065] That is to say, it is relatively easy to have stability anomalies between multiple page view levels. The jump between multiple page view levels is conducive to improving the reliability of stability testing and facilitating the troubleshooting of stability anomalies between different page view levels. In addition, at least one view control operation can efficiently trigger the jump between multiple page view levels, thereby generating an efficient control traversal operation strategy.
[0066] In some other examples, when performing a stability test on an application according to the control traversal operation strategy to generate a test result, the control traversal operation strategy can be sent to the electronic device on which the application is installed, so that the electronic device performs at least one view control operation indicated by the control traversal operation strategy. Then, through the monitoring component of the application, the execution result of at least one view control operation is obtained. Then, the exception type of the execution result of at least one view control operation is associated with at least one view control operation to generate a test result. Specifically, after the stability test is completed, a test report can be generated as the test result according to the monitoring result of the recorded running state. The test result includes at least one of the following information: environment configuration information for stability testing, view control operation information being tested, description information of the abnormal state, and statistical information.
[0067] That is to say, the monitoring component can be pre-configured into the application and can reliably detect running anomalies such as program crashes. By associating the exception type with the view control operation, a test result of stability testing with relatively high reference value is obtained.
[0068] The following will be combined with Figure 4 Describe the stability testing method according to some other embodiments of the present invention. Figure 4 The stability testing method can be executed by a terminal device and includes:
[0069] S410: When the service data interface in the application is called in response to a target test task, return the view control dependency information of the application.
[0070] S420: Obtain at least one view control operation indicated by the control traversal operation strategy corresponding to the target test task. The control traversal operation strategy is generated according to the view control layout information of each page view of the application, and the view control layout information is at least generated according to the view control dependency information.
[0071] S430: Display the execution result of the at least one view control operation.
[0072] In the solution of an embodiment of the present invention, the call operation on the service data interface of the application can obtain the application's view control dependency information without requiring the application's own underlying data. In addition, based on the view control layout information, a control traversal operation strategy corresponding to the target test task is generated. This facilitates accurately determining the control traversal operation strategy for the target test task, improving the reliability and pertinence of the control traversal operation. This can further improve the reliability of the stability test results when the application is subjected to stability testing based on the control traversal operation strategy.
[0073] In some embodiments, when displaying the execution result of at least one view control operation, the monitoring component obtains the running status indicated by the execution result of at least one view control operation, and returns the running status indicated by the execution result to the dynamic library component, and returns it to the platform server via the dynamic library component. The platform server generates a test report based on the running status indicated by the execution result.
[0074] In other embodiments, in the stability test method, a screenshot request can also be obtained from the dynamic library component, and the camera component of the operating system is accessed through the dynamic library component to obtain the screenshot results of each page view, and returned to the platform server.
[0075] The following will be combined Figure 5 The following describes in detail the exemplary interaction process within a stability testing system according to other embodiments of the present invention. Specifically, the interaction process is performed between a platform server 20, an execution node 30, an operation policy server 40, and an image recognition server 50. The execution node 30 is used to manage at least one terminal device, such as a cloud-based real machine. Figure 5 The interaction process includes:
[0076] S501: The platform server 20 creates a target test task and notifies the operation policy server 40. It should be understood that in the stability testing system, the platform server is used to manage the execution node 30, and controls the terminal device to perform operations on the application or other software components through the execution node 30. Before executing the target test task, the platform server 20 will create a target test task based on the specific requirements, purpose and related business scenarios of the target test task. For example, in the case where the application is an e-commerce application, the target test task can be the product search function or product ordering function of the application. The platform server 20 determines the product search function or product ordering function as the functional test scope of the target test task.
[0077] S502: The platform server 20 receives the configuration result of the target test task returned by the operation policy server 40. It should be understood that the operation policy server 40 is used to formulate a detailed test configuration plan based on the target test task created by the platform server 20, for example, determining the subsequent control traversal operation strategy based on the functional test scope included in the target test task. The control traversal operation strategy reflects the configuration information such as the test software configuration, test process configuration, and operation rules of different controls matched by the stability test. Specifically, after creating the target test task, the platform server 20 sends the above-mentioned relevant configuration information to the operation policy server 40. The operation policy server 40 generates the configuration result of the corresponding control traversal operation strategy and returns it to the platform server 20. For example, for the test process of the above-mentioned e-commerce application, the operation policy server 40 returns the configuration result required by the generated control traversal operation strategy so that the stability test of the product search function or the product ordering function can be performed.
[0078] S503: The platform server 20 controls the terminal device via the execution node 30 to perform device initialization. It should be understood that the execution node 30 acts as an intermediate management device between the platform server 20 and at least one terminal device, and is used to forward instructions or requests from the platform server 20 to the at least one terminal device. For example, the platform server 20 sends a device initialization instruction to the terminal device via the execution node 30. The terminal device then performs software and hardware configuration initialization according to the device initialization instruction, such as clearing the system cache, restarting applications, and setting up the network environment required by the applications.
[0079] S504: The platform server 20 sends a server request via the dynamic library component via the execution node 30. It should be understood that the dynamic library component, as a reusable code module, can be a dynamic library for the application's UI component, which is loaded when the application is running. The platform server 20, through the execution node 30, utilizes the dynamic library component to send a server request to the application. Without obtaining view control property information from the operating system's development framework, the platform server 20 obtains the view control dependency information of the application's UI component via the service data interface.
[0080] S505: The platform server 20 obtains the view control dependency information of the application via the execution node 30. It should be understood that the view control dependency information describes the logical dependency relationship between view controls, and the view control layout information is based on the above logical dependency relationship. That is to say, the view control layout information can be generated directly through the view control dependency information, or it can be generated by combining other information related to user operations. In addition, the other information combined includes but is not limited to the position information, size information, type information, etc. of the view control. The platform server 20 interacts with the application on the terminal device through the execution node 30, and obtains the view control dependency information through a simple configuration of the dynamic library component.
[0081] S506: The platform server 20 sends a screenshot request through the dynamic library component via the execution node 30. It should be understood that sending a screenshot request to the application on the terminal device using the dynamic library component can trigger the terminal device to take a screenshot of the current page view of the application.
[0082] S507: The platform server 20 obtains a screenshot result of the application's page view via the execution node 30. It should be understood that upon receiving the screenshot request from the platform server 20, the execution node 30 instructs the terminal device to perform a screenshot operation and returns the screenshot result to the platform server 20. The screenshot result of the screenshot operation can intuitively reflect the display status of the application interface, including display information such as the layout position, content, and type of controls.
[0083] S508: The platform server 20 sends the screenshot result to the image recognition server 50. It should be understood that the image recognition server 50 has higher-performance image recognition capabilities than the platform server 20 and can analyze and process the content in the screenshot result to determine the type and location of the view control. For example, it can determine positional information such as the boundaries and position of the view control through graphic recognition, and determine the identifier or character indicating the control type of the view control through character recognition.
[0084] S509: The image recognition server 50 returns the view control location information after feature recognition of the screenshot result to the platform server 20. It should be understood that after the image recognition server 50 receives the screenshot result sent by the platform server 20, it performs feature recognition of the view control in the screenshot through a machine model, etc. By analyzing the color, shape, texture and other features of the control, the specific location of each view control on the page is determined. For example, in a screenshot of an e-commerce application, the image recognition server 50 can identify the specific location and type of view controls such as the search box, product image, and purchase button.
[0085] S510: The platform server 20 generates view control layout information based on the view control dependency information and the view control position information, and sends the view control layout information to the operation policy server 40. It should be understood that the platform server 20 integrates and analyzes the previously obtained view control dependency information and view control position information to obtain the view control layout information. Among them, the view control dependency information represents the logical relationship between view controls, and the view control position information represents the physical position of view controls in the page view. By parsing these two types of information, the platform server 20 can generate detailed view control layout information, which comprehensively describes the distribution, hierarchical structure, and interrelationship of each view control in the application program. More specifically, the platform server can parse the obtained view control dependency information into table entries stored in the form of key-value pairs, where the view control ID is used as the key, and the IDs of other view controls it depends on are used as the values, so as to significantly reflect the association logic between view controls. In addition, the obtained view control position information can indicate the coordinates, length, and width of the view control in the page view. The platform server parses the view control position information into table entries with the view control ID as the index and the corresponding dependency information and position information as the index, and then determines the view control layout information. For example, some buttons are displayed only after the user input box has content. Another example is that, combined with the position information, it can be judged whether there is an overlap in the control positions. If so, the positions are adjusted according to preset rules. Through integration and analysis, the platform server can obtain the view control layout information.
[0086] S511: The operation strategy server 40 returns the control traversal operation strategy to the platform server 20. It should be understood that the platform server 20 analyzes and combines the previously obtained view control dependency information and view control position information. The operation strategy server is used to parse the view control layout information to obtain the traversal operation rules, and generate the control traversal operation strategy corresponding to the target test task according to the traversal operation rules. It should be understood that the operation strategy server is configured with an algorithm for the control traversal operation strategy, and can generate the control traversal operation strategy according to the view control layout information, thereby simplifying the local configuration of the stability test platform. Specifically, the view control layout information obtained by the operation strategy server includes the attributes, association relationships, and position coordinates in the page of various controls, and the operation strategy server can parse the view control layout information and formulate traversal operation rules according to the functional characteristics of the controls. For example, for all text box controls with data input functions in the page, traverse them in the order of each text box control in the page, first identify the first text box, and then find the next text box that can input text according to the layout information. Another example, for the button controls in the page, traverse them in the visual order from left to right and top to bottom. Another example, for the target test task, the corresponding control traversal operation strategy can be generated according to the traversal operation rules: first find the product search box and input the product keyword; then traverse the selection buttons in the search result display area and click the selection button corresponding to the target product; then find the add to cart button and click it; finally, locate the settlement button and click it. In this way, combined with the traversal rules obtained by parsing the layout information, the control traversal operation strategy matching the target test task is generated.
[0087] S512: The platform server 20 controls the terminal device to execute at least one view control operation indicated by the control traversal operation strategy via the execution node 30. It should be understood that after receiving the control traversal operation strategy returned by the operation strategy server 40, the platform server 20 will send corresponding operation instructions to the terminal device through the execution node 30 to execute at least one view control operation for each view control of the page view in the application program. For example, according to the traversal operation strategy of the above e-commerce application, the terminal device can sequentially execute operations such as clicking the search box, inputting keywords, and clicking the search button as view control operations to simulate the operation behavior of users.
[0088] S513: The platform server 20 obtains the returned execution result of at least one view control operation through the monitoring component. It should be understood that during the process of the terminal device executing the view control operation, the platform server 20 will monitor the execution status of the operation in real time through the monitoring component. The monitoring component can be configured as a software development kit (SDK) to collect the execution result indication information of the view control operation returned by the terminal device, including whether the operation is successful, the response of the page after the operation, whether an exception occurs, etc. Furthermore, after the platform server 20 obtains the execution result of the view control operation, it can analyze and evaluate the execution result to determine whether there is a problem when the application executes these operations, and provide a basis for subsequent problem location and repair. For example, if the page view does not jump to the payment page normally after clicking a view control such as a purchase button, the monitoring component will record this abnormal state, and the platform server 20 can further generate stability test results based on the abnormal state.
[0089] Figure 6 Electronic devices according to further embodiments of the present invention are shown. Figure 6 The electronic equipment corresponds to Figure 2 Stability testing methods include:
[0090] The acquisition module 610 calls the service data interface in the application according to the target test task to obtain the view control dependency information of the application.
[0091] The first generating module 620 generates view control layout information of each page view of the application at least according to the view control dependency information.
[0092] The second generating module 630 generates a control traversal operation strategy corresponding to the target test task according to the view control layout information.
[0093] The testing module 640 performs a stability test on the application according to the control traversal operation strategy and generates a test result.
[0094] In the solution of an embodiment of the present invention, the call operation on the service data interface of the application can obtain the application's view control dependency information without requiring the application's own underlying data. In addition, based on the view control layout information, a control traversal operation strategy corresponding to the target test task is generated. This facilitates accurately determining the control traversal operation strategy for the target test task, improving the reliability and pertinence of the control traversal operation. This can further improve the reliability of the stability test results when the application is subjected to stability testing based on the control traversal operation strategy.
[0095] In some other embodiments, in the acquisition module, a service data interface in the application is called to obtain view control dependency information of the application, including: generating a server request through a dynamically linked library component pre-injected into the application; and listening, through the dynamically linked library component, to the view control dependency information sent by the service data interface in the application when responding to the server request.
[0096] In some other embodiments, in the first generation module, at least based on the view control dependency information, view control layout information for each page view of the application is generated, including: obtaining each page view that matches the view control dependency information; identifying view control position information for each page view from the screenshot results of each page view; and associating the view control dependency information and the view control position information of each page view to obtain the view control layout information.
[0097] In some other embodiments, in the first generation module, to identify view control position information for each page view from the screenshot results of each page view, it includes: sending the screenshot results of each page view as an image to be recognized to an image recognition server, and receiving the view control position information of each page view returned by the image recognition server, where the image recognition server is used to perform position recognition of view controls on the image to be recognized.
[0098] In some other embodiments, in the first generation module, to associate the view control dependency information and the view control position information of each page view to obtain the view control layout information, it includes: according to the attribute information of each view control in each page view, associating the control dependency relationship of each view control with the control position of each view control to obtain the position association relationship of each view control; and generating the view control layout information according to the position association relationship of each view control.
[0099] In some other embodiments, in the second generation module, according to the view control layout information, a control traversal operation strategy corresponding to the target test task is generated, including: sending the view control layout information to an operation strategy server, and obtaining the control traversal operation strategy returned by the operation strategy server, where the operation strategy server is used to parse the view control layout information to obtain traversal operation rules, and generate the control traversal operation strategy corresponding to the target test task according to the traversal operation rules.
[0100] In some other embodiments, in the second generation module, the view control layout information is parsed to obtain a traversal operation rule, including: determining multiple page view levels indicated by the target test task; parsing the view control layout information to generate at least one view control operation for jumping between the multiple page view levels; and generating the at least one view control operation into a control traversal operation strategy.
[0101] In some other embodiments, in the test module, a stability test is performed on the application according to the control traversal operation strategy to generate a test result, including: sending the control traversal operation strategy to an electronic device on which the application is installed so that the electronic device performs at least one view control operation indicated by the control traversal operation strategy; obtaining, through a monitoring component of the application, an execution result of the at least one view control operation; and associating an exception type of the execution result of the at least one view control operation with the at least one view control operation to generate a test result.
[0102] Figure 7 An electronic device according to some other embodiments of the present invention is shown. Figure 7 The electronic device corresponding to Figure 4 A stability test method includes:
[0103] An interface module 710 returns view control dependency information of the application when a service data interface in the application is called in response to a target test task.
[0104] An acquisition module 720 acquires at least one view control operation indicated by a control traversal operation strategy corresponding to the target test task, where the control traversal operation strategy is generated according to view control layout information of each page view of the application, and the view control layout information is generated at least according to the view control dependency information.
[0105] A display module 730 displays an execution result of the at least one view control operation.
[0106] In the solution of the embodiment of the present invention, for a call operation of a service data interface in an application, without the underlying data of the application itself, view control dependency information of the application can be obtained. In addition, according to the view control layout information, a control traversal operation strategy corresponding to the target test task is generated, which is beneficial to accurately determining the control traversal operation strategy for the target test task, improving the reliability and pertinence of the control traversal operation, and further improving the reliability of the test result of the stability test when performing the stability test on the application according to the control traversal operation strategy.
[0107] It should be understood that for the specific implementation of each module in the electronic device, reference can be made to the corresponding descriptions of the corresponding steps in the foregoing method embodiments, and they have corresponding beneficial effects, which will not be elaborated herein. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described electronic device and modules can refer to the corresponding process descriptions in the foregoing method embodiments, and will not be elaborated herein again.
[0108] Referring to Figure 8 , a schematic structural diagram of an electronic device according to another embodiment of the present invention is shown. The specific implementation of the electronic device in the specific embodiments of the present invention is not limited.
[0109] As Figure 8 shown, the electronic device may include: a processor 802 for executing a program 810, a communication interface 804, a memory 806, and a communication bus 808.
[0110] The processor, the communication interface, and the memory complete communication with each other through the communication bus.
[0111] The communication interface is used to communicate with other electronic devices or servers.
[0112] The processor is used to execute the program, and specifically can execute the relevant steps in the foregoing method embodiments.
[0113] Specifically, the program may include program code, and the program code includes computer operation instructions.
[0114] The processor may be a CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention. One or more processors included in the intelligent device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.
[0115] The memory is used to store the program. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0116] The program may include multiple computer instructions, and specifically, the program can enable the processor to execute the stability test method described in any one of the foregoing multiple method embodiments through the multiple computer instructions.
[0117] For the specific implementation of each step in the program, reference may be made to the corresponding descriptions in the corresponding steps, modules or units in the foregoing method embodiments, and they have corresponding beneficial effects, which will not be elaborated here. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the devices, equipment or modules described above can refer to the corresponding process descriptions in the foregoing method embodiments, which will not be repeated here.
[0118] The embodiments of the present invention also provide a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the methods described in any one of the foregoing multiple method embodiments. The computer storage medium includes, but is not limited to: Compact Disc Read-Only Memory (CD-ROM), Random Access Memory (RAM), floppy disk, hard disk or magneto-optical disk, etc.
[0119] The embodiments of the present invention also provide a computer program product, including computer instructions, and the computer instructions direct a computing device to execute the stability test method in the above-mentioned multiple method embodiments.
[0120] In addition, it should be noted that the information related to users (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data for training the model, data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the users or fully authorized by all parties, and the collection, use and processing of the relevant data need to comply with the relevant regulations and standards, and corresponding operation entrances are provided for users to select authorization or rejection.
[0121] It should be pointed out that according to the needs of implementation, each component / step described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of the components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.
[0122] The method according to an embodiment of the present invention can be implemented in hardware, firmware, or be implemented as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or be implemented as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium and downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an Application Specific Integrated Circuit (ASIC) or a Field Programmable Gate Array (FPGA)). It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component (such as Random Access Memory (RAM), Read-Only Memory (ROM), flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.
[0123] Those of ordinary skill in the art can realize that the units and method steps of each example described in combination with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present invention.
[0124] The above embodiments are only used to illustrate the embodiments of the present invention, rather than to limit the embodiments of the present invention. Those of ordinary skill in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention. The patent protection scope of the embodiments of the present invention shall be defined by the claims.
Claims
1. A stability testing method, comprising: Invoking a service data interface in an application according to a target test task to obtain view control dependency information of the application; Generating view control layout information for each page view of the application based on at least the view control dependency information; Generating a control traversal operation strategy corresponding to the target test task according to the view control layout information; Performing a stability test on the application according to the control traversal operation strategy to generate a test result.
2. The method according to claim 1, wherein, Invoking a service data interface in an application to obtain view control dependency information of the application, including: Generating a server request through a dynamically linked library component pre-injected in the application; Listening for view control dependency information sent by the service data interface in the application when responding to the server request through the dynamically linked library component.
3. The method according to claim 1, wherein, Generating view control layout information for each page view of the application based on at least the view control dependency information, including: Obtaining each page view that matches the view control dependency information; Identifying view control position information of each page view from the screenshot results of each page view; Associating the view control dependency information and the view control position information of each page view to obtain view control layout information.
4. The method according to claim 3, wherein, Identifying view control position information of each page view from the screenshot results of each page view, including: Sending the screenshot results of each page view as an image to be recognized to an image recognition server and receiving view control position information of each page view returned by the image recognition server, where the image recognition server is used to perform position recognition of view controls on the image to be recognized.
5. The method according to claim 3, wherein, Associating the view control dependency information and the view control position information of each page view to obtain view control layout information, including: Associating the control dependency relationships of each view control with the control positions of each view control according to the attribute information of each view control in each page view to obtain position association relationships of each view control; Generating view control layout information according to the position association relationships of each view control.
6. The method according to claim 1, wherein Generating a control traversal operation strategy corresponding to the target test task according to the view control layout information, including: Sending the view control layout information to an operation strategy server to obtain a control traversal operation strategy returned by the operation strategy server, where the operation strategy server is used to parse the view control layout information to obtain traversal operation rules and generate a control traversal operation strategy corresponding to the target test task according to the traversal operation rules.
7. The method according to claim 6, wherein, Parsing the view control layout information to obtain traversal operation rules, including: Determining multiple page view levels indicated by the target test task; Parsing the view control layout information to generate at least one view control operation for jumping between the multiple page view levels; Generating the at least one view control operation into a control traversal operation strategy.
8. The method according to claim 1, wherein Performing a stability test on the application according to the control traversal operation strategy to generate a test result, including: Send the control traversal operation policy to the electronic device on which the application is installed, so that the electronic device executes at least one view control operation indicated by the control traversal operation policy; Obtain the execution result of the at least one view control operation through the monitoring component of the application; Associate the exception type of the execution result of the at least one view control operation with the at least one view control operation to generate a test result.
9. A stability test method, comprising: When a service data interface in an application responds to a target test task being called, return the view control dependency information of the application; Obtain at least one view control operation indicated by a control traversal operation policy corresponding to the target test task, where the control traversal operation policy is generated according to the view control layout information of each page view of the application, and the view control layout information is generated at least according to the view control dependency information; Display the execution result of the at least one view control operation.
10. An electronic device, comprising: An acquisition module, which, according to a target test task, calls a service data interface in an application to obtain the view control dependency information of the application; A first generation module, which generates view control layout information of each page view of the application at least according to the view control dependency information; A second generation module, which generates a control traversal operation policy corresponding to the target test task according to the view control layout information; A test module, which performs a stability test on the application according to the control traversal operation policy to generate a test result.
11. An electronic device, comprising: An interface module, which, when a service data interface in an application responds to a target test task being called, returns the view control dependency information of the application; An acquisition module, which obtains at least one view control operation indicated by a control traversal operation policy corresponding to the target test task, where the control traversal operation policy is generated according to the view control layout information of each page view of the application, and the view control layout information is generated at least according to the view control dependency information; A display module, which displays the execution result of the at least one view control operation.
12. A stability test system, comprising: The electronic device according to claim 10, and a terminal device on which the application is installed.
13. An electronic device, comprising: A processor, a memory, a communication interface, and a communication bus, where the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the method according to any one of claims 1-9.
14. A computer storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the method according to any one of claims 1-9.
15. A computer program product, comprising computer instructions, and when the computer instructions are executed by a processor, it implements the method according to any one of claims 1-9.