A game automatic test script generation method based on machine learning
By using machine learning-based multimodal data fusion and deep reinforcement learning to generate automated game test scripts, the problems of low efficiency, incomplete coverage, poor adaptability, and weak interpretability in existing technologies are solved, achieving efficient and interpretable test script generation and bug discovery.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANRUI DIGITAL INFORMATION TECH CO LTD
- Filing Date
- 2026-04-16
- Publication Date
- 2026-07-21
AI Technical Summary
In existing technologies, game development cycles are long and testing work relies heavily on manually written scripts, resulting in problems such as low efficiency, incomplete coverage, poor adaptability, and insufficient intelligence. Furthermore, AI-generated scripts have weak interpretability.
A machine learning-based approach is adopted, which collects multimodal data, fuses it using a cross-modal attention mechanism, generates a unified state representation, combines a deep reinforcement learning policy network or a multimodal Transformer model to generate candidate test scripts, performs syntactic and semantic verification, uses a constraint solver for automatic repair, and feeds back the execution results to train the model.
It enables proactive exploration of game states, rapid adaptation to version iterations, and generation of interpretable, high-coverage test scripts, improving testing efficiency and bug finding capabilities, and addressing the shortcomings of existing technologies.
Smart Images

Figure CN122432037A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to a method for generating automated game test scripts based on machine learning. Background Technology
[0002] Current game development cycles are long and feature-rich, and testing relies heavily on manually written scripts, resulting in the following technical shortcomings: Low efficiency: Manually writing test scripts is extremely time-consuming and cannot keep up with the rapid iteration pace of development.
[0003] Incomplete coverage: It is difficult to systematically explore all state spaces of the game, and it is easy to miss edge scenes.
[0004] Poor adaptability: After the game version is updated, the old scripts require a lot of manual maintenance.
[0005] Insufficient intelligence: Existing automation tools (such as Selenium and Appium) can only replay predefined steps and cannot proactively discover unknown bugs.
[0006] Weak interpretability: AI-generated scripts are often black boxes, making them difficult for testers to trust and debug. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a method for generating automated game test scripts based on machine learning.
[0008] According to one aspect of the present invention, a method for generating automated game test scripts based on machine learning is provided, comprising: Collect multimodal data during game runtime. The multimodal data includes at least game screenshots, UI tree structure, user operation event sequences, and game logs. Multimodal data is fused using a cross-modal attention mechanism to generate a unified state representation; Candidate test scripts are generated based on state representations using deep reinforcement learning policy networks or multimodal Transformer models. Perform syntax and semantic verification on candidate test scripts, and call the constraint solver to automatically repair scripts that fail verification; The validated test scripts are executed in the game environment, and the execution results, coverage, and bug information are collected and fed back to the model training stage.
[0009] According to another aspect of the present invention, a device for generating automated game test scripts based on machine learning is provided, comprising: The acquisition module is used to collect multimodal data during game runtime. The multimodal data includes at least game screenshots, UI tree structure, user operation event sequences, and game logs. The fusion module is used to fuse multimodal data using a cross-modal attention mechanism to generate a unified state representation; The generation module is used to generate candidate test scripts based on state representations, using deep reinforcement learning policy networks or multimodal Transformer models. The verification module is used to perform syntax and semantic verification on candidate test scripts, and to call the constraint solver to automatically repair scripts that fail verification. The feedback module is used to execute validated test scripts in the game environment, collect execution results, coverage and bug information, and feed them back to the model training stage.
[0010] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the methods described in any of the above aspects of the present invention.
[0011] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the method described in any of the preceding aspects of the present invention.
[0012] Therefore, the present invention has the following beneficial effects: Adversarial generation: Instead of passively reproducing, it actively creates unknown bugs.
[0013] Multimodal + Graph: Upgrading from "reading logs" to "seeing the picture, understanding the structure, and adhering to the logic".
[0014] Interpretable scripts: output counterfactual data and heatmaps to address the trust issues associated with AI black boxes.
[0015] Meta-learning adaptation: version iterations respond in minutes, no need for retraining.
[0016] Semantic verification: ensures that the generated script is almost 100% executable.
[0017] Swarm intelligence: Multi-agent collaboration + genetic algorithm to avoid local optima in testing strategies. Attached Figure Description
[0018] Exemplary embodiments of the present invention can be more fully understood by referring to the following figures: Figure 1This is a flowchart illustrating a method for generating automated game test scripts based on machine learning, provided in an exemplary embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of a game automated test script generation device based on machine learning provided in an exemplary embodiment of the present invention; Figure 3 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. Detailed Implementation
[0019] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein.
[0020] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention.
[0021] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of the present invention are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0022] It should also be understood that in the embodiments of the present invention, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.
[0023] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more unless explicitly defined or given contrary instructions in the context.
[0024] Furthermore, the term "and / or" in this invention is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this invention generally indicates that the preceding and following related objects have an "or" relationship.
[0025] It should also be understood that the description of the various embodiments in this invention emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.
[0026] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0027] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0028] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.
[0029] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0030] The embodiments of this invention can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Well-known examples of terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.
[0031] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.
[0032] Exemplary methods Figure 1 This is a flowchart illustrating a method for generating automated game test scripts based on machine learning, provided in an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as… Figure 1 As shown, the game automated test script generation method 100 based on machine learning includes the following steps: Step 101: Collect multimodal data during game runtime. The multimodal data includes at least game screenshots, UI tree structure, user operation event sequence, and game logs. Step 102: Use a cross-modal attention mechanism to fuse multimodal data and generate a unified state representation; Step 103: Generate candidate test scripts based on the state representation using a deep reinforcement learning policy network or a multimodal Transformer model. Step 104: Perform syntax and semantic verification on the candidate test scripts, and call the constraint solver to automatically repair scripts that fail verification. Step 105: Execute the validated test script in the game environment, collect execution results, coverage and bug information, and feed them back to the model training stage.
[0033] Specifically, this invention aims to provide a game automated test script generation system that is proactively exploratory, adaptively learning, interpretable, and highly reliable, significantly reducing manual input and improving test coverage and bug detection capabilities. The specific implementation steps are as follows: 1. Multimodal data acquisition and feature engineering Input mode: Visual modality: Game screenshots (frame sequences), convolutional features extracted using ResNet-50.
[0034] Structural modality: UI tree (XML / JSON format), encoded using a graph neural network (GNN).
[0035] Timing modality: A sequence of user action events (mouse, keyboard, touch), using Transformer position encoding.
[0036] Text modalities: game logs, bug descriptions, semantic vectors extracted using BERT.
[0037] Fusion method: Cross-modal attention fusion is adopted, and the formula is as follows: Among them, Q v K v V v From the perspective of vision, Q t K t V t From time sequence.
[0038] 2. Adversarial Test Generation (Core Innovation 1) 2.1 Basic Strategies of Deep Reinforcement Learning (DRL) State space S: The current multimodal features of the game.
[0039] Action space A: Possible UI operations (click, swipe, input, etc.).
[0040] The reward function R(s,a) is designed as three parts: In the formula, R novelty New state exploration reward (based on state hash count); R coverage Rewards for improved code / scenario coverage; R bug_induce : Adversarial measures, which actively induce program exceptions (such as memory overflow or assertion failure).
[0041] 2.2 Enhanced Mutation Testing The generated candidate script π is subjected to mutation operators: the operation order is randomly shuffled; the waiting time is doubled / halved; and the assertion conditions are negated.
[0042] Execute the original script and the mutated script, and compare the output differences. The smaller the difference, the lower the sensitivity of the original script in testing. Mark this sample as a "weak test sample" and add it to the training set penalty term.
[0043] 3. Knowledge Graph-Assisted Generation (Core Innovation 2) Construct a game testing knowledge graph G = (V, E): Node types: Scene node, Operation node, Bug type node, Precondition node.
[0044] Edge types: Trigger, Cause, Prohibit, Depend.
[0045] Atlas applications: When the script is generated, the output of each step of the Transformer decoder is filtered by the Graph Constrained Decoding to remove logically unreachable operations (such as generating a "buy" action when the store is not open).
[0046] The map is also used for path recommendation: If the goal is to test "backpack capacity overflow", the map recommends the following path: Enter the game → Open the backpack → Add items continuously to the limit → Add items again.
[0047] 4. Explainability Module (Core Innovation 3) 4.1 Counterfactual Interpretation Assume the generated script π successfully reproduces Bug B. The system automatically generates a minimal mutation step π′, making π′ unable to reproduce B. By comparing the differences between π and π′, the key triggering step is located. A gradient-based counterfactual search is employed: 4.2 Attention Heatmap Mapping Extracting the attention weights W of the last layer of the Transformer att This is mapped back to the original input frame sequence or UI tree nodes to generate highlighted areas. Testers can then visually see which button or text area of the game interface the model focuses on when making decisions.
[0048] Learn quickly and adapt for just 5 yuan (Core Innovation 4) Meta-training phase (offline): The model-independent meta-learning (MAML) algorithm is used to train the initial parameters θ0 across multiple different games or major historical versions of the same game. The goal of meta-learning is to enable the model to reach its optimum after a small number of gradient updates, given a small amount of new task data.
[0049] Online adaptation phase (runtime): After the game releases a new version, collect a small number (e.g., 50) of manually corrected scripts or automated exploration results, and perform gradient descent 5-10 times: Achieve minute-level adaptation without requiring complete retraining.
[0050] 6. Syntax-Semantic Adversarial Validation Layer (Core Innovation 5) The generated script must pass two layers of verification: Syntax validation: Use the ANTLR parser of the predefined DSL (Domain-Specific Language) to check keywords, parentheses, and parameter types.
[0051] Semantic verification: Model the game state transitions as a finite state machine or graph neural network state transition model. Given the current state s t Execute action a t Then, predict the next state s. t+1 If the predicted state is outside the set of legal states, then the action is rejected.
[0052] Constraint solver repair: If verification fails, the Z3 or CP-SAT solver is invoked to find the minimum action sequence correction so that the script satisfies the semantic constraints. The corrected script is then directly fed back to the generative model as a positive sample.
[0053] 4.7 Multi-Agent Swarm Intelligence (Core Innovation 6) Deploy three heterogeneous agents: Explorer: Maximizing R novelty They are responsible for covering the new area.
[0054] Destroyer: Maximize R bug_induce Perform adversarial stress testing.
[0055] Returning bugs: Maximize the reproduction rate of historical bugs and verify fixed defects.
[0056] Collaboration mechanism: Share an overlay map (a hash table records the visited status).
[0057] Use lightweight message queues for communication. For example, when an explorer discovers a new state s... new Immediately notify the saboteurs, who will then generate a target for s. new The mutated script.
[0058] Population evolution (genetic algorithm): Treat a set of test scripts as a population.
[0059] Fitness function: Selection, crossover (the steps of merging two scripts), mutation (random modification), iterative evolution.
[0060] Therefore, the present invention has the following beneficial effects: Adversarial generation: Instead of passively reproducing, it actively creates unknown bugs.
[0061] Multimodal + Graph: Upgrading from "reading logs" to "seeing the picture, understanding the structure, and adhering to the logic".
[0062] Interpretable scripts: output counterfactual data and heatmaps to address the trust issues associated with AI black boxes.
[0063] Meta-learning adaptation: version iterations respond in minutes, no need for retraining.
[0064] Semantic verification: ensures that the generated script is almost 100% executable.
[0065] Swarm intelligence: Multi-agent collaboration + genetic algorithm to avoid local optima in testing strategies.
[0066] Exemplary device Figure 2 This is a schematic diagram of the structure of a game automated test script generation device based on machine learning, provided in an exemplary embodiment of the present invention. Figure 2 As shown, the device 200 includes: The acquisition module 210 is used to acquire multimodal data during game runtime. The multimodal data includes at least game screenshots, UI tree structure, user operation event sequence, and game logs. The fusion module 220 is used to fuse multimodal data using a cross-modal attention mechanism to generate a unified state representation; The generation module 230 is used to generate candidate test scripts based on state representations using a deep reinforcement learning policy network or a multimodal Transformer model. The verification module 240 is used to perform syntax and semantic verification on candidate test scripts, and to call the constraint solver to automatically repair scripts that fail verification. Feedback module 250 is used to execute the validated test scripts in the game environment, collect execution results, coverage and bug information, and feed them back to the model training stage.
[0067] Exemplary electronic devices Figure 3 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. For example... Figure 3 As shown, the electronic device 30 includes one or more processors 31 and memory 32.
[0068] The processor 31 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0069] The memory 32 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 31 may execute the program instructions to implement the methods of the software programs of the various embodiments of the present invention described above, and / or other desired functions. In one example, the electronic device may also include an input device 33 and an output device 34, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0070] In addition, the input device 33 may also include, for example, a keyboard, a mouse, etc.
[0071] The output device 34 can output various information to the outside. The output device 34 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0072] Of course, for the sake of simplicity, Figure 3 Only some of the components of the electronic device relevant to the present invention are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0073] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods according to various embodiments of the present invention described in the "Exemplary Methods" section above.
[0074] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present invention. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0075] Furthermore, embodiments of the present invention may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the methods for information mining of historical change records according to various embodiments of the present invention as described in the "Exemplary Methods" section above.
[0076] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0077] The basic principles of the present invention have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in the present invention are merely examples and not limitations, and should not be considered as essential features of each embodiment of the present invention. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the present invention to the necessity of employing the aforementioned specific details.
[0078] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0079] The block diagrams of devices, systems, devices, and systems involved in this invention are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, systems, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0080] The methods and systems of the present invention may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of the present invention are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the present invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the methods according to the present invention. Thus, the present invention also covers recording media storing programs for performing the methods according to the present invention.
[0081] It should also be noted that in the systems, apparatus, and methods of the present invention, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered equivalents of the present invention. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the invention. Therefore, the invention is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0082] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the invention to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A method for generating automated game test scripts based on machine learning, characterized in that, include: Collect multimodal data during game runtime, including at least game screenshots, UI tree structure, user operation event sequences, and game logs; The multimodal data is fused using a cross-modal attention mechanism to generate a unified state representation; Candidate test scripts are generated based on the state representation using a deep reinforcement learning policy network or a multimodal Transformer model. Perform syntax and semantic verification on candidate test scripts, and call the constraint solver to automatically repair scripts that fail verification; The validated test scripts are executed in the game environment, and the execution results, coverage, and bug information are collected and fed back to the model training stage.
2. The method according to claim 1, characterized in that, The reward function of the deep reinforcement learning policy network includes at least one of the following: Novelty incentives are used to encourage access to game states that have not yet been covered. Coverage bonuses are used to improve the test coverage of code or scenarios; Bug-inducing rewards are used to encourage users to perform actions that may cause program errors.
3. The method according to claim 2, characterized in that, Also includes: At least one mutation operator is applied to the generated candidate test script or its subsequence, the mutation operator including operation order rearrangement, wait time adjustment, and assertion condition negation; Execute the original script and the mutated script, and compare the differences in their output. Scripts with differences less than a preset threshold are marked as weak test samples and added to the training dataset as penalty samples.
4. The method according to claim 1, characterized in that, The production process of the candidate test scripts incorporates a game test knowledge graph for constraint decoding. The knowledge graph's node types include scene nodes, operation nodes, bug type nodes, and prerequisite condition nodes. The edge types of the knowledge graph include triggering relationships, causing relationships, prohibiting relationships, and dependency relationships; When decoding each action, the Transformer model queries the knowledge graph to filter out actions that are logically unreachable or semantically illegal in the current state.
5. The method according to claim 1, characterized in that, Also includes: When a generated script successfully reproduces a bug, the system automatically generates a variant script that is least different from the original script. This variant script cannot reproduce the same bug, and the key conditions that trigger the bug are located by comparing the differences between the two scripts. Extract the attention weights within the Transformer model, map them back to the original game screenshots or UI tree nodes, and generate a visual heatmap to indicate the key areas the model focuses on when making decisions.
6. The method according to claim 1, characterized in that, Also includes: The initial parameters of the model are pre-trained using a model-independent meta-learning algorithm on multiple historical game versions or multiple different games. When a new version of the game is released, a first preset amount of new data is collected, and a second preset amount of gradient update steps are executed to enable the model to quickly adapt to the new version.
7. The method according to claim 1, characterized in that, Perform syntax and semantic validation on candidate test scripts, and automatically repair scripts that fail validation by calling the constraint solver, including: Use a predefined domain-specific language (DSL) parser to check the script's format validity; The game state transition is modeled as a finite state machine or a graph neural network state transition model. For each step in the script, the predicted state after the operation is executed is verified to be a legal set of states. When verification fails, the SMT solver or constraint programming solver is invoked to find the minimum action sequence correction scheme so that the script satisfies the semantic constraints, and the corrected script is returned as a positive sample to the generative model.
8. The method according to claim 1, characterized in that, Deploy a multi-agent swarm intelligence system, the system comprising: The Explorer Agent's strategy optimization goal is to maximize novelty rewards, and it is responsible for covering the unexplored game state space. The Disruptor Agent's strategy optimization goal is to maximize bug-inducing rewards, and it is responsible for executing adversarial stress tests. The Return Agent's strategy optimization goal is to maximize the reproducibility rate of historical bugs and is responsible for verifying fixed defects.
9. The method according to claim 8, characterized in that, It also includes inter-agent collaboration mechanisms: Shared overlay map, used to record the global game state that has been visited; Lightweight communication is achieved through message queues. When an explorer discovers a new state, it immediately notifies the destroyer to generate a mutation test script for that state. A genetic algorithm is used to evolve the test script population: a fitness function is constructed based on the coverage improvement and the number of bugs discovered, and the test script set is iteratively optimized through selection, crossover, and mutation operations.
10. A device for generating automated game test scripts based on machine learning, characterized in that, include: The acquisition module is used to collect multimodal data during game runtime. The multimodal data includes at least game screenshots, UI tree structure, user operation event sequences, and game logs. The fusion module is used to fuse the multimodal data using a cross-modal attention mechanism to generate a unified state representation; The generation module is used to generate candidate test scripts based on the state representation, using a deep reinforcement learning policy network or a multimodal Transformer model. The verification module is used to perform syntax and semantic verification on candidate test scripts, and to call the constraint solver to automatically repair scripts that fail verification. The feedback module is used to execute validated test scripts in the game environment, collect execution results, coverage and bug information, and feed them back to the model training stage.