Game testing method and device, electronic equipment and computer readable storage medium
By automatically generating and executing game test cases with pre-packaged test templates, the problem of low testing efficiency of game combat systems in the existing technology is solved, and efficient and accurate automated testing is achieved.
Patent Information
- Application Number
- CN202411629006.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In the prior art, the testing efficiency of game combat systems is low, and rely on manual testing to consume time and effort, and the efficiency is extremely low.
Generate test cases corresponding to the test task through pre-encapsulated test templates, including role creation templates and role login templates, automate the creation of test roles and control their login to the test server, and execute test cases to obtain test results.
The game testing is automated, which significantly improves the testing efficiency, reduces the time of manual intervention, and improves the speed and accuracy of the testing.
Smart Images

Figure CN119782143A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a game testing method, device, electronic device, and computer-readable storage medium. Background Art
[0002] In competitive virtual games, the combat experience is a crucial component, directly impacting both player experience and retention. As game content continues to grow in complexity, the accuracy and stability of the combat system have become crucial for ensuring product quality. To maintain a balanced and fair combat system, developers often need to frequently adjust and optimize it, such as by adding, removing, and modifying skills and balancing class strengths.
[0003] Currently, when iterating on a combat system, manual testing is often performed. However, traditional manual testing methods that rely on manpower are time-consuming, labor-intensive, and extremely inefficient.
[0004] Therefore, how to improve the efficiency of game testing has become a technical problem that needs to be solved urgently. Summary of the Invention
[0005] This application provides a game testing method, device, 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, an embodiment of the present application provides a game testing method, the method comprising:
[0007] receiving a game test instruction, wherein the game test instruction includes at least one test task;
[0008] For any of the test tasks, a test case corresponding to the test task is generated through a pre-packaged test template; the test template includes a pre-arranged role creation template and a role login template; the generating of the test case 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 a test server through the role login template in the test template to generate the test case corresponding to the test task;
[0009] The test case is executed to control the test character to perform game behavior and obtain a test result corresponding to the test task.
[0010] In a second aspect, an embodiment of the present application provides a game testing device, the device comprising:
[0011] A receiving unit, configured to receive a game test instruction, wherein the game test instruction includes at least one test task;
[0012] A generating unit is configured to generate, for any of the test tasks, a test case corresponding to the test task using a pre-packaged test template; the test template includes a pre-arranged role creation template and a pre-arranged role login template; the generating of the test case corresponding to the test task using the pre-packaged test template includes: creating at least one test role having 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 a test server using the role login template in the test template to generate the test case corresponding to the test task;
[0013] The execution unit is used to execute the test case to control the test character to perform game behavior and obtain the test result corresponding to the test task.
[0014] In a third aspect, the present application further provides an electronic device, comprising:
[0015] processor; and
[0016] The memory is used to store a data processing program. After the electronic device is powered on and the program is run by the processor, the method described in the first aspect is executed.
[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing a data processing program, which is run by a processor to execute 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 an embodiment of the present application first receives a game testing instruction, wherein the game testing instruction includes at least one test task; then, for any of the test tasks, generates a test case corresponding to the test task through a pre-packaged test template; the test template includes a pre-arranged role creation template and a role login template; the generating of the test case 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 a test case corresponding to the test task; finally, executing the test case to control the test role to perform game behavior and obtain a test result corresponding to the test task. It can be seen that the game testing method provided by the embodiment of the present application, when receiving a game testing instruction, can create a corresponding test role for any test task according to the pre-packaged test template, and control the test role to log in to the test server, thereby generating a corresponding test case. Since the test role included in the test case has a test attribute that matches the corresponding test task, when executing the test case, the test role with the test attribute can be controlled to perform game behavior, thereby obtaining the test result corresponding to the test task. Therefore, the game testing method provided by the embodiment of the present application, when receiving a game testing instruction, can quickly reuse the pre-packaged test template to generate a test case for each test task. In this way, each test task can be automatically performed through each test case, greatly improving the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a schematic diagram of an example of a game testing system for implementing a game testing method provided in an embodiment of the present application;
[0021] Figure 2 is a flowchart of the game testing method provided in an embodiment of the present application;
[0022] Figure 3 This is a flowchart of an example of copying real character data from an operation server in the game testing method provided in an embodiment of the present application;
[0023] Figure 4 This is a structural block diagram of an example of a game testing device provided in an embodiment of the present application;
[0024] Figure 5 This is a structural block diagram of an example of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.
[0026] It should be noted that the terms "first", "second", "third", etc. in the claims, description and drawings of the present application are used to distinguish similar objects and are not used to describe a specific order or sequence. The data used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than that illustrated or described herein. In addition, the terms "including", "having" and their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] It should be understood that in the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "Including A, B and / or C" means including any one, any two, or any three of A, B, and C.
[0028] It should be understood that in the embodiments of the present 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 determining B based solely on A; B can also be determined based on A and / or other information.
[0029] Based on the reasons mentioned in the background technology, in order to effectively improve the efficiency of game testing, the first embodiment of the present application provides a game testing method, which is applied to electronic devices. The electronic devices can be desktop computers, laptops, mobile phones, tablet computers, electronic watches, etc., or other electronic devices capable of game testing. The embodiments of the present application are not specifically limited.
[0030] For example, Figure 1 A game testing system 100 for implementing a game testing method provided by an embodiment of the present application is shown. The game testing system 100 may include at least one operation server 101 , at least one testing server 102 , and a network 103 .
[0031] It's important to note that during game development and operations, test servers and operational servers are two distinct server environments, each with distinct tasks and purposes. Test servers are used during the development and testing phases, primarily for verifying new features, fixing vulnerabilities, and conducting performance tests. These servers are for developers to log in to and use. Operational servers are official servers for the public, also known as production servers, responsible for providing stable service for players to log in to the game application.
[0032] It should be noted that a pre-packaged test template may be deployed in the test server 102 . The test template is used to provide an automated test framework for managing a series of subtasks that need to be executed in sequence.
[0033] It should be noted that Figure 1 The schematic diagram of the game testing system shown is merely an example. The game testing system 100 described in the embodiment of the present application is intended to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. A person skilled in the art will appreciate that, with the evolution of the game system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.
[0034] The technical solution of the present application is 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 in detail in some embodiments.
[0035] The following, combined Figure 2 and Figure 3 The game testing method provided in the embodiment of the present application is introduced.
[0036] like Figure 2 , which is a flowchart of the game testing method provided by the present application, including steps S101 to S103.
[0037] Step S101: receiving a game test instruction, wherein the game test instruction 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 battle games, role-playing games, strategy games, etc.
[0039] When there are testing requirements, developers can issue corresponding game testing instructions. A game testing instruction can include one testing task or multiple testing tasks. One testing task is used to complete the testing requirements in one dimension.
[0040] Assume that the following testing requirements currently exist: testing whether the strength of the newly added skill a in the virtual game is reasonable, testing whether the strength of each virtual profession in the virtual game is balanced, and testing whether the battle server of a fighting game is stable. In one optional embodiment, a game test instruction 1 including a test task for testing whether the strength of skill a is reasonable, a game test instruction 2 including a test task for testing whether the strength of each virtual profession is balanced, and a game test instruction 3 including a test task for testing whether the battle server is stable can be issued. In another optional embodiment, a game test instruction including a test task for testing whether the strength of skill a is reasonable, a test task for testing whether the strength of each virtual profession is balanced, and a test task for testing whether the battle server is stable can be directly issued.
[0041] It should be noted that testing whether the strength of newly added skills is reasonable can effectively prevent a certain skill from being too strong or too weak, affecting the fairness and playability of the game. Testing whether the strength of each virtual profession is balanced can ensure a reasonable balance between the virtual professions in the game, and prevent a certain virtual profession from being too strong or too weak, affecting the gaming experience. In virtual games, virtual professions refer to the role type or occupation category assumed by the game character. In combat games, virtual professions can usually include but are not limited to at least one of warriors, assassins, mages, shooters, meat shields, and supports. Testing whether the battle server is stable can ensure that the battle server can maintain stable performance under high concurrency conditions, avoiding delays, freezes, and other problems.
[0042] In summary, in-game testing is crucial for ensuring game balance, stability, and overall quality, and is an integral part of game development and operations. Through comprehensive and meticulous testing, we can significantly enhance the user experience and strengthen the game's market competitiveness.
[0043] In this step, a game test instruction may include multiple test tasks. When executing the test tasks, multiple test tasks can be automatically executed in parallel, thereby effectively improving the efficiency of game testing.
[0044] Step S102: for any of the test tasks, generate a test case 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; generating the test case 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 the test case corresponding to the test task.
[0046] In an embodiment of the present application, a test template may be pre-packaged for a test task in a game test.
[0047] In an optional implementation, the test template can include a task base class (TaskBase) and a task manager (TaskManager). For any test task, a subclass of the test task can be generated by inheriting TaskBase. TaskBase can contain a task_list attribute, which represents the subtasks to be executed within the test task. After the test task subclass is generated, the test task can be registered with the TaskManager, allowing the TaskManager to manage and execute the test task.
[0048] In an optional implementation, each test task can be processed in parallel. For example, each test task can be processed in parallel through parallelization means 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, the reusability and maintainability of the code can be effectively improved, making it easier to expand.
[0050] In an embodiment of the present application, when a game test instruction is received, for each test task in the game test instruction, a test case corresponding to the test task can be automatically created through the pre-packaged test template, and each test case is used to support the corresponding test task.
[0051] For example, when the game testing instructions include testing tasks for testing whether the strength of skill a is reasonable, testing whether the strength of each virtual profession is balanced, and testing whether the battle server is stable, then test case 1 can be created to support testing whether the strength of skill a is reasonable, test case 2 can be created to support testing whether the strength of each virtual profession is balanced, and test task 3 can be created to support testing whether the battle server is stable.
[0052] Specifically, the test template may be pre-programmed with a role creation template and a role login template. The role creation template is used to create a test role with test attributes matching the test task, and the role login template is used to control the test role to log into the test server.
[0053] In this way, at least one test role with test attributes matching the test task can be created through the role creation template, and the test role can be controlled to log into the test server through the role login template, thereby generating a test case corresponding to the above test task.
[0054] Optionally, multiple test characters can be created for a single test task, each with test attributes that match the task. For example, if the task is to test the strength of skill a, a test character with skill a and a test character without skill a can be created separately. If the task is to test the balance of strength across virtual classes, the test characters can be multiple characters belonging to different virtual classes. If the task is to test the stability of the battle server, the test characters can be multiple characters belonging to different virtual classes with high combat values.
[0055] As an optional specific implementation example, the step S102 of "creating at least one test role having test attributes matching the test task by using the role creation template in the pre-packaged test template" can be implemented by the following step S1021:
[0056] Step S1021: Obtaining role parameter values configured for role configuration variables in the role creation template in the test task, and creating at least one test role having test attributes matching the test task according to the role parameter values.
[0057] The above step S102 of "controlling the test role to log into the test server through the role login template in the test template" can be implemented by the following step S1022:
[0058] Step S1022: configuring parameters of 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 a test server, wherein the test environment of the test server is the same as the operating environment of the operating server.
[0059] In an optional embodiment, the prepackaged test template may further include a role grouping template. The above-mentioned step of creating at least one test role having test attributes matching the test task using the role creation template in the prepackaged test template includes the following steps:
[0060] A plurality of test roles having test attributes matching the test tasks are created by using the role creation template in the pre-packaged test template.
[0061] After controlling the test character to log into the test server through the character login template in the test template, the game testing method provided in the embodiment of the present application may further include the following steps:
[0062] Obtaining, in the test task, team parameter values configured for team configuration variables in the role grouping template;
[0063] The test characters logged into the test server are divided into at least two groups according to the team parameter value.
[0064] The role grouping template is used to group the test roles logged into the test server according to the test task. The test template may also include a role battle template, which is used to control the grouped test roles to fight.
[0065] In this way, at least one test role with test attributes matching the test task can be created through the role creation template, and the test role can be controlled to log in to the test server through the role login template. When there are multiple test roles logging in to the test server, the test roles logged in to the test server can be grouped through the role grouping template, thereby generating test cases corresponding to the above test tasks. Finally, the grouped test roles can be controlled to fight through the role combat template.
[0066] In the specific implementation method, for any test task, first, based on the passed in character parameter values, the character configuration variables in the character creation template can be configured to create a test character and obtain the character identification of the test character (hereinafter referred to as the character ID); and the character ID is passed into 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 role grouping template can be configured based on the team parameter group passed in by the test task, so as to divide the test character into at least two groups; after the grouping is completed, the test character can be controlled to perform game battles through the role combat template.
[0067] In this way, when receiving game test instructions, you can quickly reuse the pre-packaged test template to generate test cases for each test task, without having to manually write a test script for each test task. In this way, each test task can be automatically carried out through each test case, improving test 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 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 test role can be determined by the role parameter values configured by the user.
[0069] For a test task, if only one test character with test attributes matching the test task is created, the character attribute data of the NPC can be loaded when generating the test case, that is, the NPC is a data object. In this way, when the test case is subsequently executed, the test character with the above test attributes can be controlled to perform game behaviors and interact with the NPC. As a data object, the NPC can respond to the game behavior of the test character and adjust its own data accordingly, for example, how much the health value is reduced, or how much the blood volume is reduced. In this way, the test result of the test task in the battle scene with the NPC can be known.
[0070] For example, for a test task to test the strength of skill a, a test case can be generated that includes a test character b with skill a. When executing the test case, the character attribute data d of the wild monster c can be loaded to respond to the game behavior of the test character b with skill a. In this way, the character attribute data d will be updated, thereby feeding back the test result of the skill a acting on the wild monster c.
[0071] Step S103: Execute the test case to control the test character to perform game behavior and obtain a test result corresponding to the test task.
[0072] After generating a test case corresponding to a test task, the test case can be automatically executed through a pre-packaged test template, thereby controlling the game behavior of the test character included in the test case and having test attributes matching the test task.
[0073] The game testing method provided in an embodiment of the present application first receives a game testing instruction, wherein the game testing instruction includes at least one test task; then, for any of the test tasks, generates a test case corresponding to the test task through a pre-packaged test template; the test template includes a pre-arranged role creation template and a role login template; the generating of the test case 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 a test case corresponding to the test task; finally, executing the test case to control the test role to perform game behavior and obtain a test result corresponding to the test task. It can be seen that the game testing method provided by the embodiment of the present application, when receiving a game testing instruction, can create a corresponding test role for any test task according to the pre-packaged test template, and control the test role to log in to the test server, thereby generating a corresponding test case. Since the test role included in the test case has a test attribute that matches the corresponding test task, when executing the test case, the test role with the test attribute can be controlled to perform game behavior, thereby obtaining the test result corresponding to the test task. Therefore, the game testing method provided by the embodiment of the present application, when receiving a game testing instruction, can quickly reuse the pre-packaged test template to generate a test case for each test task. In this way, each test task can be automatically performed through each test case, greatly improving the test efficiency.
[0074] Optionally, the character combat template in the above test template may include a preset character combat logic, and the preset character combat logic may be used to automatically control the test character to automatically perform game behaviors.
[0075] Optionally, executing the test case to control the test character to perform game behavior may also include the following steps: executing the test case and calling the hosting logic in the game to control the test character to perform game behavior.
[0076] In the embodiment of the present application, the function of automatically testing the game character's behavior can be implemented by calling the hosting logic in the game. It is understandable that when a player is offline, the operation server will take over the player character of the offline player and control the behavior of the offline player character through the hosting logic, such as controlling its movement in the scene, releasing skills, using health packs, etc. The setting of the hosting logic is to ensure the continuity and fairness of the battle and avoid interruptions or unfairness of the battle due to player disconnection.
[0077] When executing test cases, the game's hosting logic is called to control the test character's gaming behavior. On the one hand, this allows the test character to perform effective gaming behaviors without being controlled by the user. On the other hand, the hosting logic allows the test character to automatically perform gaming behaviors, correctly releasing skills and automatically moving like a player character.
[0078] In an optional embodiment, the step S1021 of "obtaining the role parameter values configured for the role configuration variables in the role creation template in the test task" can be implemented by the following steps S201 and S202:
[0079] Step S201: determining a first player character from the operation server according to the test task, wherein the first player character has a test attribute matching the test task.
[0080] Step S202: Acquire first character data of the first player character from the operation server, and determine the first character data as a character parameter value configured for the character configuration variable in the character creation template.
[0081] In an embodiment of the present 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] Afterwards, 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 a real player on the operation server. Specifically, the first character data of the first player character can be pulled from the game log corresponding to the operation server. The first character data is used to reflect the player attributes of the first player character. For example, the first character data may include the current game level of the first player character, the virtual profession of the first player character, and the props and equipment owned by the first player character.
[0083] Afterwards, the first role data may be determined as the role parameter value configured by the role configuration variable in the role creation template, thereby creating a test role based on the first role data.
[0084] Specifically, creating a test character based on the first character data refers to copying the first character data to obtain a test character having the first character data. Because the first player character has test attributes that match the test task, the first character data of the first player character also carries test attributes that match the test task. Thus, the test character obtained by copying the first character data and having the first character data has test attributes that match the test task.
[0085] This setup allows for quick creation of test characters during testing by copying the character data of real players from the operational servers. This eliminates the need for complex and tedious setup steps like game level, virtual class, and equipment for the test characters, allowing for quick and efficient generation. Furthermore, by copying the character data of real players from the operational servers to create test characters for game testing, the game testing process closely matches the actual gameplay of players, improving the accuracy of game testing.
[0086] It should be noted that the game testing method provided in the embodiment of the present application supports the function of copying real character data from the operation server. When there is a need to copy real character data to create a test character, this function can be used to achieve cross-server data replication. When there is no need to copy real character data to create a test character, a new test character can also be created directly on the test server. Whether to use the real character data in the operation server to create the test character can be set based on the specific test task, and this application does not limit this.
[0087] The following is a detailed introduction to the test details of the game testing method provided in this application when applied to specific testing tasks:
[0088] In an optional implementation, the test task is a task for testing whether the operation server is stable, and the "determining the first player character from the operation server" in step S201 may include the following steps:
[0089] A preset number of player characters with high game rankings corresponding to each virtual profession in the operation server are determined as first player characters.
[0090] Step S103 can be implemented by the following steps:
[0091] Execute the test case to control at least two groups of the test characters to perform game battles to obtain a first test result, wherein the first test result includes at least one of the following: whether the battle duration is greater than a 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 a high ranking in the game corresponding to each virtual profession.
[0093] It should be noted that the game ranking can be obtained from the game log, and 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 higher levels corresponding to each virtual profession can be selected as the first player characters. Specifically, the top 10 shooter player characters, the top 10 mage player characters, the top 10 warrior player characters, and the top 10 auxiliary player characters can be selected as the first player characters.
[0094] After the first player characters are selected, the first character data of each first player character can be copied respectively, thereby creating a test character (ie, a robot) that is completely identical to the character data of each first player character.
[0095] It should be noted that for each virtual profession, the player characters ranked higher in the game usually have higher combat power, and the corresponding combat data during the battle is also more complex. Therefore, when the player characters ranked higher in the game are fighting, the data interaction and data transmission pressure of the operation server are relatively high. In this way, when the test task is to test whether the operation server is stable, the first character data of the first player character ranked higher in the game is selected to copy the test character with higher combat power, so that higher-intensity battles can be simulated, and the stability of the operation server under high load can be tested.
[0096] In addition, by selecting the first player character from the player characters of each virtual profession to copy test characters of different professional types, the processing capabilities of the operation server when facing characters of different professional types can be tested, thereby ensuring that the operation server can cope with various situations in the game.
[0097] In addition, the skills used by top-ranked player characters of different virtual professions are usually different, and the combat strategies they use are also more complex. In this way, the copied test characters can cover more situations in the game, making the game test more comprehensive and able to discover potential problems in the game as much as possible, such as logical errors, performance bottlenecks, log anomalies, etc., further improving the accuracy and efficiency of game testing, ensuring that all functions of the game are fully verified, indirectly ensuring the stability and smoothness of the game operation, and improving the player's gaming experience.
[0098] Optionally, for the task of testing the stability of the operation server, after creating test characters based on a preset number of top-ranked player characters corresponding to each virtual profession in the operation server, the 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, thereby dividing the test characters into a specified number of teams. Subsequently, the specified number of teams can be controlled to engage in game battles, thereby obtaining a first test result for the test task of testing the stability of the operation server.
[0099] In an embodiment of the present application, when the test roles are grouped, the grouping can be performed using a strategy of disrupting the occupations, so that the influence of the occupations can be eliminated when executing the test cases.
[0100] Optionally, for the task of testing whether the operation server is stable, after creating test characters based on a preset number of player characters with high game rankings corresponding to each virtual profession in the operation server, the test characters can be used as the first team, and the character attribute data of the NPC in the game can be loaded as the second team, so as to control the first team and the second team to fight in the game and obtain the corresponding first test result.
[0101] In an embodiment of the present application, 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 is greater than a threshold. When executing the test case and obtaining the first test result, it is also possible to detect whether first abnormality indicator data exists in the first test result. The first abnormality indicator data may include, but is not limited to, at least one of the following: the battle duration is greater than a preset duration, the battle recording function is abnormal, the battle log is abnormal, and the number of battles is greater than a threshold. It should be noted that if the battle duration is greater than the preset duration, or the number of battles is greater than the threshold, it indicates that there may be a dead loop or infinite loop in the battle logic.
[0102] When the first abnormal indicator data is detected in the first detection result, a first alarm message may be automatically generated. Furthermore, a test report including the first alarm message may be generated. The first alarm message indicates the abnormal cause of the instability of the operation server. Examples of abnormal causes include, but are not limited to, abnormal combat logic, abnormal combat recording function, incomplete combat logs, etc.
[0103] Through the above method, the stability of the operation server can be tested comprehensively, efficiently and accurately, thereby greatly ensuring the stability of the operation server.
[0104] In an optional embodiment, the test task is a task for testing whether the strength of the target skill is reasonable. The step of "creating at least one test role having test attributes matching the test task" in step S1021 may include the following steps:
[0105] A first test character having the target skill and a second test character not having the target skill are created.
[0106] Step S103 can be implemented by 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 damage data caused by the target skill to the second test character.
[0108] The strength of the target skill is used to reflect the damage level of the target skill. The higher the strength, the greater the damage level. 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, first, a first test character with a 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] Afterwards, the first test character and the second test character can be set to an antagonistic relationship, and a corresponding test case can be generated. In this way, 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. The second test result represents the damage data caused by the target skill to the second test character.
[0111] When the presence of 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 is used to indicate that the strength of the target skill is unreasonable. The abnormal cause can be that the strength of the target skill is too strong. The second abnormal indicator data can, for example, be that the damage data caused by the target skill to the second test character is higher than the preset damage data. For example, after the first test character releases skill a to the second test character, the health of the second test character drops from full health to 0, indicating that the strength of the target skill is too strong. In this case, a second alarm message indicating that the strength of skill a is too strong and a test report containing the second alarm message can be generated.
[0112] In an optional embodiment, the test task is a task for testing whether the strength of the target skill is normal when facing characters of different professions. At least one test character with test attributes matching the test task may be created in the following manner:
[0113] Select n player characters of different professions from the operation server, and obtain the third character data of the n player characters respectively, and copy each third character data to generate n test characters that are consistent with the game level, profession, and equipment props owned by the n player characters. Then, create a third test character, and the third test character has a target skill. Then, set the third test character and the n test characters to be in a hostile relationship, generate a test case, execute the test case, and control the third test character to release the target skill to the n test characters respectively to obtain a third test result. Each third test result represents the damage data generated by the target skill to the test character of the corresponding profession type.
[0114] Through the above method, it is possible to comprehensively, efficiently and accurately test whether the strength of the skills in the game is reasonable, thereby greatly ensuring the fairness and balance of the game.
[0115] In an optional embodiment, the test task is a task for testing whether the strength of each virtual profession is reasonable. The "determining the first player character from the operation server" in step S201 may include the following steps:
[0116] A player character at the same level and belonging to different virtual professions in the operation server is determined as a first player character.
[0117] Step S103 can be implemented by the following steps:
[0118] The test case is executed to control the test character of each virtual profession to fight in the game, and a third test result is obtained, wherein the third test result represents the life indicator data of the test character of each virtual profession.
[0119] The strength of each virtual class is used to reflect its combat capabilities (specifically, attack and defense). During game testing, the strength of each virtual class can be measured by the corresponding life indicators of each virtual class after the battle. Life indicator data may include, but is not limited to, survival rate, health points, health points, and energy points.
[0120] In this embodiment, when the test task is to test the strength of each virtual class to see if it 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 at the same level and belonging to a different virtual class. It should be noted that for each 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 the first player characters are selected, the first character data of each first player character can be copied respectively, thereby creating a test character (ie, a robot) that is completely identical to the character data of each first player character.
[0122] Afterwards, the above-mentioned test characters can be grouped using a character grouping template, and the test characters of each virtual profession can be controlled to fight in a game, thereby obtaining a third test result representing the life indicator data of the test characters of each virtual profession.
[0123] When the third abnormal indicator data is detected in the third detection result, a third alarm message may be automatically generated. Furthermore, a test report containing the third alarm message may be generated. The third alarm message indicates which virtual class has unreasonable strength. The abnormality may be caused by the virtual class being too strong or too weak. For example, the third abnormal indicator data may be that the health indicator data of the test character of the target virtual class after the game battle is lower than the preset health indicator data.
[0124] For example, a warrior-type test character, a shooter-type test character, a mage-type test character, and an auxiliary-type test character at the same level engage in a melee. After the melee, the warrior-type test character has the lowest survival rate, and the strength of the warrior-type test character is too weak. In this case, a third alarm message indicating that the strength of the warrior-type test character is too weak and a test report containing the third alarm message may be generated.
[0125] Optionally, when the test task is to test whether the strength of a virtual profession is reasonable, a target number of test characters of the same profession and belonging to the target profession can be created, as well as a target number of test characters of random professions and belonging to different virtual professions. The test characters of the same profession are used as the first camp, and the test characters of random professions are used as the second camp. The first camp and the second camp are controlled to fight in the game. After the battle, the life index data of the test characters of each virtual profession in the second camp are counted. The strength of the virtual profession to which the test characters with life index data lower than the preset life index data belong is too weak. It should be noted that when creating test characters of the same profession and creating test characters of random professions here, both can be quickly implemented by copying the real character data of the corresponding real players 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 an introduction to the test details of the game testing method provided in the embodiment of the present application when applied to a specific testing task.
[0127] Optionally, in an embodiment of the present application, the copying of real character data from the operation server may be optimized. After obtaining the first character data of the first player character from the operation server, the game testing method provided in the embodiment of the present application may further include the following steps:
[0128] storing first character data of the first player character on the testing 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 the embodiment of the present application may further include the following steps:
[0131] In response to an instruction initiated by the test server to obtain the first character data again, if the first character data of the first player character is stored in the test server, obtaining the first character data of the first player character from the test server;
[0132] If the first character data of the first player character is not stored in the test server, the first character data of the first player character is obtained from the operation server.
[0133] In an embodiment of the present application, 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, the first character data cached in the test server can be directly copied to create the other test character. When the cache duration reaches a preset duration 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 occupation pressure.
[0134] It should be noted that after a test character is created based on the first character data of the first player character for a test task in the test server, the test server may also receive another test task that requires creating a test character based on the first character data of the first player character. In this way, an instruction to obtain the first character data again can be generated on the test server.
[0135] When receiving an instruction initiated by the test server to obtain the first character data again, you can first determine whether the first character data of the first player character is stored on the test server. If so, you can directly obtain the first character data from the test server. If not, you can obtain the first character data of the first player character again from the operation server.
[0136] like Figure 3 FIG. 2 is a flowchart of an example of copying real character data from an operation server in a game testing method provided in an embodiment of the present application, including the following steps S21 to S24:
[0137] Step S21: receiving an instruction to obtain the first character data again;
[0138] Step S22: testing whether the first character data is stored in the server;
[0139] If the detection result of step S22 is yes, then step S23 is executed: obtaining the first character data from the test server;
[0140] If the detection result of step S22 is no, step S24 is executed: obtaining the first character data from the operation server.
[0141] In an embodiment of the present application, when there is a need to copy the first character data of a first player character from an operation server to create a corresponding test character on a test server, by detecting whether the first character data of the first player character is stored in the test server, and if so, directly assigning the first character data stored in the test server, the test character can be quickly created. This setting has the following advantages:
[0142] On the one hand, frequent data transmission will occupy more network bandwidth resources, especially in the case of large data volumes. This method reduces the number of data transmissions from the operation server to the test server, effectively saving bandwidth resources. On the other hand, the speed of local access to data is usually faster than the speed of cross-server access. By copying local data, the delay in data access is greatly reduced. In addition, using local data for re-copying requests for the same data within a preset time threshold can effectively avoid the problem of excessive load caused by the operation server frequently performing repeated data transmission tasks in a short period of time.
[0143] Corresponding to the game testing method provided in the first embodiment of the present application, the second embodiment of the present application further provides a game testing device, such as Figure 4 As shown, the game testing device 400 includes:
[0144] A receiving unit 401 is configured to receive a game test instruction, wherein the game test instruction includes at least one test task;
[0145] A generating unit 402 is configured to generate, for any of the test tasks, a test case corresponding to the test task using a pre-packaged test template; the test template includes a pre-arranged role creation template and a pre-arranged role login template; the generating of the test case corresponding to the test task using the pre-packaged test template includes: creating at least one test role having 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 a test server using the role login template in the test template to generate the test case corresponding to the test task;
[0146] The execution unit 403 is used to execute the test case to control the test character to perform game behavior and obtain the test result corresponding to the test task.
[0147] Optionally, the generating unit 402 is specifically configured to:
[0148] Obtaining, in the test task, role parameter values configured for role configuration variables in the role creation template, and creating at least one test role having test attributes matching the test task according to the role parameter values;
[0149] According to the role identification of the test role, the login configuration variables in the role login template are parameterized 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 operating environment of the operating server.
[0150] Optionally, the test template further includes a role grouping template, and the generating unit 402 is further specifically configured to:
[0151] Creating a plurality of test roles having test attributes matching the test tasks by using a role creation template in the prepackaged test template;
[0152] Obtaining, in the test task, team parameter values configured for team configuration variables in the role grouping template;
[0153] The test characters logged into the test server are divided into at least two groups according to the team parameter value.
[0154] Optionally, the generating unit 402 is specifically configured to:
[0155] Determining a first player character from the operation server according to the test task, wherein the first player character has a test attribute that matches the test task;
[0156] First character data of the first player character is obtained from the operation server, and the first character data is determined as a character parameter value configured for the character configuration variable in the character creation template.
[0157] Optionally, the generating unit 402 is further configured to:
[0158] storing first character data of the first player character on the testing 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 generating unit 402 is further specifically configured to:
[0161] In response to an instruction initiated by the test server to obtain the first character data again, if the first character data of the first player character is stored in the test server, obtaining the first character data of the first player character from the test server;
[0162] If the first character data of the first player character is not stored in the test server, the first character data of the first player character is obtained from the operation server.
[0163] Optionally, the test task is a task for testing whether the operation server is stable, and the generating unit 402 is specifically configured to:
[0164] Determine a preset number of player characters with top game rankings corresponding to each virtual profession in the operation server as first player characters;
[0165] The execution unit 403 is specifically configured to:
[0166] Execute the test case to control at least two groups of the test characters to perform game battles to obtain a first test result, wherein the first test result includes at least one of the following: whether the battle duration is greater than a preset duration, whether the battle recording function is abnormal, and whether the battle log is abnormal.
[0167] Optionally, the test task is a task for testing whether the strength of the target skill is reasonable, and the generating unit 402 is specifically configured to:
[0168] Creating a first test character having the target skill and a second test character not having the target skill;
[0169] The execution unit 403 is specifically configured to:
[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 damage data caused by the target skill to the second test character.
[0171] Optionally, the test task is a task for testing whether the strength of each virtual profession is reasonable, and the generating unit 402 is specifically configured to:
[0172] Determining a player character at the same level and belonging to a different virtual profession in the operation server as a first player character;
[0173] The execution unit 403 is specifically configured to:
[0174] The test case is executed to control the test character of each virtual profession to fight in the game, and a third test result is obtained, wherein the third test result represents the life indicator data of the test character of each virtual profession.
[0175] Optionally, the execution unit 403 is specifically configured to:
[0176] The test case is executed, and the managed logic in the game is called to control the game behavior of the test character.
[0177] Corresponding to the game testing method provided in the first embodiment of the present application, the third embodiment of the present application further provides an electronic device for game testing. Figure 5 As shown, the electronic device 500 includes: a processor 501; and a memory 502 for storing a program of the game testing method. After the device is powered on and the program of the game testing method is run by the processor, the following steps are performed:
[0178] receiving a game test instruction, wherein the game test instruction includes at least one test task;
[0179] For any of the test tasks, a test case corresponding to the test task is generated through a pre-packaged test template; the test template includes a pre-arranged role creation template and a role login template; the generating of the test case 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 a test server through the role login template in the test template to generate the test case corresponding to the test task;
[0180] The test case is executed to control the test character to perform game behavior and obtain a test result corresponding to the test task.
[0181] Corresponding to the game testing method provided in the first embodiment of the present application, the fourth embodiment of the present application provides a computer-readable storage medium storing a program of the game testing method, which is executed by a processor to perform the following steps:
[0182] receiving a game test instruction, wherein the game test instruction includes at least one test task;
[0183] For any of the test tasks, a test case corresponding to the test task is generated through a pre-packaged test template; the test template includes a pre-arranged role creation template and a role login template; the generating of the test case 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 a test server through the role login template in the test template to generate the test case corresponding to the test task;
[0184] The test case is executed to control the test character to perform game behavior and obtain a test result corresponding to the test task.
[0185] Below, the outstanding substantial features and beneficial technical effects obtained by applying the methods, devices, electronic devices, and computer-readable storage media disclosed in various embodiments of the present application are given, which solve the technical problems that have long been needed to be solved by those skilled in the art.
[0186] For example, there are currently 10 test tasks. The practice in the prior art is to manually prepare test data for each test task. The test data includes creating a test account, generating a test role that meets the test task for each test account, and writing a test script corresponding to the test task. The test task is executed based on the test data and the test script to obtain the test results. Among them, it usually takes 1 hour to prepare the test data, 2 hours to write the test script, and 2 hours to execute the test task. In this way, the whole process of a test task in the prior art usually takes 5 hours. In this way, 10 test tasks usually take 50 hours. It should be noted that this is only an example for the convenience of understanding. In actual applications, the time required for the whole process of a test task needs to take into account multiple factors, such as the subjective differences of each tester, the task differences of each test task, etc.
[0187] After adopting the method of the present application, the above-mentioned test tasks can be performed in parallel through the pre-packaged test template. First, the test case corresponding to each test task is generated through the test template. Since the test template is pre-arranged with a role creation template, a role login template and a role grouping template, the user only needs to perform simple parameter configuration to automatically generate the test case corresponding to each test task. The character data can be obtained from the real player data from the external server. In this way, the test cases of 10 test tasks can be generated within 2 hours. After that, the test cases are executed in parallel, and the 10 test cases can be completed within 4 hours. In this way, the whole process of 10 test tasks is 6 hours, which is 88% more efficient than the existing technology.
[0188] Moreover, when the number of test tasks increases, the test efficiency is significantly improved after adopting the solution of this application. Therefore, this application solves the long-standing technical problems in this field, and the technical effect is very outstanding, greatly improving efficiency and reducing costs. The technical solution disclosed in this application has outstanding substantive features.
[0189] It should be noted that for the detailed description of the devices, electronic devices and computer-readable storage media provided in the second, third and fourth embodiments of the present application, reference can be made to the relevant description of the first embodiment of the present application, and no further details will be given here.
[0190] Although the present application is disclosed as above with the preferred embodiments, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present 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-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0193] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, 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), random access memory (RAM) of other types, read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage media, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0194] 2. Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0195] Although the present application is disclosed as above with the preferred embodiments, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A game testing method, characterized in that: The method comprises: Receiving a game testing instruction, wherein the game testing instruction includes at least one testing task; For any of the test tasks, a test case corresponding to the test task is generated through a pre-packaged test template; the test template includes a pre-arranged role creation template and a role login template; the test case corresponding to the test task is generated through the pre-packaged test template, including: creating at least one test role with test attributes matching the test task through the role creation template in the pre-packaged test template; controlling the test role to log in to the test server through the role login template in the test template to generate the test case corresponding to the test task; Execute the test case to control the test character to perform game behavior and obtain the test result corresponding to the test task.
2. The method according to claim 1, characterized in that The step of creating at least one test role having test attributes matching the test task by using a role creation template in the prepackaged test template includes: Obtaining, in the test task, role parameter values configured for role configuration variables in the role creation template, and creating at least one test role having test attributes matching the test task according to the role parameter values; The step of controlling the test role to log into the test server through the role login template in the test template includes: According to the role identification of the test role, the login configuration variables in the role login template are parameterized to control the test role to log in to a test server, wherein the test environment of the test server is the same as the operating environment of the operating server.
3. The method according to claim 1, characterized in that The test template also includes a role grouping template. The step of creating at least one test role having test attributes matching the test task through the role creation template in the prepackaged test template includes: creating multiple test roles having test attributes matching the test task through the role creation template in the prepackaged test template. The method also includes: Obtaining, in the test task, team parameter values configured for team configuration variables in the role grouping template; The test roles logged into the test server are divided into at least two groups according to the team parameter value.
4. The method according to claim 2, characterized in that: The step of obtaining the role parameter value configured for the role configuration variable in the role creation template in the test task includes: According to the test task, determining a first player character from the operation server, wherein the first player character has a test attribute matching 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 a 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 comprises: storing first character data of the first player character on the testing 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 comprises: In response to an instruction initiated by the test server to obtain the first character data again, if the first character data of the first player character is stored in the test server, obtaining the first character data of the first player character from the test server; If the first character data of the first player character is not stored in the test server, the first character data of the first player character is obtained from the operation server.
7. The method according to claim 4, characterized in that The test task is a task for testing whether the operation server is stable, and determining the first player character from the operation server includes: Determine a preset number of player characters with top game rankings corresponding to each virtual profession in the operation server as first player characters; The executing the test case to control the test character to perform game behavior and obtain the test result corresponding to the test task includes: Execute the test case to control at least two groups of the test characters to fight in the game 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 a 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 for testing whether the strength of the target skill is reasonable, and the creating of at least one test role having a test attribute matching the test task includes: Creating a first test character having the target skill and a second test character not having the target skill; The executing the test case to control the test character to perform game behavior and obtain the test result 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 to obtain a second test result, wherein the second test result represents damage data caused by the target skill to the second test character.
9. The method according to claim 4, characterized in that The test task is a task for testing whether the strength of each virtual profession is reasonable. The step of determining the first player character from the operation server includes: Determine a player character at the same level and belonging to a different virtual profession in the operation server as a first player character; The executing the test case to control the test character to perform game behavior and obtain the test result corresponding to the test task includes: The test case is executed to control the test character of each virtual profession to fight in the game to obtain a third test result, wherein the third test result represents the life indicator data of the test character of each virtual profession.
10. The method according to claim 1, characterized in that The executing the test case to control the test character to perform game behavior includes: The test case is executed, and the managed logic in the game is called to control the game behavior of the test character.
11. A game testing device, characterized in that: The device comprises: A receiving unit, configured to receive a game test instruction, wherein the game test instruction includes at least one test task; A generating unit, for generating a test case corresponding to any of the test tasks through a pre-packaged test template; the test template includes a pre-arranged role creation template and a role login template; the generating of the test case 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 a test server through the role login template in the test template to generate a test case corresponding to the test task; The execution unit is used to execute the test case to control the test character to perform game behavior and obtain the test result corresponding to the test task.
12. An electronic device, characterized in that: include: processor; as well as The memory is used to store a data processing program. After the electronic device is powered on and the program is run by the processor, the method according to any one of claims 1 to 10 is executed.
13. A computer-readable storage medium, characterized in that: A data processing program is stored, and the program is run by a processor to execute the method according to any one of claims 1 to 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