A test method, electronic device and related apparatus

By generating a second test map and optimizing the testing strategy using ant colony optimization and heuristic algorithms, the problem of manual testing being unable to cover all paths was solved, thus improving the comprehensiveness and stability of the application's testing.

CN122309342APending Publication Date: 2026-06-30HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-12-31
Publication Date
2026-06-30

Smart Images

  • Figure CN122309342A_ABST
    Figure CN122309342A_ABST
Patent Text Reader

Abstract

This application provides a testing method, electronic device, and related apparatus. In this method, the electronic device randomly assesses the application page situation using an automated tool based on a heuristic algorithm, constructs a heuristic engine model, executes 10,000 random events to generate test paths, and then forms a first test map based on the currently covered test paths. Based on the test strategy corresponding to the first test map, the first test map is continuously evolved and improved to generate a second test map. Paths not reached in the first test map are added to the second test map, thereby covering all paths, improving the comprehensiveness of the testing process, and enhancing the robustness of the application during use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technology, and in particular to a testing method, electronic equipment and related devices. Background Technology

[0002] With the rapid development of electronic devices, the functionality and complexity of applications within these devices are constantly increasing. During use, applications face diverse usage environments, leading to more varied and complex navigation paths between application pages. To ensure the stability and integrity of applications across various usage scenarios, manual testing and verification are typically employed. However, manual testing struggles to comprehensively cover all usage scenarios, resulting in incomplete testing and a degraded user experience. Summary of the Invention

[0003] The present application provides a testing method, electronic device, and related apparatus that can improve testing efficiency and comprehensiveness.

[0004] In a first aspect, this application provides a testing method, which can be executed by an electronic device or a module (such as a chip) in an electronic device, the method comprising:

[0005] Obtain a first test map, wherein the first test map includes a test path corresponding to at least one node, and any one of the at least one nodes is a node corresponding to a page in the application;

[0006] Determine the test strategy corresponding to the first test map;

[0007] The first test map is tested based on the test strategy corresponding to the first test map to obtain a second test map. The number of test paths contained in the second test map is greater than the number of test paths contained in the first test map, or the test paths contained in the second test map are different from the test paths contained in the first test map. The test path includes at least one of the following: page identifier, jump path between pages, and identifier of the control that triggers the jump path.

[0008] In this method, the application is the application to be tested. The electronic device can form a path model of the application based on the test paths that have been covered so far (i.e. the test paths included in the first test map). Then, the path model is evolved and improved based on the test strategy, thereby adding unreached paths to obtain a second test map, which can improve the testing efficiency and the comprehensiveness of the test.

[0009] In one possible implementation of the first aspect, determining the test strategy corresponding to the first test map includes:

[0010] Obtain the test results corresponding to the first test map, wherein the test results include at least one of the following: test cases, execution results corresponding to the test path, node information covered by the test path, and operation behavior information corresponding to the test path;

[0011] Determine the critical path in the first test map based on the test results;

[0012] Based on the critical paths in the first test map, the test strategy corresponding to the first test map is determined according to the ant colony algorithm.

[0013] In this method, the test result corresponding to the first test map is a complete test report. The first test map can fully reflect the execution process of the application in this test case. Then, based on the execution result, the first test map is retested to obtain the second test map, thereby continuously iterating the test of the application under this test case, ensuring the integrity of the test case and improving the comprehensiveness of the test.

[0014] In one possible implementation of the first aspect, the testing strategy includes at least one of the following: depth-first strategy, breadth-first strategy, weight-first strategy, and failure-first strategy.

[0015] In this method, electronic devices can provide a variety of different testing strategies for testing, in order to adapt to different testing needs and improve testing efficiency.

[0016] In one possible implementation of the first aspect, testing the first test map based on the test strategy corresponding to the first test map to obtain a second test map includes:

[0017] Based on the failure priority strategy corresponding to the first test map, the failed paths in the first test map are tested to obtain a second test map, wherein the number of tests on the failed paths in the second test map is greater than the number of tests on the failed paths in the first test map.

[0018] In this method, electronic devices can automatically record the tested scenarios (i.e., the first test map). In the next test, the failed scenarios (such as the failed paths in the first test map) can be tested first, and then the failed scenarios can be tested multiple times to help locate failure problems and improve the robustness of the application.

[0019] In one possible implementation of the first aspect, testing the first test map based on the test strategy corresponding to the first test map to obtain a second test map includes:

[0020] Based on the depth-first strategy corresponding to the first test map, a depth test is performed on the test path corresponding to the first node in the first test map to obtain a second test map. The first node is any one of the at least one nodes, and the number of nodes of the first node on the test path in the second test map is greater than the number of nodes of the first node on the test path in the first test map.

[0021] In this method, electronic devices can automatically record the tested scenarios. In the next test, they can prioritize traversing to the deepest page based on a depth-first strategy, thereby ensuring that less frequently used and deeper pages are verified first, improving the comprehensiveness and stability of the test.

[0022] In one possible implementation of the first aspect, testing the first test map based on the test strategy corresponding to the first test map to obtain a second test map includes:

[0023] Based on the breadth-first strategy corresponding to the first test map, a breadth test is performed on the test path corresponding to the second node in the first test map to obtain a second test map. The second node is any one of the at least one nodes, and the number of test paths of the second node in the second test map is greater than the number of test paths of the second node in the first test map.

[0024] In this method, electronic devices can automatically record tested and untested scenarios. In the next test, shallow-level pages can be verified first based on a breadth-first strategy, thereby ensuring the priority verification of frequently used pages, guaranteeing the coverage of frequently used pages, and improving the comprehensiveness and stability of the test.

[0025] In one possible implementation of the first aspect, testing the first test map based on the test strategy corresponding to the first test map to obtain a second test map includes:

[0026] The first test path in the first test map is weighted and tested based on the weight priority strategy corresponding to the first test map to obtain the second test map. The number of tests corresponding to the first test path in the second test map is more than the number of tests corresponding to the first test map.

[0027] In this method, electronic devices can ensure high-frequency testing of frequently used functions (scenarios) and low-frequency testing of low-frequency functions (scenarios) based on a weight priority strategy, thereby ensuring the stability of the application.

[0028] In one possible implementation of the first aspect, prior to acquiring the first test map, the method further includes:

[0029] Obtain at least one graph structure of the application, wherein any one of the at least one graph structure includes at least one node and at least one edge, and any one of the at least one edges is used to indicate the navigation relationship between the pages;

[0030] Randomly select a first node from at least one node in the at least one graph structure, and execute a click event on the first node;

[0031] The first test map of the application is generated based on the click event;

[0032] Save the first test map.

[0033] In this method, electronic devices can build node information based on application pages, modeling each page and its interaction relationship as a graph structure, where each page can be regarded as a node, and navigation or interaction between pages can be regarded as edges. Thus, the first test map of the application can be built based on this graph structure, improving the efficiency of map creation.

[0034] In one possible implementation of the first aspect, the test path includes a download failure path and an installation failure path among the failure paths. The execution result corresponding to the download failure path includes at least one of the following: secure hash algorithm sha256, insufficient storage space, network unavailable, abnormal download address, and failure to merge packages. The execution result corresponding to the installation failure path includes insufficient storage space, non-existent differential file, lack of installation permissions, and inconsistency between the differential file and sha256.

[0035] In this method, the application to be tested is an app store. The core functions of the app store are downloading and installing applications. There may be various reasons for download or installation failures. Various reasons can be listed and analyzed to find the cause of failure in the failure path. In this way, the cause of failure can be located in the next test, thereby improving the robustness of the application.

[0036] In one possible implementation of the first aspect, the test cases include: task type and network conditions, the task type including at least one of initial download, silent update, package download, copy download, manual update and differential package update, and the network conditions including no network signal, high-fidelity WiFi, mobile network, the WiFi and the mobile network, switching from no network signal to the mobile network, and switching from the WiFi to the mobile network.

[0037] In this method, the application to be tested is an app store. This application corresponds to different task types and may be located under different network conditions when performing download or installation tasks. This indicates that the application may generate many complex scenarios, and the application can be tested under different scenarios to improve the comprehensiveness of the test.

[0038] Secondly, an electronic device is provided in the embodiments of this application, the electronic device comprising: one or more processors; a memory; wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the test method described in the first aspect or any possible implementation of the first aspect.

[0039] In one possible implementation, the electronic device in this application embodiment includes a cloud-side interface. Through the cloud-side interface processor, various types of parameter paths can be automatically enumerated to verify the compatibility and stability of the interface.

[0040] Thirdly, this application provides a chip or chip system including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to perform the test methods described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.

[0041] In one possible implementation, the chip or chip system described above in the embodiments of this application further includes at least one memory, in which instructions are stored. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).

[0042] Fourthly, embodiments of this application provide a computer storage medium storing a computer program that, when executed by a processor, causes the computer to perform the test methods described in the first aspect or any possible implementation thereof.

[0043] Fifthly, embodiments of this application provide a computer program product that, when run on a communication device, causes the communication device to perform the test method described in the first aspect or any possible implementation thereof.

[0044] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0045] The accompanying drawings used in the embodiments of this application are described below.

[0046] Figure 1A This is a diagram of the backend interface of an application market provided in an embodiment of this application;

[0047] Figure 1B This is a schematic diagram of a download link for downloading an application from an application market, provided in an embodiment of this application.

[0048] Figure 1C This is a schematic diagram of an application market scenario path provided in an embodiment of this application;

[0049] Figure 2 This is a flowchart illustrating a testing method provided in an embodiment of this application;

[0050] Figure 3A This is a schematic diagram of a grid map for determining a test path based on an ant colony algorithm, provided in an embodiment of this application.

[0051] Figure 3B This is a schematic diagram illustrating how N routes are determined based on the ant colony algorithm, as provided in an embodiment of this application.

[0052] Figure 3C This is a schematic diagram of a first test map provided in an embodiment of this application;

[0053] Figures 4A to 4C This is a schematic diagram of a second test map provided in an embodiment of this application;

[0054] Figure 5 This is a schematic diagram of a testing method provided in an embodiment of this application;

[0055] Figure 6 This is a schematic diagram of the structure of an electronic device 60 provided in an embodiment of this application;

[0056] Figure 7 The diagram shown is a structural schematic of another electronic device 70 provided in an embodiment of this application. Detailed Implementation

[0057] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.

[0058] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0059] In this application embodiment, an application market or application store is used as an example to describe a testing method provided by this application embodiment. It can be understood that the testing method provided by this application embodiment is also applicable to other applications.

[0060] App stores are electronic application shops that provide software download services for electronic devices. They serve as application distribution channels connecting application developers and users and are the foundation for building an ecosystem. In the app store scenario, application downloads are a core and crucial capability. Understandably, downloads are related to both the professional level of the entire distribution ecosystem and user experience. For example, sometimes users will switch to other channels to download apps due to a poor download experience. Furthermore, defects and problems encountered when downloading apps from app stores are always handled with high priority. However, due to the high complexity of download scenarios, manual testing and verification of application functionality is difficult to fully cover all download scenarios. Research shows that manual downloads can cover approximately 30% of download scenarios, while 70% of download scenarios cannot be fully verified.

[0061] Please see Figure 1A , Figure 1A This is a diagram of the backend interface of an application market provided in an embodiment of this application. Figure 1AThe installation and download metrics shown indicate that up to 240 million downloads are generated daily, along with over 900,000 download errors and over 800,000 installation errors. The number of errors during downloads and / or installations is substantial. Download failure error codes include, but are not limited to: 217 - Socket Timeout, 242 - IO Error, 109 - Connection Error, 213 - Unknown Host, 243 - Connection Reset, 105 - Insufficient SD Card Space, 3 - Added to Waiting Queue, 111 - Local Version Already Updated, 203 - Duplicate Download Task, etc. Installation failure error codes include, but are not limited to, the following: [317-18] Insufficient storage space, [315-100] Invalid installation package, [315-103] Unsigned, [315-23] Invalid installation package (package modified), [315-25] Package version is less than the current version, [316-112] Installation conflict, [304-1] Local application does not exist, [316-8] Installation conflict (signature mismatch),

[304] Original file merging failed, etc. Figure 1AThe download speed indicators show that, under different network environments, the average download speed for users downloading applications is 7.91 megabytes per second (MB / s), the mobile network download speed is 11.4 MB / s, and the Wireless Fidelity (WiFi) download speed is 7.80 MB / s. The download speed percentile (offline statistics) includes the following: 50th percentile (P50) corresponds to a minimum (Min) speed of 4.90 MB / s, a maximum (Maximum) speed of 7.56 MB / s, and an average (Mean) speed of 5.90 MB / s; 90th percentile (P90) corresponds to a minimum speed of 1.04 MB / s, a maximum speed of 2.36 MB / s, and a Mean speed of 1.36 MB / s; and 95th percentile (P95) corresponds to a minimum speed of 65 kilobytes per second (KB / s), a maximum speed of 1.92 MB / s, and a Mean speed of 796 kB / s. The average download speed (24 hours (H)) includes the following: the Min rate is 7.40 MB / s, the Max rate is 8.53 MB / s, and the Mean rate is 7.97 MB / s; the Min rate for mobile network download speed is 9.23 MB / s, the Max rate is 12.7 MB / s, and the Mean rate is 11.4 MB / s; and the Min rate for WiFi download speed is 7.27 MB / s, the Max rate is 8.39 MB / s, and the Mean rate is 7.84 MB / s. The average download speeds (30 days) are as follows: the Min rate is 7.40 MB / s, the Max rate is 8.44 MB / s, and the Mean rate is 7.93 MB / s; the Min rate for mobile network downloads is 9.23 MB / s, the Max rate is 12.54 MB / s, and the Mean rate is 11.22 MB / s; and the Min rate for WiFi downloads is 7.27 MB / s, the Max rate is 8.31 MB / s, and the Mean rate is 7.75 MB / s.

[0062] Please see Figure 1B , Figure 1B This is a schematic diagram of a download link for downloading an application from an application market, provided in an embodiment of this application. Figure 1B As shown, the download link from clicking download / clicking update / clicking all updates to successful installation / installation failure is quite long, and there are many complex states and scenarios in between, such as the user clicking pause, pause due to network reasons, the user clicking resume, resume due to network reasons, download failure, download cancellation, etc.

[0063] Please see Figure 1C , Figure 1CThis is a schematic diagram of an application market scenario path provided in an embodiment of this application, such as... Figure 1C As shown, there may be various download scenarios and failure scenarios during the application download process from the app store. For example, download scenarios include download type and network conditions. Download types include, but are not limited to, first-time download, silent update, package washing download, copy download, manual update, and differential package update, etc. Network conditions include, but are not limited to: WiFi and mobile network, WiFi, mobile network, no network, WiFi switching to mobile network, no network switching to mobile network, etc. Failure scenarios include download failure scenarios and installation failure scenarios. Reasons for download failure include, but are not limited to: secure hash algorithm SHA256, insufficient storage space, network unavailable, abnormal download address, and failed package merging. Reasons for installation failure include, but are not limited to: insufficient storage space, non-existent differential file, lack of installation permissions, and inconsistency between the differential file and SHA256. Figure 1C It can be seen that different download types may correspond to different network conditions. For example, the network conditions for the first download may include at least one of the following: WiFi and mobile network, WiFi, mobile network, no network, WiFi switching to mobile network, and no network switching to mobile network. Downloading an application under different network conditions may result in different download failure scenarios or installation failure scenarios. Therefore, for an app store application, due to the complexity of its functionality (the ability to download applications), comprehensively enumerating all page paths involved in the application's functionality is a problem that needs to be considered during the testing of the app store application.

[0064] In view of this, this application provides a testing method in which an automated tool based on a heuristic algorithm randomly surveys the application page situation, constructs a heuristic engine model, executes 10,000 random events to generate test paths, and then forms a first test map (also known as a path model) based on the currently covered test paths. Based on the test strategy corresponding to the first test map, the first test map is continuously evolved and improved to generate a second test map. Paths not reached in the first test map are added to the second test map, thereby covering all paths, improving the comprehensiveness of the testing process, and enhancing the robustness of the application during use.

[0065] Please see Figure 2 , Figure 2 This is a flowchart illustrating a testing method provided in an embodiment of this application. The method includes, but is not limited to, the following steps:

[0066] Step S201: Obtain the first test map.

[0067] In one implementation, the first test map is generated by an automated testing tool based on a heuristic algorithm. The first test map includes a test path corresponding to at least one node, and any one of the at least one nodes is a node corresponding to a page in the application, which is the application being tested.

[0068] As a possible example, an electronic device can obtain a first test map through a cloud-side interface, which may be obtained on other devices.

[0069] As another example, electronic devices can determine and generate the first survey map based on a heuristic algorithm.

[0070] For example, we will first introduce heuristic algorithms. Heuristic algorithms are proposed in contrast to optimization algorithms. An optimal algorithm for a problem finds the optimal solution for every instance of the problem. A heuristic algorithm is defined as: an algorithm constructed based on intuition or experience that provides a feasible solution for every instance of a combinatorial optimization problem to be solved, with an acceptable cost (referring to computation time and space), the degree of deviation of the feasible solution from the optimal solution generally cannot be predicted.

[0071] In one implementation, the ant colony algorithm, as an important type of heuristic algorithm, is more suitable for large-scale use as an algorithm for automated tools. Pheromone is a core concept in the ant colony algorithm; it is a virtual chemical signal used to simulate the secretions shed by real ants while searching for food. In the algorithm, pheromones are used to represent the quality of a path; the higher the concentration of pheromones on a path, the more likely it is to be a good path. In one implementation, the concentration of pheromones gradually decreases over time, simulating the decay of pheromones over time in the real world. Simultaneously, when ants traverse a path, pheromones are added to that path based on its quality, thereby attracting more ants to choose that path.

[0072] Please see Figure 3A , Figure 3A This is a schematic diagram of a grid map for determining test paths based on the ant colony algorithm, as provided in an embodiment of this application. Figure 3A As shown, in the ant colony algorithm for path planning, a grid map is a commonly used environmental labeling method. It discretizes the actual two-dimensional or three-dimensional space into regular small squares (two-dimensional case) or small cubes (three-dimensional case). Assuming the application has 8 pages, then... Figure 3AThe grid map shown contains 8x8 grids, where white squares are considered walkable and black squares are considered impassable. At the start of the ant colony algorithm, an ant is randomly placed on a walkable grid (starting position) and a target position is set (usually another specific walkable grid). When searching for a path, the ant needs to select a neighboring grid to move to next at each grid. Common neighborhood definitions include four-neighborhood (four adjacent walkable grids in all directions) and eight-neighborhood (including four diagonally walkable grids in addition to the four adjacent grids). When selecting a neighboring grid, the ant considers the pheromone concentration on the grid and some heuristic information (such as the distance to the target position) to obtain a path from the starting position to the target position. This path can be considered as a path from page A to page B.

[0073] In one implementation, Figure 3A If N (say 10,000) ants are randomly placed on the grid diagram shown, N ant decision-making processes can be executed, thus obtaining N routes, for example. Figure 3B The N lines are shown. Please refer to [link / reference]. Figure 3B , Figure 3B This is a schematic diagram illustrating how N routes are determined based on the ant colony algorithm, as provided in an embodiment of this application. It is understood that... Figure 3A Each grid cell in the grid diagram shown represents a page of the application in this embodiment. Therefore, when searching for a route, one can move from the current grid cell to a neighboring grid cell until reaching the grid cell where the target location is located. Thus, the grid cells traversed during the route search process can form a route, thereby obtaining... Figure 3B The lines shown are 1, 2, 3, 4, ..., N. In this application, each line can correspond to a page path of the application to be tested, so the above N lines can constitute the first test map in this embodiment.

[0074] The following section describes the process of generating the first test map based on a heuristic algorithm.

[0075] In one possible implementation, the process of establishing node information based on application pages typically involves modeling the various pages of the application and their interaction relationships as a graph structure, where each page can be considered a node, and navigation or interactions between pages can be considered edges. In one implementation, the electronic device can identify the pages of the application; for example, the electronic device can list all pages in the application, such as: login page, home page, settings page, details page, etc. Then, the electronic device treats each page as a node; exemplarily, a node can contain basic information about the page, such as the page name, page identifier (identificationID), page uniform resource locator (URL), etc. Next, the electronic device identifies interaction relationships to determine navigation relationships between pages; for example, navigation relationships include, but are not limited to: navigation from the login page to the home page, navigation from the home page to the settings page, etc. Following this, the electronic device can establish edges based on the navigation relationships between pages; exemplarily, edges can be represented as navigation paths. Finally, the electronic device uses data structures to construct a graph structure and vectors to store navigation paths. For example, the data structures include a hash map and a linked list. The hash map stores the starting page (e.g., page A), and the linked list stores the pages that can be navigated to from the starting page (e.g., pages B, C, and D). Thus, it can be determined that page A can navigate to any one of pages B, C, and D. For example, the vectors include page identifiers and control identifiers; for instance, page ID1 and control ID2 can navigate to page ID2.

[0076] In one implementation, electronic devices can define data structures such as page elements and node information in the following way.

[0077]

[0078] def display(self):

[0079] for node in self.nodes.values():

[0080] connections=[conn.page_name for conn in node.connections]

[0081] print(f"{node.page_name}->{','.join(connections)}")

[0082] For example, `app_graph = AppGraph()`, `app_graph.add_node(1,"Login Page")` indicates the login page, `app_graph.add_node(2,"Main Page")` indicates the main page, `app_graph.add_node(3,"Settings Page")` indicates the settings page, `app_graph.add_node(4,"Details Page")` indicates the details page, `app_graph.add_edge(1,2)#Login->Main` indicates the path from the login page to the main page, `app_graph.add_edge(2,3)#Main->Settings` indicates the path from the main page to the settings page, and `app_graph.add_edge(2,4)#Main->Details` indicates the path from the main page to the details page. Here, the `Node` class represents each page node, containing the page ID, name, and connections to other pages. The `AppGraph` class represents the graph structure of the entire app, containing methods for adding nodes and edges. In this embodiment, during the process of determining the first test map, at least one graph structure of the application can be created, page and navigation relationships can be added to the graph structure, and the results can be displayed. Therefore, any graph structure in at least one graph structure includes at least one node and at least one edge, and any one of the at least one edges is used to indicate the navigation relationship between pages.

[0083] In one possible implementation, after the electronic device has configured at least one graph structure of the application, a first test map can be generated based on a heuristic algorithm for randomized automated testing. Specifically, the electronic device configures the test framework and related dependencies to set up the test environment. Based on the aforementioned at least one graph structure, the electronic device can determine all pages and executable operations in the application, and then, based on a test script, randomly select a node (e.g., the first node) from at least one node in the at least one graph structure, perform a click operation on the first node, and record the operation result. After the test execution is completed, a test execution path report (which may be simply referred to as a test report) can be generated, which includes, but is not limited to: the first test map, test cases, operations performed on the page, and execution results, etc.

[0084] For example, test cases include, but are not limited to, task types and network conditions. The task types include at least one of initial download, silent update, package download, copy download, manual update, and differential package update. The network conditions include no network signal, high-fidelity Wi-Fi, mobile network, Wi-Fi and mobile network, switching from no network signal to mobile network, and switching from Wi-Fi to mobile network. Operations performed on the page include, but are not limited to, operations performed on controls on the page, such as click operations. Execution results include, but are not limited to, whether the application is downloaded, whether the application is installed, whether the application is successfully installed, etc. It should be noted that different test cases can be set to test the application in different testing environments / scenarios.

[0085] In one implementation, the electronic device can generate a first test map through randomized automated testing based on a heuristic algorithm in the following manner.

[0086] class RandomAppTest:

[0087] def__init__(self):

[0088] self.path = []

[0089] self.driver = None

[0090] self.pages = ["Login Page", "Main Page", "Settings Page", "Details Page"]

[0091] self.actions = ["Enter username and password","Click settings","Modify settings","View details"]

[0092] def setup(self):

[0093] desired_caps={

[0094] 'platformName':'Android',

[0095] 'deviceName':'YourDeviceName',

[0096] 'app':'path / to / your / app.apk',

[0097]

[0098] It should be noted that the above method involves the following processing logic:

[0099]

[0100] In the above approach, the `RandomAppTest` class manages the test execution path and the Appium driver. The `setup` method configures and starts the Appium driver. The `visit_page` and `perform_action` methods record the pages visited and the actions performed. The `random_test_flow` method randomly selects pages and actions for testing, with the `iterations` parameter controlling the number of tests. The `generate_report` method generates a report on the test execution path. The `teardown` method shuts down the test framework driver.

[0101] For example, please see Figure 3C , Figure 3C This is a schematic diagram of a first test map provided in an embodiment of this application. Taking an application market as an example, such as... Figure 3C As shown, the first test map includes, but is not limited to, the following test paths: App Store Homepage - Update Management Page - Update Management Page Recommended Module - Details Page - Recommended Page - Download App Page; App Store Homepage - Update Management Page - Update Management Page Recommended Module - Details Page - Download App Page; App Store Homepage - H5 Activity Page - Download App Page; App Store Homepage - Download Management Page - Download Management Page Recommended Page - Download App Page; App Store Homepage - Horizontal Swipe Web Card - Download App Page.

[0102] Step S202: Determine the test strategy corresponding to the first test map.

[0103] Specifically, the electronic device can analyze the test report generated in step S201 and determine the test strategy corresponding to the first test map. In one implementation, the electronic device first collects the report (hereinafter referred to as the test report) obtained in step S201 after the automated test execution. This report includes, but is not limited to, test cases, execution results, covered page nodes (i.e., the first test map), and operation behavior information. Then, the electronic device analyzes the test report to identify which pages and functions are covered and which pages and functions are not covered. It then analyzes the failed test cases and reasons to obtain test results. The test results include at least one of the following: test cases, execution results corresponding to test paths, node information covered by test paths, and operation behavior information corresponding to test paths. Then, the electronic device can determine the critical path in the first test map based on the test results. The critical path can be considered as a frequently executed path or a path where the function fails. Finally, based on the critical path in the first test map, the test strategy corresponding to the first test map is determined according to the ant colony algorithm.

[0104] For example, if the information reflected by the critical path in the first test map indicates that the nodes in the test path belong to shallow-level pages (such as first-level pages), it means that the nodes in the first test map have not yet involved deeper-level pages (such as second-level pages and below). In this case, the test strategy corresponding to the first test map is a depth-first strategy. The depth-first strategy is used to indicate that the deepest page should be traversed first in the next test to ensure that the functions of infrequently used pages and deeper pages can be tested first.

[0105] For example, if the information reflected by the critical path in the first test map is that there are few nodes in the test path, it means that not all controls on the nodes in the first test map have been operated. In this case, the test strategy corresponding to the first test map is the breadth-first strategy. The breadth-first strategy is used to indicate that all controls on the current page should be tested first in the next test, which means ensuring the automated test coverage of frequently used pages.

[0106] For example, if the critical path in the first test map reflects information such that one or more paths in the test path are executed more frequently, it indicates that the path is a frequently used path and is likely to be used by more users in actual operation, and therefore can be set as a path with higher weight; if the critical path in the first test map reflects information such that one or more paths in the test path are executed less frequently, it indicates that the path is an infrequently used path and is unlikely to be used by more users in actual operation, and therefore can be set as a path with lower weight. In this case, the test strategy corresponding to the first test map is a weight-first strategy. The weight-first strategy is used to indicate that the functions of pages with higher weights should be tested first, thereby ensuring high-frequency testing of frequently used functions and low-frequency testing of low-frequency scenarios.

[0107] For example, the information reflected by the critical path in the first test map is that there is a failed path, indicating that the application function cannot be implemented through this path. In order to ensure the implementation of the application function, the test strategy corresponding to the first test map is a failure priority strategy. The failure priority strategy is used to indicate the priority testing of pages with failed functions, thereby ensuring that pages with failed functions are tested more frequently and helping to locate the cause of failure.

[0108] Understandably, taking an app store as an example, the core function of an app store is to navigate to the download page through the pages provided by the app, ultimately completing the download and installation of the app. Therefore, download failure and / or installation failure can be considered as application functionality failure. The test path includes download failure paths and installation failure paths within the failure path. For example, as analyzed above, there are multiple reasons for download failure and installation failure. Therefore, the execution results corresponding to the download failure path include at least one of the following: secure hash algorithm SHA256, insufficient storage space, network unavailability, abnormal download address, and failure to merge packages. The execution results corresponding to the installation failure path include insufficient storage space, non-existent differential file, lack of installation permissions, and inconsistency between the differential file and SHA256.

[0109] In one implementation, the testing strategy includes at least one of depth-first search, breadth-first search, weight-first search, and failure-first search. Optionally, the first test map may correspond to at least one of depth-first search, breadth-first search, weight-first search, and failure-first search, meaning that the test paths in the first test map may correspond to multiple testing strategies.

[0110] Step S203: Test the first test map based on the test strategy corresponding to the first test map to obtain the second test map.

[0111] For example, the testing strategy includes at least one of the following: depth-first strategy, breadth-first strategy, weight-first strategy, and failure-first strategy. In this embodiment, when testing / verifying the functionality of an application, it is not necessary to immediately verify the deepest / most numerous functional modules. Instead, multiple paths / strategies are considered for verification to ensure that the test can proceed from point A to point B, thereby covering as many paths as possible. This allows for the discovery of compatibility and stability issues caused by incomplete coverage of hidden paths during the testing / verification process. Therefore, based on the currently covered verification paths, a path model (i.e., the test paths in the first test map) is formed. The model is continuously evolved and improved, adding unreached paths to ensure the completeness and comprehensiveness of the test.

[0112] In one implementation, the electronic device tests failed paths in the first test map based on a failure-first strategy corresponding to the first test map, thus obtaining a second test map. The failed paths in the second test map are tested more times than those in the first test map. For example, taking an app store as an example, please refer to [link to relevant documentation]. Figure 4A , Figure 4A This is a schematic diagram of a second test map provided in an embodiment of this application. It can be understood that, in Figure 3CThe first test map shown already covers the tested paths, but there are failed paths within this test map, for example... Figure 3C The test path shown, from the app store homepage to the horizontal scrolling webpage card to the app download page, is a failed path. To further verify the reasons for the failure of this failed path or to further verify the failure frequency of this failed path, in the next test, the failed path in the first test map can be obtained based on the failure priority strategy (prioritizing / multiple tests). Figure 4A The second test map is shown. From Figure 4A It can be seen that the test path from the app store homepage to the horizontal scrolling webpage card to the app download page was tested multiple times compared to other test paths. This ensured the number of tests for this failed path and thus guaranteed the stability of the application through multiple tests.

[0113] In one implementation, the electronic device performs depth testing on the test path corresponding to a first node in the first test map based on a depth-first strategy corresponding to the first test map, thereby obtaining a second test map. The first node is any one of at least one nodes, and the number of nodes corresponding to the first node on the test path in the second test map is greater than the number of nodes corresponding to the first node on the test path in the first test map. For example, taking an app store as an example, please refer to [link to relevant documentation]. Figure 4B , Figure 4B This is a schematic diagram of another second test map provided in an embodiment of this application. It can be understood that the first test map already covers the tested paths, but the nodes in those test paths belong to shallow-level pages (e.g., first-level pages), indicating that the nodes in the first test map do not yet involve deeper-level pages (e.g., second-level pages and below). Figure 3C The nodes along the test path shown (App Market Homepage - Update Management Page - Download App Page) are shallow-level pages. To further verify whether these nodes can trigger deeper-level pages, in the next test, a depth-first strategy can be used to traverse deeper pages (i.e., subpages or lower-level pages). In other words, the lowest-level page reachable from the nodes along this test path should be tested first. Figure 4B The second test map is shown. From Figure 4B It can be seen that, relative to Figure 3C The first test map shown has added several nodes corresponding to Page 1, Page 2, and Page 3 in the test path from the app store homepage to the update management page to the download app page. Page 1 is the next level page of the update management page (i.e., the page corresponding to the first node), Page 2 is the next level page of Page 1, and Page 3 is the next level page of Page 2. This allows the test path to verify deeper levels (i.e., lower levels) of pages.

[0114] In one implementation, a breadth-first search strategy corresponding to a second node in the first test map is used to perform breadth-first search on the test paths, resulting in a second test map. The second node is any one of at least one nodes, and the number of test paths for the second node in the second test map is greater than the number of test paths for the second node in the first test map. For example, taking an app store as an example, please refer to [link to relevant documentation]. Figure 4C , Figure 4C This is a schematic diagram of another second test map provided in an embodiment of this application. It can be understood that the first test map already covers the tested paths, but the test paths in the first test map have fewer node branches, indicating that some controls in the first test map are not being manipulated. To further verify whether all controls on the nodes of this test path have been manipulated, in the next test, a breadth-first search strategy can be used to traverse all controls on the page corresponding to the current node (i.e., the second node), that is, to prioritize testing all controls on the page corresponding to the nodes of this test path. Figure 4C The second test map is shown. From Figure 4C It can be seen that, relative to Figure 3C The first test map shown is Figure 4C The second test map shown adds two test paths: the app store homepage - page 4 - download app page and the app store homepage - page 5 - download app page. This allows the test map to verify more test paths and ensures the automated test coverage of commonly used pages.

[0115] In one implementation, a weighted test is performed on the first test path in the first test map based on a weight-first strategy corresponding to the first test map, resulting in a second test map. The first test path is tested more times in the second test map than it is tested in the first test map. This is because if one or more test paths in the first test map are executed more frequently, it indicates that these paths are commonly used and are likely to be used by more users in actual operation. Therefore, these test paths can be tested more frequently based on the weight-first strategy. Conversely, if one or more test paths in the first test map are executed less frequently, it indicates that these paths are less commonly used and are unlikely to be used by more users in actual operation. Therefore, testing of these test paths can be stopped when they are encountered based on the weight-first strategy. This ensures high-frequency testing of frequently used functions and low-frequency testing of low-frequency scenarios.

[0116] The following describes a testing method provided in an embodiment of this application, using a practical scenario as an example. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of a testing method provided in an embodiment of this application. For example... Figure 5 As shown in (a), taking the application market as an example, the electronic device has a pre-built data structure of page elements, node information, etc. of the application market in the automated testing tool. Further, the electronic device can display a first interface 500 in the automated testing tool. The first interface 500 includes task types and network conditions in the test cases. Task types include, but are not limited to: initial download, silent update, package download, copy download, manual update, and differential package update. Network conditions include, but are not limited to: no network signal, high-fidelity WiFi, mobile network, WiFi and the mobile network, switching from no network signal to the mobile network, and switching from WiFi to the mobile network. Figure 5 As can be seen from (a), each task type and each network condition corresponds to a selection control 501. The electronic device can select the corresponding task type and network condition in response to an operation on the selection control 501. For example, after the electronic device determines the task type and network condition to be tested in the first interface 500, in response to an operation on the start test control 502, it can begin automated testing of the application market, displaying... Figure 5 The second interface 510 is shown in (b).

[0117] As a possible example, during automated testing of an application marketplace, the electronic device establishes data structures such as page elements and node information. It then executes a random event, randomly selecting a node (e.g., a control in the second interface 510), clicking it, recording the execution process, and inputting the recorded process into a heuristic engine model. In one implementation, during the click event, the electronic device records the node's state to change in response to the click event. For example, changing the business state can be considered as the current node being in a first state (e.g., a paused state) before the click event and in a second state (e.g., a resumed state) after the click event. In another implementation, the electronic device records the node's state to construct an edge (i.e., generate a new page) in response to the click event opening a new page.

[0118] As another possible example, during the execution of a random event, if a new page is opened, a data structure such as page elements and node information is established; if only the business state is changed, a node is randomly selected again and a click event is executed.

[0119] In one possible implementation, the electronic device builds a heuristic engine that records node information (such as the number of clicks on page IDs and control IDs) to construct a directed graph. For example, such as Figure 5As shown in (b), if a randomly selected node during the execution of a random event is the continue control corresponding to application 4 on the homepage, then the recorded node information includes the homepage ID, the application 4 ID, the continue control ID, and the number of clicks on the continue control. In one implementation, if the random event corresponds to a page jump, a directed graph is constructed using hash tables and linked lists, for example, the edge from page ID1 + control ID1 to page ID2. For example, as... Figure 5 As shown in (b), if a randomly selected node is the icon of application 7 on the homepage, the recorded node information includes: homepage ID, application 7 ID, application 7 response ID, and directed graph.

[0120] In one implementation, the test dwell time on the page can also be recorded during the execution of random events. For example, a longer test dwell time indicates that the test path corresponding to the page is simpler, and the page is less likely to redirect to other pages.

[0121] In one possible implementation, after executing N (say, 10,000) random events, the electronic device can construct a directed graph (i.e., a first test map). This first test map can record page dwell time, control click times, relationships (edges) between pages, and so on. For example, please refer to... Figure 5 The first test map shown in (c) is from Figure 5As can be seen from (c), the first test map includes, but is not limited to, the following: the homepage dwell time is 40 seconds, the number of clicks on control 1 on the homepage is 5, the number of clicks on control 2 on the homepage is 6, the number of clicks on control 3 on the homepage is 8, the number of clicks on control 4 on the homepage is 9, clicking on control 1 on the homepage will redirect to the details page, the dwell time on the details page is 50 seconds, the number of clicks on control 11 on the details page is 5, the number of clicks on control 12 on the details page is 6, the number of clicks on control 13 on the details page is 8, clicking on control 2 on the homepage will redirect to the update management page, the dwell time on the update management page is 55 seconds, the number of clicks on control 21 on the update management page is 5, and the number of clicks on control 22 on the update management page is 6. The following actions are performed: Clicking control 23 on the update management page requires 8 clicks; clicking control 22 on the update management page redirects to the details page; clicking control 23 on the update management page redirects to the ignore update page; the dwell time on the ignore update page is 75 seconds; clicking control 231 on the ignore update page requires 4 clicks; clicking control 232 on the ignore update page requires 6 clicks; clicking control 233 on the ignore update page requires 8 clicks; clicking control 3 on the homepage redirects to the download management page; the dwell time on the download management page is 40 seconds; clicking control 31 on the download management page requires 5 clicks; clicking control 32 on the download management page requires 6 clicks; clicking control 33 on the download management page requires 8 clicks; clicking control 32 on the download management page yields the execution result. For example, the execution result includes, but is not limited to: download unsuccessful, download successful but installation unsuccessful, and installation successful.

[0122] In one possible implementation, the electronic device is based on Figure 5 After generating the first test map under the test cases configured in (a) (which can be called the test environment), an automated testing strategy (such as depth-first search, breadth-first search, weight-first search, etc.) can be determined based on the traversal algorithm of the first test map (such as the ant colony algorithm), and then based on the... Figure 5 The test cases configured in (a) and the determined test strategy perform specific heuristic traversal tasks on the first test map to generate the second test map. By continuously evolving, untriggered paths are added to ensure the comprehensiveness of the verification process.

[0123] The methods of the embodiments of this application have been described above, and the apparatus of the embodiments of this application is provided below.

[0124] It is understood that the various devices provided in the embodiments of this application, such as data migration devices and migration scheduling devices, include hardware structures, software units, or combinations of hardware and software structures to perform the functions described in the above method embodiments in order to achieve the functions. Those skilled in the art should readily recognize that the devices and modules within them, in conjunction with the various functions described in the embodiments disclosed herein, can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different device implementation methods to implement the aforementioned method embodiments in different usage scenarios, and different implementation methods of the devices should not be considered beyond the scope of the embodiments of this application.

[0125] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device 60 provided in an embodiment of this application. The electronic device 60 may include an acquisition module 601 and a processing module 602. The electronic device can be used to perform the aforementioned test method.

[0126] In one possible implementation, the acquisition module 601 is used to acquire a first test map, wherein the first test map includes a test path corresponding to at least one node, and any one of the at least one nodes is a node corresponding to a page in the application.

[0127] Processing module 602 is used to determine the test strategy corresponding to the first test map;

[0128] The processing module 602 is further configured to test the first test map based on the test strategy corresponding to the first test map to obtain a second test map, wherein the number of test paths contained in the second test map is greater than the number of test paths contained in the first test map, or the test paths contained in the second test map are different from the test paths contained in the first test map, and the test paths include at least one of page identifiers, page jump paths, and identifiers of controls that trigger the jump paths.

[0129] In another possible implementation, the processing module 602 is specifically used to obtain the test results corresponding to the first test map, wherein the test results include at least one of the following: test cases, execution results corresponding to the test path, node information covered by the test path, and operation behavior information corresponding to the test path;

[0130] Determine the critical path in the first test map based on the test results;

[0131] Based on the critical paths in the first test map, the test strategy corresponding to the first test map is determined according to the ant colony algorithm.

[0132] In another possible implementation, the testing strategy includes at least one of the following: depth-first strategy, breadth-first strategy, weight-first strategy, and failure-first strategy.

[0133] In another possible implementation, the processing module 602 is specifically used to test the failed paths in the first test map based on the failure priority strategy corresponding to the first test map to obtain a second test map, wherein the number of tests on the failed paths in the second test map is greater than the number of tests on the failed paths in the first test map.

[0134] In another possible implementation, the processing module 602 is specifically used to perform depth testing on the test path corresponding to the first node in the first test map based on the depth-first strategy corresponding to the first test map, to obtain a second test map, wherein the first node is any one of the at least one nodes, and the number of nodes of the first node on the test path in the second test map is greater than the number of nodes on the test path in the first test map.

[0135] In another possible implementation, the processing module 602 is specifically used to perform breadth testing on the test paths corresponding to the second node in the first test map based on the breadth-first strategy corresponding to the first test map, to obtain a second test map, wherein the second node is any one of the at least one nodes, and the number of test paths of the second node in the second test map is greater than the number of test paths of the second node in the first test map.

[0136] In another possible implementation, the processing module 602 is specifically used to perform weight testing on the first test path in the first test map based on the weight priority strategy corresponding to the first test map, to obtain a second test map, wherein the number of tests corresponding to the first test path in the second test map is more than the number of tests corresponding to the first test map.

[0137] In another possible implementation, the acquisition module 601 is specifically used to: acquire at least one graph structure of the application, wherein any one of the at least one graph structure includes the at least one node and at least one edge, and any one of the at least one edges is used to indicate the navigation relationship between the pages;

[0138] Randomly select a first node from at least one node in the at least one graph structure, and execute a click event on the first node;

[0139] The first test map of the application is generated based on the click event;

[0140] Save the first test map.

[0141] In another possible implementation, the test path includes a download failure path and an installation failure path in the failure path. The execution result corresponding to the download failure path includes at least one of the following: secure hash algorithm sha256, insufficient storage space, network unavailable, abnormal download address, and failure to merge packages. The execution result corresponding to the installation failure path includes insufficient storage space, non-existent differential file, no installation permission, and inconsistency between the differential file and sha256.

[0142] In another possible implementation, the test cases include: task type and network conditions, the task type including at least one of initial download, silent update, package download, copy download, manual update and differential package update, and the network conditions including no network signal, high-fidelity WiFi, mobile network, the WiFi and the mobile network, switching from no network signal to the mobile network, and switching from the WiFi to the mobile network.

[0143] Figure 7 The diagram shown is a structural schematic of another electronic device 70 provided in an embodiment of this application. The electronic device 70 is a device with computing capabilities. This device can be a physical device, such as a controller, processor, server (such as a rack server), host, etc., or it can be a virtual device, such as a virtual machine, container, etc.

[0144] like Figure 7 As shown, the electronic device 70 includes a processor 702 and a memory 701, and optionally includes a bus 704 and a communication interface 703. The processor 702 and the memory 701 communicate with each other via the bus 704. It should be understood that this application does not limit the number of processors and memories in the electronic device 70.

[0145] Memory 701 provides storage space, which may optionally store application data, user data, operating system, and computer programs. Memory 701 may include volatile memory, such as random access memory (RAM). Memory 701 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD).

[0146] Processor 702 is a module that performs computations and may include any one or more of the following: controller (e.g., memory controller), central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), digital signal processor (DSP), coprocessor (to assist the central processing unit in performing corresponding processing and applications), application-specific integrated circuit (ASIC), microcontroller unit (MCU), virtual machine, container, etc.

[0147] The communication interface 703 is used to provide information input or output to the at least one processor. And / or, the communication interface 703 can be used to receive data transmitted externally and / or transmit data externally. The communication interface 703 can be a wired link interface, such as an Ethernet cable, or a wireless link interface (Wi-Fi, Bluetooth, general wireless transmission, and other wireless communication technologies, etc.). Optionally, the communication interface 703 may also include a transmitter (such as a radio frequency transmitter, antenna, etc.) or a receiver coupled to the interface.

[0148] The 704 bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 7 The bus 704 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 704 may include a path for transmitting information between various components of the electronic device 70 (e.g., memory 701, processor 702, communication interface 703).

[0149] In this embodiment, memory 701 stores executable instructions, and processor 702 executes these executable instructions to implement the aforementioned testing method. That is, memory 701 stores instructions for executing the testing method.

[0150] This application embodiment also provides an electronic device cluster, which includes at least one electronic device 70, each electronic device 70 including a processor 702 and a memory 701;

[0151] A processor 702 of at least one electronic device 70 is configured to execute instructions stored in a memory 701 of the at least one electronic device 70, so that the cluster of electronic devices implements the aforementioned test method. Optionally, the memory stores instructions for executing the test method.

[0152] This application provides a computer-readable storage medium storing instructions that, when executed on at least one processor, implement the aforementioned test method.

[0153] The computer-readable storage medium can be any available medium that an electronic device can store, or a data storage device such as a data center that contains one or more available media. The computer-readable storage medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).

[0154] This application provides a computer program product including computer instructions that, when executed on at least one processor, implement the aforementioned test method.

[0155] Optionally, the computer program product can be a software installation package or an image package. If the aforementioned method is required, the computer program product can be downloaded and executed on an electronic device.

[0156] In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0157] In this application, "at least one" in the embodiments refers to one or more items, and "more than one" refers to two or more items. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, and c can be single or multiple. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0158] Furthermore, unless otherwise stated, the use of ordinal numbers such as "first" and "second" in the embodiments of this application is for distinguishing multiple objects and is not for limiting the order, timing, priority, or importance of multiple objects. For example, "first storage device" and "second storage device" are only for ease of description and do not indicate differences in the device structure, deployment order, importance, etc. of the first storage device and the second storage device.

[0159] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A testing method, characterized in that, The method includes: Obtain a first test map, wherein the first test map includes a test path corresponding to at least one node, and any one of the at least one nodes is a node corresponding to a page in the application; Determine the test strategy corresponding to the first test map; The first test map is tested based on the test strategy corresponding to the first test map to obtain a second test map. The number of test paths contained in the second test map is greater than the number of test paths contained in the first test map, or the test paths contained in the second test map are different from the test paths contained in the first test map. The test path includes at least one of the following: page identifier, jump path between pages, and identifier of the control that triggers the jump path.

2. The method according to claim 1, characterized in that, The step of determining the test strategy corresponding to the first test map includes: Obtain the test results corresponding to the first test map, wherein the test results include at least one of the following: test cases, execution results corresponding to the test path, node information covered by the test path, and operation behavior information corresponding to the test path; Determine the critical path in the first test map based on the test results; Based on the critical paths in the first test map, the test strategy corresponding to the first test map is determined according to the ant colony algorithm.

3. The method according to claim 1 or 2, characterized in that, The testing strategy includes at least one of the following: depth-first strategy, breadth-first strategy, weight-first strategy, and failure-first strategy.

4. The method according to claim 3, characterized in that, The step of testing the first test map based on the test strategy corresponding to the first test map to obtain the second test map includes: Based on the failure priority strategy corresponding to the first test map, the failed paths in the first test map are tested to obtain a second test map, wherein the number of tests on the failed paths in the second test map is greater than the number of tests on the failed paths in the first test map.

5. The method according to claim 3 or 4, characterized in that, The step of testing the first test map based on the test strategy corresponding to the first test map to obtain the second test map includes: Based on the depth-first strategy corresponding to the first test map, a depth test is performed on the test path corresponding to the first node in the first test map to obtain a second test map. The first node is any one of the at least one nodes, and the number of nodes of the first node on the test path in the second test map is greater than the number of nodes of the first node on the test path in the first test map.

6. The method according to any one of claims 3 to 5, characterized in that, The step of testing the first test map based on the test strategy corresponding to the first test map to obtain the second test map includes: Based on the breadth-first strategy corresponding to the first test map, a breadth test is performed on the test path corresponding to the second node in the first test map to obtain a second test map. The second node is any one of the at least one nodes, and the number of test paths of the second node in the second test map is greater than the number of test paths of the second node in the first test map.

7. The method according to any one of claims 3 to 6, characterized in that, The step of testing the first test map based on the test strategy corresponding to the first test map to obtain the second test map includes: The first test path in the first test map is weighted and tested based on the weight priority strategy corresponding to the first test map to obtain the second test map. The number of tests corresponding to the first test path in the second test map is more than the number of tests corresponding to the first test map.

8. The method according to any one of claims 1 to 7, characterized in that, Before obtaining the first test map, the method further includes: Obtain at least one graph structure of the application, wherein any one of the at least one graph structure includes at least one node and at least one edge, and any one of the at least one edges is used to indicate the navigation relationship between the pages; Randomly select a first node from at least one node in the at least one graph structure, and execute a click event on the first node; The first test map of the application is generated based on the click event; Save the first test map.

9. The method according to any one of claims 2 to 8, characterized in that, The test path includes the download failure path and the installation failure path in the failure path. The execution result corresponding to the download failure path includes at least one of the following: secure hash algorithm sha256, insufficient storage space, network unavailable, abnormal download address, and failure to merge packages. The execution result corresponding to the installation failure path includes insufficient storage space, non-existent differential file, no installation permission, and inconsistency between differential file and sha256.

10. The method according to any one of claims 2 to 9, characterized in that, The test cases include: task type and network conditions. The task type includes at least one of the following: initial download, silent update, package download, copy download, manual update, and differential package update. The network conditions include no network signal, high-fidelity WiFi, mobile network, WiFi and mobile network, switching from no network signal to mobile network, and switching from WiFi to mobile network.

11. An electronic device, characterized in that, The electronic device includes: one or more processors; a memory; wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 10.

12. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 10.

13. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 10.

14. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1 to 10.