Automatic game testing method and system
By establishing a knowledge base and event library, parsing the logical rules in the game development toolkit and combining natural language processing, the automatic generation and execution of game automated testing can be achieved, solving the problems of low efficiency and poor flexibility in traditional game testing methods, and improving testing efficiency and adaptability.
Patent Information
- Application Number
- CN202510589954.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-09-26
AI Technical Summary
Traditional game testing methods are inefficient, inflexible, have rigid test logic, lack natural language processing, separate data from logic, and have insufficient exception handling.
Establish a knowledge base and event library, parse the logical rules in the game development toolkit and convert them into structured data, break down test cases into event operation instructions, and combine the natural language processing model to convert user needs into semantic features to achieve automatic generation and execution of test logic.
Significantly improve test efficiency and adaptability, reduce manual intervention, achieve intelligent analysis of natural language requirements and dynamic feedback optimization, form an execution-feedback-update closed loop, and enhance the system's self-learning ability.
Smart Images

Figure CN120705030A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated testing, and in particular to a game automated testing method and system. Background Art
[0002] As game development becomes more complex, traditional game testing methods face bottlenecks such as low efficiency and poor flexibility. Existing technologies often rely on manual operations or automated testing with fixed scripts, which present the following problems: 1. Rigid test logic: Scripts need to be written in advance and cannot dynamically adapt to game version updates or changes in requirements, resulting in insufficient test coverage.
[0003] 2. Lack of natural language processing: User requirements (such as "upload a file at 8 pm tomorrow") need to be manually converted into code instructions, which is time-consuming and error-prone.
[0004] 3. Separation of data and logic: Test cases and API call rules are stored separately, lacking unified knowledge base and event library management, making it difficult to achieve intelligent association.
[0005] 4. Insufficient exception handling: During the test process, if problems such as window inactivation and interface timeout occur, there is a lack of automatic retry or rule correction mechanism. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a game automated testing method and system that can significantly improve testing efficiency and adaptability.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is: A method for automated game testing, comprising the steps of: Parsing the logic rules in the game development toolkit and converting the logic rules into structured data for storage in the knowledge base; Decomposing the preset test cases into event operation instructions, storing the event operation instructions in an event library, and associating the event library operation instructions with the logical rules of the knowledge base; Converting the natural language requirements input by the user into semantic features, matching the semantic features with the operation instructions in the event library, and obtaining executable test logic; The event in the event library is triggered according to the executable test logic, the execution result of the event is pushed to the user end, and the execution feedback data of the event is used to update the knowledge base and the event library.
[0008] In order to solve the above technical problems, another technical solution adopted by the present invention is: A game automation testing system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned game automation testing method is implemented.
[0009] The beneficial effects of the present invention are as follows: by establishing a knowledge base and an event base, and coordinating the management of the knowledge base and the event base, the automatic generation and execution of test logic is realized, reducing manual intervention; the natural language requirements input by the user end are converted into semantic features, and the semantic features are matched with the operation instructions in the event base to obtain executable test logic to lower the test threshold; according to the executable test logic, the event in the event base is triggered, the execution result of the event is pushed to the user end, and the execution feedback data of the event is used to update the knowledge base and the event base, thereby forming an "execution-feedback-update" closed loop and improving the self-learning ability of the test system. In this way, the logical rules in the game development toolkit are converted into a knowledge base, combined with the preset operation instructions of the event base, to achieve intelligent parsing of natural language requirements and dynamic feedback optimization, significantly improving test efficiency and adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is a flowchart of a method for automated game testing according to an embodiment of the present invention; Figure 2 A schematic diagram of a game automated testing system according to an embodiment of the present invention; Figure 3 A business flow chart of a game automation testing method according to an embodiment of the present invention; Figure 4 A flowchart of an execution marking event according to an embodiment of the present invention; Figure 5 This is a flowchart of creating an event library according to an embodiment of the present invention.
[0011] Description of labels: 1. A game automated testing system; 2. Memory; 3. Processor. DETAILED DESCRIPTION
[0012] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.
[0013] Please refer to Figure 1 , an embodiment of the present invention provides a game automated testing method, comprising the steps of: Parsing the logic rules in the game development toolkit and converting the logic rules into structured data for storage in the knowledge base; Decomposing the preset test cases into event operation instructions, storing the event operation instructions in an event library, and associating the event library operation instructions with the logical rules of the knowledge base; Converting the natural language requirements input by the user into semantic features, matching the semantic features with the operation instructions in the event library, and obtaining executable test logic; The event in the event library is triggered according to the executable test logic, the execution result of the event is pushed to the user end, and the execution feedback data of the event is used to update the knowledge base and the event library.
[0014] From the above description, it can be seen that the beneficial effects of the present invention are: by establishing a knowledge base and an event base, as well as the collaborative management of the knowledge base and the event base, the automatic generation and execution of the test logic is realized, reducing manual intervention; the natural language requirements input by the user end are converted into semantic features, and the semantic features are matched with the operation instructions in the event base to obtain executable test logic to lower the test threshold; according to the executable test logic, the event in the event base is triggered, the execution result of the event is pushed to the user end, and the execution feedback data of the event is used to update the knowledge base and the event base, thereby forming an "execution-feedback-update" closed loop and improving the self-learning ability of the test system. In this way, the logical rules in the game development toolkit are converted into a knowledge base, combined with the preset operation instructions of the event base, to achieve intelligent parsing of natural language requirements and dynamic feedback optimization, significantly improving test efficiency and adaptability.
[0015] Furthermore, the logic rules in the game development toolkit are parsed and converted into structured data for storage in a knowledge base, including: Extracting logic rules defined in the game development toolkit, wherein the logic rules include interface parameters and API call sequence; The interface parameters and the API call sequence are converted into hierarchical structure data, and the conversion results are stored in the preset classification nodes of the knowledge base.
[0016] From the above description, we can see that by extracting the interface parameters and API call sequence in the SDK, the integrity and traceability of the knowledge base data can be ensured; and converting logical rules into hierarchical structured data can enhance the query efficiency of the knowledge base and facilitate AI to quickly match logical rules.
[0017] Furthermore, the preset test cases are decomposed into event operation instructions, including: Atomize and split the composite operations in the preset test cases to generate independent event instruction units, each of which corresponds to a single interactive action. A unique event identifier is assigned to each event instruction unit, and a corresponding API call sequence and interface parameters are bound to each event instruction unit based on the logic rules in the knowledge base.
[0018] From the above description, it can be seen that by atomically splitting compound operations into independent event instruction units, the reusability and execution accuracy of test cases can be improved; and binding the unique event identifier with the API call chain can ensure that the instructions strictly correspond to the knowledge base rules and avoid parameter passing errors.
[0019] Furthermore, the natural language requirements input by the user are converted into semantic features, including: Extracting time, action, object, and constraints from the natural language requirements through a natural language processing model to generate structured semantic tags; The non-standard words in the semantic tag are converted into operation instruction keywords predefined in the event library based on the synonym mapping table.
[0020] As can be seen from the above description, the NLP model extracts key semantics such as time and action to achieve accurate parsing of unstructured requirements; using a synonym mapping table to standardize user colloquial expressions into event library instructions can effectively improve the matching fault tolerance rate.
[0021] Furthermore, triggering an event in the event library according to the executable test logic includes: Dynamically create multiple virtual test threads based on the event sequence in the executable test logic, each thread independently simulating the interactive operation of a game window or host; The status data of the game process is captured in real time. If it is detected that the window is not activated or the interface call times out, the retry instruction or exception handling rule in the event library is triggered.
[0022] As can be seen from the above description, dynamically creating multiple virtual threads to simulate different test scenarios can significantly improve test concurrency efficiency; while real-time status monitoring and exception handling rule triggering (such as retry instructions) can enhance system robustness and reduce the risk of test interruption.
[0023] Please refer to Figure 2 Another embodiment of the present invention provides a game automation testing system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned game automation testing method is implemented.
[0024] The above-mentioned automated game testing method and system of the present invention are suitable for significantly improving testing efficiency and adaptability, and are described below through specific implementation methods: Please refer to Figure 1, embodiment 1 of the present invention is: A method for automated game testing, comprising the steps of: S1. Parse the logic rules in the game development toolkit and convert the logic rules into structured data for storage in a knowledge base.
[0025] Among them, the logical rules defined in the game development toolkit are extracted, and the logical rules include interface parameters and API call sequence; the interface parameters and the API call sequence are converted into hierarchical structure data, and the conversion results are stored in the preset classification nodes of the knowledge base.
[0026] For details, please refer to Figure 3 After the AI module obtains the data SDK (game development kit), it needs to learn the functional logic in the data SDK. For example, if the SDK defines "move the game window to coordinates (221,115)", the AI will learn this rule and automatically execute it when it receives similar instructions later.
[0027] In this embodiment, the data SDK is a toolkit used in game development (such as the file operation SDK and the email SDK), which provides an API interface to help AI interact with the game. Its function is to encapsulate in-game operations (such as moving windows and clicking the mouse) into "keyword instructions." For example, "Move the game window to 221,115" will be converted into an SDK instruction, directly triggering the game execution.
[0028] exist Figure 3 In [1], the file SDK is used to transfer text data between the game and the AI. That is, the game sends a text request, the AI connects to the network to obtain the answer, and the AI generates an action instruction based on the answer. The instruction triggers the binding of the knowledge base and event library, and finally the action is executed.
[0029] In this embodiment, the knowledge base is used to store structured data related to the game. The knowledge base can record "uploaded files must include time, path, and file name", and AI completes the user's missing information based on these rules.
[0030] S2. Decompose the preset test case into operation instructions of the event, store the operation instructions of the event in an event library, and associate the operation instructions of the event library with the logical rules of the knowledge base.
[0031] Among them, the compound operations in the preset test cases are atomically split to generate independent event instruction units, each of which corresponds to a single interactive action; a unique event identifier is assigned to each event instruction unit, and the corresponding API call sequence and interface parameters are bound to each event instruction unit based on the logical rules in the knowledge base.
[0032] In this embodiment, please refer to Figure 4 , an event includes event text and event data.
[0033] The event text describes the target and operation of the event in natural language or a specific format. For example, in "@123 dd:\1.txt", @123 represents the target host number (such as host 123); d represents the operation type (such as a delete command); and "d:\1.txt" represents the operation object (such as file 1.txt on drive D). The entire text can be understood as: "Delete file 1.txt on drive D on host 123."
[0034] Event data is the result data generated after an event is executed. For example, a delete operation may return a success or failure status and record the specific reason (such as "file does not exist").
[0035] In this embodiment, the event text is bound to the specific execution logic through the operation rules defined by the event text, and feedback is generated: (1) The system breaks down @123 dd:\1.txt into: the target host is 123, the operation type is delete (d), and the operation object is d:\1.txt.
[0036] (2) Call the corresponding data SDK to perform the deletion action based on the analysis results.
[0037] (3) After the operation is completed, the system records the result (such as "deletion successful" or "reason for failure").
[0038] (4) Based on the additional information in the event text (such as admini@q1.cb), call the email SDK to send a notification to the specified mailbox.
[0039] Binding logic is to associate the operation instruction (such as d) in the event text with the corresponding SDK function. For example, the d command is bound to the delete interface of the file operation SDK, and admini@q1.cb is bound to the notification interface of the email SDK.
[0040] In this way, users only need to enter simple event text (such as @123 dd:\1.txt), and the system can automatically complete complex operations and feedback results, achieving efficient automated testing and configuration.
[0041] In this embodiment, please refer to Figure 5The event library includes process events, thread events, window events, mouse events, and keyboard events. Process events are used to create and destroy processes; thread events are used to create multi-threaded tasks and process user input data in multiple processes; window events are used for users to access specific game windows, including event text movement, destruction, dragging, shrinking, enlarging, maximizing, minimizing, changing window size, and activation; mouse events are used to simulate user mouse operations, such as left and right button clicks, movement, clicks with coordinates, and double-clicks; keyboard events are used to simulate user keyboard operations, such as pressing, releasing, long pressing, and key presses with events.
[0042] An event can be: when the game process test.exe exists in "window: select", it is activated, the window size is set to 800*600, and the keyboard is pressed: Enter.
[0043] S3. Convert the natural language requirements input by the user end into semantic features, match the semantic features with the operation instructions in the event library, and obtain executable test logic.
[0044] Among them, the time, action, object and constraint conditions in the natural language requirements are extracted through a natural language processing model to generate structured semantic tags; based on a synonym mapping table, the non-standard words in the semantic tags are converted into predefined operation instruction keywords in the event library.
[0045] In this embodiment, the AI module can automatically convert the natural language requirements input by the user into standardized instructions that the system can understand. For example, when the user says "help me upload the recording file", the AI will match the preset "file upload" operation in the event library and add details such as time and path.
[0046] In this embodiment, the semantic features are matched with the operation instructions in the event library to obtain executable test logic. Specifically, the network data (such as time, server status) and the local knowledge base can be combined to generate specific operation steps. For example: Example: The user says "Upload the recording to the server sern123 at 8 o'clock tomorrow night", the AI will parse the time, file, action, and generate an executable instruction.
[0047] S4. Trigger an event in the event library according to the executable test logic, push the execution result of the event to the user end, and use the execution feedback data of the event to update the knowledge base and the event library.
[0048] Among them, according to the event sequence in the executable test logic, multiple virtual test threads are dynamically created, and each thread independently simulates the interactive operation of a game window or host; the status data of the game process is captured in real time, and if it is detected that the window is not activated or the interface call times out, the retry instruction or exception handling rule in the event library is triggered.
[0049] Specifically, after the AI module generates executable test logic, it creates specific operations based on user needs to generate events, adds identifiers to the events, associates the events with specific operations in the game, and notifies the user of the results through email, pop-up windows, etc. after execution is completed.
[0050] Please refer to Figure 2 , the second embodiment of the present invention is: A game automation testing system 1 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, each step of a game automation testing method of embodiment 1 is implemented.
[0051] In summary, the present invention provides a game automation testing method and system, which realizes the automatic generation and execution of test logic by establishing a knowledge base and an event base, as well as the collaborative management of the knowledge base and the event base, reducing manual intervention; converting the natural language requirements input by the user end into semantic features, matching the semantic features with the operation instructions in the event base, and obtaining executable test logic to lower the test threshold; triggering events in the event base according to the executable test logic, pushing the execution results of the events to the user end, and using the execution feedback data of the events to update the knowledge base and the event base, thereby forming an "execution-feedback-update" closed loop and improving the self-learning ability of the test system. In this way, the logical rules in the game development toolkit are converted into a knowledge base, combined with the preset operation instructions of the event base, to achieve intelligent parsing and dynamic feedback optimization of natural language requirements, significantly improving test efficiency and adaptability. In addition, the present invention can complete multi-dimensional test simulation of the game through AI combing logic and events in the event base, and AI can create multiple host objects, which are equivalent to multiple test objects, greatly improving efficiency.
[0052] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A game automation testing method, characterized in that: Including steps: Parsing the logic rules in the game development toolkit and converting the logic rules into structured data for storage in the knowledge base; Decomposing the preset test cases into event operation instructions, storing the event operation instructions in an event library, and associating the event library operation instructions with the logical rules of the knowledge base; Converting the natural language requirements input by the user into semantic features, matching the semantic features with the operation instructions in the event library, and obtaining executable test logic; The event in the event library is triggered according to the executable test logic, the execution result of the event is pushed to the user end, and the execution feedback data of the event is used to update the knowledge base and the event library.
2. A game automation testing method according to claim 1, characterized in that: Parsing the logic rules in the game development toolkit and converting them into structured data for storage in the knowledge base, including: Extracting logic rules defined in the game development toolkit, wherein the logic rules include interface parameters and API call sequence; The interface parameters and the API call sequence are converted into hierarchical structure data, and the conversion results are stored in the preset classification nodes of the knowledge base.
3. A game automation testing method according to claim 1, characterized in that: Decompose the preset test cases into event operation instructions, including: Atomize and split the composite operations in the preset test cases to generate independent event instruction units, each of which corresponds to a single interactive action. A unique event identifier is assigned to each event instruction unit, and a corresponding API call sequence and interface parameters are bound to each event instruction unit based on the logic rules in the knowledge base.
4. A game automation testing method according to claim 1, characterized in that: Convert the natural language requirements input by the user into semantic features, including: Extracting time, action, object, and constraints from the natural language requirements through a natural language processing model to generate structured semantic tags; The non-standard words in the semantic tag are converted into operation instruction keywords predefined in the event library based on the synonym mapping table.
5. A game automation testing method according to claim 1, characterized in that: Triggering an event in the event library according to the executable test logic includes: Dynamically create multiple virtual test threads based on the event sequence in the executable test logic, each thread independently simulating the interactive operation of a game window or host; The status data of the game process is captured in real time. If it is detected that the window is not activated or the interface call times out, the retry instruction or exception handling rule in the event library is triggered.
6. A game automated testing system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Parsing the logic rules in the game development toolkit and converting the logic rules into structured data for storage in the knowledge base; Decomposing the preset test cases into event operation instructions, storing the event operation instructions in an event library, and associating the event library operation instructions with the logical rules of the knowledge base; Converting the natural language requirements input by the user into semantic features, matching the semantic features with the operation instructions in the event library, and obtaining executable test logic; The event in the event library is triggered according to the executable test logic, the execution result of the event is pushed to the user end, and the execution feedback data of the event is used to update the knowledge base and the event library.
7. A game automated testing system according to claim 6, characterized in that: Parsing the logic rules in the game development toolkit and converting them into structured data for storage in the knowledge base, including: Extracting logic rules defined in the game development toolkit, wherein the logic rules include interface parameters and API call sequence; The interface parameters and the API call sequence are converted into hierarchical structure data, and the conversion results are stored in the preset classification nodes of the knowledge base.
8. A game automated testing system according to claim 6, characterized in that: Decompose the preset test cases into event operation instructions, including: Atomize and split the composite operations in the preset test cases to generate independent event instruction units, each of which corresponds to a single interactive action. A unique event identifier is assigned to each event instruction unit, and a corresponding API call sequence and interface parameters are bound to each event instruction unit based on the logic rules in the knowledge base.
9. A game automation testing system according to claim 6, characterized in that: Convert the natural language requirements input by the user into semantic features, including: Extracting time, action, object, and constraints from the natural language requirements through a natural language processing model to generate structured semantic tags; The non-standard words in the semantic tag are converted into operation instruction keywords predefined in the event library based on the synonym mapping table.
10. A game automation testing system according to claim 6, characterized in that: Triggering an event in the event library according to the executable test logic includes: Dynamically create multiple virtual test threads based on the event sequence in the executable test logic, each thread independently simulating the interactive operation of a game window or host; The status data of the game process is captured in real time. If it is detected that the window is not activated or the interface call times out, the retry instruction or exception handling rule in the event library is triggered.
Citation Information
Cited By
Game GUI autonomous operation method and system
CN121668685A
A method and system for autonomous operation of a game GUI
CN121668685B