A method, device, equipment and storage medium for generating game test cases
By finding candidate test cases that meet the test objectives from the pre-built test case library, and generating target test cases based on writing logic and game logic, the test case reusability, high writing cost and low efficiency in the existing technology is solved. Problem, achieving efficient reuse and generation of test cases.
Patent Information
- Application Number
- CN202410951548.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-07-16
AI Technical Summary
In the prior art, the reusability of game test cases is poor, and the writing is labor-intensive and inefficient.
Find at least two candidate test cases that meet the test objectives from the prebuilt test case library, and integrate candidate test cases based on the writing logic of the test case and the game logic of the game to be tested to generate target test cases.
It realizes the reuse of written test cases, reduces the writing workload and improves the generation efficiency of test cases.
Smart Images

Figure CN119025406B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of game testing technology, and specifically relates to a method, device, equipment and medium for generating game test cases. Background Art
[0002] A test case is a description of a test task for a specific software product, used to verify whether it meets the requirements of a specific software. It usually includes four contents: the case title, preconditions, test steps, and expected results. With the development of the game industry, it is very important to test the function, compatibility, and performance of the game according to the test case before the game is released.
[0003] In the related technology, game testers need to write one or more new test cases for each game according to the test tasks. However, a game often uses multiple SDKs, and each SDK may be used by multiple games. When game testers test different test tasks in the same game, they need to write a large number of repeated test cases, which results in poor test case reusability, high labor costs and low writing efficiency. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device, equipment and medium for generating game test cases, which solves the problems of poor reusability of test cases, high labor cost in writing and low writing efficiency in the prior art. By searching at least two candidate test cases that meet the test objectives from a pre-built test case library, the candidate test cases are integrated based on the test case writing logic and the game logic of the game to be tested to generate a target test case of the test objective, thereby realizing the reuse of the written test cases, reducing the writing workload and improving the test case generation efficiency.
[0005] In a first aspect, an embodiment of the present application provides a method for generating a game test case, the method comprising:
[0006] Receive test requirement information of the game to be tested, and read the test target field in the test requirement information to determine the test target of the game to be tested;
[0007] Read the configuration parameters of the game to be tested, and determine the game test case identifier and SDK test case identifier corresponding to the test target according to the configuration parameters;
[0008] Searching at least two candidate test cases that meet the test objective from a pre-built test case library according to the game test case identifier and the SDK test case identifier, wherein the candidate test cases include: a candidate game test case and a candidate SDK test case;
[0009] The candidate test cases are integrated based on the set test case writing logic and the game logic of the game to be tested to generate a target test case.
[0010] Furthermore, the test case writing logic based on the setting and the game logic of the game to be tested are integrated with the candidate test cases to generate target test cases, including:
[0011] Determine the game test step execution priority and SDK test step execution priority of the test target according to the game logic of the game to be tested;
[0012] According to the execution priority of the game test step, the test step of the candidate game test case is adjusted to obtain a first test step; according to the execution priority of the SDK test step, the test step of the candidate SDK test case is adjusted to obtain a second test step;
[0013] The first test step and the second test step are integrated according to the set test case writing logic to generate a target test case.
[0014] Furthermore, before adjusting the test steps of the candidate game test case according to the game test step execution priority to obtain the first test step, the method further includes:
[0015] Calculating the similarity of the test steps between the test cases in the candidate game test cases, and determining whether the similarity of the test steps is greater than a preset similarity threshold;
[0016] If the similarity of the test steps is greater than a preset similarity threshold, at least one of the test steps is deleted.
[0017] Further, the step of integrating the first test step and the second test step according to the set test case writing logic to generate a target test case includes:
[0018] Determine the test case structure, filling rules and execution order of the first test step and the second test step of the target test case according to the set test case writing logic;
[0019] Merging the first test step and the second test step based on the execution order to obtain a target test step of a target test case;
[0020] The test case information of each item in the candidate test case is read, and the test case information and the target test steps are filled into the case structure according to the filling rule to obtain the target test case.
[0021] Furthermore, before determining the test case structure, filling rules, and the execution order between the first test step and the second test step of the target test case according to the set test case writing logic, the method further includes:
[0022] Determine the version information of the game to be tested according to the configuration parameters of the game to be tested, determine the first execution version information of the first test step according to the game test case identifier, and determine the second execution version information of the second test step according to the SDK test case identifier;
[0023] Identify whether the version information of the game to be tested is compatible with the first execution version information and the second execution version information;
[0024] If the version information of the game to be tested is incompatible with the first execution version information and / or the second execution version information, the incompatible test steps are deleted, and at least two candidate test cases that meet the test objectives are searched again from the pre-built test case library.
[0025] Further, searching at least two candidate test cases that meet the test objective from a pre-built test case library according to the game test case identifier and the SDK test case identifier includes:
[0026] Identify whether there is a test case identical to the game test case identifier and the SDK test case identifier in a pre-built test case library;
[0027] If there is a test case in the test case library that is identical to the game test case identifier and the SDK test case identifier, the test case is used as a candidate test case that meets the test objective;
[0028] If there is no test case identical to the game test case identifier and / or the SDK test case identifier in the test case library, the precondition of the test target is determined according to the configuration parameters, the game test cases and / or SDK test cases in the test case library with the highest similarity to the precondition of the test target are calculated, and based on the precondition of the test target, the game test cases and / or SDK test cases in the test case library with the highest similarity to the precondition of the test target are rewritten to obtain at least two candidate test cases that meet the test target.
[0029] Furthermore, rewriting the game test cases and / or SDK test cases in the test case library that have the highest similarity to the preconditions of the test target based on the preconditions of the test target includes:
[0030] Identify a first precondition in the test case to be rewritten whose similarity with the precondition of the test target does not meet a preset similarity threshold;
[0031] Determine the association relationship between the test steps and the preconditions in the test case to be rewritten according to the writing logic of the test case, and determine the test steps to be rewritten associated with the first precondition according to the association relationship;
[0032] The test step to be rewritten is rewritten according to the precondition of the test target.
[0033] In a second aspect, an embodiment of the present application provides a device for generating a game test case, the device comprising:
[0034] A test target determination module, used to receive test requirement information of a game to be tested, and determine a test target of the game to be tested according to the test requirement information;
[0035] A test case identification determination module, used to read the configuration parameters of the game to be tested, and determine the game test case identification and SDK test case identification corresponding to the test target according to the configuration parameters;
[0036] A candidate test case search module, used to search at least two candidate test cases that meet the test objectives from a pre-built test case library according to the game test case identifier and the SDK test case identifier; the candidate test cases include: candidate game test cases and candidate SDK test cases;
[0037] The target test case generation module is used to integrate the candidate test cases to generate target test cases based on the set test case writing logic and the game logic of the game to be tested.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0039] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0040] In the fifth aspect, an embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and at least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device performs the method described in the first aspect.
[0041] In an embodiment of the present application, the test requirement information of the game to be tested is received, and the test target field in the test requirement information is read to determine the test target of the game to be tested; the configuration parameters of the game to be tested are read, and the game test case identifier and SDK test case identifier corresponding to the test target are determined according to the configuration parameters; at least two candidate test cases that meet the test target are searched from a pre-built test case library according to the game test case identifier and the SDK test case identifier, and the candidate test cases include: candidate game test cases and candidate SDK test cases; based on the set test case writing logic and the game logic of the game to be tested, the candidate test cases are integrated to generate target test cases. Through the above-mentioned game test case generation method, the problems of poor test case reusability, high labor cost and low writing efficiency in the prior art are solved. By searching at least two candidate test cases that meet the test target from a pre-built test case library, the candidate test cases are integrated based on the test case writing logic and the game logic of the game to be tested to generate the target test case of the test target, the reuse of the written test cases is realized, the writing workload is reduced and the test case generation efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flowchart of a method for generating a game test case provided in an embodiment of the present application;
[0043] Figure 2 This is a flowchart of target test case generation provided by an embodiment of the present application;
[0044] Figure 3 It is a flowchart integrating the test steps provided in the embodiment of the present application;
[0045] Figure 4 This is a flowchart of candidate test case search provided by an embodiment of the present application;
[0046] Figure 5 It is a structural block diagram of a device for generating game test cases provided in an embodiment of the present application;
[0047] Figure 6 It is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0050] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0051] First of all, the use scenario of this solution can be a scenario of testing specific functions or performance of the game, especially a scenario of automated testing of the game through test cases. By separating the game test cases for a certain test target in the game from the SDK test cases, the purpose of reusing the same test cases can be achieved, which greatly reduces the burden of test case writing for testers and improves the efficiency of testing. Based on the above usage scenarios, it can be understood that the execution subject of this solution can be a server.
[0052] In conjunction with the accompanying drawings, a method, device, equipment and medium for generating a game test case provided by an embodiment of the present application are described in detail through specific embodiments and their application scenarios.
[0053] Figure 1 : is a flow chart of a method for generating a game test case provided in an embodiment of the present application. Figure 1 As shown, the specific steps include:
[0054] S101, receiving test requirement information of a game to be tested, and reading a test target field in the test requirement information to determine a test target of the game to be tested.
[0055] Among them, the game to be tested may be a game to be tested to see whether it can run normally and stably. The test requirement information may be information recording the content and test requirements of the game to be tested. The test requirement information records the content to be tested formulated by the game developers and game testers. The test target may be the test content recorded in the test requirement information. The number of test targets may be multiple. For example: game compatibility, game fluency test, and server stress test, etc. The test target field may be a field in the test requirement information used to describe the specific content of the test target.
[0056] In one embodiment, the test requirement information of the game to be tested may be received through the client interface, and the content in the test target field in the test requirement information may be read to determine the content in the test target field as the test target of the game to be tested.
[0057] S102, reading the configuration parameters of the game to be tested, and determining the game test case identifier and SDK test case identifier corresponding to the test target according to the configuration parameters.
[0058] Configuration parameters can be parameters used to represent the properties and operating requirements of the game to be tested. For example, the frame rate of the game to be tested, the hardware system parameters and interface parameters of the running game, etc. Test cases can be documents that describe the test targets. Test cases are used to verify whether the actual test results of the test targets meet the expected results, including case titles, preconditions, test steps and expected results.
[0059] The test of the test target includes two parts: game testing and SDK testing. SDK can be the software development kit of the game. The game SDK integrates documents, examples, tools and APIs with login and payment as the core functions. A game can use multiple SDKs, and an SDK can be used by multiple games. Therefore, in the game testing process, the game test cases can be separated from the SDK test cases, and the test cases can be written separately. According to the SDK used by the test target and the game to be tested to which the test target belongs, the game test cases and SDK test cases can be directly combined to generate test cases that meet the test target. When a game uses multiple SDKs, a game test case can be combined with multiple SDK test cases to generate multiple sets of test cases, and then multiple SDKs in the game can be tested separately.
[0060] Among them, the game test case can be a description of the test of the running process of the game itself and the expected results. The SDK test case can be a description of the test of the SDK used by the game to be tested and the expected results. The SDK test can be a functional test of the various functions provided by the SDK used by the game, including testing of player interaction data, testing of the connection between the game and various channels, testing of the integrity of data and log information on the server, etc. The game test case identifier can be a mark used to indicate the game configuration that can be tested by the test case. The SDK test case identifier can be a mark used to indicate the SDK configuration that can be tested by the test case.
[0061] In one embodiment, the configuration parameters of the game to be tested can be read by reading the game data stored in the storage unit, the game running configuration and SDK configuration of the game to be tested can be determined according to the configuration parameters, the game test case identifier corresponding to the test target can be determined according to the correspondence between the game running configuration and the test case identifier, and the SDK test case identifier can be determined according to the correspondence between the SDK configuration and the test case identifier.
[0062] S103, searching at least two candidate test cases that meet the test objectives from a pre-built test case library according to the game test case identifier and the SDK test case identifier, wherein the candidate test cases include: candidate game test cases and candidate SDK test cases.
[0063] The test case library may be a database for storing pre-written game test cases and SDK test cases. Candidate test cases may be test cases that meet the test target configuration requirements and test requirements. Candidate test cases include: candidate game test cases and candidate SDK test cases. The number of candidate test cases is at least two, and the number of candidate game test cases or candidate SDK test cases is at least one respectively.
[0064] In one embodiment, by comparing the candidate test cases with the identifiers of each test case in the pre-built test case library, at least two candidate test cases that meet the test objectives are searched from the test case library.
[0065] S104, integrating candidate test cases based on the set test case writing logic and the game logic of the game to be tested to generate a target test case.
[0066] The test case writing logic can be the rules that the tester needs to follow when writing the test case. For example, the writing format, writing order, writing results, and content composition. Game logic can be the operating rules and operating mechanism of the game to be tested. For example, game play rules, level design, character behavior, and game progress. Target test cases can be test cases for the test target.
[0067] In one embodiment, the target test case writing rules can be determined based on the set test case writing logic, and the game running rules during the test target test can be determined according to the game logic of the game to be tested. The test steps of the candidate test cases are integrated according to the game logic of the game to be tested, and the integrated test steps are filled into the test case writing framework according to the test case writing logic, and other contents in the framework, such as the case title, preconditions and expected results, are combined to generate the target test case.
[0068] The technical solution provided by the embodiment of the present application receives the test requirement information of the game to be tested, reads the test target field in the test requirement information to determine the test target of the game to be tested; reads the configuration parameters of the game to be tested, and determines the game test case identifier and SDK test case identifier corresponding to the test target according to the configuration parameters; searches for at least two candidate test cases that meet the test target from a pre-built test case library according to the game test case identifier and the SDK test case identifier, and the candidate test cases include: candidate game test cases and candidate SDK test cases; integrates the candidate test cases based on the set test case writing logic and the game logic of the game to be tested to generate a target test case. Through the above-mentioned game test case generation method, the problems of poor test case reusability, high labor cost and low writing efficiency in the prior art are solved. By searching for at least two candidate test cases that meet the test target from a pre-built test case library, the candidate test cases are integrated based on the test case writing logic and the game logic of the game to be tested to generate the target test case of the test target, which realizes the reuse of the written test cases, reduces the writing workload and improves the test case generation efficiency.
[0069] Figure 2 This is a flowchart of target test case generation provided by the embodiment of the present application. Figure 2As shown, the specific steps include:
[0070] S201, determining the game test step execution priority and SDK test step execution priority of the test target according to the game logic of the game to be tested.
[0071] The execution priority of the game test steps can be the order in which the various game test steps are executed. For example, the prerequisite for a player to kill monsters in area A is that the player first enters the map of area A. Therefore, the priority of entering the map of area A is higher than the priority of killing monsters. The execution priority of the SDK test steps can be the order in which the various interfaces or tools in the SDK are called when testing the SDK.
[0072] In one embodiment, the game execution order when testing the test target can be determined according to the game logic of the game to be tested, the interface or tool required to be called for each game execution step can be determined according to the execution target of each game execution step, the game test step execution priority can be determined according to the game execution order, and the SDK test step execution priority can be determined according to the interface or tool required to be called for each game execution step.
[0073] S202, adjusting the test steps of the candidate game test cases according to the game test step execution priority to obtain a first test step, and adjusting the test steps of the candidate SDK test cases according to the SDK test step execution priority to obtain a second test step.
[0074] The first test step may be a step in which the test steps of the candidate game test case are adjusted according to the game test step execution priority. The second test step may be a step in which the test steps of the candidate SDK test case are adjusted according to the SDK test step execution priority.
[0075] In one embodiment, the order of each test step in the candidate game test case can be determined according to the execution priority of the game test step, and each test step in the candidate game test case can be adjusted according to the order to obtain the first test step. The order of each test step in the candidate SDK test case can be determined according to the execution priority of the SDK test step, and each test step in the candidate SDK test case can be adjusted according to the order to obtain the second test step.
[0076] In one embodiment, optionally, before adjusting the test steps of the candidate game test cases according to the game test step execution priority to obtain the first test step, the method further includes:
[0077] Calculate the similarity of the test steps between the test cases in the candidate game test cases, and determine whether the similarity of the test steps is greater than a preset similarity threshold;
[0078] If the similarity of the test steps is greater than a preset similarity threshold, at least one test step is deleted.
[0079] The preset similarity threshold may be a preset maximum value of similarities between different game test steps.
[0080] In one embodiment, since there may be multiple candidate game test cases, when the test steps in multiple candidate game test cases need to be integrated, the repeated steps need to be deleted. Each test step in the candidate game test case can be converted into vector data, and the similarity between the test steps in the candidate game test case is determined by calculating the similarity between the vector data, and whether the similarity of the test steps is greater than the preset similarity threshold is determined by comparing whether the difference between the similarity of the test steps and the preset similarity threshold is greater than 0. If the difference is greater than 0, it means that the two test steps corresponding to the similarity are the same, and at least one test step needs to be deleted.
[0081] This solution calculates the similarity of the test steps between each test case in the candidate game test case, compares the similarity of the test steps with a preset similarity threshold, and deletes at least one test step. This can avoid the problem of repeated steps in the test steps, further improve the accuracy of the test steps, and thus improve the accuracy of the test cases.
[0082] S203, integrating the first test step and the second test step according to the set test case writing logic to generate a target test case.
[0083] In one embodiment, the test case writing framework and the test order of the first test step and the second test step are determined according to the test case writing logic, and the first test step and the second test step are filled into the writing framework according to the test order to generate the target test case. The test order of the first test step and the second test step includes testing the first test step and the second test step in sequence and testing the first test step and the second test step at the same time.
[0084] The technical solution provided in the embodiment of the present application determines the game test step execution priority and SDK test step execution priority of the test target through the game logic of the game to be tested, adjusts and integrates the test steps of candidate game test cases and candidate SDK test cases according to the test step execution priority to generate a target test case, thereby achieving the purpose of adapting the test case steps according to different games, thereby improving the applicability of the present solution and the accuracy of test case generation.
[0085] Figure 3 This is a flow chart integrating the test steps provided in the embodiment of the present application. Figure 3 As shown, the specific steps include:
[0086] S301, determining the test case structure, filling rules, and execution order between the first test step and the second test step of the target test case according to the set test case writing logic.
[0087] Among them, the use case structure can be a framework structure for writing test cases. The use case structure at least includes: use case title, preconditions, test steps and expected results. The filling rules can be the data format and filling method when filling the corresponding data in the candidate test case into the use case structure. The filling methods include drag-and-drop filling and text input. The execution order between the first test step and the second test step can be the order in which the first test step and the second test step are executed. The execution order between the first test step and the second test step includes sequential execution and simultaneous execution.
[0088] In one embodiment, the case structure, filling rules and execution order between the first test step and the second test step of the target test case can be determined according to the content of the field representing the test case writing method in the test case writing logic.
[0089] In one embodiment, optionally, before determining the test case structure, filling rules, and execution order between the first test step and the second test step of the target test case according to the set test case writing logic, the method further includes:
[0090] Determine the version information of the game to be tested according to the configuration parameters of the game to be tested, determine the first execution version information of the first test step according to the game test case identifier, and determine the second execution version information of the second test step according to the SDK test case identifier;
[0091] Identify whether the version information of the game to be tested is compatible with the first execution version information and the second execution version information;
[0092] If the version information of the game to be tested is incompatible with the first execution version information and / or the second execution version information, the incompatible test steps are deleted, and at least two candidate test cases that meet the test objectives are searched again from the pre-built test case library.
[0093] Among them, the version information of the game to be tested can be information used to indicate the update or repair stage that the game to be tested is currently in. The version information of the game to be tested can be represented by a version number. The update of the game version will bring new game content, new game systems and new game functions, and will also put forward higher requirements on the system configuration of the operation. The minimum configuration requirements of the system running the game to be tested can be determined based on the version information of the game to be tested. The first execution version information can be the version information of the game that can be tested by the candidate game test case. The second execution version information can be the version information of the game supported by the SDK that can be tested by the candidate SDK test case.
[0094] In one embodiment, since the update of the game version corresponds to the update of the game configuration parameters, the version information of the game to be tested can be determined according to the configuration parameter values related to the game version in the configuration parameters of the game to be tested, the game configuration that can be tested by the test case can be determined according to the game test case identifier, and the first execution version information that can be tested by the test case can be determined according to the game configuration that can be tested by the test case. The SDK configuration that can be tested by the test case can be determined according to the SDK test case identifier, and the second execution version information that can be tested by the test case can be determined according to the SDK configuration that can be tested by the test case.
[0095] By comparing the version information of the game to be tested with the first execution version information and the second execution version information, it is determined whether the version of the game to be tested is lower than or equal to the first execution version information and the second execution version information. If it is lower than or equal to, the version information of the game to be tested is compatible with the first execution version information and the second execution version information, otherwise it is incompatible.
[0096] If the version information of the game to be tested is incompatible with the first execution version information and / or the second execution version information, the test case corresponding to the incompatible execution version information cannot test the game to be tested. At this time, the incompatible test steps in the first test step and / or the second test step can be deleted, and at least two candidate test cases that meet the test objectives can be re-searched from the pre-built test case library based on the version information of the game to be tested.
[0097] This solution, by determining and comparing whether the version information of the game to be tested is compatible with the execution version information of the candidate test cases, deletes the incompatible test steps and re-searches at least two candidate test cases that meet the test objectives from a pre-built test case library. This can avoid the problem that the generated test cases cannot test the test objectives due to incompatibility between the test case version and the game version, thereby improving the success rate of test case generation.
[0098] S302: Merge the first test step and the second test step based on the execution order to obtain a target test step of the target test case.
[0099] The target test step may be a step obtained by merging the first test step and the second test step in the execution order;
[0100] In one embodiment, each step in the first test step and the second test step may be combined in execution order to obtain a target test step for testing the test target.
[0101] S303, reading each test case information in the candidate test case, and filling the test case information and target test steps into the case structure according to the filling rule to obtain the target test case.
[0102] The various test case information may be information used to indicate the execution condition and execution process of the candidate test case, such as case title information, precondition information, test step information, and expected result information.
[0103] In one embodiment, the test case information of each item in the candidate test case can be read according to the content prompt field in the candidate test case, and the test case information of each item and the target test steps can be filled into the case structure according to the filling rules to obtain the target test case.
[0104] The technical solution provided in the embodiment of the present application merges the first test step and the second test step through the test case writing logic to obtain the target test step of the target test case, and fills the test case information and the target test step into the case structure according to the filling rules to obtain the target test case. This can achieve the purpose of integrating game test cases and SDK test cases, and merges and generates target test cases without writing a whole set of test cases, thereby reducing the workload of testers in writing.
[0105] Figure 4 : is a flowchart of candidate test case search provided by the embodiment of the present application. Figure 4 As shown, the specific steps include:
[0106] S401, identifying whether there is a test case identical to the game test case identifier and the SDK test case identifier in the pre-built test case library.
[0107] In one embodiment, the identification field in the game test case identification can be used as the first keyword, and a keyword search method can be used to search for test cases identical to the first keyword in a pre-built test case library. The identification field in the SDK test case identification can be used as the second keyword, and a keyword search method can be used to search for test cases identical to the second keyword in a pre-built test case library.
[0108] S402: If there is a test case with the same game test case identifier and SDK test case identifier in the test case library, the test case is taken as a candidate test case that meets the test objectives.
[0109] In one embodiment, if a test case with the same identifier as a game test case and a test case with the same identifier as an SDK test case are found in the test case library respectively, the test case with the same identifier as the game test case and the test case with the same identifier as the SDK test case will be regarded as candidate test cases that meet the test objectives.
[0110] S403, if there is no test case with the same test case identifier as the game test case identifier and / or the SDK test case identifier in the test case library, determine the preconditions of the test target according to the configuration parameters, calculate the game test cases and / or SDK test cases in the test case library that are most similar to the preconditions of the test target, and rewrite the game test cases and / or SDK test cases in the test case library that are most similar to the preconditions of the test target based on the preconditions of the test target to obtain at least two candidate test cases that meet the test target.
[0111] The preconditions of the test target can be specific conditions or environment settings that the current system needs to meet before executing the test cases of the test target. The preconditions of the test target include software environment, hardware environment, data configuration, prerequisites, execution order, etc.
[0112] In one embodiment, if there is no test case in the test case library that is identical to the game test case identifier and / or the SDK test case identifier, it means that the test case in the test case library cannot be used directly at this time. Since the precondition is a description of the system status, and the system status is related to the game configuration, the higher the game configuration, the higher the requirement for the system status during testing. Therefore, the test case with a configuration that meets the test objectives can be obtained by rewriting the test case with a high degree of precondition similarity.
[0113] Determine the minimum system state requirement when the test target is tested according to the configuration parameters, and use the minimum system state requirement as the precondition of the target test case. Calculate the first similarity between the precondition of the target test case and the precondition of at least two game test cases in the test case library, and compare the game test case with the highest similarity among the at least two first similarities as the game test case to be rewritten. Calculate the second similarity between the precondition of the target test case and the precondition of at least two SDK test cases in the test case library, and compare the SDK test case with the highest similarity among the at least two second similarities as the SDK test case to be rewritten. According to the association between the precondition and the test step in the test case, rewrite the associated test steps with different preconditions in the preconditions of the test target and the game test case and / or SDK test case to be rewritten to obtain at least two candidate test cases that meet the test target.
[0114] In one embodiment, optionally, based on the preconditions of the test target, the game test cases and / or SDK test cases in the test case library with the highest similarity to the preconditions of the test target are rewritten, including:
[0115] Identify a first precondition in the test case to be rewritten whose similarity with the precondition of the test target does not meet a preset similarity threshold;
[0116] Determine the association relationship between the test steps and the preconditions in the test case to be rewritten according to the writing logic of the test case, and determine the test step to be rewritten associated with the first precondition according to the association relationship;
[0117] Rewrite the test steps to be rewritten according to the prerequisites of the test target.
[0118] Among them, the preset similarity threshold can be the value of the maximum similarity of the same pre-set preconditions. The first precondition can be a precondition in the test case to be rewritten whose precondition similarity with the test target does not meet the preset similarity threshold. The association relationship between the test step and the precondition can be the execution method of the test step under the limitation of the precondition. For example: the operations that the test step can or must perform, the operations that the test step is prohibited from performing, how the test step is executed, etc. The test step to be rewritten can be a test step that is limited or affected by the first precondition.
[0119] In one embodiment, the similarity between each precondition in the test case to be rewritten and the precondition corresponding to the test target can be calculated, and the similarity can be compared to see if it is greater than a preset similarity threshold, and the precondition in the test case to be rewritten whose similarity is greater than the preset similarity threshold is used as the first precondition. According to the writing logic of the test case, the execution mode of each test step under the precondition of the test case to be rewritten, that is, the association relationship between the test step and the precondition, is determined, and the test step to be rewritten associated with the first precondition is determined according to the association relationship. The test step to be rewritten is rewritten according to the precondition of the test target, for example: deleting the test steps prohibited by the precondition of the test target, adding the test steps necessary for the precondition of the test target, and partially modifying the test steps. For adding test steps or modifying test steps, a test case generation model can be created in advance, and the test case generation model is trained by the test cases in the pre-built test case library, and the test steps to be rewritten are input into the trained test case generation model to obtain the rewritten test steps.
[0120] This solution determines the test steps to be rewritten by identifying the similarity between the test cases to be rewritten and the preconditions of the test target, and rewrites the test steps to be rewritten according to the preconditions of the test target. This can avoid the problem of rewriting the entire set of test cases and the test cases not meeting the test requirements, and improves the reuse of the written test cases while ensuring the accuracy of the test cases.
[0121] The technical solution provided in the embodiment of the present application can improve the reuse of written test cases and ensure the generation of test cases by identifying whether there are test cases with the same game test case identifier and SDK test case identifier in a pre-built test case library, and determining the test cases with the same identifier as candidate test cases that meet the test objectives, or when there are no test cases with the same game test case identifier and / or SDK test case identifier in the test case library, rewriting the test cases according to the similarity between the preconditions of the test targets to obtain at least two candidate test cases.
[0122] Figure 5 is a structural block diagram of a device for generating game test cases provided in an embodiment of the present application. Figure 5 As shown, specifically including the following:
[0123] The test target determination module 501 is used to receive the test requirement information of the game to be tested, and determine the test target of the game to be tested according to the test requirement information;
[0124] The test case identification determination module 502 is used to read the configuration parameters of the game to be tested, and determine the game test case identification and SDK test case identification corresponding to the test target according to the configuration parameters;
[0125] The candidate test case search module 503 is used to search at least two candidate test cases that meet the test objectives from a pre-built test case library according to the game test case identifier and the SDK test case identifier; the candidate test cases include: candidate game test cases and candidate SDK test cases;
[0126] The target test case generation module 504 is used to generate a target test case by integrating candidate test cases based on the set test case writing logic and the game logic of the game to be tested.
[0127] Furthermore, the target test case generation module 504 is specifically used for:
[0128] Determine the game test step execution priority and SDK test step execution priority of the test target according to the game logic of the game to be tested;
[0129] The test steps of the candidate game test cases are adjusted according to the execution priority of the game test steps to obtain a first test step, and the test steps of the candidate SDK test cases are adjusted according to the execution priority of the SDK test steps to obtain a second test step;
[0130] The first test step and the second test step are integrated according to the set test case writing logic to generate a target test case.
[0131] Furthermore, the device also includes:
[0132] A similarity calculation module is used to calculate the similarity of the test steps between the test cases in the candidate game test cases, and determine whether the similarity of the test steps is greater than a preset similarity threshold;
[0133] The step deletion module is used to delete at least one test step if the similarity of the test steps is greater than a preset similarity threshold.
[0134] Furthermore, the target test case generation module 504 is specifically used for:
[0135] Determine the test case structure, filling rules and execution order between the first test step and the second test step of the target test case according to the set test case writing logic;
[0136] Merge the first test step and the second test step based on the execution order to obtain a target test step of the target test case;
[0137] Read the test case information of each candidate test case, and fill the test case information and target test steps into the case structure according to the filling rules to obtain the target test case.
[0138] Furthermore, the target test case generation module 504 is specifically used for:
[0139] Determine the version information of the game to be tested according to the configuration parameters of the game to be tested, determine the first execution version information of the first test step according to the game test case identifier, and determine the second execution version information of the second test step according to the SDK test case identifier;
[0140] Identify whether the version information of the game to be tested is compatible with the first execution version information and the second execution version information;
[0141] If the version information of the game to be tested is incompatible with the first execution version information and / or the second execution version information, the incompatible test steps are deleted, and at least two candidate test cases that meet the test objectives are searched again from the pre-built test case library.
[0142] Furthermore, the candidate test case search module 503 is specifically used for:
[0143] Identify whether there is a test case identical to the game test case ID and the SDK test case ID in the pre-built test case library;
[0144] If there is a test case with the same game test case ID and SDK test case ID in the test case library, the test case will be regarded as a candidate test case that meets the test objectives;
[0145] If there is no test case with the same test case identifier and / or SDK test case identifier in the test case library, the prerequisite of the test target is determined according to the configuration parameters, and the game test cases and / or SDK test cases in the test case library with the highest similarity to the prerequisite of the test target are calculated. Based on the prerequisite of the test target, the game test cases and / or SDK test cases in the test case library with the highest similarity to the prerequisite of the test target are rewritten to obtain at least two candidate test cases that meet the test target.
[0146] Furthermore, the candidate test case search module 503 is specifically used for:
[0147] Identify a first precondition in the test case to be rewritten whose similarity with the precondition of the test target does not meet a preset similarity threshold;
[0148] Determine the association relationship between the test steps and the preconditions in the test case to be rewritten according to the writing logic of the test case, and determine the test step to be rewritten associated with the first precondition according to the association relationship;
[0149] Rewrite the test steps to be rewritten according to the prerequisites of the test target.
[0150] The technical solution provided in the embodiment of the present application includes a test target determination module, which is used to receive test requirement information of a game to be tested, and determine the test target of the game to be tested according to the test requirement information; a test case identification determination module, which is used to read the configuration parameters of the game to be tested, and determine the game test case identification and SDK test case identification corresponding to the test target according to the configuration parameters; a candidate test case search module, which is used to search at least two candidate test cases that meet the test target from a pre-built test case library according to the game test case identification and the SDK test case identification; the candidate test cases include: candidate game test cases and candidate SDK test cases; a target test case generation module, which is used to generate a target test case by integrating the candidate test cases based on the set test case writing logic and the game logic of the game to be tested. Through the above-mentioned game test case generation device, the problems of poor test case reusability, high labor cost and low writing efficiency in the prior art are solved. By searching at least two candidate test cases that meet the test objectives from a pre-built test case library, the candidate test cases are integrated based on the test case writing logic and the game logic of the game to be tested to generate the target test case of the test objective, the reuse of the written test cases is achieved, the writing workload is reduced and the test case generation efficiency is improved.
[0151] A generation device of a game test case in the embodiment of the present application can be configured in a device, and can also be configured in a component, an integrated circuit, or a chip in a terminal. The device can be a mobile electronic device, or a non-mobile electronic device. Exemplary, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0152] A device for generating a game test case in an embodiment of the present application may be an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0153] A device for generating a game test case provided in an embodiment of the present application can implement each process implemented in the above-mentioned method embodiments. To avoid repetition, it will not be described again here.
[0154] like Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601, a memory 602, and a program or instruction stored in the memory 602 and executable on the processor 601. When the program or instruction is executed by the processor 601, each process of the above-mentioned method for generating a game test case is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0155] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0156] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned game test case generation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0157] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0158] The present application embodiment further provides a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device can execute a method for generating a game test case described in the present application embodiment. The program product can be implemented in any combination of one or more readable media.
[0159] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0161] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0162] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A method for generating a game test case, characterized in that: The method comprises: Receive test requirement information of the game to be tested, and read the test target field in the test requirement information to determine the test target of the game to be tested; Read the configuration parameters of the game to be tested, and determine the game test case identifier and SDK test case identifier corresponding to the test target according to the configuration parameters; Searching for at least two candidate test cases that meet the test objective from a pre-built test case library according to the game test case identifier and the SDK test case identifier, including: identifying whether there is a test case identical to the game test case identifier and the SDK test case identifier in the pre-built test case library; if there is a test case identical to the game test case identifier and the SDK test case identifier in the test case library, taking the test case as a candidate test case that meets the test objective; if there is no test case identical to the game test case identifier and / or the SDK test case identifier in the test case library, determining the pre-condition of the test objective according to the configuration parameters, and calculating the game in the test case library with the highest similarity to the pre-condition of the test objective. Test cases and / or SDK test cases, based on the preconditions of the test target, case rewriting is performed on the game test cases and / or SDK test cases in the test case library that have the highest similarity to the preconditions of the test target, to obtain at least two candidate test cases that meet the test target, which includes: identifying a first precondition in the test case to be rewritten whose similarity to the precondition of the test target does not meet a preset similarity threshold, determining the association relationship between the test steps and the preconditions in the test case to be rewritten according to the test case writing logic, determining the test steps to be rewritten associated with the first precondition according to the association relationship, and rewriting the test steps to be rewritten according to the preconditions of the test target, the candidate test cases include: candidate game test cases and candidate SDK test cases; The target test case is generated by integrating the candidate test cases based on the set test case writing logic and the game logic of the game to be tested, which includes: determining the test step execution priority of the test target based on the game logic of the game to be tested, adjusting the test steps of the candidate test cases based on the test step execution priority, and integrating the test step adjustment results of the candidate test cases based on the set test case writing logic to generate the target test case.
2. The method for generating a game test case according to claim 1, characterized in that: The test case writing logic based on the setting and the game logic of the game to be tested are integrated with the candidate test cases to generate target test cases, including: Determine the game test step execution priority and SDK test step execution priority of the test target according to the game logic of the game to be tested; According to the execution priority of the game test step, the test step of the candidate game test case is adjusted to obtain a first test step; according to the execution priority of the SDK test step, the test step of the candidate SDK test case is adjusted to obtain a second test step; The first test step and the second test step are integrated according to the set test case writing logic to generate a target test case.
3. The method for generating game test cases according to claim 2, characterized in that: Before adjusting the test steps of the candidate game test case according to the game test step execution priority to obtain the first test step, the method further includes: Calculating the similarity of the test steps between the test cases in the candidate game test cases, and determining whether the similarity of the test steps is greater than a preset similarity threshold; If the similarity of the test steps is greater than a preset similarity threshold, at least one of the test steps is deleted.
4. The method for generating a game test case according to claim 2, characterized in that: The step of integrating the first test step and the second test step according to the set test case writing logic to generate a target test case includes: Determine the test case structure, filling rules and the execution order between the first test step and the second test step of the target test case according to the set test case writing logic; Merging the first test step and the second test step based on the execution order to obtain a target test step of a target test case; The test case information of each item in the candidate test case is read, and the test case information and the target test steps are filled into the case structure according to the filling rule to obtain the target test case.
5. The method for generating game test cases according to claim 4, characterized in that: Before determining the case structure, filling rules and the execution order between the first test step and the second test step of the target test case according to the set test case writing logic, the method further includes: Determine the version information of the game to be tested according to the configuration parameters of the game to be tested, determine the first execution version information of the first test step according to the game test case identifier, and determine the second execution version information of the second test step according to the SDK test case identifier; Identify whether the version information of the game to be tested is compatible with the first execution version information and the second execution version information; If the version information of the game to be tested is incompatible with the first execution version information and / or the second execution version information, the incompatible test steps are deleted, and at least two candidate test cases that meet the test objectives are searched again from the pre-built test case library.
6. A device for generating game test cases, characterized in that: The device comprises: A test target determination module, used to receive test requirement information of a game to be tested, and determine a test target of the game to be tested according to the test requirement information; A test case identification determination module, used to read the configuration parameters of the game to be tested, and determine the game test case identification and SDK test case identification corresponding to the test target according to the configuration parameters; A candidate test case search module is used to search for at least two candidate test cases that meet the test target from a pre-built test case library according to the game test case identifier and the SDK test case identifier, which includes: identifying whether there is a test case identical to the game test case identifier and the SDK test case identifier in the pre-built test case library; if there is a test case identical to the game test case identifier and the SDK test case identifier in the test case library, then the test case is used as a candidate test case that meets the test target; if there is no test case identical to the game test case identifier and / or the SDK test case identifier in the test case library, then determining the precondition of the test target according to the configuration parameters, and calculating the preconditions in the test case library that are similar to the preconditions of the test target. The game test cases and / or SDK test cases with the highest similarity to the preconditions of the test target are rewritten based on the preconditions of the test target to obtain at least two candidate test cases that meet the test target, which include: identifying a first precondition in the test case to be rewritten whose similarity to the precondition of the test target does not meet a preset similarity threshold, determining an association relationship between a test step and a precondition in the test case to be rewritten according to the writing logic of the test case, determining a test step to be rewritten associated with the first precondition according to the association relationship, and rewriting the test step to be rewritten according to the preconditions of the test target, wherein the candidate test cases include: candidate game test cases and candidate SDK test cases; A target test case generation module is used to generate a target test case by integrating the candidate test cases based on the set test case writing logic and the game logic of the game to be tested, which includes: determining the test step execution priority of the test target based on the game logic of the game to be tested, adjusting the test steps of the candidate test cases based on the test step execution priority, and integrating the test step adjustment results of the candidate test cases based on the set test case writing logic to generate a target test case.
7. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of a method for generating a game test case as described in any one of claims 1 to 5 are implemented.
8. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of a method for generating a game test case as described in any one of claims 1-5 are implemented.
Citation Information
Patent Citations
Game automation test method and device, terminal and computer storage medium
CN110781085A
Software development kit SDK test method and related equipment
CN112433940A