Time performance test method and device for mobile application and electronic equipment
By pre-installing a testing platform on mobile devices and using screen recording and computer vision technology to analyze video frames, the system identifies the start and end frames of mobile application loading, thus solving the security risks and accuracy issues caused by invasive testing in existing technologies and achieving high-precision non-invasive time performance testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-24
AI Technical Summary
Existing mobile application time performance testing methods rely on invasive testing, which poses security risks, has poor universality, and low testing accuracy, failing to meet the high-precision performance evaluation needs of mobile applications.
By pre-installing a testing platform on mobile devices and capturing user operation videos using screen recording, combined with computer vision technology and an automated testing framework, the video frames are analyzed to identify the application response status, determine the start and end frames of loading, and calculate the time difference, thus achieving non-intrusive time performance testing.
It enables high-precision time performance evaluation of mobile applications without code modification, improving the security and versatility of testing. It is applicable to various mobile applications and ensures that the testing process does not affect the normal operation of the application.
Smart Images

Figure CN121919079A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology or other related fields, and more specifically, to a method and apparatus for testing the time performance of mobile applications, and an electronic device. Background Technology
[0002] Currently, with the rapid development of mobile internet technology, the number and types of mobile applications (Apps) have increased dramatically, making performance testing increasingly important. For time-related performance testing of mobile applications, especially evaluating application loading speed, response time, and user waiting time, the commonly used methods rely on intrusive testing techniques, such as directly inserting performance monitoring code into the application code or customizing the test environment. While this method can provide detailed performance data, it has significant drawbacks:
[0003] 1. Security risks of intrusive testing methods: Directly modifying the application source code introduces potential security vulnerabilities. If the test code is not completely removed, it may lead to instability of the application after release or leakage of sensitive information.
[0004] 2. Universality issues: Intrusive testing methods often require customized development for different applications and testing scenarios, which greatly limits their universality and portability across different platforms and applications, increasing testing costs and complexity.
[0005] 3. Limitations of non-intrusive methods: Some non-intrusive testing methods on the market either rely on specific hardware monitoring equipment or can only provide rough time estimates, failing to accurately capture critical moments of application state changes, thus making it difficult to obtain high-precision performance data.
[0006] In summary, existing mobile time-based performance testing methods are not ideal in terms of universality, security, and testing accuracy. The most prominent problem is that time performance testing for mobile applications cannot avoid intrusive methods, resulting in poor APP security.
[0007] There is currently no effective solution to the above problems. Summary of the Invention
[0008] The main objective of this application is to provide a method, apparatus, and electronic device for time performance testing of mobile applications, so as to at least solve the technical problem in the related art that time performance testing of mobile applications cannot avoid intrusive methods, resulting in poor APP security.
[0009] To achieve the above objectives, according to one aspect of this application, a method for time performance testing of mobile applications is provided. The method includes: running a test script through a test platform and capturing a video file using the screen recording function of the test platform, wherein the test platform is pre-installed on a mobile device, the test script is used to simulate user operations on a mobile application on the mobile device, and the video file is used to record the response process of the mobile application to the simulated instructions in the test script; parsing the video file to obtain N information groups, and determining a start frame (the beginning of application loading) and an end frame (the end of application loading) in the N video frames based on the application response states in the information groups, wherein each information group records one video frame and the application response state described by each video frame, and N is a positive integer; calculating the time difference between the start frame and the end frame to obtain the time performance test result of the mobile application.
[0010] Furthermore, the test script is pre-generated, and the steps for generating the test script include: after obtaining user authorization, capturing the user's manual testing process of the mobile application through the screen recording function of the testing platform to obtain a manual test video file; identifying the user's manual operation sequence by analyzing the manual test video file, wherein the manual operation sequence is used to record click operations, swipe operations and / or input operations arranged in chronological order; writing an automatic test script based on the manual operation sequence, and obtaining an executable test script if the automatic test script passes verification.
[0011] Further, the step of parsing the video file to obtain N information groups includes: performing frame-segmentation on the video file based on a preset frame interval to obtain N video frames, and numbering all the video frames in chronological order; using computer vision technology to compare and analyze all the video frames to identify the application response state in each video; and constructing the information groups based on each video frame and the application response state to obtain the N information groups.
[0012] Furthermore, computer vision technology is used to compare and analyze all the video frames to identify the application response state in each video, including: identifying the change points and change state information of the mobile application interface recorded in each video frame by comparing all adjacent video frames; and generating the application response state corresponding to each video frame by comparing the change points and change state information corresponding to all adjacent video frames.
[0013] Further, determining the start frame of application loading and the end frame of application loading completion among the N video frames based on the application response status in the information group includes: traversing the application response status of all video frames in chronological order; during the traversal, if the application response status of an adjacent video frame indicates that the application interface of the mobile application has changed from an idle state to a loading state, then the adjacent video frame is determined as a candidate start frame; if the application response status of an adjacent video frame indicates that the application interface of the mobile application has changed from a loading state to a stable display state, then the adjacent video frame is determined as a candidate end frame.
[0014] Furthermore, after determining the candidate start frame / candidate end frame based on the adjacent video frames, the method further includes: determining all video frames within a predetermined range before and after the adjacent video frames as the candidate start frame / candidate end frame to obtain a target video frame group; for each candidate frame in the target video frame group, using an image similarity evaluation algorithm to compare and calculate the candidate frame and the next video frame adjacent to the candidate frame to obtain a similarity evaluation value; if the similarity evaluation value meets a preset difference threshold, determining the candidate frame corresponding to the similarity evaluation value as the start frame / end frame.
[0015] Further, the step of calculating the time difference between the start frame and the end frame to obtain the time performance test result of the mobile application includes: obtaining a first number of the start frame and obtaining a second number of the end frame; calculating the time difference based on the first number, the second number and a preset frame interval to obtain the time performance test result.
[0016] To achieve the above objectives, according to another aspect of this application, a time performance testing apparatus for mobile applications is also provided. The apparatus includes: a running unit, configured to run a test script through a test platform and capture a video file using the screen recording function of the test platform, wherein the test platform is pre-installed on a mobile device, the test script is used to simulate user operations on a mobile application on the mobile device, and the video file is used to record the response process of the mobile application to the simulated instructions in the test script; a parsing unit, configured to parse the video file to obtain N information groups, and determine a start frame (the beginning of application loading) and an end frame (the end of application loading) in the N video frames based on the application response status in the information groups, wherein each information group is used to record one video frame and the application response status described by each video frame, and N is a positive integer; and a calculation unit, configured to calculate the time difference between the start frame and the end frame to obtain the time performance test result of the mobile application.
[0017] Furthermore, the time performance testing device for mobile applications further includes: a generation unit for pre-generating the test script, the generation unit comprising: a capture module for capturing the user's manual testing process of the mobile application through the screen recording function of the testing platform after obtaining user authorization, thereby obtaining a manual test video file; a recognition module for recognizing the user's manual operation sequence by analyzing the manual test video file, wherein the manual operation sequence is used to record click operations, swipe operations, and / or input operations arranged in chronological order; and a writing module for writing an automatic test script based on the manual operation sequence, and obtaining an executable test script if the automatic test script passes verification.
[0018] Furthermore, the parsing unit includes: a frame segmentation module, used to perform frame segmentation processing on the video file based on a preset frame segmentation time interval to obtain N video frames, and to number all the video frames in chronological order; a comparison and analysis module, used to perform comparison and analysis on all the video frames using computer vision technology to identify the application response state in each video; and a construction module, used to construct the information group based on each video frame and the application response state to obtain the N information groups.
[0019] Furthermore, the comparison analysis module includes: an identification submodule, used to identify the change points and change status information of the mobile application interface recorded in each video frame by comparing all adjacent video frames; and a generation submodule, used to generate the application response status corresponding to each video frame by comparing the change points and change status information corresponding to all adjacent video frames.
[0020] Furthermore, the parsing unit further includes: a traversal module, used to traverse the application response states of all the video frames in chronological order; a first determination module, used during the traversal process, to determine the adjacent video frames as candidate start frames when the application response states of adjacent video frames indicate that the application interface of the mobile application has changed from an idle state to a loading state; and a second determination module, used to determine the adjacent video frames as candidate end frames when the application response states of adjacent video frames indicate that the application interface of the mobile application has changed from a loading state to a stable display state.
[0021] Furthermore, the parsing unit further includes: a third determining module, configured to, after determining the adjacent video frames as candidate start frames / candidate end frames, determine all video frames within a predetermined range before and after the adjacent video frames as candidate start frames / candidate end frames to obtain a target video frame group; a comparison calculation module, configured to, for each candidate frame in the target video frame group, use an image similarity evaluation algorithm to compare and calculate the candidate frame and the next adjacent video frame to obtain a similarity evaluation value; and a fourth determining module, configured to, if the similarity evaluation value meets a preset difference threshold, determine the candidate frame corresponding to the similarity evaluation value as the start frame / end frame.
[0022] Furthermore, the calculation unit includes: an acquisition module, used to acquire a first number of the starting frame and a second number of the ending frame; and a calculation module, used to calculate the time difference based on the first number, the second number and a preset frame interval to obtain the time performance test result.
[0023] To achieve the above objectives, according to another aspect of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the time performance testing method for mobile applications described in any one of the above claims.
[0024] To achieve the above objectives, according to another aspect of this application, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the time performance testing method for mobile applications described in any one of the above claims.
[0025] To achieve the above objectives, according to another aspect of this application, a computer program product is also provided, including computer instructions, wherein when the computer instructions are executed by a processor, they implement the steps of the time performance testing method for mobile applications described in any of the above claims.
[0026] This invention proposes a time performance testing method for mobile applications. First, a test script is run on a test platform, and a video file is captured using the platform's screen recording function. The test platform is pre-installed on a mobile device. The test script simulates user operations on the mobile application on the mobile device, and the video file records the mobile application's response to the simulated instructions in the test script. Then, the video file is parsed to obtain N information groups. Based on the application response status in the information groups, the start frame (where application loading begins) and the end frame (where application loading is complete) are determined from the N video frames. Each information group records one video frame and the application response status described by each video frame. N is a positive integer. Finally, the time difference between the start and end frames is calculated to obtain the time performance test result of the mobile application.
[0027] This invention employs a non-intrusive automated testing strategy. By integrating the Appium automated testing framework with advanced image processing and computer vision technologies, it achieves the goal of conducting comprehensive time performance evaluation without modifying the mobile application code. This enables precise measurement of the time consumption of mobile application startup, response, and function switching, thereby solving the technical problem in related technologies where time performance testing of mobile applications cannot avoid intrusive methods, resulting in poor APP security.
[0028] Specifically, this invention first uses an automated testing platform pre-installed on mobile devices to run test scripts, simulating real user operations to obtain the application's interactive responses in different scenarios. Then, it utilizes the testing platform's built-in screen recording function to capture video files in real time, providing not only a direct record of application behavior but also a foundational carrier for subsequent data analysis. By parsing the video files, it obtains N information groups representing the recorded video frames and the application's instantaneous response state within each frame, reflecting the comprehensiveness and detail of the testing process. Next, it analyzes these information groups in depth, using time series analysis and image similarity evaluation techniques to analyze the changing patterns of the application's response state, intelligently selecting the key start frame for the application's loading and the marker end frame indicating loading completion. Finally, it calculates the time difference between the start and end frames to obtain the mobile application's time performance test results. This solves the problem that existing technologies for mobile application time performance testing often rely on intrusive methods and modifications to native code, greatly enhancing test security, improving test versatility and flexibility, and making it suitable for various mobile applications. Attached Figure Description
[0029] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0030] Figure 1A hardware structure block diagram of a computer terminal (or mobile device) for implementing a time performance testing method for mobile applications is shown.
[0031] Figure 2 This is a flowchart of an optional time performance testing method for mobile applications according to an embodiment of the present invention;
[0032] Figure 3 This is a schematic diagram of an optional time performance testing device for mobile applications according to an embodiment of the present invention;
[0033] Figure 4 This is a structural block diagram of an electronic device that performs a time performance testing method for mobile applications according to an embodiment of the present invention. Detailed Implementation
[0034] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0036] It should be noted that the time performance testing method and apparatus for mobile applications in this application can be used in the fintech field for non-intrusive, automated performance testing of mobile banking or payment applications, and can also be used in any field other than fintech for non-intrusive, automated performance testing of mobile banking or payment applications. This application does not limit the application field of the time performance testing method and apparatus for mobile applications.
[0037] It should be noted that all relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) involved in this application are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, processing, transmission, provision, disclosure, use, and handling of such data comply with the laws, regulations, and standards of the relevant regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding access points are provided for users to choose to authorize or refuse access. For example, this system has interfaces with relevant users or organizations. Before obtaining relevant information, a request to obtain the information needs to be sent to the aforementioned user or organization through the interface, and the relevant information is obtained only after receiving consent from the aforementioned user or organization.
[0038] The information collection (e.g., user voice, video, and text collection) and analysis operations involved in this application have provided users with corresponding operation entry points during execution, allowing users to choose to agree to or reject the automated decision results; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0039] The following embodiments of the present invention can be applied to various systems / applications / devices that require mobile application performance optimization and user experience improvement, enabling a non-intrusive time performance testing and analysis platform based on an automated testing framework. The present invention uses an automated testing framework to simulate user operations and record screens of mobile applications, and then uses an image similarity evaluation algorithm to analyze video frame sequences, which can better capture instantaneous changes in the application interface and quantify time delays during loading.
[0040] By accurately identifying the application's start and end loading frames, this invention not only provides accurate time performance test results but also evaluates response speed under different operating scenarios, offering targeted guidance for application performance optimization. Furthermore, the non-intrusive testing method ensures that the testing process does not affect the normal operation of the application, improving the security and versatility of the test.
[0041] The present invention will now be described in detail with reference to various embodiments.
[0042] Example 1
[0043] According to an embodiment of the present invention, an embodiment of a time performance testing method for mobile applications is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0044] The time performance testing method for mobile applications provided in Embodiment 1 of the present invention can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a time performance testing method for mobile applications is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0045] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0046] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the time performance testing method for mobile applications in this embodiment of the application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned time performance testing method for mobile applications. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0047] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0048] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0049] Under the above operating environment, the present invention provides, as follows: Figure 2 The method shown is for time performance testing of mobile applications. The main implementation of this method is an automated testing system. It combines an automated testing framework with image similarity evaluation technology for time-related performance testing scenarios of mobile applications. In particular, it addresses the issue of non-intrusive testing methods by integrating a testing platform and intelligent image analysis methods. Specifically, it involves steps such as starting an automated testing background service, recording user operation scripts, executing scripts and simultaneously recording the screen, parsing video frame sequences, identifying start and end frames, and calculating time differences. This aims to achieve accurate and efficient testing of mobile application startup speed, response time, and operational smoothness.
[0050] The embodiments of the present invention will now be described in detail with reference to each specific step.
[0051] Figure 2 This is a flowchart of an optional time performance testing method for mobile applications according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:
[0052] Step S201: Run the test script through the test platform and capture video files through the screen recording function of the test platform. The test platform is pre-installed on the mobile device, the test script is used to simulate user operations on the mobile application on the mobile device, and the video files are used to record the response process of the mobile application to the simulated instructions in the test script.
[0053] Specifically, mobile devices refer to handheld electronic devices with touchscreens, network connectivity, and operating systems, such as smartphones and tablets. They can run various types of mobile operating systems and are capable of running various mobile applications, making them indispensable information terminals in modern people's daily lives. In the context of this invention, the mobile device serves as the operating environment for the test object and is pre-installed with a test platform for automated testing.
[0054] A testing platform refers to a software system installed on a mobile device for automated testing. Its core functions are executing test scripts and collecting test data. The testing platform mentioned in this embodiment integrates an automated testing framework, supports cross-platform testing, can interact with various mobile applications, simulate user operations, and simultaneously record the screen to provide raw data for subsequent video analysis.
[0055] A mobile application (App) is a software program that runs on a mobile device and can be of various types, such as games, social media, banking services, and shopping platforms. It's important to note that designing and developing mobile applications requires balancing functionality, user-friendliness, and performance stability, especially time-related performance, which directly impacts the user experience. In this embodiment of the invention, the mobile application is the object of testing, and its quantitative evaluation is performed using non-intrusive automated testing methods.
[0056] Simulated user operation refers to controlling a mobile application through an automated testing platform to perform expected user interface operations without human intervention. These operations include, but are not limited to, clicking, swiping, zooming, long-pressing, and text input. The purpose is to allow the testing platform to interact with the mobile application like a real user, thereby testing the application's performance under normal user operation, especially loading and response times. In this embodiment of the invention, simulated user operation is achieved by running a preset test script, and the execution of the script simultaneously initiates screen recording.
[0057] A test script is a set of instructions executed by an automated testing platform to guide the platform in simulating real user interactions with a mobile application. The writing and execution of scripts are the core of automated testing, covering different functional scenarios and operational paths to ensure the comprehensiveness and effectiveness of the tests. In this embodiment of the invention, the test script is pre-recorded or written by testers, and then read and executed by the testing platform. Its purpose is to reproduce user operations to evaluate the response time and performance of the mobile application under these operations.
[0058] Another point to note is that the screen recording function is a built-in capability of the testing platform. It supports continuously recording visual changes on the mobile device screen during the execution of the test script, capturing the updates to the application interface after each user operation.
[0059] The video file is the output of the screen recording function, containing the complete operation process and visual changes in application response. In this embodiment of the invention, the video file serves as the basis for subsequent temporal performance analysis. By parsing and analyzing video frames, every instant from user operation to application response can be accurately measured. The video file format can vary depending on the platform and tools, but it is typically saved in common video formats such as MP4 or AVI.
[0060] The response process recorded in the video file refers to the mobile application's reaction and processing flow to simulated user operations in the test script. This includes the entire process from the user triggering an operation (such as clicking a button) to the application fully responding and displaying the expected interface or result, involving multiple stages such as application startup, loading, calculation, and rendering. In this embodiment of the invention, the recording and analysis of the response process is crucial for evaluating the time-related performance of mobile applications. The video file provides a detailed record of this process; by analyzing video frames, the response time of different operations can be quantified, and bottlenecks and delays in the loading process can be identified.
[0061] Through the above steps, this embodiment of the invention uses the screen recording function of the test platform to capture the complete response process of a mobile application to simulated user operations. The generated video file not only records the changes in the application interface, but also provides raw data for subsequent identification of the loading start and end times using an image similarity evaluation algorithm.
[0062] To ensure accurate simulation of test scenarios and guarantee the repeatability and consistency of tests, optionally, in the time performance testing method for mobile applications provided in this embodiment of the invention, the test script is pre-generated. The steps for generating the test script include: after obtaining user authorization, capturing the user's manual testing process of the mobile application through the screen recording function of the test platform to obtain a manual test video file; identifying the user's manual operation sequence by analyzing the manual test video file, wherein the manual operation sequence is used to record click operations, swipe operations and / or input operations arranged in chronological order; writing an automatic test script based on the manual operation sequence, and obtaining an executable test script if the automatic test script passes verification.
[0063] In embodiments of the present invention, test script generation begins with user authorization and the capture of manual test video files. User authorization is a necessary step before conducting any testing, ensuring the legality of the test operations and involving the protection of user privacy as well as obtaining permissions to perform screen recording and operation logging on the device. Once authorization is obtained, the screen recording function of the testing platform will be activated to capture the entire process of the user performing manual testing on the mobile application. The manual test video file records the complete trajectory of the user's operations, including visual changes in the interface and specific details of the operations, such as clicks, swipes, and inputs.
[0064] The purpose of identifying manual operation sequences is to convert video files into actionable data. By parsing manual test video files, operations are recorded and categorized chronologically to form operation sequences. These sequences include basic user interactions with mobile applications, such as clicks, swipes, and input, comprehensively reflecting the application's usage scenarios. This process relies on advanced image recognition technology and behavioral analysis algorithms to ensure accurate differentiation and recording of each action, even in complex user interactions.
[0065] Automated test scripts can be written based on manual operation sequences. Specifically, an automated test script is a set of instructions that simulate user actions and execute tests, transforming manual operation sequences into code that the test platform can recognize and execute. The script contains specific commands to be executed on the application, such as simulating clicks and swipes, as well as conditional statements to check the application's status. During the writing process, the order of operations, time intervals, and location of target elements need to be considered to ensure the accuracy and executability of the test script.
[0066] After automated test scripts are generated, they must be validated to confirm their effectiveness. This includes at least: executing the script and observing whether it can accurately reproduce the manual testing process performed in the lab or under user authorization, and ensuring that the application's response meets expectations. If validation is successful, the test script is considered executable and can be used in an automated testing environment. Furthermore, script optimization is also a crucial task at this stage. By analyzing execution results, the operation time intervals can be adjusted, element location strategies optimized, and even exception handling mechanisms introduced to improve the robustness and testing efficiency of the test script.
[0067] Step S202: Parse the video file to obtain N information groups, and determine the start frame of application loading and the end frame of application loading completion in the N video frames based on the application response status in the information groups. Each information group is used to record a video frame and the application response status described by each video frame, where N is a positive integer.
[0068] It should be noted that a video frame is the basic unit that constitutes a video file, and each frame represents a static image of the video at a specific point in time. In this embodiment of the invention, the video file records the response process of the mobile application in the form of continuous images. The video frames are extracted from the video file captured by the test platform and are used to record the display status of the mobile application at different points in time; they are arranged in chronological order to facilitate tracking the trend of changes in the application interface over time.
[0069] Application response status refers to the operational status of a mobile application at a specific point in time, specifically reflected in the information display, interactive usability, and resource loading progress of the application interface. In the context of performance testing, application response status helps determine when the application begins loading, when it completes loading, and the status at each stage of the loading process. By comparing the application response status between video frames, the initial display state after a user operation and the final stable state can be identified, thereby calculating the time required for the application to respond.
[0070] An information group is a data structure that combines video frames with their corresponding application response states, used to store and represent information about each frame in a video file. In this embodiment of the invention, the information group is based on the results of video frame parsing. Each information group not only contains the image data of a video frame but also covers the application state information represented by that frame. Since a video file may contain hundreds or thousands of frames, parsing the video file to obtain multiple information groups is essentially a refinement and decomposition of the entire application response process, ensuring that the application state at each point in time is recorded. N is a positive integer representing the number of parsed video frames, reflecting the temporal resolution in the test analysis.
[0071] The embodiments of the present invention further deepen the processing of video files by associating video frames with the corresponding application response states to form a series of information groups. This not only preserves the integrity of the video content but also converts it into an analyzable data form, creating conditions for identifying the start and end points of loading time using image similarity evaluation algorithms. Constructing information groups also enables accurate tracking of the application's time performance under different operations.
[0072] To achieve high-precision time capture and data structure optimization, optionally, in the time performance testing method for mobile applications provided in this embodiment of the invention, the step of parsing a video file to obtain N information groups includes: performing frame processing on the video file based on a preset frame interval to obtain N video frames, and numbering all video frames in chronological order; using computer vision technology to compare and analyze all video frames to identify the application response state in each video; and constructing information groups based on each video frame and the application response state to obtain N information groups.
[0073] In embodiments of the present invention, the recorded video file is first segmented using a preset frame interval to convert the continuous video stream into a series of independent video frames. Each video frame represents a snapshot of the state applied at a specific point in time.
[0074] To ensure the correspondence between frames and time, all video frames are numbered in chronological order of recording time. For example, the first frame is named 1.png, the second frame is 2.png, and so on, until the last frame. This time-labeling method provides the necessary foundation for subsequent time-series-based performance analysis.
[0075] Next, computer vision technology is used to perform a detailed comparative analysis of each video frame. Image processing algorithms can be applied to identify and compare changes in the application interface between video frames. In this embodiment of the invention, algorithms that can be used include structural similarity algorithms and the mean squared error (MSE) algorithm, used to measure the structural similarity and pixel differences between video frames, respectively. Through the comprehensive application of these algorithms, the start and end frames of the application response can be automatically identified—that is, the first frame when the application begins loading or a specific function is executed, and the last frame when loading is complete and the application interface reaches a stable state. Identifying the application response state essentially determines the trend of changes within the entire time window from receiving a user operation to completing that operation.
[0076] Finally, information groups are constructed based on each video frame and the application response status. Each information group not only contains the image data of a single video frame, but also integrates the application status information corresponding to that frame, such as element loading status and network request status. The original video file is transformed into a series of images rich in application status information, enabling the implementation system to monitor the application response process with finer time granularity, thereby accurately measuring the time difference from the start of user operation to the completion of application response.
[0077] To achieve high-precision recognition and non-intrusive detection, optionally, in the time performance testing method for mobile applications provided in this embodiment of the invention, computer vision technology is used to compare and analyze all video frames to identify the application response state in each video, including: identifying the change points and change state information of the mobile application interface recorded in each video frame by comparing all adjacent video frames; and generating the application response state corresponding to each video frame by comparing the change points and change state information corresponding to all adjacent video frames.
[0078] In this embodiment of the invention, the core step in identifying the response state of a mobile application is to use computer vision technology to compare all adjacent video frames to identify the points of change in the application interface and their change state information recorded in each frame. This process specifically involves multiple levels of image processing and analysis:
[0079] Image difference detection: Using image similarity algorithms such as structural similarity index and mean square error, visual differences are found between adjacent frames, which may be changes in the position of interface elements, changes in color, or the loading and display of new elements;
[0080] Change point localization: Further analyze the results of image difference detection to accurately locate the specific areas or elements on the application interface that have changed;
[0081] Change state information extraction: Conduct in-depth analysis of the located change points to extract the significance of the change for the application response state, such as state information such as element loading completion, page switching, animation end, etc.
[0082] Furthermore, by continuously comparing and accumulating the change points and change state information of all adjacent video frames, this embodiment of the invention can automatically generate the application response state corresponding to each video frame. The logic for state generation is as follows:
[0083] Initial state determination: First, identify the frame at which the application response begins, which is usually the video frame after the user first triggers the operation. At this time, the application response state is marked as "start".
[0084] Continuous state tracking: As video frames progress, the changes in the application interface are continuously tracked until the application interface reaches a stable state. That is, the change points and change state information indicate that the application has fully responded to the user's operation. At this time, the application response state is marked as "end".
[0085] State change logging: Record all intermediate states between the "start" and "end" states. These states are used to reflect different stages of the application response, such as "loading", "transition", or "semi-stable".
[0086] It should be further clarified that the starting frame mentioned in step S202 refers to the first video frame in the video file that shows the change in the mobile application's response after the user's operation. In this embodiment of the invention, identifying the starting frame marks the initial reaction of the mobile application after receiving a user instruction. Typically, the starting frame captures the process of the application interface transitioning from static to dynamic loading. For example, when a user clicks to open an application, the starting frame may show the application icon enlarging or the application's splash screen just appearing. Accurately identifying the starting frame is crucial for subsequent calculations of loading time, ensuring the correct starting point for time measurement.
[0087] The end frame refers to the last video frame in a video file that shows the application has fully loaded and reached a stable state. In this embodiment of the invention, determining the end frame indicates the end point of the application loading process. The end frame typically indicates that the application's main functional pages have been fully displayed, all dynamically loaded elements (such as advertisements, dynamic menus, and data population) have stopped changing, and the application is ready to accept further user actions. By identifying the end frame, the specific point in time when the mobile application reaches a fully usable state can be clearly identified, which can be used to evaluate the application's response speed and loading efficiency.
[0088] In this embodiment of the invention, the start and end frames are determined by analyzing the application response status in the information group. This involves comparing the differences between adjacent video frames and using image similarity evaluation algorithms, such as structural similarity index and mean squared error, to identify the start and end of application interface changes. When the algorithm detects significant differences between video frames, it means that the application has started loading or an operation is in progress; conversely, when the algorithm finds that the differences between video frames tend to stabilize or disappear, it can be inferred that the application loading process has been completed and a stable state has been reached.
[0089] Therefore, by finding these key change points in multiple video frames, the positions of the start and end frames can be effectively determined, and the total time from when the application receives a user action to when it is fully loaded can be calculated.
[0090] To achieve precise time window positioning and automated testing processes, optionally, in the time performance testing method for mobile applications provided in this embodiment of the invention, the starting frame for application loading and the ending frame for application loading completion are determined from N video frames based on the application response status in the information group. This includes: traversing the application response status of all video frames in chronological order; during the traversal, if the application response status of an adjacent video frame indicates that the application interface of the mobile application has changed from an idle state to a loading state, then the adjacent video frame is determined as a candidate starting frame; if the application response status of an adjacent video frame indicates that the application interface of the mobile application has changed from a loading state to a stable display state, then the adjacent video frame is determined as a candidate ending frame.
[0091] In this embodiment of the invention, determining the start frame of application loading and the end frame of application loading completion begins with a chronological traversal of the application response states of all video frames. This process is based on a previously constructed information group, which contains the image data of each video frame and its corresponding application response state information. By traversing this group, each video frame can be systematically examined, identifying the loading and state transition processes of the main elements on the application interface.
[0092] During the traversal, pay special attention to the transition of the application interface from an "idle state" to a "loading state," which typically occurs after a user triggers an action, such as launching the application, clicking a button, or loading a new page. Compare the application response states of adjacent video frames; when a momentary change from "idle" to "loading" is detected, identify that frame as a candidate starting frame. The key to this step is accurately capturing the starting point of the application response to determine the time window for performance testing.
[0093] Similar to determining the candidate starting frame, close monitoring of the transition from the "loading state" to the "stable display state" is also necessary. This transition signifies the completion of the application's response and that the application interface has achieved the expected display effect. Continuously comparing adjacent video frames, when it is detected that the elements of the application interface have finished loading, the interface state no longer changes significantly, or the predetermined stable display conditions are met, that frame will be considered a candidate ending frame. This step ensures that the time performance test can capture the complete response process until the application interface is stably displayed.
[0094] To achieve more accurate response time measurement and enhance robustness, optionally, in the time performance testing method for mobile applications provided in this embodiment of the invention, after determining candidate start frames / candidate end frames based on adjacent video frames, the method further includes: determining all video frames within a predetermined range before and after adjacent video frames as candidate start frames / candidate end frames to obtain a target video frame group; for each candidate frame in the target video frame group, using an image similarity evaluation algorithm to compare and calculate the candidate frame and the next adjacent video frame to obtain a similarity evaluation value; if the similarity evaluation value meets a preset difference threshold, determining the candidate frame corresponding to the similarity evaluation value as the start frame / end frame.
[0095] After initially determining the candidate start frame or candidate end frame, this embodiment of the invention further optimizes this process by including all video frames within a certain time range before and after the candidate frame in the analysis to form a target video frame group. This extended range is typically based on a preset frame interval (e.g., 20 milliseconds) and a preliminary estimate of the response time. The purpose is to ensure that the selected frames accurately reflect the start or completion of the application response, while avoiding the impact of misjudgment of a single frame on the overall test results.
[0096] For each candidate frame in the target video frame group, this embodiment of the invention employs advanced image similarity evaluation algorithms for comparison calculations, such as structural similarity and mean squared error, to measure structural similarity and pixel-level differences between images, respectively. By comparing the similarity between the candidate frame and the next frame (adjacent frame), subtle changes in the application interface can be identified more precisely, marking the true start or end of the application response.
[0097] After obtaining the similarity evaluation values of all candidate frames, these evaluation values are compared with a preset difference threshold. The preset difference threshold is used to reflect the maximum acceptable degree of difference during application interface changes. When a similarity evaluation value first meets or exceeds this threshold, the candidate frame corresponding to that value will be officially determined as the start frame or end frame, indicating that the algorithm has confirmed the start or completion of the application response.
[0098] Step S203: Calculate the time difference between the start frame and the end frame to obtain the time performance test results of the mobile application.
[0099] Specifically, the time difference refers to the time interval between the start frame and the end frame determined in a video frame sequence. In this embodiment of the invention, the method for calculating the time difference is based on the recording frequency of the video frames, that is, the actual time length represented by each frame.
[0100] Assuming the video frame rate is set to 50 frames per second, this means the time interval between any two adjacent frames is 20 milliseconds. Once the start and end frames are accurately identified, the time difference can be calculated using their positions in the sequence. For example, if the start frame is frame 1 and the end frame is frame 46, then the time difference is (46 - 1). 20 = 900 milliseconds. This time difference reflects the total time required for a mobile application to fully load and reach a stable state from its initial response after a user interaction.
[0101] The time performance test results are direct indicators for evaluating application time performance in this embodiment of the invention, helping testers and developers understand whether the application's loading time meets expected standards and whether performance bottlenecks exist. The test results can be used not only for evaluating startup time but also extended to other time-related performance tests, such as page transition time and function call response time. By comparing the time performance test results under different versions or configurations, developers can monitor application performance improvements or degradations, adjust optimization strategies in a timely manner, and improve user experience.
[0102] In practical applications, time performance test results can be further statistically analyzed to eliminate outliers, assess mean load time or standard deviation, thereby obtaining a more comprehensive and in-depth overview of performance. These test results are crucial feedback in the mobile application performance optimization cycle, guiding subsequent code optimization, resource allocation, or algorithm adjustments to ensure the application responds quickly and runs smoothly under various conditions.
[0103] To avoid other complex clock synchronization or timestamp parsing issues and improve efficiency, optionally, in the time performance testing method for mobile applications provided in this embodiment of the invention, the step of calculating the time difference between the start frame and the end frame to obtain the time performance test result of the mobile application includes: obtaining a first number of the start frame and obtaining a second number of the end frame; calculating the time difference based on the first number, the second number and a preset frame interval to obtain the time performance test result.
[0104] In embodiments of the present invention, once the start and end frames are accurately identified and determined using computer vision technology, the next step is to obtain their serial numbers. Since video frames are numbered sequentially according to their recording time, the first number of the start frame and the second number of the end frame directly reflect their positions in the time series. This process is based on the step of constructing information groups, where each video frame has corresponding application response status information, ensuring the accuracy and consistency of the numbering acquisition.
[0105] For example, the first frame number is 1, the second frame number is 46, and the frame interval is 20. ms The calculated time difference is: .
[0106] Through steps S201 to S203 above, a test script can be run on the test platform, and a video file can be captured using the screen recording function of the test platform. The test platform is pre-installed on the mobile device. The test script is used to simulate user operations on the mobile application on the mobile device. The video file is used to record the response process of the mobile application to the simulated instructions in the test script. Then, the video file is parsed to obtain N information groups. Based on the application response status in the information groups, the start frame of application loading and the end frame of application loading completion are determined in the N video frames. Each information group is used to record a video frame and the application response status described by each video frame. N is a positive integer. Finally, the time difference between the start frame and the end frame is calculated to obtain the time performance test result of the mobile application.
[0107] In this embodiment of the invention, a non-intrusive automated testing strategy is adopted. By integrating the Appium automated testing framework with advanced image processing and computer vision technologies, the goal of comprehensive time performance evaluation can be achieved without modifying the mobile application code. This achieves the technical effect of accurately measuring the time consumption of mobile application startup, response, and function switching, thereby solving the technical problem in related technologies that time performance testing of mobile applications cannot avoid intrusive methods, resulting in poor APP security.
[0108] Specifically, this invention first uses an automated testing platform pre-installed on mobile devices to run test scripts, simulating real user operations to obtain the application's interactive responses in different scenarios. Then, it utilizes the testing platform's built-in screen recording function to capture video files in real time, providing not only a direct record of application behavior but also a foundational carrier for subsequent data analysis. By parsing the video files, it obtains N information groups representing the recorded video frames and the application's instantaneous response state within each frame, reflecting the comprehensiveness and detail of the testing process. Next, it analyzes these information groups in depth, using time series analysis and image similarity evaluation techniques to analyze the changing patterns of the application's response state, intelligently selecting the key start frame for the application's loading and the marker end frame indicating loading completion. Finally, it calculates the time difference between the start and end frames to obtain the mobile application's time performance test results. This solves the problem that existing technologies for mobile application time performance testing often rely on intrusive methods and modifications to native code, greatly enhancing test security, improving test versatility and flexibility, and making it suitable for various mobile applications.
[0109] The invention will now be described in conjunction with another alternative embodiment.
[0110] Example 2
[0111] This invention also provides a time performance testing device for mobile applications. It should be noted that the time performance testing device for mobile applications in this invention includes multiple implementation units, which can be used to execute the time performance testing method for mobile applications provided in Embodiment 1 above. Each implementation unit corresponds to each implementation step in Embodiment 1 above.
[0112] Figure 3 This is a schematic diagram of an optional time performance testing apparatus for mobile applications according to an embodiment of the present invention, such as... Figure 3 As shown, the device may include: a running unit 31, a parsing unit 32, and a calculation unit 33.
[0113] The running unit 31 is used to run test scripts through the test platform and capture video files through the screen recording function of the test platform. The test platform is pre-installed on the mobile device, the test script is used to simulate user operations on the mobile application on the mobile device, and the video file is used to record the response process of the mobile application to the simulated instructions in the test script.
[0114] The parsing unit 32 is used to parse the video file to obtain N information groups, and to determine the start frame of application loading and the end frame of application loading completion in the N video frames based on the application response status in the information groups. Each information group is used to record a video frame and the application response status described by each video frame, where N is a positive integer.
[0115] The calculation unit 33 is used to calculate the time difference between the start frame and the end frame to obtain the time performance test results of the mobile application.
[0116] The aforementioned time performance testing device for mobile applications can first run a test script through the test platform via the running unit 31, and capture video files through the screen recording function of the test platform. The test platform is pre-installed on the mobile device, the test script is used to simulate user operations on the mobile application on the mobile device, and the video files are used to record the response process of the mobile application to the simulated instructions in the test script. Then, the parsing unit 32 parses the video file to obtain N information groups, and determines the start frame of application loading and the end frame of application loading completion in the N video frames based on the application response status in the information groups. Each information group is used to record a video frame and the application response status described by each video frame, where N is a positive integer. Finally, the calculation unit 33 calculates the time difference between the start frame and the end frame to obtain the time performance test result of the mobile application.
[0117] In this embodiment of the invention, a non-intrusive automated testing strategy is adopted. By integrating the Appium automated testing framework with advanced image processing and computer vision technologies, the goal of conducting comprehensive time performance evaluation without modifying the mobile application code is achieved. This enables precise measurement of the time consumption of mobile application startup, response, and function switching, thereby solving the technical problem in related technologies where time performance testing of mobile applications cannot avoid intrusive methods, resulting in poor APP security.
[0118] Specifically, this invention first uses an automated testing platform pre-installed on mobile devices to run test scripts, simulating real user operations to obtain the application's interactive responses in different scenarios. Then, it utilizes the testing platform's built-in screen recording function to capture video files in real time, providing not only a direct record of application behavior but also a foundational carrier for subsequent data analysis. By parsing the video files, it obtains N information groups representing the recorded video frames and the application's instantaneous response state within each frame, reflecting the comprehensiveness and detail of the testing process. Next, it analyzes these information groups in depth, using time series analysis and image similarity evaluation techniques to analyze the changing patterns of the application's response state, intelligently selecting the key start frame for the application's loading and the marker end frame indicating loading completion. Finally, it calculates the time difference between the start and end frames to obtain the mobile application's time performance test results. This solves the problem that existing technologies for mobile application time performance testing often rely on intrusive methods and modifications to native code, greatly enhancing test security, improving test versatility and flexibility, and making it suitable for various mobile applications.
[0119] Optionally, in the time performance testing device for mobile applications provided in this embodiment of the invention, the device further includes: a generation unit for pre-generating test scripts; the generation unit includes: a capture module for capturing the process of a user manually testing a mobile application through the screen recording function of the testing platform after obtaining user authorization, thereby obtaining a manual test video file; a recognition module for recognizing the user's manual operation sequence by analyzing the manual test video file, wherein the manual operation sequence is used to record click operations, swipe operations, and / or input operations arranged in chronological order; and a writing module for writing an automatic test script based on the manual operation sequence, thereby obtaining an executable test script if the automatic test script passes verification.
[0120] Optionally, in the time performance testing device for mobile applications provided in this embodiment of the invention, the parsing unit includes: a frame segmentation module, used to perform frame segmentation processing on the video file based on a preset frame segmentation time interval to obtain N video frames, and number all video frames in chronological order; a comparison and analysis module, used to perform comparison and analysis on all video frames using computer vision technology to identify the application response state in each video; and a construction module, used to construct information groups based on each video frame and the application response state to obtain N information groups.
[0121] Optionally, in the time performance testing device for mobile applications provided in this embodiment of the invention, the comparison analysis module includes: an identification submodule, used to identify the change points and change status information of the mobile application interface recorded in each video frame by comparing all adjacent video frames; and a generation submodule, used to generate the application response status corresponding to each video frame by comparing the change points and change status information corresponding to all adjacent video frames.
[0122] Optionally, in the time performance testing device for mobile applications provided in this embodiment of the invention, the parsing unit further includes: a traversal module, used to traverse the application response states of all video frames in chronological order; a first determination module, used to determine a candidate start frame based on adjacent video frames when the application response states of adjacent video frames indicate that the application interface of the mobile application has changed from an idle state to a loading state during the traversal process; and a second determination module, used to determine a candidate end frame based on adjacent video frames when the application response states of adjacent video frames indicate that the application interface of the mobile application has changed from a loading state to a stable display state.
[0123] Optionally, in the time performance testing device for mobile applications provided in this embodiment of the invention, the parsing unit further includes: a third determining module, used to determine all video frames within a predetermined range before and after the adjacent video frames as candidate start frames / candidate end frames after determining them as candidate start frames / candidate end frames based on adjacent video frames, to obtain a target video frame group; a comparison calculation module, used to perform a comparison calculation on each candidate frame in the target video frame group and the next adjacent video frame using an image similarity evaluation algorithm to obtain a similarity evaluation value; and a fourth determining module, used to determine the candidate frame corresponding to the similarity evaluation value as the start frame / end frame when the similarity evaluation value meets a preset difference threshold.
[0124] Optionally, in the time performance testing device for mobile applications provided in this embodiment of the invention, the calculation unit includes: an acquisition module, used to acquire a first number of the starting frame and a second number of the ending frame; and a calculation module, used to calculate the time difference based on the first number, the second number and a preset frame interval to obtain the time performance test result.
[0125] It should be noted that the above-mentioned running unit 31, parsing unit 32, and calculation unit 33 correspond to steps S201 to S203 in Embodiment 1. The instances and application scenarios implemented by the above-mentioned units and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above-mentioned modules or units can also be run as part of the device in the computer terminal 10 provided in Embodiment 1.
[0126] The invention will now be described in conjunction with another alternative embodiment.
[0127] Example 3
[0128] The present invention can also provide an electronic device. Figure 4 This is a structural block diagram of an electronic device that performs a time performance testing method for mobile applications according to an embodiment of the present invention, such as... Figure 4 As shown, the electronic device may include: one or more ( Figure 4 (Only one is shown) Processor 402, memory 404, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0129] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the time performance testing method and apparatus for mobile applications in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the aforementioned time performance testing method for mobile applications. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0130] The processor can access information and applications stored in memory via a transmission device to perform the following steps: run a test script on a test platform and capture video files using the test platform's screen recording function. The test platform is pre-installed on a mobile device. The test script simulates user operations on the mobile application on the mobile device, and the video files record the mobile application's response to the simulated instructions in the test script. Parse the video files to obtain N information groups, and based on the application response status in the information groups, determine the start frame (where application loading begins) and the end frame (where application loading is complete) within the N video frames. Each information group records one video frame and the application response status described by each video frame, where N is a positive integer. Calculate the time difference between the start and end frames to obtain the mobile application's time performance test results.
[0131] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: after obtaining user authorization, the processor captures the user's manual testing process of the mobile application through the screen recording function of the testing platform, obtaining a manual test video file; by analyzing the manual test video file, the processor identifies the user's manual operation sequence, wherein the manual operation sequence is used to record click operations, swipe operations and / or input operations arranged in chronological order; an automatic test script is written based on the manual operation sequence, and an executable test script is obtained if the automatic test script passes verification.
[0132] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: divide the video file into frames based on a preset frame interval to obtain N video frames, and number all video frames in chronological order; use computer vision technology to compare and analyze all video frames to identify the application response status in each video; and construct information groups based on each video frame and the application response status to obtain N information groups.
[0133] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: by comparing all adjacent video frames, identify the points of change and change status information of the mobile application interface recorded in each video frame; by comparing the points of change and change status information corresponding to all adjacent video frames, generate the application response status corresponding to each video frame.
[0134] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: traversing the application response status of all video frames in chronological order; during the traversal, when the application response status of an adjacent video frame indicates that the application interface of the mobile application has changed from an idle state to a loading state, determining the adjacent video frame as a candidate start frame; when the application response status of an adjacent video frame indicates that the application interface of the mobile application has changed from a loading state to a stable display state, determining the adjacent video frame as a candidate end frame.
[0135] The processor can also call the information and application program stored in the memory through the transmission device to perform the following steps: determine all video frames within a predetermined range before and after adjacent video frames as candidate start frames / candidate end frames to obtain a target video frame group; for each candidate frame in the target video frame group, use an image similarity evaluation algorithm to compare and calculate the candidate frame and the next video frame adjacent to the candidate frame to obtain a similarity evaluation value; if the similarity evaluation value meets a preset difference threshold, determine the candidate frame corresponding to the similarity evaluation value as the start frame / end frame.
[0136] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: obtain the first number of the start frame and the second number of the end frame; calculate the time difference based on the first number, the second number and the preset frame interval to obtain the time performance test result.
[0137] This invention provides a time performance testing solution for mobile applications. Employing a non-intrusive automated testing strategy, it integrates the Appium automated testing framework with advanced image processing and computer vision technologies. This achieves comprehensive time performance evaluation without modifying the mobile application code, enabling precise measurement of time consumption during mobile application startup, response, and function switching. This solves the problem in related technologies where time performance testing for mobile applications cannot avoid intrusive methods, leading to poor app security.
[0138] Those skilled in the art will understand that Figure 4The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 4 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.
[0139] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0140] The invention will now be described in conjunction with another alternative embodiment.
[0141] Example 4
[0142] This invention also provides a computer-readable storage medium. Optionally, in this invention, the computer-readable storage medium can be used to store the program code executed by the time performance testing method for mobile applications provided in Embodiment 1.
[0143] Optionally, in this embodiment of the invention, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0144] This invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of a time performance testing method for mobile applications: running a test script through a test platform and capturing a video file through the screen recording function of the test platform, wherein the test platform is pre-installed on the mobile device, the test script is used to simulate user operations on the mobile application on the mobile device, and the video file is used to record the response process of the mobile application to the simulated instructions in the test script; parsing the video file to obtain N information groups, and determining the start frame of application loading and the end frame of application loading completion in the N video frames based on the application response status in the information groups, wherein each information group is used to record a video frame and the application response status described by each video frame, and N is a positive integer; calculating the time difference between the start frame and the end frame to obtain the time performance test result of the mobile application.
[0145] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0146] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0147] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0148] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0150] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0151] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for time performance testing of mobile applications, characterized in that, include: The test script is run through the test platform, and video files are captured through the screen recording function of the test platform. The test platform is pre-installed on the mobile device, the test script is used to simulate user operations on the mobile application on the mobile device, and the video files are used to record the response process of the mobile application to the simulated instructions in the test script. The video file is parsed to obtain N information groups, and the start frame of application loading and the end frame of application loading completion are determined in the N video frames based on the application response status in the information groups. Each information group is used to record a video frame and the application response status described by each video frame, and N is a positive integer. The time difference between the start frame and the end frame is calculated to obtain the time performance test results of the mobile application.
2. The time performance testing method according to claim 1, characterized in that, The test script is pre-generated, and the steps for generating the test script include: After obtaining user authorization, the screen recording function of the testing platform is used to capture the process of the user manually testing the mobile application, and a manual test video file is obtained. By analyzing the manual test video file, the user's manual operation sequence is identified, wherein the manual operation sequence is used to record click operations, swipe operations and / or input operations arranged in chronological order; An automated test script is written based on the manual operation sequence. If the automated test script passes verification, an executable test script is obtained.
3. The time performance testing method according to claim 1, characterized in that, The steps for parsing the video file to obtain N information groups include: The video file is divided into frames based on a preset frame interval to obtain N video frames, and all video frames are numbered in chronological order. Computer vision technology is used to compare and analyze all the video frames to identify the application response status in each video. The information group is constructed based on each video frame and the application response status, resulting in the N information groups.
4. The time performance testing method according to claim 3, characterized in that, Computer vision technology is used to compare and analyze all the video frames to identify the application response state in each video, including: By comparing all adjacent video frames, the changes in the mobile application interface and the change status information recorded in each video frame are identified. By comparing the change points and change state information corresponding to all adjacent video frames, the application response state corresponding to each video frame is generated.
5. The time performance testing method according to claim 1, characterized in that, Based on the application response status in the information group, determine the start frame of application loading and the end frame of application loading completion among the N video frames, including: The application response states of all the video frames are traversed in chronological order. During the traversal, if the application response status of an adjacent video frame indicates that the application interface of the mobile application has changed from an idle state to a loading state, the adjacent video frame is determined as a candidate starting frame. When the application response state of an adjacent video frame indicates that the application interface of the mobile application has transitioned from a loading state to a stable display state, the adjacent video frame is determined as a candidate end frame.
6. The time performance testing method according to claim 5, characterized in that, After determining the candidate start frame / candidate end frame based on the adjacent video frames, the process further includes: All video frames within a predetermined range before and after the adjacent video frames are identified as the candidate start frame / candidate end frame to obtain the target video frame group. For each candidate frame in the target video frame group, an image similarity evaluation algorithm is used to compare and calculate the similarity evaluation value between the candidate frame and the next video frame adjacent to the candidate frame. If the similarity evaluation value meets the preset difference threshold, the candidate frame corresponding to the similarity evaluation value is determined as the start frame / end frame.
7. The time performance testing method according to claim 1, characterized in that, The step of calculating the time difference between the start frame and the end frame to obtain the time performance test result of the mobile application includes: Obtain the first number of the start frame, and obtain the second number of the end frame; The time difference is calculated based on the first number, the second number, and the preset frame interval to obtain the time performance test result.
8. A time performance testing device for mobile applications, characterized in that, include: The running unit is used to run test scripts through a test platform and capture video files through the screen recording function of the test platform. The test platform is pre-installed on a mobile device, the test script is used to simulate user operations on a mobile application on the mobile device, and the video file is used to record the response process of the mobile application to the simulated instructions in the test script. The parsing unit is used to parse the video file to obtain N information groups, and to determine the start frame of application loading and the end frame of application loading completion in the N video frames based on the application response status in the information groups. Each information group is used to record a video frame and the application response status described by each video frame, where N is a positive integer. The calculation unit is used to calculate the time difference between the start frame and the end frame to obtain the time performance test results of the mobile application.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the time performance testing method for mobile applications as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the time performance testing method for mobile applications as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, Includes computer instructions, wherein when executed by a processor, the computer instructions implement the steps of the time performance testing method for mobile applications as described in any one of claims 1 to 7.