Game testing methods, devices, electronic devices and computer-readable storage media
By automating the creation and control of test characters through pre-packaged test templates, the problem of low testing efficiency in game combat systems is solved, achieving an efficient testing process and ensuring the balance and stability of the game.
Patent Information
- Application Number
- CN202411629006.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The testing efficiency of existing game combat systems is low. Relying on manual testing is time-consuming and labor-intensive, making it difficult to meet the needs of rapid iteration and optimization.
Test cases are generated using pre-packaged test templates, including character creation and login templates. Test characters are automatically created and their login to the test server is controlled to execute game behaviors and obtain test results.
It automates and improves the efficiency of game testing, quickly generates test cases, enhances testing efficiency, and ensures the balance and stability of the game.
Smart Images

Figure CN119782143B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a game testing method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] In competitive virtual games, the combat experience is a crucial element, directly impacting player enjoyment and retention rates. As game content becomes increasingly rich and complex, the accuracy and stability of the combat system become vital guarantees of game quality. To maintain the balance and fairness of the combat system, developers typically need to frequently adjust and optimize it, such as adding, deleting, or modifying skills, and balancing class strength.
[0003] Currently, when iterating on combat systems, the iterations are typically tested manually. However, this traditional manual testing method is time-consuming, labor-intensive, and extremely inefficient.
[0004] Therefore, improving the efficiency of game testing has become an urgent technical problem to be solved. Summary of the Invention
[0005] This application provides a game testing method, apparatus, electronic device, and computer-readable storage medium, which greatly improves the efficiency of game testing. The specific solution is as follows:
[0006] In a first aspect, embodiments of this application provide a game testing method, the method comprising:
[0007] Receive a game test instruction, wherein the game test instruction includes at least one test task;
[0008] For any of the aforementioned test tasks, test cases corresponding to the test task are generated using a pre-packaged test template. The test template includes a pre-arranged role creation template and a role login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template; and controlling the test role to log in to the test server using the role login template in the test template to generate test cases corresponding to the test task.
[0009] The test cases are executed to control the test character's game behavior and obtain the test results corresponding to the test tasks.
[0010] Secondly, embodiments of this application provide a game testing device, the device comprising:
[0011] A receiving unit is configured to receive game test instructions, wherein the game test instructions include at least one test task;
[0012] A generation unit is configured to generate test cases corresponding to any of the test tasks using a pre-packaged test template. The test template includes a pre-arranged role creation template and a role login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template; and controlling the test role to log in to the test server using the role login template in the test template to generate test cases corresponding to the test task.
[0013] An execution unit is used to execute the test cases to control the test character to perform game behavior and obtain the test results corresponding to the test task.
[0014] Thirdly, this application also provides an electronic device, including:
[0015] Processor; and
[0016] A memory for storing a data processing program, which, when the electronic device is powered on and runs through the processor, executes the method described in the first aspect.
[0017] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a data processing program that is executed by a processor to perform the method described in the first aspect.
[0018] Compared with the prior art, this application has the following advantages:
[0019] The game testing method provided in this application first receives a game testing instruction, which includes at least one test task. Then, for any one of the test tasks, test cases corresponding to the test task are generated using a pre-packaged test template. The test template includes a pre-arranged character creation template and a character login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test character with test attributes matching the test task using the character creation template in the pre-packaged test template; and controlling the test character to log in to the test server using the character login template in the test template, thereby generating test cases corresponding to the test task. Finally, the test cases are executed to control the test character to perform game behavior, obtaining the test result corresponding to the test task. As can be seen, the game testing method provided in this application, upon receiving a game testing instruction, can create a corresponding test character for any test task based on a pre-packaged test template, and control the test character to log in to the test server, thereby generating corresponding test cases. Since the test characters included in the test cases have test attributes matching the corresponding test task, when executing the test case, the test character with the specified test attributes can be controlled to perform game behavior, thereby obtaining the test results corresponding to the test task. Therefore, the game testing method provided in this application, upon receiving a game testing instruction, can quickly reuse the pre-packaged test template to generate test cases for each test task. This allows for automated execution of each test task through the test cases, greatly improving testing efficiency. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of an example of a game testing system for implementing game testing methods provided in an embodiment of this application;
[0021] Figure 2 This is a flowchart of the game testing method provided in the embodiments of this application;
[0022] Figure 3 This is a flowchart illustrating an example of copying real character data from an operations server in the game testing method provided in this application embodiment;
[0023] Figure 4 This is a structural block diagram of an example of the game testing device provided in the embodiments of this application;
[0024] Figure 5 This is a structural block diagram of an example of an electronic device provided in an embodiment of this application. Detailed Implementation
[0025] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0026] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0027] It should be understood that in the embodiments of this application, "at least one" means one or more, and "more than one" means two or more. "And / or" 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, and B existing alone. The character " / " generally indicates that the related objects before and after it are in an "or" relationship. "Contains A, B and / or C" means containing any one, two, or three of A, B, and C.
[0028] It should be understood that in the embodiments of this application, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.
[0029] Based on the reasons mentioned in the background art, in order to effectively improve the efficiency of game testing, the first embodiment of this application provides a game testing method. This method is applied to an electronic device, which may be a desktop computer, laptop computer, mobile phone, tablet computer, electronic watch, etc., or other electronic devices capable of performing game testing. This embodiment of the application is not specifically limited.
[0030] For example, Figure 1 An embodiment of this application illustrates a game testing system 100 for implementing a game testing method. The game testing system 100 may include at least one operation server 101, at least one test server 102, and a network 103.
[0031] It's important to note that during game development and operation, test servers and operations servers are two distinct server environments, each undertaking different tasks and purposes. Test servers are used during the development and testing phases, primarily for verifying new features, fixing vulnerabilities, and conducting performance tests; they are used by developers. Operations servers, also known as production servers, are the official servers for public use, responsible for providing stable service for game players to log into the game application.
[0032] It should be noted that test server 102 can be deployed with pre-packaged test templates, which are used to provide an automated testing framework for managing a series of subtasks that need to be executed in sequence.
[0033] It should be noted that, Figure 1 The game testing system diagram shown is merely an example. The game testing system 100 described in this application embodiment is intended to more clearly illustrate the technical solutions of this application embodiment and does not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of game systems and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.
[0034] The technical solution of this application will be described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0035] The following, combined with Figure 2 and Figure 3 This application introduces a game testing method provided in its embodiments.
[0036] like Figure 2 The diagram shown is a flowchart of the game testing method provided in this application, including steps S101 to S103.
[0037] Step S101: Receive a game test instruction, which includes at least one test task.
[0038] It should be noted that the game testing method provided in this application can be applied to various virtual games, such as real-time combat games, role-playing games, and strategy games.
[0039] When there is a testing requirement, developers can issue corresponding game testing instructions. A game testing instruction can include one test task or multiple test tasks. A test task is used to complete the testing requirements in one dimension.
[0040] Suppose the following testing requirements exist: testing whether the strength of a newly added skill 'a' in a virtual game is reasonable; testing whether the strength of each virtual class in the virtual game is balanced; and testing whether the battle server of a combat game is stable. In one optional implementation, game test command 1 can be issued, including a test task to test whether the strength of skill 'a' is reasonable; game test command 2 can be issued, including a test task to test whether the strength of each virtual class is balanced; and game test command 3 can be issued, including a test task to test whether the battle server is stable. In another optional implementation, game test commands can be issued directly, including test tasks to test whether the strength of skill 'a' is reasonable, whether the strength of each virtual class is balanced, and whether the battle server is stable.
[0041] It's important to note that testing the strength of newly added skills ensures their reasonableness, effectively preventing any skill from being too powerful or weak, which could negatively impact the game's fairness and playability. Testing the balance of strength among virtual classes ensures a reasonable balance between them, preventing any single class from being too strong or too weak, which could negatively affect the gaming experience. In virtual games, a virtual class refers to the role type or class category of a game character. In combat games, virtual classes typically include, but are not limited to, at least one of the following: warrior, assassin, mage, archer, tank, and support. Testing the stability of the battle server ensures that it maintains stable performance under high concurrency, avoiding issues such as latency and lag.
[0042] In conclusion, in-game testing is crucial for ensuring game balance, stability, and overall quality, and is an indispensable part of game development and operation. Comprehensive and meticulous testing can significantly improve the user experience and enhance the game's market competitiveness.
[0043] In this step, a game test instruction can include multiple test tasks. When executing test tasks, multiple test tasks can be executed automatically in parallel, thereby effectively improving the efficiency of game testing.
[0044] Step S102: For any of the test tasks, generate test cases corresponding to the test task using a pre-packaged test template;
[0045] The test template includes a pre-arranged role creation template and a role login template; the step of generating test cases corresponding to the test task through the pre-packaged test template includes: creating at least one test role with test attributes matching the test task through the role creation template in the pre-packaged test template; and controlling the test role to log in to the test server through the role login template in the test template to generate test cases corresponding to the test task.
[0046] In this embodiment of the application, test templates can be pre-packaged for test tasks in game testing.
[0047] In one optional implementation, the test template may include a task base class (TaskBase) and a task manager (TaskManager). For any test task, a subclass can be generated by inheriting from TaskBase. TaskBase may contain a task_list attribute, where task_list represents the subtasks that need to be executed within the test task. After generating the subclass of the test task, the test task can be registered with the TaskManager, enabling the TaskManager to manage and execute the test task.
[0048] In one alternative implementation, the test tasks can be processed in parallel. For example, the test tasks can be parallelized using parallelization techniques such as greenlet (a lightweight coroutine library in Python that allows developers to execute multiple tasks concurrently in a single thread), thereby improving the efficiency of game testing.
[0049] By pre-packaging test templates, code reusability and maintainability can be effectively improved, and it is easier to extend the code.
[0050] In this embodiment of the application, when a game test instruction is received, for each test task in the game test instruction, test cases corresponding to the test task can be automatically created through the pre-encapsulated test template, and each test case is used to support the corresponding test task.
[0051] For example, if a game testing instruction includes a test task to test whether the strength of skill 'a' is reasonable, whether the strength of each virtual class is balanced, and whether the battle server is stable, then test case 1 can be created to support the test whether the strength of skill 'a' is reasonable, test case 2 can be created to support the test whether the strength of each virtual class is balanced, and test task 3 can be created to support the test whether the battle server is stable.
[0052] Specifically, the test template can include a pre-arranged role creation template and a role login template. The role creation template is used to create a test role with test attributes that match the test task, and the role login template is used to control the test role's login to the test server.
[0053] In this way, at least one test role with test attributes matching the test task can be created using the role creation template, and the test role can be logged into the test server using the role login template, thereby generating test cases corresponding to the aforementioned test task.
[0054] Optionally, multiple test characters can be created for a single test task. Each test character possesses test attributes that match the test task. For example, if the test task is to test whether the strength of skill 'a' is reasonable, then test characters with skill 'a' and test characters without skill 'a' can be created separately. If the test task is to test whether the strength of each virtual class is balanced, then the test character can consist of multiple characters belonging to different virtual classes with high combat values.
[0055] As an optional implementation, the step S102 above, "creating at least one test role with test attributes matching the test task through the role creation template in the pre-packaged test template," can be achieved through the following step S1021:
[0056] Step S1021: Obtain the character parameter values configured in the character configuration variable of the character creation template in the test task, and create at least one test character with test attributes that match the test task based on the character parameter values.
[0057] The step S102 above, "controlling the test role to log in to the test server through the role login template in the test template," can be achieved through the following step S1022:
[0058] Step S1022: Configure the login configuration variables in the role login template according to the role identifier of the test role to control the test role to log in to the test server, wherein the test environment of the test server is the same as the operation environment of the operation server.
[0059] In an optional implementation, the pre-packaged test template may further include a role grouping template. The creation of at least one test role with test attributes matching the test task, using the role creation template within the pre-packaged test template, includes the following steps:
[0060] Using the role creation template in the pre-packaged test template, multiple test roles with test attributes that match the test task are created.
[0061] After controlling the test character to log in to the test server through the character login template in the test template, the game testing method provided in this application embodiment may further include the following steps:
[0062] Obtain the team parameter values configured in the team configuration variable for the role grouping template in the test task;
[0063] Based on the team formation parameter values, the test characters logged into the test server are divided into at least two groups.
[0064] The aforementioned character grouping template is used to group test characters logged into the test server according to the test task. The test template may also include a character combat template, which is used to control the grouped test characters in combat.
[0065] In this way, at least one test character with test attributes matching the test task can be created using the character creation template, and the test character can be controlled to log in to the test server using the character login template. If there are multiple test characters logged into the test server, the test characters logged into the test server can be grouped using the character grouping template, thereby generating test cases corresponding to the above test task. Finally, the grouped test characters can be controlled to fight using the character combat template.
[0066] In the specific implementation, for any test task, firstly, a test character can be created by configuring the character configuration variables in the character creation template based on the input character parameter values, thereby obtaining the character identifier (hereinafter referred to as the character ID) of the test character; then, the character ID is passed to the character login template to control the test character to log in to the test server; after the test character logs in successfully, if the test character includes multiple characters, the team configuration variables in the character grouping template can be configured based on the team parameter group input by the test task to divide the test character into at least two groups; after the grouping is completed, the test character can be controlled to engage in game combat through the character combat template.
[0067] In this way, upon receiving game testing instructions, pre-packaged test templates can be quickly reused to generate test cases for each test task, eliminating the need to manually write a test script for each task. This automates the testing process through test cases, improving testing efficiency.
[0068] Optionally, in addition to creating multiple test roles and grouping them as described above, the test template provided in this application can also create only one test role for a single test task. In this case, the test role will not be grouped. It should be noted that the number of test roles created for a given test role can be determined by the role parameter values configured by the user.
[0069] For a given test task, if only one test character with test attributes matching that test task is created, the NPC's character attribute data can be loaded when generating test cases. That is, the NPC is a data object. In this way, when the test cases are executed subsequently, the test character with the aforementioned test attributes can be controlled to perform game behaviors and interact with the NPC. As a data object, the NPC can respond to the test character's game behaviors and adjust its own data accordingly, such as how much its health points or HP points have decreased. In this way, the test results of the test task in the battle scenario with the NPC can be known.
[0070] For example, for a test task targeting the strength of skill 'a', test cases can be generated that include a test character 'b' with skill 'a'. When executing the test case, the character attribute data 'd' of the monster 'c' can be loaded, thereby responding to the game behavior of the test character 'b' with skill 'a'. In this way, the character attribute data 'd' will be updated, thus providing feedback on the test results of skill 'a' applied to the monster 'c'.
[0071] Step S103: Execute the test case to control the test character to perform game behavior and obtain the test results corresponding to the test task.
[0072] After generating test cases corresponding to a test task, the test cases can be automatically executed through pre-packaged test templates, thereby controlling the game behavior of test characters included in the test cases that have test attributes that match the test task.
[0073] The game testing method provided in this application first receives a game testing instruction, which includes at least one test task. Then, for any one of the test tasks, test cases corresponding to the test task are generated using a pre-packaged test template. The test template includes a pre-arranged character creation template and a character login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test character with test attributes matching the test task using the character creation template in the pre-packaged test template; and controlling the test character to log in to the test server using the character login template in the test template, thereby generating test cases corresponding to the test task. Finally, the test cases are executed to control the test character to perform game behavior, obtaining the test result corresponding to the test task. As can be seen, the game testing method provided in this application, upon receiving a game testing instruction, can create a corresponding test character for any test task based on a pre-packaged test template, and control the test character to log in to the test server, thereby generating corresponding test cases. Since the test characters included in the test cases have test attributes matching the corresponding test task, when executing the test case, the test character with the specified test attributes can be controlled to perform game behavior, thereby obtaining the test results corresponding to the test task. Therefore, the game testing method provided in this application, upon receiving a game testing instruction, can quickly reuse the pre-packaged test template to generate test cases for each test task. This allows for automated execution of each test task through the test cases, greatly improving testing efficiency.
[0074] Optionally, the character combat template in the above test template may contain preset character combat logic, which can automatically control the test character to perform game behaviors.
[0075] Optionally, executing the test cases to control the test character's game behavior may further include the following steps: executing the test cases and invoking managed logic in the game to control the test character's game behavior.
[0076] In this embodiment, the function of automatically performing game behaviors of the test character can be realized by calling the managed logic in the game. It is understood that when a player disconnects, the operation server will take over the disconnected player character and control the behavior of the disconnected player character through the managed logic. For example, it can control the character's movement in the scene, release skills, and use health packs. The managed logic is set up to ensure the continuity and fairness of the battle, and to avoid battle interruption or unfairness due to player disconnection.
[0077] When executing test cases, the test character's game behavior is controlled by calling the managed logic in the game. On the one hand, this allows the test character to perform effective game behavior even without user control. On the other hand, the managed logic can control the test character to correctly release skills and move automatically, just like a player character.
[0078] In an optional implementation, the step S1021 above, "obtaining the character parameter values configured in the character configuration variables of the character creation template in the test task," can be achieved through the following steps S201 and S202:
[0079] Step S201: Based on the test task, determine a first player character from the operation server, wherein the first player character has test attributes that match the test task.
[0080] Step S202: Obtain the first character data of the first player character from the operation server, and determine the first character data as the character parameter value configured for the character configuration variable in the character creation template.
[0081] In this embodiment of the application, for any test task, a suitable first player character can be determined from the operation server. The first player character is a virtual character controlled by a real player in the operation server, and the first player character has test attributes that match the test task.
[0082] Then, the first character data of the first player character can be obtained from the operation server. The first character data is the real character data of the real player on the operation server. Specifically, the first character data of the first player character can be retrieved from the game logs corresponding to the operation server. The first character data is used to reflect the player attributes of the first player character. The first character data may include, for example, the first player character's current game level, the virtual class to which the first player character belongs, and the items and equipment possessed by the first player character.
[0083] Then, the first character data can be identified as the character parameter value configured in the character configuration variable in the character creation template, thereby creating a test character based on the first character data.
[0084] Specifically, creating a test character based on the first character data means: copying the first character data to obtain a test character that possesses the first character data. Since the first player character has test attributes that match the aforementioned test task, the first character data of the first player character also carries test attributes that match the aforementioned test task. Thus, the test character obtained by copying the first character data possesses test attributes that match the aforementioned test task.
[0085] This setup allows for the rapid creation of test characters by copying real player character data from the operations server during testing tasks. It eliminates the need for complex and tedious steps such as setting game levels, virtual classes, and equipment for the test characters, enabling quick and efficient character generation. Furthermore, creating test characters by copying real player character data from the operations server ensures that the game testing process closely mirrors the actual gameplay experience, thus improving the accuracy of the game testing.
[0086] It should be noted that the game testing method provided in this application supports the function of copying real character data from the operation server. When there is a function to copy real character data to create a test character, cross-server data copying can be achieved through this function. When there is no function to copy real character data to create a test character, a test character can also be created directly on the test server. Whether to use real character data from the operation server to create a test character can be set based on the specific test task, and this application does not limit it in this regard.
[0087] The following details the testing methods provided in this application when applied to specific testing tasks:
[0088] In one optional implementation, the test task is a task to test whether the operation server is stable, and the "determine the first player character from the operation server" in step S201 may include the following steps:
[0089] The top-ranked player characters in the game for each virtual profession on the operating server are designated as the first player characters.
[0090] Step S103 can be achieved through the following steps:
[0091] The test cases are executed to control at least two groups of test characters to engage in game battles and obtain a first test result, wherein the first test result includes at least one of the following: whether the battle duration is greater than the preset duration, whether the battle recording function is abnormal, and whether the battle log is abnormal.
[0092] In this embodiment, when the test task is to test whether the operation server is stable, before creating the test character, the corresponding first player character can be selected from the operation server. The first player character is a preset number of player characters with the highest game rankings corresponding to each virtual profession.
[0093] It should be noted that the game rankings can be obtained from the game logs. The preset number can be set according to the actual situation. For example, if the preset number is 10, the top 10 player characters with the highest level for each virtual class can be selected as the first player character. Specifically, the top 10 archer players, the top 10 mage players, the top 10 warrior players, and the top 10 support players can be selected as the first player characters.
[0094] After selecting the first player character, you can copy the first character data of each first player character to create a test character (i.e., a robot) that is exactly the same as the character data of each first player character.
[0095] It should be noted that for each virtual profession, the top-ranked player characters in the game usually have higher combat power, and the corresponding combat data during combat is also more complex. Therefore, when the top-ranked player characters are in combat, the data interaction and data transmission pressure on the operation server is greater. Thus, when the test task is to test the stability of the operation server, by selecting the first character data of the top-ranked player character in the game, a test character with higher combat power can be obtained, thereby simulating a higher intensity battle, and thus testing the stability of the operation server under high load.
[0096] In addition, by selecting the first player character from the player characters of various virtual professions, and replicating test characters of different profession types, the processing capability of the operation server when facing different profession types of characters can be tested, thereby ensuring that the operation server can cope with various situations in the game.
[0097] Furthermore, top-ranked player characters in different virtual professions typically use different skills and employ more complex combat strategies. This allows the replicated test characters to cover a wider range of situations in the game, making game testing more comprehensive. This enables the detection of potential problems in the game, such as logical errors, performance bottlenecks, and log anomalies, further improving the accuracy and efficiency of game testing. It ensures that all game functions are fully validated, indirectly guaranteeing the stability and smoothness of game operation and enhancing the player's gaming experience.
[0098] Optionally, for the task of testing the stability of the operating server, after creating test characters based on a preset number of top-ranked player characters corresponding to each virtual profession on the operating server, these test characters can be divided into at least two groups using a character grouping template. For example, the test characters can be shuffled and randomly divided into two groups, or the test characters can be shuffled and randomly divided into four groups, thus forming a specified number of teams. Then, the specified number of teams can be controlled to engage in game battles, thereby obtaining the first test result for the test task of testing the stability of the operating server.
[0099] In this embodiment of the application, when grouping the test roles, the grouping strategy can be to shuffle the professions. In this way, the influence of profession can be eliminated when executing test cases.
[0100] Optionally, for the task of testing whether the operation server is stable, after creating a test character based on a preset number of player characters with the highest game rankings corresponding to each virtual profession in the operation server, the test character can be used as the first team, and the character attribute data of NPCs in the game can be loaded as the second team, thereby controlling the first team and the second team to fight in the game and obtain the corresponding first test result.
[0101] In this embodiment, the first test result may include, but is not limited to, at least one of the following: whether the battle duration is greater than a preset duration, whether the battle recording function is abnormal, whether the battle log is abnormal, and whether the number of battles exceeds a threshold. When executing test cases and obtaining the first test result, it is also possible to detect whether there is first abnormal indicator data in the first test result. The first abnormal indicator data may include, but is not limited to, at least one of the following: battle duration greater than a preset duration, abnormal battle recording function, abnormal battle log, and the number of battles exceeding a threshold. It should be noted that if the battle duration is greater than a preset duration or the number of battles exceeds a threshold, it indicates that there may be an infinite loop or a dead loop in the battle logic.
[0102] When a first abnormal indicator data is detected in the first detection result, a first alarm message can be automatically generated. Furthermore, a test report containing the first alarm message can also be generated. The first alarm message indicates the cause of the instability of the operation server. The cause of the abnormality may include, but is not limited to, abnormal combat logic, abnormal combat recording function, or incomplete combat logs.
[0103] The above methods can be used to comprehensively, efficiently, and accurately test the stability of the operation server, thereby greatly ensuring the stability of the operation server.
[0104] In an optional implementation, the test task is a task to test whether the strength of the target skill is reasonable, and step S1021, "creating at least one test role with test attributes matching the test task," may include the following steps:
[0105] Create a first test character with the target skill and a second test character without the target skill.
[0106] Step S103 can be achieved through the following steps:
[0107] The test case is executed to control the first test character to release the target skill to the second test character, and a second test result is obtained, wherein the second test result represents the damage data generated by the target skill on the second test character.
[0108] The strength of the target skill mentioned above is used to reflect the damage level of the target skill. The higher the strength, the greater the damage. In game testing, the strength of the target skill can be measured by the damage data generated by the target skill.
[0109] In this embodiment, firstly, a first test character with the target skill and a second test character without the target skill can be created. For example, if the test task is to test the strength of skill a, then a test character a with skill a and a test character b without skill a can be created.
[0110] Then, the first test character and the second test character can be set to an adversarial relationship to generate corresponding test cases. Executing these test cases will control the first test character to release the target skill on the second test character, resulting in a second test result. The second test result represents the damage data caused by the target skill to the second test character.
[0111] When a second abnormal indicator data is detected in the second detection result, a second alarm message can be automatically generated. Furthermore, a test report containing the second alarm message can also be generated. The second alarm message indicates that the strength of the target skill is unreasonable, and the reason for the abnormality could be that the target skill is too strong. For example, the second abnormal indicator data could be that the damage data generated by the target skill on the second test character is higher than the preset damage data. For instance, if the first test character releases skill 'a' on the second test character, and the second test character's health drops from full to 0, it indicates that the target skill is too strong, and a second alarm message indicating that skill 'a' is too strong, along with a test report containing the second alarm message, can be generated.
[0112] In one optional implementation, the test task is a task that tests whether the strength of the target skill is normal when facing different professional roles. At least one test role with test attributes matching the test task can also be created in the following way:
[0113] Select n player characters of different professions from the operation server, and obtain the third-party data of each of the n player characters. Copy the third-party data of each player character to generate n test characters with the same game level, profession, and equipment as the n player characters. Then, create a third test character with the target skill. Then, set the third test character and the n test characters to be in an adversarial relationship, generate test cases, execute the test cases, and control the third test character to release the target skill on the n test characters respectively to obtain the third test results. Each third test result represents the damage data of the target skill to the corresponding profession type of the test character.
[0114] The above methods can comprehensively, efficiently, and accurately test whether the strength of skills in the game is reasonable, thereby greatly ensuring the fairness and balance of the game.
[0115] In one optional implementation, the test task is to test whether the strength of each virtual profession is reasonable, and the step of "determining the first player character from the operation server" in step S201 may include the following steps:
[0116] Player characters at the same level but belonging to different virtual professions in the aforementioned operating server are designated as the first player character.
[0117] Step S103 can be achieved through the following steps:
[0118] The test cases are executed to control the test characters of each virtual profession to engage in game combat, and a third test result is obtained, wherein the third test result represents the life index data of the test characters of each virtual profession.
[0119] The strength of each virtual class is used to reflect its combat capabilities (specifically, attack power and defense). During game testing, the strength of each virtual class can be measured by its corresponding health metric data after a battle. This health metric data may include, but is not limited to, survival rate, health points, life points, and energy points.
[0120] In this implementation, when the test task is to test whether the strength of each virtual class is reasonable, before creating the test character, a corresponding first player character can be selected from the operation server. This first player character is a player character of the same level but belonging to a different virtual class. It should be noted that for a virtual class, the first player character can include at least one player character. For example, three player characters of the warrior class at level 8, three player characters of the archer class at level 8, three player characters of the mage class at level 8, and three player characters of the support class at level 8 can be selected from the operation server as the first player characters.
[0121] After selecting the first player character, you can copy the first character data of each first player character to create a test character (i.e., a robot) that is exactly the same as the character data of each first player character.
[0122] Then, the test characters can be grouped using a character grouping template, and the test characters of each virtual profession can be controlled to engage in game battles, thereby obtaining a third test result representing the life index data of the test characters of each virtual profession.
[0123] When a third abnormal indicator data is detected in the aforementioned third detection results, a third alarm message can be automatically generated. Furthermore, a test report containing the third alarm message can also be generated. The third alarm message indicates which virtual profession's strength is unreasonable; the reason for the abnormality could be that the virtual profession's strength is too strong or too weak. For example, the third abnormal indicator data could be that the test character of the target virtual profession's health index data is lower than a preset health index data after the game battle ends.
[0124] For example, if test characters of the same level, such as warrior, marksman, mage, and support, engage in a free-for-all, and the warrior test characters have the lowest survival rate after the free-for-all ends, then the warrior test characters are considered too weak. In this case, a third alert message indicating that the warrior test characters are too weak can be generated, along with a test report containing that third alert message.
[0125] Optionally, when the test task is to test whether the strength of a virtual profession is reasonable, a target number of test characters belonging to the same profession and the target profession, as well as a target number of test characters belonging to different virtual professions and random professions, can be created. The test characters belonging to the same profession are designated as the first faction, and the test characters belonging to random professions as the second faction. The first and second factions are then controlled to engage in game combat. After the combat, the health stat data of each virtual profession test character in the second faction is calculated. Test characters whose health stat data is lower than the preset health stat data belong to a virtual profession that is too weak. It should be noted that the creation of test characters belonging to the same profession and the creation of test characters belonging to random professions can be quickly achieved by copying the corresponding real player character data from the operation server, or the corresponding test characters can be directly created in the test server. This application does not impose any restrictions on this.
[0126] The above is a description of the testing details when the game testing method provided in the embodiments of this application is applied to a specific testing task.
[0127] Optionally, in this embodiment of the application, the copying of real character data from the operation server can be optimized. After obtaining the first character data of the first player character from the operation server, the game testing method provided in this embodiment of the application may further include the following steps:
[0128] The first character data of the first player character is stored in the test server;
[0129] When the storage time of the first character data reaches a preset time threshold, the first character data of the first player character is deleted from the test server.
[0130] Optionally, the game testing method provided in this application embodiment may further include the following steps:
[0131] In response to the instruction initiated by the test server to retrieve the first character data again, if the test server stores the first character data of the first player character, retrieve the first character data of the first player character from the test server;
[0132] If the test server does not store the first character data of the first player character, the first character data of the first player character shall be obtained from the operation server.
[0133] In this embodiment, when the first character data of the first player character is obtained from the operation server, the first character data can be cached so that when another test character needs to be created based on the first character data later, the cached first character data in the test server can be directly copied to create another test character. When the caching time reaches a preset time threshold (e.g., 1 hour or 2 hours), the cached first character data of the first player character is deleted from the test server to alleviate space usage pressure.
[0134] It should be noted that after a test character is created on the test server based on the first character data of the first player character for a test task, the test server may receive another test task that requires the creation of a test character based on the first character data of the first player character. In this case, an instruction to retrieve the first character data again can be generated on the test server.
[0135] When receiving a command from the test server to retrieve the first character's data again, you can first determine whether the test server stores the first player's data. If so, you can directly retrieve the first character's data from the test server. If not, you can retrieve the first player's data from the operations server again.
[0136] like Figure 3 The diagram shown is a flowchart illustrating an example of copying real character data from an operations server in the game testing method provided in this application, including the following steps S21 to S24:
[0137] Step S21: Receive the instruction to retrieve the first character's data again;
[0138] Step S22: Test whether the first role data is stored in the test server;
[0139] If the detection result of step S22 is yes, then proceed to step S23: obtain the first role data from the test server;
[0140] If the detection result of step S22 is negative, then proceed to step S24: obtain the first role data from the operation server.
[0141] In this embodiment, when there is a need to copy the first character data of the first player character from the operation server to create a corresponding test character on the test server, the creation of the test character can be quickly achieved by detecting whether the first character data of the first player character is stored in the test server. If it exists, the stored first character data can be directly assigned from the test server. This setting method has the following advantages:
[0142] On the one hand, frequent data transmission consumes a lot of network bandwidth resources, especially with large amounts of data. This method reduces the number of data transmissions from the operation server to the test server, effectively saving bandwidth resources. On the other hand, local data access is usually faster than cross-server access. By copying local data, the latency of data access is greatly reduced. In addition, using local data for subsequent copy requests of the same data within a preset time threshold can effectively avoid the problem of excessive load caused by the operation server frequently performing repetitive data transmission tasks in a short period of time.
[0143] Corresponding to the game testing method provided in the first embodiment of this application, the second embodiment of this application also provides a game testing device, such as... Figure 4 As shown, the game testing device 400 includes:
[0144] Receiving unit 401 is used to receive game test instructions, wherein the game test instructions include at least one test task;
[0145] The generation unit 402 is configured to generate test cases corresponding to any of the test tasks using a pre-packaged test template. The test template includes a pre-arranged role creation template and a role login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template; and controlling the test role to log in to the test server using the role login template in the test template to generate test cases corresponding to the test task.
[0146] The execution unit 403 is used to execute the test cases to control the test character to perform game behavior and obtain the test results corresponding to the test task.
[0147] Optionally, the generation unit 402 is specifically used for:
[0148] Obtain the character parameter values configured in the character configuration variable of the character creation template in the test task, and create at least one test character with test attributes that match the test task based on the character parameter values;
[0149] Based on the role identifier of the test role, the login configuration variables in the role login template are configured with parameters to control the test role's login to the test server, wherein the test environment of the test server is the same as the operation environment of the operation server.
[0150] Optionally, the test template further includes a role grouping template, and the generation unit 402 is further specifically used for:
[0151] Using the role creation template in the pre-packaged test template, create multiple test roles with test attributes that match the test task;
[0152] Obtain the team parameter values configured in the team configuration variable for the role grouping template in the test task;
[0153] Based on the team formation parameter values, the test characters logged into the test server are divided into at least two groups.
[0154] Optionally, the generation unit 402 is specifically used for:
[0155] Based on the test task, a first player character is determined from the operation server, wherein the first player character has test attributes that match the test task;
[0156] The first character data of the first player character is obtained from the operation server, and the first character data is determined as the character parameter value configured for the character configuration variable in the character creation template.
[0157] Optionally, the generation unit 402 is further configured to:
[0158] The first character data of the first player character is stored in the test server;
[0159] When the storage time of the first character data reaches a preset time threshold, the first character data of the first player character is deleted from the test server.
[0160] Optionally, the generation unit 402 is further specifically used for:
[0161] In response to the instruction initiated by the test server to retrieve the first character data again, if the test server stores the first character data of the first player character, retrieve the first character data of the first player character from the test server;
[0162] If the test server does not store the first character data of the first player character, the first character data of the first player character shall be obtained from the operation server.
[0163] Optionally, the test task is a task to test whether the operation server is stable, and the generation unit 402 is specifically used for:
[0164] The top-ranked, preset number of player characters corresponding to each virtual profession in the operation server are designated as the first player character.
[0165] The execution unit 403 is specifically used for:
[0166] The test cases are executed to control at least two groups of test characters to engage in game battles and obtain a first test result, wherein the first test result includes at least one of the following: whether the battle duration is greater than the preset duration, whether the battle recording function is abnormal, and whether the battle log is abnormal.
[0167] Optionally, the test task is a task to test whether the strength of the target skill is reasonable, and the generation unit 402 is specifically used for:
[0168] Create a first test character with the target skill and a second test character without the target skill;
[0169] The execution unit 403 is specifically used for:
[0170] The test case is executed to control the first test character to release the target skill to the second test character, and a second test result is obtained, wherein the second test result represents the damage data generated by the target skill on the second test character.
[0171] Optionally, the test task is a task to test whether the strength of each virtual profession is reasonable, and the generation unit 402 is specifically used for:
[0172] Player characters at the same level but belonging to different virtual professions in the aforementioned operating server are designated as the first player character;
[0173] The execution unit 403 is specifically used for:
[0174] The test cases are executed to control the test characters of each virtual profession to engage in game combat, and a third test result is obtained, wherein the third test result represents the life index data of the test characters of each virtual profession.
[0175] Optionally, the execution unit 403 is specifically used for:
[0176] The test cases are executed, and the managed logic in the game is invoked to control the test character's game behavior.
[0177] Corresponding to the game testing method provided in the first embodiment of this application, the third embodiment of this application also provides an electronic device for game testing. For example... Figure 5 As shown, the electronic device 500 includes: a processor 501; and a memory 502 for storing a program for the game testing method. After the device is powered on and the program for the game testing method is run by the processor, the following steps are performed:
[0178] Receive a game test instruction, wherein the game test instruction includes at least one test task;
[0179] For any of the aforementioned test tasks, test cases corresponding to the test task are generated using a pre-packaged test template. The test template includes a pre-arranged role creation template and a role login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template; and controlling the test role to log in to the test server using the role login template in the test template to generate test cases corresponding to the test task.
[0180] The test cases are executed to control the test character's game behavior and obtain the test results corresponding to the test tasks.
[0181] Corresponding to the game testing method provided in the first embodiment of this application, the fourth embodiment of this application provides a computer-readable storage medium storing a program for the game testing method, which is executed by a processor to perform the following steps:
[0182] Receive a game test instruction, wherein the game test instruction includes at least one test task;
[0183] For any of the aforementioned test tasks, test cases corresponding to the test task are generated using a pre-packaged test template. The test template includes a pre-arranged role creation template and a role login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template; and controlling the test role to log in to the test server using the role login template in the test template to generate test cases corresponding to the test task.
[0184] The test cases are executed to control the test character's game behavior and obtain the test results corresponding to the test tasks.
[0185] The following describes the prominent substantive features and beneficial technical effects obtained by applying the methods, apparatus, electronic devices and computer-readable storage media disclosed in the various embodiments of this application, which solve technical problems that have long needed to be solved by those skilled in the art.
[0186] For example, consider 10 test tasks. Current technology involves manually preparing test data for each task. This includes creating test accounts, generating test roles for each account that match the test task, and writing corresponding test scripts. The test tasks are then executed based on the test data and scripts to obtain the test results. Preparing test data typically takes 1 hour, writing test scripts takes 2 hours, and executing the test task takes 2 hours. Therefore, the entire process for one test task in current technology usually takes 5 hours. Thus, 10 test tasks would typically take 50 hours. It should be noted that this is merely an example for illustrative purposes. In practical applications, the total time required for a test task's entire process needs to consider various factors, such as the subjective differences among testers and the differences between the individual test tasks.
[0187] By adopting the method of this application, the above-mentioned test tasks can be performed in parallel through pre-packaged test templates. First, test cases corresponding to each test task are generated through the test templates. Since the test templates pre-arrange character creation templates, character login templates, and character grouping templates, users only need to configure the parameters to automatically generate test cases corresponding to each test task. The character data can be obtained from real player data from external servers. In this way, test cases for 10 test tasks can be generated within 2 hours. Then, each test case is executed in parallel, and the 10 test cases can be completed within 4 hours. Thus, the entire process of 10 test tasks takes 6 hours, which is 88% more efficient than the existing technology.
[0188] Furthermore, the greater the number of test tasks, the more significant the improvement in testing efficiency becomes after adopting the solution of this application. Therefore, this application solves a long-standing technical problem in this field, with outstanding technical effects, greatly improving efficiency and reducing costs. The technical solution disclosed in this application has prominent substantive features.
[0189] It should be noted that for a detailed description of the apparatus, electronic device and computer-readable storage medium provided in the second, third and fourth embodiments of this application, please refer to the relevant description of the first embodiment of this application, which will not be repeated here.
[0190] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
[0191] In a typical configuration, a node device in a blockchain includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0192] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0193] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage media, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0194] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0195] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
Claims
1. A game testing method, characterized in that, The method includes: Receive a game test instruction, wherein the game test instruction includes at least one test task; For any of the aforementioned test tasks, test cases corresponding to the test task are generated using a pre-packaged test template. The test template includes a pre-arranged role creation template and a role login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template; and controlling the test role to log in to the test server using the role login template in the test template to generate test cases corresponding to the test task. The test cases are executed to control the test character's game behavior and obtain the test results corresponding to the test tasks.
2. The method according to claim 1, characterized in that, The step of creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template includes: Obtain the character parameter values configured in the character configuration variable of the character creation template in the test task, and create at least one test character with test attributes that match the test task based on the character parameter values; The step of controlling the test role to log in to the test server through the role login template in the test template includes: Based on the role identifier of the test role, the login configuration variables in the role login template are configured with parameters to control the test role's login to the test server, wherein the test environment of the test server is the same as the operation environment of the operation server.
3. The method according to claim 1, characterized in that, The test template also includes a role grouping template. Creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template includes: creating multiple test roles with test attributes matching the test task using the role creation template in the pre-packaged test template; the method further includes: Obtain the team parameter values configured in the team configuration variable for the role grouping template in the test task; Based on the team formation parameter values, the test characters logged into the test server are divided into at least two groups.
4. The method according to claim 2, characterized in that, The step of obtaining the character parameter values configured in the character configuration variables of the character creation template in the test task includes: Based on the test task, a first player character is determined from the operation server, wherein the first player character has test attributes that match the test task; The first character data of the first player character is obtained from the operation server, and the first character data is determined as the character parameter value configured for the character configuration variable in the character creation template.
5. The method according to claim 4, characterized in that, The method further includes: The first character data of the first player character is stored in the test server; When the storage time of the first character data reaches a preset time threshold, the first character data of the first player character is deleted from the test server.
6. The method according to claim 5, characterized in that, The method further includes: In response to the instruction initiated by the test server to retrieve the first character data again, if the test server stores the first character data of the first player character, retrieve the first character data of the first player character from the test server; If the test server does not store the first character data of the first player character, the first character data of the first player character shall be obtained from the operation server.
7. The method according to claim 4, characterized in that, The test task is to test whether the operation server is stable. Determining the first player character from the operation server includes: The top-ranked, preset number of player characters corresponding to each virtual profession in the operation server are designated as the first player character. The execution of the test cases to control the test character's game behavior and obtain the test results corresponding to the test task includes: The test cases are executed to control at least two groups of test characters to engage in game battles and obtain a first test result, wherein the first test result includes at least one of the following: whether the battle duration is greater than the preset duration, whether the battle recording function is abnormal, and whether the battle log is abnormal.
8. The method according to claim 1, characterized in that, The test task is a task to test whether the strength of the target skill is reasonable. Creating at least one test role with test attributes matching the test task includes: Create a first test character with the target skill and a second test character without the target skill; The execution of the test cases to control the test character's game behavior and obtain the test results corresponding to the test task includes: The test case is executed to control the first test character to release the target skill to the second test character, and a second test result is obtained, wherein the second test result represents the damage data generated by the target skill on the second test character.
9. The method according to claim 4, characterized in that, The test task is to test whether the strength of each virtual profession is reasonable. The step of determining the first player character from the operation server includes: Player characters at the same level but belonging to different virtual professions in the aforementioned operating server are designated as the first player character; The execution of the test cases to control the test character's game behavior and obtain the test results corresponding to the test task includes: The test cases are executed to control the test characters of each virtual profession to engage in game combat, and a third test result is obtained, wherein the third test result represents the life index data of the test characters of each virtual profession.
10. The method according to claim 1, characterized in that, Executing the test cases to control the test character's game behavior includes: The test cases are executed, and the managed logic in the game is invoked to control the test character's game behavior.
11. A game testing device, characterized in that, The device includes: A receiving unit is configured to receive game test instructions, wherein the game test instructions include at least one test task; A generation unit is configured to generate test cases corresponding to any of the test tasks using a pre-packaged test template. The test template includes a pre-arranged role creation template and a role login template. Generating test cases corresponding to the test task using the pre-packaged test template includes: creating at least one test role with test attributes matching the test task using the role creation template in the pre-packaged test template; and controlling the test role to log in to the test server using the role login template in the test template to generate test cases corresponding to the test task. An execution unit is used to execute the test cases to control the test character to perform game behavior and obtain the test results corresponding to the test task.
12. An electronic device, characterized in that, include: processor; as well as A memory for storing a data processing program, which, when the electronic device is powered on and runs through the processor, executes the method as described in any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The system contains a data processing program that is executed by a processor to perform the method as described in any one of claims 1-10.
Citation Information
Patent Citations
Test case generation method and device and storage medium
CN112306850A
Automatic testing method and device, computer equipment and storage medium
CN116701188A