Mobile application parallel testing method, system and related device based on master-slave architecture
By employing a master-slave architecture for parallel testing, and utilizing LAN broadcasting and preset synchronization strategies, efficient collaboration in multi-device testing was achieved, solving the problem of low testing efficiency in existing technologies and improving the quality of compatibility testing.
Patent Information
- Application Number
- CN202511224311.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-08-29
AI Technical Summary
Existing mobile application testing methods are inadequate for effectively handling dynamic data display across multiple devices, verification of differentiated interactive logic, and complex network interaction debugging needs, resulting in high testing costs and low efficiency.
A parallel testing method based on a master-slave architecture is adopted. A local area network connection is established through broadcast information. The master application generates synchronization configuration information and sends it to the slave application. The operation and network request are synchronized using a preset synchronization strategy to achieve multi-device testing.
It improved testing efficiency, reduced manual testing costs, enhanced the quality of App compatibility testing, and enabled simultaneous observation of performance differences across multiple different models and platform devices on a single main device.
Smart Images

Figure CN120723658B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of software testing technology, specifically to a method, system, computer device, and computer-readable storage medium for parallel testing of mobile applications based on a master-slave architecture. Background Technology
[0002] Currently, in traditional mobile application testing, developers typically need to perform operations on multiple devices to verify compatibility and behavioral consistency. Existing methods mostly rely on script playback, screen mirroring, or automated testing frameworks (such as Appium, UIAutomator, XCTest, etc.), which are difficult to handle dynamic data display on multiple devices, verification of different interaction logic, and complex network interaction debugging needs, resulting in high testing costs and low efficiency. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention provide a parallel testing method for mobile applications based on a master-slave architecture, which is used to solve the problems of complex verification logic and network interaction debugging requirements and low testing efficiency in the prior art.
[0004] According to one aspect of the present invention, a method for parallel testing of mobile applications based on a master-slave architecture is provided, the method comprising:
[0005] When the main application starts, it sends a broadcast message to the local area network via broadcast. The broadcast message includes a service identifier broadcast packet.
[0006] At least one slave application joins the main application's network upon receiving the broadcast information;
[0007] The at least one application sends identity registration information to the main application; the identity registration information includes device identifier, system platform information, and application version number;
[0008] The master device of the main application establishes a connection with the slave device of the at least one slave application based on the identity registration information;
[0009] During testing, when the main application receives an operation request, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy is used to determine the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data.
[0010] The at least one slave application performs a replay operation based on the synchronization configuration information through a built-in execution engine to generate slave test results corresponding to the at least one slave application;
[0011] The main application obtains the test results corresponding to at least one slave application.
[0012] In one alternative approach, when the main application starts, it sends broadcast information to the local area network via broadcast. The broadcast information includes service identification information and further includes:
[0013] When the main application starts, it initializes the communication service;
[0014] The main application periodically sends service identification information to a preset broadcast address within the local area network via the UDP protocol; the service identification broadcast packet includes the device information of the main application, the main application identifier, and the host status of the main application.
[0015] In one alternative approach, the at least one slave application joining the main application's network upon receiving the broadcast information includes:
[0016] When the at least one application receives the broadcast information, it verifies whether the broadcast content of the broadcast information is legal.
[0017] When legal, the at least one slave application caches the main application's main device information into memory or displays it in a list;
[0018] The at least one slave device of the slave application initiates a WebSocket connection with the master device of the master application based on the information of the master device.
[0019] In one optional approach, the operation request information includes operation actions and network requests; the synchronization configuration information includes structured operation instructions; during testing, when the main application receives the operation request information, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application, including:
[0020] When the main application captures user actions through the embedded operation recorder; the user actions include click operations, swipe operations, input operations, and back operations;
[0021] When the operation behavior is captured, it is encapsulated into a structured operation instruction; the structured operation instruction includes operation type, target control information, operation parameters and timestamp;
[0022] The structured operation instruction and its corresponding instruction configuration identifier are sent to the at least one slave application; the instruction configuration identifier is used to indicate whether to synchronize the network request information corresponding to the structured operation instruction.
[0023] In one optional approach, during testing, when the main application receives an operation request information from itself, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application, including:
[0024] When the main device initiates a network request during the operation corresponding to the operation behavior, the main application intercepts the network request and the corresponding response data through the embedded network proxy layer.
[0025] The main application determines whether it needs to send network request information corresponding to the structured operation instruction for synchronization according to a preset synchronization strategy. When it needs to send, it generates an instruction configuration identifier that contains the network request information that needs to be synchronized.
[0026] The structured operation instructions, the network request and the corresponding response data, and the corresponding instruction configuration identifier are sent to the at least one slave application.
[0027] In one alternative approach, the preset synchronization strategy includes:
[0028] Based on the interface corresponding to the network request and the information of the currently logged-in account, determine whether to synchronize the network request and the corresponding response data;
[0029] Based on the page type corresponding to the operation, determine whether to synchronize the network request and the corresponding response data;
[0030] Based on a preset interface whitelist and / or interface blacklist, determine whether to synchronize the network request and the corresponding response data;
[0031] Depending on the test type, determine whether to synchronize the network request and its corresponding response data.
[0032] According to another aspect of the present invention, a mobile application parallel testing system based on a master-slave architecture is provided, comprising:
[0033] The main application is used to send broadcast information to the local area network via broadcast after the main application starts. The broadcast information includes a service identifier broadcast packet.
[0034] At least one slave application is configured to join the network of the master application upon receiving the broadcast information.
[0035] The at least one slave application is further configured to send identity registration information to the main application; the identity registration information includes device identifier, system platform information, and application version number;
[0036] The master device of the main application is used to establish a connection with the slave device of the at least one slave application based on the identity registration information;
[0037] The main application is further configured to, during testing, when it receives operation request information from the main application, generate synchronization configuration information based on the operation request information using a preset synchronization strategy, and send it to the at least one slave application; the preset synchronization strategy is used to determine the synchronization configuration information; the synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data;
[0038] The at least one slave application is further configured to perform a replay operation based on the synchronization configuration information through a built-in execution engine to generate slave test results corresponding to the at least one slave application;
[0039] The main application is also used to obtain the test results corresponding to the at least one slave application.
[0040] In one optional approach, the synchronization configuration information includes structured operation instructions; during testing, the main application generates synchronization configuration information according to a preset synchronization strategy and sends it to the at least one slave application, including:
[0041] When the main application captures user actions through the embedded operation recorder; the user actions include click operations, swipe operations, input operations, and back operations;
[0042] When the operation behavior is captured, it is encapsulated into a structured operation instruction; the structured operation instruction includes operation type, target control information, operation parameters and timestamp;
[0043] The structured operation instruction and its corresponding instruction configuration identifier are sent to the at least one slave application; the instruction configuration identifier is used to indicate whether to synchronize the network request information corresponding to the structured operation instruction.
[0044] According to another aspect of the present invention, a computer device is provided, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0045] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the master-slave architecture-based mobile application parallel testing method.
[0046] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing at least one executable instruction, which, when executed on a computer device, causes the computer device to perform the operation of the mobile application parallel testing method based on a master-slave architecture.
[0047] This invention, in its embodiments, involves the main application broadcasting information to the local area network upon startup. At least one slave application, upon receiving this broadcast information, joins the main application's network. Each slave application sends identity registration information to the main application. The main application's master device establishes a connection with the slave devices of each slave application based on the identity registration information. During testing, when the main application receives an operation request, it generates synchronization configuration information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy determines the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data. Each slave application uses its built-in execution engine to perform a replay operation based on the synchronization configuration information, generating slave test results corresponding to each slave application. The main application obtains these slave test results, effectively improving testing efficiency. This invention utilizes local area network broadcasting to enable low-configuration-cost access for multiple terminals, improving the efficiency of multi-device testing. It proposes a master-slave collaborative testing architecture, enabling multi-terminal reproduction and difference verification without the need for complex script writing. This allows developers to operate on only one master device to simultaneously observe the performance differences of multiple different models and platform devices, thereby effectively reducing manual testing costs and improving debugging efficiency and App compatibility testing quality.
[0048] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0049] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0050] Figure 1 A flowchart illustrating the parallel testing method for mobile applications based on a master-slave architecture provided in an embodiment of the present invention is shown.
[0051] Figure 2A schematic diagram of the structure of a mobile application parallel testing system based on a master-slave architecture provided in an embodiment of the present invention is shown.
[0052] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation
[0053] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0054] Figure 1 The flowchart illustrates a parallel testing method for mobile applications based on a master-slave architecture, provided in an embodiment of the present invention. This method is executed by a computer device. The computer device can be a terminal device loaded with an application, such as a mobile phone, tablet, computer, wearable device, etc., and the embodiments of the present invention do not impose specific limitations. Figure 1 As shown, the method includes the following steps:
[0055] Step 110: After the main application starts, it sends a broadcast message to the local area network via broadcast. The broadcast message includes a service identifier broadcast packet.
[0056] When the main application starts, it initializes the communication service. The main application periodically sends service identification information to a preset broadcast address within the local area network via UDP (User Datagram Protocol). The service identification broadcast packet includes the main application's device information, the main application's identifier, and the main application's host status. The preset broadcast address can be set according to specific application scenarios, for example, it can be 255.255.255.255 or 192.168.X.255.
[0057] Step 120: At least one slave application joins the main application's network upon receiving the broadcast information.
[0058] The at least one slave application enters a listening state upon startup, specifically by binding to a local specific port (e.g., 9876) via the UDP protocol to continuously listen for broadcast messages within the local area network. Upon receiving broadcast information, it verifies the validity of the broadcast content. Specifically, the slave application verifies the validity of the broadcast content, such as whether the appId (application ID) matches and whether the network is accessible. The slave application caches the master device information in memory or displays it in a list, allowing users of the slave application to select from multiple master devices. If valid, the at least one slave application caches the master device information of the master application in memory or displays it in a list. The slave device of the at least one slave application initiates a WebSocket (WebSocket is a full-duplex communication protocol) connection with the master device of the master application based on the master device information. When the master application and slave application are configured in "auto-join mode," the slave application immediately initiates a WebSocket connection with the master device to complete registration. When the master application and slave application are configured in "manual join mode," users of the slave devices of the slave applications can click to join or add the master device of the master application by scanning a QR code.
[0059] Specifically, to improve applicability in network isolation or broadcast-restricted environments, the system also supports joining the master device via QR code scanning or manual IP input: 1. The master device generates a QR code with the following content: {"ip":"192.168.1.8","wsPort":8080,"appId":"com.xxx.app"}; 2. The slave device identifies the QR code through its camera, parses the address information, and initiates a WebSocket connection; 3. The slave device manually enters the master device's IP and port in the settings interface and clicks Connect.
[0060] Step 130: The at least one application sends identity registration information to the main application; the identity registration information includes device identifier, system platform information, and application version number.
[0061] The master device adds the slave device to the connection list and sends initial configurations, such as whether to receive data and synchronization strategies. Compared to existing technologies where establishing a connection between the master and slave applications requires triggering tests and starting the test process via command line, this invention uses a combination of broadcast and WebSocket to achieve dynamic device-level discovery and connection during the master-slave application connection process, eliminating the need for command-line operations or device injection. The entire master-slave discovery process does not rely on tools such as ADB (Android Debug Bridge) and does not modify the application package structure, making it applicable to all platforms. Furthermore, this invention supports simultaneous access from multiple slave devices, suitable for horizontal consistency testing or batch device comparison scenarios; it also has network adaptability, ensuring communication establishment even in environments without broadcast access via QR code scanning / manual access. After successfully establishing a WebSocket connection with the master device, the slave device immediately sends identity registration information to the master device, including device identifier, system platform, and application version number.
[0062] Step 140: The master device of the main application confirms the completion of establishing a connection with the slave device of the at least one slave application based on the identity registration information.
[0063] Specifically, after the master device of the main application completes identity registration based on the identity registration information, it confirms the establishment of a connection with the slave device of the at least one slave application. This includes:
[0064] After registering the slave device according to the identity registration information, the master device adds the slave device corresponding to the slave application to the connection list and sends initial configuration information to the at least one slave application. The slave application is configured according to the initial configuration information; the initial configuration information includes the data type of the synchronization test, whether to receive data, and the synchronization strategy.
[0065] Thus, the master device of the main application establishes a persistent connection with the slave device of the slave application, and the slave application enters a standby state, ready to receive synchronization instructions.
[0066] Step 150: During the test, when the main application receives the operation request information of the main application, it generates synchronization configuration information according to the operation request information using a preset synchronization strategy and sends it to the at least one slave application.
[0067] The preset synchronization strategy is used to determine the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data, as well as instruction configuration identifiers. The operation request information includes operation actions and network requests. The synchronization configuration information includes structured operation instructions.
[0068] In one embodiment of the present invention, the main application captures operation behaviors through an embedded operation recorder. These operation behaviors include click operations, swipe operations, input operations, and return operations. The reasons why this embodiment of the present invention does not directly use readily available open-source or third-party operation recorders are as follows: 1. Existing tools are mostly used for recording automated test scripts, focusing on "single-device playback," and do not support real-time broadcast synchronization to multiple terminals; 2. Most rely on ADB (Android Debug Bridge), Instrumentation (an instrumentation technology used for testing and measuring software), or system injection mechanisms, limiting their use in non-root environments (root environment refers to an environment with the highest system privileges) or on non-Android platforms (such as iOS, HarmonyOS); 3. The data structures recorded by these tools are not conducive to cross-platform adaptation, with inconsistent encapsulation formats and poor replayability; 4. They cannot intercept network behavior in real time, nor can they be integrated with custom data synchronization mechanisms. Therefore, in this embodiment of the invention, operation behaviors such as clicks, swipes, and inputs are recorded based on the Accessibility service (a core component of the Android system's user-friendly design), touch event listening, touch time distribution, or page lifecycle listening.
[0069] When the operation is captured, it is encapsulated into a structured operation instruction. This instruction can be replayable and its data format is JSON. The structured operation instruction includes the operation type, target control information, operation parameters, and a timestamp.
[0070] Upon receiving the structured operation instruction, the structured operation instruction and its corresponding instruction configuration identifier are sent to the at least one slave application. The instruction configuration identifier indicates whether to synchronize the network request information corresponding to the structured operation instruction. Specifically, the structured operation instruction is broadcast in real time to all connected slave devices via a WebSocket communication link. Each instruction includes the configuration identifier, indicating whether to synchronize the corresponding network request information.
[0071] When the master device initiates a network request during the operation corresponding to the operation behavior, it sends the structured operation instruction and the corresponding instruction configuration identifier to the at least one slave application. When the master device initiates a network request during the operation corresponding to the operation behavior, the master application intercepts the network request and the corresponding response data through an embedded network proxy layer. Specifically, the master application uses OkHttp (an HTTP client library) as the main network request framework. To capture each network access, this embodiment adds a custom interceptor to OkHttp. This interceptor can execute custom logic before the request is sent and after the response is returned. Specifically, when the master application executes a network request, the interceptor first reads the request URL, request method (GET, POST, etc.), and request body (such as form data or JSON). Then, the interceptor continues to execute the request, obtaining the response data returned by the server, such as the status code and response body content (usually JSON). The interceptor packages the network request and response data into a structure (using JSON format internally). In this embodiment of the invention, the system pre-abstracts instruction types: combining the most common operation types in application testing, operation instructions are summarized into the following basic actions, each of which can be standardized in description and executed across platforms. Operation types include: tap: click, supporting control positioning or coordinate positioning; long_press: long press; input: text input, requiring the input target and text content; swipe: swipe, supporting direction (up / down / left / right) and distance parameters; scroll: vertical / horizontal scrolling, allowing specification of a target area; back: return operation, triggering a system return event; wait: wait for a specified time (used for rhythm control). Each operation instruction is described using a unified JSON format, including operation type, target, parameters, timestamp, etc.
[0072] The main application determines whether it needs to send network request information corresponding to the structured operation instruction according to a preset synchronization strategy. When it needs to send such information, it generates an instruction configuration identifier containing the network request information that needs to be synchronized. The main application then sends the structured operation instruction, the network request, the corresponding response data, and the corresponding instruction configuration identifier to the at least one slave application.
[0073] The preset synchronization strategy includes the following strategies:
[0074] Based on the interface corresponding to the network request and the information of the currently logged-in account, it is determined whether to synchronize the network request and its corresponding response data. Specifically, if the request or response data of a certain interface is bound to the currently logged-in account, such as the user center, orders, or message notifications, then it is determined not to synchronize the network data to the slave device. This is because the users logged in on the slave device may be different, and directly reusing data from the master device can easily lead to data corruption or security issues. For example, if the master device pulls the message list of "User A," synchronizing it to the slave device would cause the slave device to see "User A's" data instead of its own account's data. However, if the data returned by a certain interface is public data, such as homepage banners, product lists, article content, static configuration data, etc., then the request and response can be directly synchronized, thus saving the number of network requests and ensuring data consistency.
[0075] Based on the page type corresponding to the operation, determine whether to synchronize the network request and corresponding response data. Specifically, determine whether the page type corresponds to the operation based on the page type configuration table. The page type configuration table contains page identification information and corresponding page types, and can be loaded when the system starts. For the first page type, operation instructions, network requests, and response data can be synchronized by default. This first page type can include the homepage, information details page, etc. For the second page type, only the operation action is synchronized by default, without synchronizing network requests and response data. The second page type includes pages related to personal information, such as "My Page" and "Settings Page."
[0076] Based on a preset interface whitelist and / or interface blacklist, the system determines whether to synchronize the network request and its corresponding response data. The system allows configuration of synchronization policies for certain interfaces, such as setting them to whitelists or blacklists. Furthermore, when the network request corresponding to an operation is made to an interface on either the whitelist or blacklist, the system further checks whether the request parameters contain fields such as Authorization (in the HTTP protocol, Authorization is a request header field), userId (user ID), token (a string or data structure containing authentication information, authorization credentials, or session identifier), and sessionId (session ID). If these fields are present, the request is considered account-related, and the network request and response data are not synchronized. Additionally, if the URL path of the interface contains sensitive keywords such as " / user / " or " / order / ", the interface is considered sensitive, and the system automatically switches to "synchronize instructions only" mode.
[0077] Depending on the test type (set according to the test objective), determine whether to synchronize the network requests and corresponding response data. If the test type is to test whether the rendering effects of the main application's UI (graphical user interface) and the slave application's UI are consistent on different devices, then directly synchronize the operation commands, network requests, and corresponding response data. If the test type is to compare platform compatibility, such as comparing behavioral differences between Android and iOS systems, then only synchronize the operation actions; the main application and slave application each make real requests to observe performance differences. If the test type is to test "retry logic in a weak network environment," then the main and slave applications can be configured with different network environments. After the main device initiates a request, the failure status is synchronized, and the slave device can observe whether the processing logic is consistent.
[0078] The instruction configuration identifier includes a preset synchronization field to indicate how the slave device should respond to received synchronization configuration information. Specifically, the instruction configuration identifier configures the syncMode and dataSensitivity fields. For example:
[0079] {
[0080] "type": "tap",
[0081] "selector": "#submitBtn",
[0082] "timestamp": 1720001111,
[0083] "syncMode": "with_data", / / or "command_only"
[0084] "dataSensitivity": "account_bound" / / or "public"
[0085] }
[0086] The main application broadcasts synchronization configuration information to all connected slave devices in real time via a WebSocket communication link. Since not all operations require synchronizing network request data, this embodiment intelligently controls whether to include network request and response data based on factors such as interface sensitivity, page type, and test objectives. Through the aforementioned lightweight, scalable, and platform-independent operation capture and instruction synchronization mechanism, it ensures both simulation consistency and avoids account data corruption. Furthermore, this mechanism allows multiple slave devices to share the result of a single network request from the master device, avoiding duplicate requests and improving testing efficiency. Moreover, the flexible synchronization strategy also ensures account isolation and data security, allowing slave devices to maintain consistent UI behavior while maintaining the realism and security of the test.
[0087] Step 160: The at least one slave application performs a replay operation based on the synchronization configuration information through the built-in execution engine to generate slave test results corresponding to the at least one slave application.
[0088] Upon receiving the synchronization configuration information, at least one slave application performs a replay operation. If complete network data is received, a local mock is used instead of a real network request to ensure high consistency with the main application; if only operation instructions are received, the slave application initiates the network request itself.
[0089] After receiving an operation command from the device, the built-in command execution engine simulates the response behavior based on the operation type, including finding controls, simulating clicks / swipes, and setting text. If the operation command includes network response data, the device directly uses that data for page rendering; otherwise, the device initiates a real network request with the same parameters. The execution logic of the application's embedded execution engine is as follows:
[0090] 1. Command Reception:
[0091] The device receives operation instructions from the master device via WebSocket or local message queue and hands them over to the execution scheduler for processing.
[0092] 2. Instruction parsing and target search:
[0093] The control positioning method is determined based on the target field in the operation instruction (the target field represents the identifier of the target object of the operation). The ID and text are used first, and then the coordinate positioning is returned (optional).
[0094] If the target element cannot be found, you can skip, retry, or report an error.
[0095] 3. Operation mapping execution:
[0096] Map the instruction type of the operation command to the platform's native API call. For example, in Android, it is executed by simulating touch events (such as dispatchTouchEvent) or control API calls (such as editText.setText()).
[0097] Based on the replay operation of at least one application, generate the corresponding test results for the at least one application.
[0098] Step 170: The main application obtains the test results corresponding to the at least one slave application.
[0099] This invention, in its embodiments, involves the main application broadcasting information to the local area network upon startup. At least one slave application, upon receiving this broadcast information, joins the main application's network. Each slave application sends identity registration information to the main application. The main application's master device establishes a connection with the slave devices of each slave application based on the identity registration information. During testing, when the main application receives an operation request, it generates synchronization configuration information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy determines the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data. Each slave application uses its built-in execution engine to perform a replay operation based on the synchronization configuration information, generating slave test results corresponding to each slave application. The main application obtains these slave test results, effectively improving testing efficiency. This invention utilizes local area network broadcasting to enable low-configuration-cost access for multiple terminals, improving the efficiency of multi-device testing. It proposes a master-slave collaborative testing architecture, enabling multi-terminal reproduction and difference verification without the need for complex script writing. This allows developers to operate on only one master device to simultaneously observe the performance differences of multiple different models and platform devices, thereby effectively reducing manual testing costs and improving debugging efficiency and App compatibility testing quality.
[0100] Figure 2 This diagram illustrates the structure of a master-slave architecture-based parallel testing system for mobile applications provided in an embodiment of the present invention. Figure 2 As shown, the system includes:
[0101] The main application 210 is used to send broadcast information to the local area network via broadcast after the main application starts, the broadcast information including a service identifier broadcast packet;
[0102] At least one slave application 220 is configured to join the network of the master application upon receiving the broadcast information.
[0103] The at least one slave application 220 is also configured to send identity registration information to the main application; the identity registration information includes device identifier, system platform information, and application version number;
[0104] The master device of the main application 210 is used to establish a connection with the slave device of the at least one slave application based on the identity registration information;
[0105] The main application 210 is further configured to, during the testing process, when it receives operation request information from the main application, generate synchronization configuration information according to the operation request information using a preset synchronization strategy, and send it to the at least one slave application; the preset synchronization strategy is used to determine the synchronization configuration information; the synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data;
[0106] The at least one slave application 220 is further configured to perform a replay operation based on the synchronization configuration information through a built-in execution engine to generate slave test results corresponding to the at least one slave application;
[0107] The main application 210 is also used to obtain the test results corresponding to the at least one slave application.
[0108] This invention, in its embodiments, involves the main application broadcasting information to the local area network upon startup. At least one slave application, upon receiving this broadcast information, joins the main application's network. Each slave application sends identity registration information to the main application. The main application's master device establishes a connection with the slave devices of each slave application based on the identity registration information. During testing, when the main application receives an operation request, it generates synchronization configuration information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy determines the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data. Each slave application uses its built-in execution engine to perform a replay operation based on the synchronization configuration information, generating slave test results corresponding to each slave application. The main application obtains these slave test results, effectively improving testing efficiency. This invention utilizes local area network broadcasting to enable low-configuration-cost access for multiple terminals, improving the efficiency of multi-device testing. It proposes a master-slave collaborative testing architecture, enabling multi-terminal reproduction and difference verification without the need for complex script writing. This allows developers to operate on only one master device to simultaneously observe the performance differences of multiple different models and platform devices, thereby effectively reducing manual testing costs and improving debugging efficiency and App compatibility testing quality.
[0109] Figure 3 The diagram shows a structural schematic of a computer device provided in an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computer device.
[0110] like Figure 3 As shown, the computer device may include: a processor 402, a communications interface 404, a memory 406, and a communications bus 408.
[0111] The processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408. Communication interface 404 is used to communicate with other network elements such as clients or other servers. The processor 402 executes program 410, specifically performing the relevant steps described in the embodiment of the parallel testing method for mobile applications based on a master-slave architecture.
[0112] Specifically, program 410 may include program code, which includes computer-executable instructions.
[0113] Processor 402 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computer device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0114] Memory 406 is used to store program 410. Memory 406 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0115] Specifically, program 410 can be called by processor 402 to cause the computer device to perform the following operations:
[0116] When the main application starts, it sends a broadcast message to the local area network via broadcast. The broadcast message includes a service identifier broadcast packet.
[0117] At least one slave application joins the main application's network upon receiving the broadcast information;
[0118] The at least one application sends identity registration information to the main application; the identity registration information includes device identifier, system platform information, and application version number;
[0119] The master device of the main application establishes a connection with the slave device of the at least one slave application based on the identity registration information;
[0120] During testing, when the main application receives an operation request, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy is used to determine the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data.
[0121] The at least one slave application performs a replay operation based on the synchronization configuration information through a built-in execution engine to generate slave test results corresponding to the at least one slave application;
[0122] The main application obtains the test results corresponding to at least one slave application.
[0123] In one alternative approach, when the main application starts, it sends broadcast information to the local area network via broadcast. The broadcast information includes service identification information and further includes:
[0124] When the main application starts, it initializes the communication service;
[0125] The main application periodically sends service identification information to a preset broadcast address within the local area network via the UDP protocol; the service identification broadcast packet includes the device information of the main application, the main application identifier, and the host status of the main application.
[0126] In one alternative approach, the at least one slave application joining the main application's network upon receiving the broadcast information includes:
[0127] When the at least one application receives the broadcast information, it verifies whether the broadcast content of the broadcast information is legal.
[0128] When legal, the at least one slave application caches the main application's main device information into memory or displays it in a list;
[0129] The at least one slave device of the slave application initiates a WebSocket connection with the master device of the master application based on the information of the master device.
[0130] In one optional approach, the operation request information includes operation actions and network requests; the synchronization configuration information includes structured operation instructions; during testing, when the main application receives the operation request information, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application, including:
[0131] When the main application captures user actions through the embedded operation recorder; the user actions include click operations, swipe operations, input operations, and back operations;
[0132] When the operation behavior is captured, it is encapsulated into a structured operation instruction; the structured operation instruction includes operation type, target control information, operation parameters and timestamp;
[0133] The structured operation instruction and its corresponding instruction configuration identifier are sent to the at least one slave application; the instruction configuration identifier is used to indicate whether to synchronize the network request information corresponding to the structured operation instruction.
[0134] In one optional approach, during testing, when the main application receives an operation request information from itself, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application, including:
[0135] When the main device initiates a network request during the operation corresponding to the operation behavior, the main application intercepts the network request and the corresponding response data through the embedded network proxy layer.
[0136] The main application determines whether it needs to send network request information corresponding to the structured operation instruction for synchronization according to a preset synchronization strategy. When it needs to send, it generates an instruction configuration identifier that contains the network request information that needs to be synchronized.
[0137] The structured operation instructions, the network request and the corresponding response data, and the corresponding instruction configuration identifier are sent to the at least one slave application.
[0138] In one alternative approach, the preset synchronization strategy includes:
[0139] Based on the interface corresponding to the network request and the information of the currently logged-in account, determine whether to synchronize the network request and the corresponding response data;
[0140] Based on the page type corresponding to the operation, determine whether to synchronize the network request and the corresponding response data;
[0141] Based on a preset interface whitelist and / or interface blacklist, determine whether to synchronize the network request and the corresponding response data;
[0142] Depending on the test type, determine whether to synchronize the network request and its corresponding response data.
[0143] This invention, in its embodiments, involves the main application broadcasting information to the local area network upon startup. At least one slave application, upon receiving this broadcast information, joins the main application's network. Each slave application sends identity registration information to the main application. The main application's master device establishes a connection with the slave devices of each slave application based on the identity registration information. During testing, when the main application receives an operation request, it generates synchronization configuration information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy determines the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data. Each slave application uses its built-in execution engine to perform a replay operation based on the synchronization configuration information, generating slave test results corresponding to each slave application. The main application obtains these slave test results, effectively improving testing efficiency. This invention utilizes local area network broadcasting to enable low-configuration-cost access for multiple terminals, improving the efficiency of multi-device testing. It proposes a master-slave collaborative testing architecture, enabling multi-terminal reproduction and difference verification without the need for complex script writing. This allows developers to operate on only one master device to simultaneously observe the performance differences of multiple different models and platform devices, thereby effectively reducing manual testing costs and improving debugging efficiency and App compatibility testing quality.
[0144] This invention provides a computer-readable storage medium storing at least one executable instruction that, when executed on a computer device, causes the computer device to perform the master-slave architecture-based mobile application parallel testing method in any of the above method embodiments.
[0145] Executable instructions can be used to cause computer devices to perform the following operations:
[0146] When the main application starts, it sends a broadcast message to the local area network via broadcast. The broadcast message includes a service identifier broadcast packet.
[0147] At least one slave application joins the main application's network upon receiving the broadcast information;
[0148] The at least one application sends identity registration information to the main application; the identity registration information includes device identifier, system platform information, and application version number;
[0149] The master device of the main application establishes a connection with the slave device of the at least one slave application based on the identity registration information;
[0150] During testing, when the main application receives an operation request, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy is used to determine the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data.
[0151] The at least one slave application performs a replay operation based on the synchronization configuration information through a built-in execution engine to generate slave test results corresponding to the at least one slave application;
[0152] The main application obtains the test results corresponding to at least one slave application.
[0153] In one alternative approach, when the main application starts, it sends broadcast information to the local area network via broadcast. The broadcast information includes service identification information and further includes:
[0154] When the main application starts, it initializes the communication service;
[0155] The main application periodically sends service identification information to a preset broadcast address within the local area network via the UDP protocol; the service identification broadcast packet includes the device information of the main application, the main application identifier, and the host status of the main application.
[0156] In one alternative approach, the at least one slave application joining the main application's network upon receiving the broadcast information includes:
[0157] When the at least one application receives the broadcast information, it verifies whether the broadcast content of the broadcast information is legal.
[0158] When legal, the at least one slave application caches the main application's main device information into memory or displays it in a list;
[0159] The at least one slave device of the slave application initiates a WebSocket connection with the master device of the master application based on the information of the master device.
[0160] In one optional approach, the operation request information includes operation actions and network requests; the synchronization configuration information includes structured operation instructions; during testing, when the main application receives the operation request information, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application, including:
[0161] When the main application captures user actions through the embedded operation recorder; the user actions include click operations, swipe operations, input operations, and back operations;
[0162] When the operation behavior is captured, it is encapsulated into a structured operation instruction; the structured operation instruction includes operation type, target control information, operation parameters and timestamp;
[0163] The structured operation instruction and its corresponding instruction configuration identifier are sent to the at least one slave application; the instruction configuration identifier is used to indicate whether to synchronize the network request information corresponding to the structured operation instruction.
[0164] In one optional approach, during testing, when the main application receives an operation request information from itself, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application, including:
[0165] When the main device initiates a network request during the operation corresponding to the operation behavior, the main application intercepts the network request and the corresponding response data through the embedded network proxy layer.
[0166] The main application determines whether it needs to send network request information corresponding to the structured operation instruction for synchronization according to a preset synchronization strategy. When it needs to send, it generates an instruction configuration identifier that contains the network request information that needs to be synchronized.
[0167] The structured operation instructions, the network request and the corresponding response data, and the corresponding instruction configuration identifier are sent to the at least one slave application.
[0168] In one alternative approach, the preset synchronization strategy includes:
[0169] Based on the interface corresponding to the network request and the information of the currently logged-in account, determine whether to synchronize the network request and the corresponding response data;
[0170] Based on the page type corresponding to the operation, determine whether to synchronize the network request and the corresponding response data;
[0171] Based on a preset interface whitelist and / or interface blacklist, determine whether to synchronize the network request and the corresponding response data;
[0172] Depending on the test type, determine whether to synchronize the network request and its corresponding response data.
[0173] This invention, in its embodiments, involves the main application broadcasting information to the local area network upon startup. At least one slave application, upon receiving this broadcast information, joins the main application's network. Each slave application sends identity registration information to the main application. The main application's master device establishes a connection with the slave devices of each slave application based on the identity registration information. During testing, when the main application receives an operation request, it generates synchronization configuration information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy determines the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data. Each slave application uses its built-in execution engine to perform a replay operation based on the synchronization configuration information, generating slave test results corresponding to each slave application. The main application obtains these slave test results, effectively improving testing efficiency. This invention utilizes local area network broadcasting to enable low-configuration-cost access for multiple terminals, improving the efficiency of multi-device testing. It proposes a master-slave collaborative testing architecture, enabling multi-terminal reproduction and difference verification without the need for complex script writing. This allows developers to operate on only one master device to simultaneously observe the performance differences of multiple different models and platform devices, thereby effectively reducing manual testing costs and improving debugging efficiency and App compatibility testing quality.
[0174] This invention provides a mobile application parallel testing device based on a master-slave architecture, used to execute the aforementioned mobile application parallel testing method based on a master-slave architecture.
[0175] This invention provides a computer program that can be invoked by a processor to cause a computer device to execute the master-slave architecture-based mobile application parallel testing method in any of the above method embodiments.
[0176] This invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, which, when executed on a computer, cause the computer to perform the master-slave architecture-based mobile application parallel testing method in any of the above method embodiments.
[0177] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0178] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0179] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0180] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0181] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
Claims
1. A parallel testing method for mobile applications based on a master-slave architecture, characterized in that, The method includes: When the main application starts, it sends a broadcast message to the local area network via broadcast. The broadcast message includes a service identifier broadcast packet. At least one slave application joins the main application's network upon receiving the broadcast information; The at least one application sends identity registration information to the main application; the identity registration information includes device identifier, system platform information, and application version number; The master device of the main application establishes a connection with the slave device of the at least one slave application based on the identity registration information; During testing, when the main application receives an operation request, it generates synchronization configuration information based on the operation request information using a preset synchronization strategy and sends it to the at least one slave application. The preset synchronization strategy is used to determine the synchronization configuration information. The synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data and instruction configuration identifiers. The at least one slave application performs a replay operation based on the synchronization configuration information through a built-in execution engine to generate slave test results corresponding to the at least one slave application; The main application obtains the test results corresponding to at least one slave application.
2. The method according to claim 1, characterized in that, When the main application starts, it sends broadcast information to the local area network via broadcast. The broadcast information includes service identification information and further includes: When the main application starts, it initializes the communication service; The main application periodically sends service identification information to a preset broadcast address within the local area network via the UDP protocol; the service identification broadcast packet includes the device information of the main application, the main application identifier, and the host status of the main application.
3. The method according to claim 2, characterized in that, The at least one slave application joining the main application's network upon receiving the broadcast information includes: When the at least one application receives the broadcast information, it verifies whether the broadcast content of the broadcast information is legal. When legal, the at least one slave application caches the main application's main device information into memory or displays it in a list; The at least one slave device of the slave application initiates a WebSocket connection with the master device of the master application based on the information of the master device.
4. The method according to claim 1, characterized in that, The operation request information includes operation actions and network requests; the synchronization configuration information includes structured operation instructions; during the testing process, when the main application receives the operation request information, it generates synchronization configuration information according to the operation request information using a preset synchronization strategy and sends it to the at least one slave application, including: When the main application captures user actions through the embedded operation recorder; the user actions include click operations, swipe operations, input operations, and back operations; When the operation behavior is captured, it is encapsulated into a structured operation instruction; the structured operation instruction includes operation type, target control information, operation parameters and timestamp; The structured operation instruction and its corresponding instruction configuration identifier are sent to the at least one slave application; the instruction configuration identifier is used to indicate whether to synchronize the network request information corresponding to the structured operation instruction.
5. The method according to claim 4, characterized in that, During testing, when the main application receives an operation request, it generates synchronization configuration information based on a preset synchronization strategy according to the operation request information and sends it to the at least one slave application, including: When the main device initiates a network request during the operation corresponding to the operation behavior, the main application intercepts the network request and the corresponding response data through the embedded network proxy layer. The main application determines whether it needs to send network request information corresponding to the structured operation instruction for synchronization according to a preset synchronization strategy. When it needs to send, it generates an instruction configuration identifier that contains the network request information that needs to be synchronized. The structured operation instructions, the network request and the corresponding response data, and the corresponding instruction configuration identifier are sent to the at least one slave application.
6. The method according to claim 5, characterized in that, The preset synchronization strategy includes: Based on the interface corresponding to the network request and the information of the currently logged-in account, determine whether to synchronize the network request and the corresponding response data; Based on the page type corresponding to the operation, determine whether to synchronize the network request and the corresponding response data; Based on a preset interface whitelist and / or interface blacklist, determine whether to synchronize the network request and the corresponding response data; Depending on the test type, determine whether to synchronize the network request and its corresponding response data.
7. A mobile application parallel testing system based on a master-slave architecture, characterized in that, The system includes: The main application is used to send broadcast information to the local area network via broadcast after the main application starts. The broadcast information includes a service identifier broadcast packet. At least one slave application is configured to join the network of the master application upon receiving the broadcast information. The at least one slave application is further configured to send identity registration information to the main application; the identity registration information includes device identifier, system platform information, and application version number; The master device of the main application is used to establish a connection with the slave device of the at least one slave application based on the identity registration information; The main application is further configured to, during testing, when it receives operation request information from the main application, generate synchronization configuration information based on the operation request information using a preset synchronization strategy, and send it to the at least one slave application; the preset synchronization strategy is used to determine the synchronization configuration information; the synchronization configuration information includes structured operation instructions and / or network requests and corresponding response data; The at least one slave application is further configured to perform a replay operation based on the synchronization configuration information through a built-in execution engine to generate slave test results corresponding to the at least one slave application; The main application is also used to obtain the test results corresponding to the at least one slave application.
8. The system according to claim 7, characterized in that, The synchronization configuration information includes structured operation instructions; during the testing process, the main application generates synchronization configuration information according to a preset synchronization strategy and sends it to the at least one slave application, including: When the main application captures user actions through the embedded operation recorder; the user actions include click operations, swipe operations, input operations, and back operations; When the operation behavior is captured, it is encapsulated into a structured operation instruction; the structured operation instruction includes operation type, target control information, operation parameters and timestamp; The structured operation instruction and its corresponding instruction configuration identifier are sent to the at least one slave application; the instruction configuration identifier is used to indicate whether to synchronize the network request information corresponding to the structured operation instruction.
9. A computer device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation of the master-slave architecture-based mobile application parallel testing method as described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The storage medium stores at least one executable instruction, which, when executed on a computer device, causes the computer device to perform the operation of the master-slave architecture-based mobile application parallel testing method as described in any one of claims 1-6.
Citation Information
Patent Citations
Application compatibility testing method and system
CN105335292A
Application evaluation method and apparatus
CN106095664A