A WebXR application testing method, computer-readable storage medium and terminal

By encapsulating WebXR applications and integrating simulator functions, combined with reinforcement learning and computer vision methods, the fragmentation and coverage problems of WebXR application testing are solved, and efficient test coverage and accuracy are achieved.

CN114168449BActive Publication Date: 2024-10-08SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111289431.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-02
Publication Date
2024-10-08
Estimated Expiration
2041-11-02

AI Technical Summary

Technical Problem

Existing technologies cannot effectively test WebXR applications, especially due to the difficulty of testing due to fragmentation issues, incompatible runtime environments, functionality and rendering issues, and the difficulty in achieving high coverage with traditional testing methods.

Method used

By encapsulating the WebXR application to be tested, it provides a unified interface and simulator function, uses the OpenAI Gym interface standard to encapsulate the WebXR application, combines reinforcement learning algorithms and computer vision methods for interactive testing, detects actions and rendering scenes, and discovers and verifies vulnerabilities.

Benefits of technology

It achieves effective testing of WebXR applications without real XR hardware equipment, improves test coverage and accuracy, and solves the problem of WebXR application testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168449B_ABST
    Figure CN114168449B_ABST
Patent Text Reader

Abstract

The present invention relates to a WebXR application testing method, a computer-readable storage medium and a terminal, the method comprising: encapsulating a WebXR application to be tested so that the WebXR application to be tested has a unified interface; the WebXR application to be tested has a simulator function; calling the unified interface to perform interactive testing with the WebXR application to be tested to obtain a test result. By encapsulating the WebXR application to be tested so that the WebXR application to be tested has a unified interface, the unified interface can be used to interact with the WebXR application to be tested. Since it has a simulator function, it can interact with the WebXR application without a real XR hardware device. By detecting the interaction process, the test result of the WebXR application to be tested is obtained. The problem that the WebXR application cannot be reasonably tested in the prior art is well solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software testing technology, and in particular to a WebXR application testing method, a computer-readable storage medium, and a terminal. Background Art

[0002] Extended Reality (XR) technology creates an interactive environment by combining the virtual world and the real world to provide users with an immersive experience. At present, there are three main types of XR technology, namely Virtual Reality (VR), Augmented Reality (AR) and Mixed Reality (MR). As XR technology has brought disruptive innovation to the way people interact with computers, this new generation of technology has become increasingly popular in recent years and has been applied to various scenarios, including online collaboration, product display, skills training, medical surgery, entertainment and leisure, etc.

[0003] Similar to other software, WebXR software requires a sound testing methodology to ensure its quality and reliability. Due to the particularity of WebXR software, testing techniques for traditional software are not sufficient to test WebXR applications. First, the widespread fragmentation problem in the WebXR ecosystem poses a great challenge to testing, and the resulting runtime environment incompatibility is the most common root cause of WebXR vulnerabilities. When handling different user interactions through various devices, the testing framework should adapt to various browsers, WebXR frameworks, device models, and operating systems. In addition, 44.02% of the WebXR vulnerabilities studied were functional issues and 23.10% were rendering issues, which shows that a large proportion of WebXR vulnerabilities are application-specific, making it particularly difficult to build a general test oracle.

[0004] In addition, WebXR applications have a variety of interaction mechanisms and input types, and the testing framework faces a huge input search space (for example, the rotation degrees of handheld controllers and head-mounted displays in three-dimensional space are all within a reasonable range of real number domains), making it difficult to achieve satisfactory test coverage.

[0005] Therefore, how to test WebXR applications well is an urgent problem to be solved. Summary of the invention

[0006] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a WebXR application testing method, a computer-readable storage medium and a terminal, aiming to solve the problem that there is no suitable testing method for WebXR applications.

[0007] According to a first aspect of an embodiment of the present invention, a WebXR application testing method is provided, wherein the method includes:

[0008] Encapsulating the WebXR application to be tested so that the WebXR application to be tested has a unified interface; the WebXR application to be tested has a simulator function;

[0009] The unified interface is called to perform interactive testing with the WebXR application to be tested, and a test result is obtained.

[0010] Optionally, the WebXR application testing method, wherein the step of encapsulating the WebXR application to be tested so that the WebXR application to be tested has a unified interface; and the step of providing the WebXR application to be tested with a simulator function specifically includes:

[0011] The OpenAI Gym interface standard is used to encapsulate several different WebXR applications to be tested into a unified interface; the unified interface includes: initializing the test environment, executing actions, rendering scenes, resetting the test environment, and closing the test environment;

[0012] Integrate a program with simulator functionality into the WebXR application to be tested.

[0013] Optionally, in the WebXR application testing method, the step of calling the unified interface to perform interactive testing with the WebXR application to be tested and obtaining a test result specifically includes:

[0014] Obtaining decision information for triggering the WebXR application to be tested, and triggering corresponding actions according to the decision information;

[0015] The unified interface is called to perform interactive testing on the triggered action to obtain a test result.

[0016] Optionally, in the WebXR application testing method, a data collection program is injected into the source code of the WebXR application to be tested;

[0017] The obtaining of decision information that triggers the rendering scene in the WebXR application to be tested includes:

[0018] Calling the unified interface to collect observation data in different test environments from the packaged WebXR application to be tested through the data collection program;

[0019] The collected action data are calculated using a reinforcement learning algorithm to obtain the decision information; the reinforcement learning algorithm includes a reward function, and the reward function is used for decision making of the reinforcement learning algorithm;

[0020] The reward function includes: an intrinsic reward function and an external reward function, wherein the reward function is a weighted sum of the intrinsic reward function and the external reward function; the intrinsic function is a weighted sum of code coverage, memory, number of entities, requested animation frames, WebGL renderer, and memory indicators of the WebXR application to be tested;

[0021] The external function is a function specific to the WebXR application to be tested that is specified through a unified interface.

[0022] Optionally, the WebXR application testing method further comprises: using heuristic rules to randomly insert interaction events during the interaction test to test vulnerabilities caused by diverse user interaction mechanisms of the WebXR application to be tested.

[0023] Optionally, in the WebXR application testing method, calling the unified interface to perform interactive testing with the WebXR application to be tested to obtain a test result, wherein the interactive testing specifically includes:

[0024] A metamorphosis test is used to construct a test prediction, and a computer vision method is used to test whether the action of the WebXR application to be tested violates the test prediction.

[0025] Optionally, in the WebXR application testing method, the step of using a computer vision method to test whether an action of the WebXR application to be tested violates the test prediction specifically comprises:

[0026] Using the physical limitations corresponding to the rendering scene as the transformation relationship, the original test sequence is modified into a new test sequence;

[0027] Using a computer vision method to test the execution outputs of the original test sequence and the new test sequence respectively to obtain similarity;

[0028] The similarity is compared with a threshold, and when the similarity is lower than the threshold, the test language is violated.

[0029] Optionally, in the WebXR application testing method, the test prediction further includes: a console error prediction, a system crash prediction, and a hang prediction.

[0030] According to a second aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following steps:

[0031] Encapsulating the WebXR application to be tested so that the WebXR application to be tested has a unified interface; the WebXR application to be tested has a simulator function;

[0032] The unified interface is called to perform interactive testing with the WebXR application to be tested, and a test result is obtained.

[0033] According to a third aspect of an embodiment of the present invention, a terminal is provided, comprising: a processor and a memory; the memory stores a program executable by the processor; and when the processor executes the program, the steps in the WebXR application testing method described above are implemented.

[0034] Beneficial effect: The present invention provides a WebXR application testing method for testing a WebXR application that needs to be tested. By encapsulating the WebXR application to be tested, the WebXR application to be tested has a unified interface, and the unified interface can be used to interact with the WebXR application to be tested. Due to the simulator function, the WebXR application can be interacted with without a real XR hardware device. The test result of the WebXR application to be tested is obtained by detecting the interaction process. The problem that the WebXR application cannot be reasonably tested in the prior art is well solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 A flow chart of a WebXR application testing method provided by an embodiment of the present invention;

[0037] Figure 2 A schematic diagram of an overall method for WebXR application testing provided by an embodiment of the present invention;

[0038] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thoroughly understood.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0041] Professional terminology

[0042] Intelligent agent refers to the mainstream Chinese translation of (intelligent) agent in the field of AI, that is, an intelligent subject that explores the surrounding environment and responds accordingly.

[0043] The inventors have found that the existing popular WebXR application tests face the following technical problems:

[0044] (1) The input space for WebXR software is huge and hardware-dependent, including 3D real-valued inputs of the position and orientation of the head-mounted display and two handheld controllers;

[0045] (2) User interaction mechanisms are very important in WebXR testing. If developers do not properly handle the diverse user interaction mechanisms of various XR devices, many WebXR vulnerabilities will occur.

[0046] (3) The input space of WebXR software is constrained by the physical world, such as human movement speed and rotation range;

[0047] (4) Common heuristics for guiding test generation are difficult to directly apply to the testing of WebXR software;

[0048] (5) It is difficult to design test oracles for WebXR vulnerabilities because a large portion of these vulnerabilities are rendering issues or application-specific functionality issues.

[0049] At the same time, given the large input space of WebXR software, classic systematic testing methods are not suitable for this scenario, and they are difficult to test efficiently on WebXR software. Random strategies and search-based strategies are also affected by the huge input space. For example, when we fuzz tested Moonrider, a popular WebXR music game, the existing test could not find the "Start" button and click to enter the game, resulting in the entire testing process being isolated from the game. The effectiveness of model-based testing strategies depends largely on the quality of the model, but it is difficult to derive an accurate model for WebXR applications.

[0050] In order to solve the above problems, in an embodiment of the present application, by encapsulating the WebXR application to be tested, the encapsulation refers to the encapsulation of the test environment of the WebXR application to be tested. Through encapsulation, different WebXR applications to be tested can be turned into a unified test format, so that the test method is applicable to WebXR applications of different formats. By utilizing the simulator function of the WebXR application, the intelligent agent can interact with the WebXR application without a real XR hardware device, and the interaction process is tested, so as to obtain the test result of the WebXR application to be tested, thereby achieving the purpose of testing the WebXR application.

[0051] The following is a further explanation of the application content through the description of the embodiments in conjunction with the accompanying drawings. Figure 1 to Figure 2 As shown, this embodiment provides a WebXR application testing method, including:

[0052] S10. Encapsulate the WebXR application to be tested so that the WebXR application to be tested has a unified interface; the WebXR application to be tested has a simulator function.

[0053] Specifically, the agent's exploration and learning functions are decoupled into different programs to improve the usability, maintainability, and scalability of the testing method.

[0054] For example, Figure 2 As shown, several WebXR applications to be tested are preprocessed, and the so-called preprocessing includes inserting the source code of the WebXR application and injecting the data collector to facilitate subsequent data collection. The OpenAI Gym interface standard is used to encapsulate several different WebXR applications to be tested into unified interfaces; so that several different WebXR applications are packaged in a similar form, and only a unified interface is exposed to the outside for the intelligent agent to call. Among them, the unified interface includes: initializing the test environment, executing actions, rendering scenes, resetting the test environment, and closing the test environment.

[0055] In this embodiment, by encapsulating the WebXR to be tested, a unified testing environment is formed for the WebXR test. The intelligent agent can perform actions through the unified interface, detect the functions of the WebXR application with the help of the simulator, observe the detection process and results, and record the observed results.

[0056] For example, the WebXR music game Moonrider is tested by inserting a code segment into the source code of Moonrider to collect the dynamic context information of Moonrider at runtime, and to obtain the running status of Moonrider based on the context information. Then the simulator is integrated into Moonrider. It should be noted that the specific plug-in technology and simulator are commonly used technologies in this field and are not limited here.

[0057] Moonrider is encapsulated using the OpenAI Gym interface standard to obtain the encapsulated Moonrider (with a unified interface). The intelligent agent detects the functions of Moonrider, including songs, difficulty modes, and music game clearance actions. Now the intelligent agent selects songs in the Moonrider application to test whether its functions are normal. If the decision information is to select the third song in the playlist, the test environment is first initialized through the unified interface. After the intelligent agent obtains the above decision information, it uses the simulator to perform the song selection action and selects the third song in the playlist. At this moment, if the action can be executed normally, it means that the function is normal. If it cannot be selected, or the third song is not selected, it means that there may be a bug in the function.

[0058] In one implementation of this embodiment, a decision processor is used to explore intelligence in WebXR applications, that is, the exploration of the intelligent agent in WebXR is guided by the decision processor. The decision processor refers to a reinforcement learner guided by a series of heuristic rules, which interacts with the WebXR application through the unified interface described above.

[0059] In this embodiment, the reinforcement learning algorithm is a proximal policy optimization (PPO) learning algorithm, wherein the proximal policy optimization (PPO) learning algorithm is a model-free actor-critic type reinforcement learning method, which is suitable for continuous action space and has good performance in continuous control problems. It requires fewer hyperparameters than other algorithms, and also has the advantages of good robustness and high stability, and is less sensitive to random factors. The learning data used by the reinforcement learning algorithm can be obtained from the data collector injected into the WebXR application.

[0060] Furthermore, the KL (Kullback–Leibler Divergence) divergence can be used to limit the update rate of the decision processor's decision, making the reinforcement learning algorithm less sensitive to larger learning rates.

[0061] In one implementation of this embodiment, heuristic rules are used to guide decision-making processes to discover vulnerabilities caused by improper handling of diverse user interaction mechanisms, such as the lack of checking whether a head-mounted display is connected when a user enters VR mode. The goal of the reinforcement algorithm is to obtain higher rewards, so similar vulnerabilities are difficult to detect. We use heuristic rules to randomly insert user interaction events during the test process to detect this type of vulnerability. In addition, for situations where rewards are sparse, the agent cannot obtain effective feedback in most states, which makes the exploration efficiency extremely low. Therefore, we added multiple heuristic rules to guide the agent in this case.

[0062] For example, many WebXR applications have entities with text, including buttons, lists / options, interactive objects, etc. Most of these entities are functional entities that users are expected to interact with. However, compared with the entire WebXR scene, the functional entities are relatively small, which makes it difficult and time-consuming for the agent to accurately grasp or click on them, and some of them even prevent the agent from further exploring the WebXR application. For example, during the testing of the WebXR music game Moonrider, the reinforcement learning agent was always blocked from the game by the "Start" button of the game and could not enter the main functional area of ​​the application for testing. Therefore, we designed corresponding heuristic rules to guide the agent: filter out all entities with visible text when entering a new scene and interact with them first.

[0063] In this embodiment, the reward function used by the reinforcement learning algorithm during the learning process contains two independent parts, namely, intrinsic reward and extrinsic reward. For the intrinsic reward, indicators such as code coverage, memory, number of entities, requested animation frames, WebGL renderer, and WebGL memory are used, and the intrinsic reward function is the weighted sum of the above indicators. The application-specific external reward function can be specified through a unified interface. Finally, the weighted sum of the two reward functions from different sources (intrinsic reward function and extrinsic reward function) forms the final reward function, which is expressed as R (总) =w (内在) R (内在) +w (外在) R (外在) , where R (内在) =w0p0+w1p1+…+w n p n , where w0-w n is the weight, p0-p nThe above code coverage, memory, number of entities, requested animation frames, WebGL renderer, and WebGL memory. Extrinsic rewards are specific to a particular application and can be set to the score / task completion rate obtained in the application. For example, for a game-like WebXR application, we set its extrinsic reward to the weighted sum of the levels passed in the game and the scores obtained. For the above two weighted sums, the weights need to be dynamically adjusted according to the different WebXR applications tested.

[0064] After the above step S10, the method further includes S20, calling the unified interface to perform interactive testing with the WebXR application to be tested to obtain a test result.

[0065] Specifically, the intelligent agent issues action instructions with the help of a simulator to explore the WebXR to be tested, observes the actions through a unified interface, and records the observed actions. The decision processor obtains data from the data collector injected into the WebXR application, and uses a reinforcement learning algorithm to learn the acquired data to obtain decision information, and guides the intelligent agent based on the decision information. In other words, the intelligent agent further detects the WebXR application based on the decision information and repeats the operation until the end. The so-called end can be a pre-specified time, a pre-set end indication, or the end of the WebXR application.

[0066] In this embodiment, during the process of the agent exploring the WebXR application to be tested, the vulnerability detector monitors the state and performance of the WebXR application during operation (during the agent exploration process) or after operation. The vulnerability detector uses metamorphic testing to construct test predictions and uses computer vision methods to check whether the behavior of the WebXR software violates the defined test predictions. Metamorphic testing modifies the original test sequence into a new test sequence according to some clearly defined metamorphic relationships. The execution outputs of these two test sequences are expected to have some certain relationship.

[0067] Exemplarily, a series of common transformation relationships in WebXR software are defined, and vulnerabilities are detected by checking whether the test sequences before and after the modification meet the expected relationship. WebXR generally provides a three-dimensional experience, that is, a stereoscopic effect, by rendering two similar but slightly different (different viewpoints) images for both eyes. The human brain reconstructs a stereoscopic scene with two images from the left and right eyes. Therefore, for the brain to construct correctly and comfortably, the rendering outputs of the left and right eyes must have a specific physical relationship. Specifically, the two images must have a certain correlation at runtime and the gap cannot be too large. Therefore, during the operation of the WebXR software, the vulnerability detector checks the similarity of the two images through feature extraction and comparison algorithms. When the similarity is lower than the predefined threshold, it indicates that there is an error. In addition, conventional test predictions such as console errors, crashes, and hangs are also taken into account.

[0068] Based on the above-mentioned WebXR application testing method, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the WebXR application testing method as described below:

[0069] Based on the above-mentioned WebXR application testing method, the present invention also provides a terminal, such as Figure 3As shown, it includes at least one processor (processor) 30; memory (memory) 31, and may also include a communications interface (CommunicationsInterface) 32 and a bus 33. Among them, the processor 30, the memory 31 and the communication interface 32 can communicate with each other through the bus 33. The communication interface 32 can transmit information. The processor 30 can call the logic instructions in the memory 31 to execute the method in the above embodiment. In addition, the logic instructions in the above memory 31 can be implemented in the form of software functional units and can be stored in a readable storage medium when sold or used as an independent product. The memory 31, as a readable storage medium, can be configured to store software programs, such as program instructions or modules corresponding to the method in the embodiment of the present invention. The processor 30 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 31, that is, implementing the method in the above embodiment. The memory 31 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 31 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, can also be a transient storage medium. In addition, the specific process of loading and executing the above storage medium and the multiple instruction processors in the terminal has been described in detail in the above method, and will not be described here one by one.

[0070] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A WebXR application testing method, characterized in that: The method comprises: Encapsulating the WebXR application to be tested so that the WebXR application to be tested has a unified interface; the WebXR application to be tested has a simulator function; Calling the unified interface to perform interactive testing with the WebXR application to be tested, and obtaining a test result; The step of encapsulating the WebXR application to be tested so that the WebXR application to be tested has a unified interface; and the step of providing the WebXR application to be tested with a simulator function specifically includes: The OpenAI Gym interface standard is used to encapsulate several different WebXR applications to be tested into WebXR applications to be tested with a unified interface; the unified interface includes: initializing the test environment, executing actions, rendering scenes, resetting the test environment, and closing the test environment; Integrate a program with simulator function into the WebXR application to be tested; The step of calling the unified interface to perform interactive testing with the WebXR application to be tested and obtaining a test result specifically includes: Obtaining decision information for triggering the WebXR application to be tested, and triggering corresponding actions according to the decision information; Calling the unified interface to perform interactive testing on the triggered action to obtain the test result; A data collection program is injected into the source code of the WebXR application to be tested; The obtaining of decision information that triggers the WebXR application to be tested includes: Calling the unified interface to collect observation data in different test environments from the packaged WebXR application to be tested through the data collection program; Using a reinforcement learning algorithm to calculate the collected observation data to obtain the decision information; The reinforcement learning algorithm includes a reward function, which is used for decision making of the reinforcement learning algorithm; The reward function includes: an intrinsic reward function and an external reward function, wherein the reward function is a weighted sum of the intrinsic reward function and the external reward function; the intrinsic function is a weighted sum of code coverage, memory, number of entities, requested animation frames, WebGL renderer, and memory indicators of the WebXR application to be tested; The external function is a function specific to the WebXR application to be tested that is specified through a unified interface.

2. The WebXR application testing method according to claim 1, characterized in that: The method also includes: using heuristic rules to randomly insert interactive events during the interactive test to test vulnerabilities caused by diverse user interaction mechanisms of the WebXR application to be tested.

3. The WebXR application testing method according to claim 1, wherein: The calling of the unified interface to perform an interactive test with the WebXR application to be tested to obtain a test result, wherein the interactive test specifically includes: A metamorphosis test is used to construct a test prediction, and a computer vision method is used to test whether the action of the WebXR application to be tested violates the test prediction.

4. The WebXR application testing method according to claim 3, characterized in that: The method of using a computer vision method to test whether the action of the WebXR application to be tested violates the test prediction specifically includes: Using the physical limitations corresponding to the rendering scene as the transformation relationship, the original test sequence is modified into a new test sequence; Using a computer vision method to test the execution outputs of the original test sequence and the new test sequence respectively to obtain similarity; The similarity is compared with a threshold, and when the similarity is lower than the threshold, the test language is violated.

5. The WebXR application testing method according to claim 3, characterized in that: The test predictions also include: console error prediction, system crash prediction and hang prediction.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following steps: Encapsulating the WebXR application to be tested so that the WebXR application to be tested has a unified interface; the WebXR application to be tested has a simulator function; Calling the unified interface to perform interactive testing with the WebXR application to be tested, and obtaining a test result; The step of encapsulating the WebXR application to be tested so that the WebXR application to be tested has a unified interface; and the step of providing the WebXR application to be tested with a simulator function specifically includes: The OpenAI Gym interface standard is used to encapsulate several different WebXR applications to be tested into WebXR applications to be tested with a unified interface; the unified interface includes: initializing the test environment, executing actions, rendering scenes, resetting the test environment, and closing the test environment; Integrate a program with simulator function into the WebXR application to be tested; The step of calling the unified interface to perform interactive testing with the WebXR application to be tested and obtaining a test result specifically includes: Obtaining decision information for triggering the WebXR application to be tested, and triggering corresponding actions according to the decision information; Calling the unified interface to perform interactive testing on the triggered action to obtain the test result; A data collection program is injected into the source code of the WebXR application to be tested; The obtaining of decision information that triggers the WebXR application to be tested includes: Calling the unified interface to collect observation data in different test environments from the packaged WebXR application to be tested through the data collection program; Using a reinforcement learning algorithm to calculate the collected observation data to obtain the decision information; The reinforcement learning algorithm includes a reward function, which is used for decision making of the reinforcement learning algorithm; The reward function includes: an intrinsic reward function and an external reward function, wherein the reward function is a weighted sum of the intrinsic reward function and the external reward function; the intrinsic function is a weighted sum of code coverage, memory, number of entities, requested animation frames, WebGL renderer, and memory indicators of the WebXR application to be tested; The external function is a function specific to the WebXR application to be tested that is specified through a unified interface.

7. A terminal, characterized in that: include: Processor and memory; The memory stores a program executable by the processor; When the processor executes the program, the steps in the WebXR application testing method as described in any one of claims 1-5 are implemented.