Test Method, Device, Equipment, Medium and Computer Program Product for an Application
Testing by the remote server controls the application client of the execution terminal, the problem of data sharing of multiple clients in complex use case scenarios is solved, and efficient testing efficiency and coordinated testing task execution is achieved.
Patent Information
- Application Number
- CN202111624072.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-12-03
- Filing Date
- 2021-12-28
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2041-12-28
AI Technical Summary
When performing application testing of complex use case scenarios in the prior art, the data and status of multiple clients cannot be shared, resulting in low testing efficiency.
The remote server controls the application client in the execution terminal to perform the test. The server receives the test task information, determines and sends the execution step information to the execution terminal, receives and integrates the test data returned by the execution terminal, and generates the test results.
It realizes efficient testing of complex use cases, improves testing efficiency, and can integrate data from multiple clients into the server to coordinate the execution of concurrent testing tasks.
Smart Images

Figure CN114328217B_ABST
Abstract
Description
[0001] This application claims the priority of a Chinese patent application with the application number 202111465838.4 and the invention title "Testing Method, Device, Equipment, Medium and Computer Program Product for Applications" filed on December 03, 2021, the entire content of which is incorporated herein by reference. Technical Field
[0002] This application relates to the field of computer technology, and particularly to a testing method, device, equipment, medium and computer program product for applications. Background Art
[0003] Testing of applications is a key process for ensuring the quality of applications. Application testing can promptly detect current program errors (Bugs) in applications, facilitating the subsequent formulation of corresponding solutions.
[0004] Taking the above application as a game application as an example, the current application testing method based on test script driving is to use automated testing tools such as GAutomator and AirTest based on game UI (User Interface) controls, use the local computer environment, interact with the mobile device for running the client by connecting the tool, execute test cases in the local computer environment, and the local computer makes logical judgments based on the content returned by the game server to obtain test results.
[0005] However, in the application testing process implemented in the above manner, for complex use case scenarios (such as teaming, trading, multi-player game interactions, etc.), since the data and states between the mobile devices of multiple clients cannot be shared, some strongly collaborative testing scenarios cannot be efficiently completed, and the testing efficiency for complex use case scenarios is relatively low. Summary of the Invention
[0006] Embodiments of this application provide a testing method, device, equipment, medium and computer program product for applications, which can automatically implement the application testing process and improve the testing efficiency for complex use case scenarios. The technical solutions are as follows:
[0007] On the one hand, a testing method for applications is provided, and the method includes:
[0008] Receiving test task information, where the test task information is used to indicate a target task for testing a target application;
[0009] Determining execution step information corresponding to the target task based on the test task information, where the execution step information includes execution steps for completing the target task;
[0010] Send the execution step information to the execution terminal corresponding to the target application, where the execution step information is used to instruct the execution terminal to run the target application to complete the execution steps;
[0011] Receive the test data returned by the execution terminal, where the test data is the data generated after completing the execution steps;
[0012] Generate a test result based on the test data, where the test result is used to indicate the test completion degree of the target application for the target task.
[0013] On the other hand, a test device for an application is provided. The device includes:
[0014] A receiving module, configured to receive test task information, where the test task information is used to indicate a target task for testing a target application;
[0015] A determining module, configured to determine execution step information corresponding to the target task based on the test task information, where the execution step information includes execution steps for completing the target task;
[0016] A sending module, configured to send the execution step information to the execution terminal corresponding to the target application, where the execution step information is used to instruct the execution terminal to run the target application to complete the execution steps;
[0017] The receiving module is further configured to receive the test data returned by the execution terminal, where the test data is the data generated after completing the execution steps;
[0018] A generating module, configured to generate a test result based on the test data, where the test result is used to indicate the test completion degree of the target application for the target task.
[0019] On the other hand, a computer device is provided. The terminal includes a processor and a memory. At least one instruction, at least one program, a code set, or an instruction set is stored in the memory. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement any one of the application test methods in the embodiments of the present application.
[0020] On the other hand, a computer-readable storage medium is provided. At least one program code is stored in the computer-readable storage medium. The program code is loaded and executed by the processor to implement any one of the application test methods in the embodiments of the present application.
[0021] On the other hand, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the test method of the application described in any one of the foregoing embodiments.
[0022] The technical solutions provided in this application at least include the following beneficial effects:
[0023] When it is necessary to test a target application, the server sends the execution steps corresponding to the target task to the execution terminal according to the test task information, and the server generates a test result based on the test data returned by the execution terminal after completing the execution steps. That is, by adopting the method of using a remote server to control the application client in the execution terminal for testing, the data of multiple clients can be integrated into the server, better coordinating the execution of concurrent test tasks, thereby automatically realizing the test process of the application and improving the test efficiency of complex use case scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0025] Figure 1 It is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0026] Figure 2 It is a flowchart of a test method for an application provided by an exemplary embodiment of the present application;
[0027] Figure 3 It is a flowchart of a test method for an application provided by another exemplary embodiment of the present application;
[0028] Figure 4 It is a schematic diagram of a target test case where the target task corresponds to a charged attack - block provided by an exemplary embodiment of the present application;
[0029] Figure 5 It is a schematic diagram of an execution terminal provided by an exemplary embodiment of the present application;
[0030] Figure 6 It is a schematic diagram of a tool server provided by an exemplary embodiment of the present application;
[0031] Figure 7It is a schematic diagram of the automated test process of an application provided by an exemplary embodiment of the present application;
[0032] Figure 8 It is a flowchart of the method for generating test cases provided by an exemplary embodiment of the present application;
[0033] Figure 9 It is a flowchart of the preliminary preparation provided by an exemplary embodiment of the present application;
[0034] Figure 10 It is a timing diagram of the automated test provided by an exemplary embodiment of the present application;
[0035] Figure 11 It is a block diagram of the test device of an application provided by an exemplary embodiment of the present application;
[0036] Figure 12 It is a block diagram of the test device of an application provided by another exemplary embodiment of the present application;
[0037] Figure 13 It is a schematic diagram of the structure of a server provided by an exemplary embodiment of the present application. Detailed implementation manners
[0038] To make the objectives, technical solutions, and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0039] First, the implementation environment of the embodiments of the present application will be described. As Figure 1 shown, the implementation environment includes: an execution terminal 110, an application server 120, a tool server 130, and a communication network 140.
[0040] The execution terminal 110 includes various types of terminal devices such as mobile phones, tablet computers, desktop computers, portable laptops, handheld game consoles, and home game consoles. A target application runs on the execution terminal 110. In some embodiments, the target application includes an application with multi-terminal interaction capabilities. Optionally, the above-mentioned target application can be an independent application program, a web application, or a mini-program in a host application, which is not limited herein. Optionally, when the target application is a game application, the target application can be any one of applications such as virtual reality application programs, three-dimensional map programs, Third-Personal Shooting Games (TPS), First-Person Shooting Games (FPS), and Multiplayer Online Battle Arena Games (MOBA). Optionally, the number of execution terminals 110 is determined by the test task, and can be one or more, which is not limited herein.
[0041] The application server 120 is used to provide backend support for the above-mentioned execution terminal 110 to run the target application. Taking the target application as a game application as an example, the application server 120 provides backend game logic for the target application. In some embodiments, the target application includes frontend game logic and backend game logic. The frontend game logic is completed by the game client installed in the execution terminal 110, and the backend game logic is completed by the application server 120.
[0042] The tool server 130 is used to provide the test function of the target application. Schematically, the tool server 130 receives the test task information uploaded by the above-mentioned execution terminal 110 or other terminals, determines the execution step information according to the test task information, distributes the execution step information to the execution terminal 110. The execution terminal 110 runs the target application according to the above-mentioned execution step information. The target application performs data interaction with the application server 120 during the running process to complete the execution steps. The execution terminal 110 uploads the cached interaction data and the data returned by the application engine call interface as test data to the tool server 130, and the tool server 130 generates a test result according to the test data.
[0043] Optionally, the application server 120 and the tool server 130 can be different functional modules in the same server, or can be independent servers, which is not limited herein.
[0044] It should be noted that the above application server 120 or tool server 130 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0045] Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data calculation, storage, processing, and sharing. Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark and needs to be transmitted to the background system for logical processing. Data at different levels will be processed separately, and various industry data requires the support of a powerful system background, which can only be achieved through cloud computing.
[0046] In some embodiments, the above application server 120 or tool server 130 can also be implemented as a node in a blockchain system. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. Blockchain, essentially a decentralized database, is a series of data blocks associated using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity (anti-counterfeiting) of the information and generate the next block. Blockchain can include the blockchain underlying platform, platform product service layer, and application service layer.
[0047] The underlying blockchain platform may include processing modules such as a management module, basic services, smart contracts, and operations. Among them, the management module is responsible for the information management of all blockchain participants, including maintaining the generation of public and private keys, key management, etc.; the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and after consensus on valid requests, record them on the storage. For a new business request, the basic service first performs interface adaptation parsing and authentication processing (interface adaptation), then encrypts the business information through a consensus algorithm (consensus management), transmits it intact and consistently to the shared ledger after encryption (network communication), and records and stores it; the smart contract module is responsible for the registration and issuance of contracts, contract triggering, and contract execution. Developers can define contract logic through a certain programming language, publish it to the blockchain (contract registration), trigger execution according to the logic of the contract terms by calling keys or other events, complete the contract logic, and also provide functions for contract upgrade and cancellation; the operations module is mainly responsible for deployment, configuration modification, contract setting, cloud adaptation during the product release process, and visual output of the real-time status during product operation.
[0048] Schematically, between the execution terminal 110 and the application server 120, or between the execution terminal 110 and the tool server 130, they are connected through the communication network 140.
[0049] Secondly, a schematic description is given of the application scenario of the application testing method provided by the embodiments of the present application.
[0050] Optionally, the application testing method provided by the embodiments of the present application can be applied to an application scenario of multi-terminal interaction, that is, the number of execution terminals in a single test process corresponding to the test task is multiple, and the execution terminals interact through the application server. Taking the target application as an online game application as an example, when it is necessary to test functions with multi-terminal interaction such as the team formation function, trading function, and combat function provided by the game application, the tool server sends the execution step information to multiple execution terminals participating in the test according to the test task, and generates test results based on the test data returned by the multiple execution terminals, so that the data of multiple clients can be integrated into the server, and the execution of concurrent test tasks can be better coordinated.
[0051] Optionally, the test method for an application provided by an embodiment of the present application can be applied to an application scenario implemented on a single machine, that is, the number of execution terminals for a single test process corresponding to a test task is one. The tool server sends the execution step information corresponding to the test task to the execution terminal, and generates a test result based on the test data returned by the execution terminal. In this scenario, since the test result is completed by the tool server, the test efficiency can also be improved when it is necessary to test the same test task according to different metrics. In one example, it is necessary to obtain the test results of the execution terminals of the same test task for different platforms. For example, to test the running conditions of a target application on different platforms such as the Android platform, the IOS platform, the Personal Computer (PC) platform, and the host platform (such as a handheld game console, a home game console, etc.), the tool server can obtain the test data of different test processes corresponding to the same test task from multiple platforms respectively, and also perform data analysis to obtain the test result. In another example, if it is necessary to obtain the test results of the same test task for different versions of the target application, the tool server can obtain the test data corresponding to different versions of the target application from the same execution terminal, or obtain the test data corresponding to different versions of the target application from different execution terminals, so as to perform data analysis to obtain the test result.
[0052] Please refer to Figure 2 , which shows the test method for an application shown in an embodiment of the present application. In the embodiment of the present application, this method is described by taking it as an example that it is applied to a tool server as shown in Figure 1 . This method can also be applied to a terminal device, which is not limited here. This method includes:
[0053] Step 201, receive test task information.
[0054] Schematically, the above test task information is used to indicate a target task for testing a target application.
[0055] Optionally, the above target application can be an application such as a game application, a social application, a video application, etc., which is not limited here.
[0056] Optionally, the above test task information may include the task information corresponding to the target task. For example, taking the target application as a game application, the above task information indicates testing the interaction function of charging attack - block. The above test task information may also include device information, user identification (UID), pipeline information, etc. Among them, the above device information may include the hardware information of the execution terminal or the software running platform information (such as Android device, IOS device, PC device), etc. The above UID may be the account identifier of the test account logged in to the target application on the execution terminal by the tester. The above pipeline information is used to indicate the information of the current test task in the application development under the continuous integration pipeline, such as the position of the current test task in the pipeline, the task deployment before and after the pipeline, etc. It can be understood that in the specific implementation manner of this application, for the relevant data such as the above device information, UID, or other data obtained from the terminal device, when the above embodiments of this application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0057] Optionally, the above test task information may be sent by the execution terminal for completing the target task, or may be sent by other terminals. For example, there is a test control terminal for sending the test task information to the tool server and specifying the execution terminal for testing through the test task information.
[0058] Optionally, the above test task information may be sent manually from the terminal device to the tool server, or may be sent automatically from the terminal device to the tool server. For example, when the continuous integration pipeline executes to the point where application testing is required, the terminal device automatically sends the above test task information to the tool server.
[0059] Optionally, the above target task corresponds to a task base class. The task base class of the target task may be a single - person task completed by a single execution terminal, or a multi - person task completed by multiple execution terminals collaborating, or a concurrent task completed by multiple execution terminals in parallel. The target task may also be a combination of multiple task base classes. Specifically, the task base class corresponding to the target task is stored in the tool server, and the task base class of the test task is marked through the task base class label.
[0060] Optionally, the target task also corresponds to a transaction base class (cases), and the transaction base class of the target task consists of one or more identical or different task base classes. For example, the transaction base class corresponding to the target task may include one or more of a movement transaction, a turning transaction, an attack transaction, etc., that is, the relationship between the task base class and the transaction base class is 1:n, where n is a positive integer. Specifically, the transaction base class corresponding to the target task is stored in the tool server, and the transaction base class of the test task is marked by a transaction base class label.
[0061] Optionally, the target task also corresponds to a use case base class, and the use case base class of the target task consists of one or more identical or different transaction base classes, that is, the relationship between the transaction base class and the use case base class is 1:n, where n is a positive integer. Specifically, the use case base class corresponding to the target task is stored in the tool server, and the use case base class of the test task is marked by a use case base class label.
[0062] In some embodiments, the task base class, the transaction base class, and the use case base class corresponding to the above target task are all saved and serialized in the database.
[0063] Step 202, determine the execution step information corresponding to the target task based on the test task information.
[0064] Schematically, the tool server determines what test task the execution terminal needs to execute according to the test task information uploaded by the execution terminal, so as to determine the corresponding execution step information. The above execution step information includes the execution steps for completing the target task.
[0065] In some embodiments, test cases are pre-stored in the tool server. After receiving the above test task information, the tool server determines the target test case corresponding to the target task according to the test task information, and parses the target test case to obtain the execution step information for completing the target task. Schematically, the target test case is obtained according to the test task information, the target test case is parsed into an execution step set, and the execution step information is generated based on the execution step set.
[0066] Optionally, a test task may correspond to a test case, that is, the relationship between the test task and the test case is one-to-one; or, a test task may correspond to multiple test cases, that is, a test task is composed of a combination of multiple test cases.
[0067] Optionally, the test task information includes the use case identifier of the test case corresponding to the target task, and the tool server can read the corresponding test case from the database through the above use case identifier. In some embodiments, when a test task corresponds to multiple test cases, the test task information also includes the order relationship between the multiple test cases, and the above order relationship includes a serial order and / or a parallel order.
[0068] In some embodiments, after receiving the test task information, the tool server generates execution step information in real time according to the test task information. For example, the tool server determines the function to be tested corresponding to the target task through the task information in the test task information, and generates execution step information according to the implementation steps corresponding to the function to be tested.
[0069] Step 203: Send the execution step information to the execution terminal corresponding to the target application.
[0070] The above execution step information is used to instruct the execution terminal to run the target application to complete the execution steps.
[0071] Optionally, during a single transmission process of the execution step information from the tool server to the execution terminal, the execution step information includes multiple execution steps. After receiving the above execution step information, the execution terminal parses it to obtain the corresponding individual execution steps and the sequence relationship between the execution steps.
[0072] Optionally, during a single transmission process of the execution step information from the tool server to the execution terminal, the execution step information includes a single execution step. Schematically, the tool server encapsulates the execution steps corresponding to the target task into step data packets in sequence and transmits them to the execution terminal in sequence, that is, the execution step information is transmitted through the step data packets.
[0073] In some embodiments, the execution steps in the execution step set corresponding to the target task are encapsulated with a target communication protocol to obtain step data packets, and the step data packets are transmitted to the execution terminal. In one example, the above target communication protocol is Remote Procedure Call (RPC).
[0074] Schematically, after receiving the above execution step information, the execution terminal reflects the execution step information into interaction events and test interface call events.
[0075] Among them, the interaction events include UI interaction events. The execution terminal can automatically control the triggering of the corresponding function controls in the target application according to the reflected UI interaction events. In one example, when the target application is a game application, the interaction events are used to control the virtual objects in the target application to perform target interactions. Schematically, the use of the RPC reflection mechanism can reduce the need for writing test interfaces, that is, the native functions of the test project can be directly used as test interfaces, which is conducive to the separation of testing and development and improves the efficiency of automated testing.
[0076] The above test interface call event is used to drive the application engine or business layer in the target application for testing. Schematically, the above test interface includes interfaces on the application engine or business layer of the target application in the execution terminal, and these interfaces can call the corresponding interface parameters through the reflection ability of C#, or the interface parameters can also be obtained through dynamic parsing. In one example, when the target application is a game application, the above application engine can be the Unity3D engine, Unreal engine, etc., where the above running engine is used to provide functions such as modeling, layout, animation generation, lighting, visual effects, rendering, and synthesis in the target application.
[0077] Schematically, when the above running engine implements the execution steps in the target application, data logic frames will be correspondingly generated, and the execution terminal outputs the above data logic frames through the test interfaces preset in the running engine.
[0078] Step 204, receive the test data returned by the execution terminal.
[0079] Schematically, the above test data is the data generated after completing the execution steps.
[0080] In some embodiments, the execution terminal generates test data by interacting with node data and calling test interface data. The interacting node data is the data recorded after the execution terminal controls the virtual object in the target application to perform the target interaction, and the calling test interface data is the data returned by the test interface after the execution terminal calls the test interface in the application engine according to the test interface call event.
[0081] Optionally, the above interacting node data and calling test data are asynchronously cached by the execution terminal in the message pool.
[0082] Optionally, the above test data can be converted by the execution terminal into data in json format through a preset component, and its corresponding data structure can be an array structure, a map (graph) structure, a tree structure, etc., which are not limited here.
[0083] In some embodiments, after the execution terminal confirms that it has received all the execution step information and all the execution step information has been completed, it correspondingly packages and generates the test data for the target task to upload the test data to the tool server. Or, during the process of running the target application according to the execution step information, the execution terminal sends the data in the message pool to the tool server at a preset frequency.
[0084] Schematically, after receiving the test data returned by the execution terminal, the tool server stores the test data in the target area. The above target area is used to store data corresponding to the virtual object (robot) automatically controlled by the execution terminal, that is, the data uploaded by the execution terminal for testing is stored in the corresponding private domain, which is different from the data storage domain of ordinary user accounts.
[0085] Step 205: Generate test results based on the test data.
[0086] The above test results are used to indicate the completion degree of the test of the target application for the target task.
[0087] Optionally, the determination of the above test completion degree may include determining according to the stage at which the execution steps currently completed by the execution terminal are in the set of execution steps corresponding to the target task. For example, the set of execution steps corresponding to the target task includes 10 execution steps that the execution terminal needs to complete. The tool server determines through the test data returned by the execution terminal that the execution terminal has completed 10 execution steps, and then the corresponding generated test result is that the test completion degree < 100%, and the test completion degree > 100%.
[0088] Optionally, the determination of the above test completion degree may also include that after the execution terminal completes all the execution steps in the set of execution steps, the tool server determines whether there is error data according to the test data returned by the execution terminal, and determines according to the number of error reports. For example, when the tool server determines that the execution terminal has returned all the test data corresponding to all the execution steps of the target task, it compares the test data with the pre-stored standard data to determine whether there is error data. If there is error data, the above test completion degree is determined according to the percentage of the correct data in the total number of data for comparison.
[0089] In some embodiments, the tool server sends the above test results to the execution terminal, and / or the tool server sends the above test results to the test control terminal to provide the test results to the testers.
[0090] In summary, for the application test method provided by the embodiments of the present application, when it is necessary to test the target application, the server sends the execution steps corresponding to the target task to the execution terminal according to the test task information, and the server generates test results based on the test data returned by the execution terminal after the execution terminal completes the execution steps. That is, by using the method of using the remote server to control the application client in the execution terminal for testing, the data of multiple clients can be integrated into the server, and the execution of concurrent test tasks can be better coordinated, so as to automatically implement the test process of the application and improve the test efficiency of complex use case scenarios.
[0091] Please refer to Figure 3 , which shows the application test method shown in an embodiment of the present application. In the embodiment of the present application, the automated test process is schematically described. The method includes:
[0092] Step 301: Receive test task information.
[0093] Optionally, the above test task information may include the task information corresponding to the target task. For example, taking the target application as a game application, the above task information indicates to test the interaction function of charging attack - block. The above test task information may also include device information, user identification, pipeline information, etc. Among them, the above device information may include the hardware information of the execution terminal or the software operation platform (such as, Android device, IOS device, PC device) information, etc. The above UID may be the account identifier of the test account logged in to the target application in the execution terminal by the tester. The above pipeline information is used to indicate the information of the current test task in the application development under the continuous integration pipeline, such as the position of the current test task in the pipeline, the task deployment before and after the pipeline, etc.
[0094] In the embodiment of the present application, the above test task information is automatically sent to the tool server by the execution terminal when the continuous integration pipeline is executed until application testing is required.
[0095] Step 302, obtain the target test case according to the test task information.
[0096] Among them, the above target test case is a pre - made test case.
[0097] Illustratively, the above target test case is made during the preliminary preparation process of the test. Optionally, the above test case may be a case made by the tester through the test control terminal and uploaded to the tool server for corresponding storage. Optionally, the above test case may be a function set corresponding to the case uploaded by the tester through the test control terminal, and the tool server generates test cases according to the preset generation rules.
[0098] Step 303, parse the target test case into a set of execution steps.
[0099] Illustratively, the execution steps in the set of execution steps are used to jointly complete the target test case.
[0100] In some embodiments, when there are multiple execution terminals participating in the target task test, the test task information sent by the tool server to the execution terminal is used to indicate that at least two execution terminals participate in the test. Among them, at least two execution terminals include the target execution terminal. The test task information includes the execution end to which the target execution terminal belongs in the target task. For example, taking the target task to indicate testing the virtual attack - block function, the test task information includes that the target execution terminal is the attacking end (executor) or the hit end (assistant) in the target task.
[0101] Optionally, the target test case is a JSON case or a behavior tree case. In the embodiments of the present application, the target test case stores the execution steps in a tree structure. Schematically, the behavior tree data is extracted from the target test case. The behavior tree data includes the execution steps stored in a tree structure. Based on the execution end to which the target execution terminal belongs in the target task, the execution step set corresponding to the target execution terminal is determined from the behavior tree data.
[0102] In some embodiments, the target test case includes the execution steps that need to be completed by the execution terminal and the execution steps that need to be completed by the tool server.
[0103] In an example, as Figure 4 shown, it shows a schematic diagram of the target test case when the target task corresponds to a charged attack - block. Among them, the main branch 400 includes seven parallel sub - branches, such as the global setting branch 410, the matching process branch 420, the preparation phase branch 430, and the combat branch 440. Among them, the first setting sub - branch (increment the global matching number) 411 in the global setting branch 410 is the global lock operation, which is used to ensure that other non - test terminals do not enter. The second setting branch (compare the parameter global_match_label) 412 is used to control the entry of the execution terminal (teammate execution terminal) that completes the same case as the current execution terminal into the matching, and then the current execution terminal can also enter. In the combat branch 440, the co_label in the first control branch (co_label equals 1) 441 is used to determine whether the robot controlled by the current execution terminal is an assistant or a skill executor, and the second control branch (compare the skill_last_label of the teammate) 442 is used to determine whether the teammate execution terminal is in the charging period. The robot A in the execution terminal A and the robot B in the execution terminal B jointly execute the above - mentioned target test case, and use the global resource lock to ensure that the robots in the same group are matched into the same single game. According to the division of labor, different case branches are executed. The robot A, as an assistant, uses the block skill according to the charging state of the robot B. The robot B, as the main attacker, uses the charged skill to attack the robot A, and jointly completes the realization of the block - attack scenario.
[0104] Step 304, encapsulate the execution steps in the execution step set with the target communication protocol to obtain a step data packet.
[0105] In the embodiments of the present application, the execution steps are encapsulated into step data packets through RPC. Among them, one execution step corresponds to a step data packet of the RPC protocol. By encapsulating the execution steps through the RPC protocol, since RPC is a protocol for requesting services from a remote computer program over a network without the need to understand the underlying network technology, the efficiency of controlling the execution terminal to complete the execution steps through the tool server is improved.
[0106] In some embodiments, the execution terminal requests execution instructions (requests execution step information) from the tool server via the Hyper Text Transfer Protocol (HTTP), and the tool server sends the above-mentioned step data packet to the execution terminal via an HTTP return packet. Schematically, the execution terminal requests execution instructions from the tool server via http at each system clock (tick), where the above tick can be set according to the actual situation and defaults to 500 ms.
[0107] Step 305: Transmit the step data packet corresponding to the execution step to the execution terminal.
[0108] In some embodiments, the tool server sequentially transmits the step data packets to the execution terminal according to the order relationship between the execution steps, and the execution terminal reflects them as UI events. In one example, a solution for handling UI in the Poco library is adopted. The above Poco is a game automation test library based on UI controls, allowing users to customize interfaces such as UI search and UI operations for games.
[0109] Schematically, as Figure 5 shown, the execution terminal 500 includes a test process management module 510, which is used to coordinate the test process corresponding to the target task and control the execution terminal to execute different test processes according to the preset test process. The execution terminal 500 also includes a data reporting module 520, and the functions of the data reporting module 520 include: 1. Reporting engine node data, where the above engine is the application engine of the target application, such as the Unity engine, etc.; 2. Reporting custom data, which includes data such as random numbers used during the operation of the target application. The execution terminal 500 also includes an RPC module 530, and the functions of the RPC module 530 include: 1. UI processing events based on the NGUI plugin; 2. Lua function call interfaces based on the UnLua component; 3. Custom rpc functions (C#). Both the above data reporting module 520 and the RPC module 530 perform data interaction with the packet receiving and sending thread 540 in the execution terminal 500.
[0110] In the embodiments of the present application, the execution terminal uploads the data asynchronously cached in the message pool (data of UI nodes, data returned by calling test interfaces, etc.) to the tool server. Among them, the above test interface is implemented based on the application engine layer, so this test process can achieve compatibility with multi-platform terminals and improve the adaptability of the test solution in different scenarios.
[0111] In some embodiments, after step 305, the following step (1) is further included: receiving test data returned by the execution terminal.
[0112] In the embodiments of the present application, the tool server stores these test data in the private domain of the robot corresponding to the execution terminal, and these data can be accessed through an interface during the execution of the corresponding test cases, so as to achieve the purpose of condition judgment and finally obtain the test results.
[0113] In some embodiments, when the tool server obtains test data from multiple execution terminals, the tool server uses a global lock to enable mutual access to the corresponding private domain data between the execution terminals corresponding to the target task, thereby realizing the scenario of mutual cooperation among multiple execution terminals.
[0114] In some embodiments, after step (1), the following step (2) is further included: generating a test result based on the test data.
[0115] The above test result is used to indicate the test completion degree of the target application with the target task as the target.
[0116] In some embodiments, the tool server sends the above test result to the execution terminal, and / or the tool server sends the above test result to the test control terminal to provide the test result to the tester.
[0117] In an example, as Figure 6 shown, the tool server 600 includes an account status management module 610, a test report module 620, a use case management module 630, a sub-application management module 640, and a test process management module 650. The test process management module 650 controls and obtains data from other modules according to a preset test process. Among them, the account status management module 610 is used to manage the application accounts logged in to the target application including the execution terminal, the test report module 620 is used to generate test results based on the test data, the use case management module 630 is used to store and manage test cases (including json use cases and / or behavior tree use cases, where the behavior tree use cases are edited by testers through a behavior tree editor based on Node.js), and the sub-application management module 640 is used to configure different forms of automated testing (such as, smoke automation, performance automation, numerical automation, single-game frame synchronization automation, etc.).
[0118] In some embodiments, when the tool server receives the test data, it can immediately generate a test result based on the test data; or, when the tool server receives a test instruction for a target task sent by the test control terminal, it generates a test result by retrieving the test data corresponding to the target task. Schematically, when the tool server generates a test result based on the test data, the tool server obtains the target test case corresponding to the target task, parses the target test case, and obtains the corresponding set of execution steps and the corresponding standard data. The tool server compares the corresponding test data with the standard data corresponding to the set of execution steps, and thus outputs a test result; or, the tool server performs a conditional interruption judgment on the execution steps in the set of execution steps through the test data, and thus outputs a test result.
[0119] In summary, for the application test method provided by the embodiments of the present application, when it is necessary to test a target application, the server sends the execution steps corresponding to the target task to the execution terminal according to the test task information, and the server generates a test result based on the test data returned by the execution terminal after completing the execution steps. That is, by using the method of controlling the application client in the execution terminal by the remote server for testing, the data of multiple clients can be integrated into the server, and the execution of concurrent test tasks can be better coordinated, so as to automatically implement the test process of the application and improve the test efficiency of complex use case scenarios. At the same time, this method can be applied to scenarios that require interaction between multiple terminals, solves the compatibility problem of different terminal platforms during the automated testing of applications based on the Unity engine, and since the automated testing can be performed through the network interaction between the execution terminal and the tool server, it can adapt to the cloud real machine production environment.
[0120] In the embodiments of the present application, the automated test process of the application is as Figure 7 shown. Among them, the execution process in the tool server 710 includes 1. starting a test task 701; 2. distributing test cases 702; 3. robot grouping 703; 4. executing test cases 704; 5. sorting out test data 705. Finally, the tool server 710 transmits the output test result to the target web page or social application 720, so as to provide testers with a Bug list 730 formulated according to the execution problems indicated in the test result.
[0121] Please refer to Figure 8 , which shows the method for generating a test case shown in an embodiment of the present application. In the embodiments of the present application, a schematic description of the preliminary preparation process for automated testing is provided. The method includes:
[0122] Step 801, obtaining automated use case information and test task configuration information.
[0123] In the embodiments of the present application, test case configuration is required in the preliminary preparation stage of automated testing. Optionally, the test case generation method provided by the embodiments of the present application can be applied to a test control terminal or a tool server, which is not limited herein.
[0124] In some embodiments, the target test cases corresponding to the target tasks include at least one target automated use case and target test task use cases. Among them, the automated use cases are used to control the operations executed by the target application during testing, and the test task use cases are used to organize the automated use cases to obtain the target test cases.
[0125] In one example, the automated use case is a behavior tree use case, which is a use case for controlling the behaviors and strategies of robots in the execution terminal and is edited by a corresponding behavior tree editor (such as a behavior tree editor based on Node.js). Schematically, for a scenario with multi-terminal interaction, during the writing process of the automated use case, the use case branches can be written according to the state changes of the robots in the same group of execution terminals (such as using functions such as mutex locks or resource locks). The test task use case is a use case for organizing the automated use cases and formulating a test plan. Specifically, it can be configured through a table file (such as excel). Among them, the above-mentioned organization of automated use cases includes the organization processes such as determining the specific automated use cases to be executed by the task, the execution order between the automated use cases, and the parameter passing between the automated use cases. The above-mentioned formulation of the test plan includes formulating automated use case allocation rules, precondition dependencies of automated use cases (the current automated use case needs to be executed after the execution of one or some automated use cases), etc.
[0126] In some embodiments, the preliminary preparation process of automated testing also includes writing a test interface, that is, writing a test interface corresponding to the target application for obtaining test data. In one example, this test interface is located in the application engine of the target application.
[0127] In some embodiments, the automated information is the target number of automated use cases that have been edited and completed by the tester through the editor, that is, the automated use case information includes the target number of automated use cases. The above-mentioned test task configuration information is used to indicate the target automated use cases included in the target test cases corresponding to the target tasks.
[0128] Optionally, a target test case can be composed of one automated use case or multiple automated use cases, which is not limited herein.
[0129] Schematically, taking the application of the test case generation method to a tool server as an example, a tester edits a target number of automated test cases through an editor on a test control terminal. The test control terminal packages the target number of automated test cases into automated test case information and transmits it to the tool server. Then, the tester configures the test task configuration information corresponding to the test task and transmits it to the tool server.
[0130] Step 802: Based on the test task configuration information, screen out the target automated test cases from the target number of automated test cases.
[0131] In some embodiments, the automated test case information includes the case content corresponding to the automated test case and its corresponding case identifier, and the test task configuration information includes the correspondence between the task identifier of the test task and the case identifier. Among them, the test task includes the target task. The tool server determines the automated test cases for completing the test task according to the above correspondence between the task identifier and the case identifier. In one example, the tool server determines the task identifier of the target task and screens out the corresponding target automated test cases from the target number of automated test cases according to the case identifier corresponding to the task identifier of the target task.
[0132] Step 803: Generate the target test task cases based on the relationships between the target automated test cases.
[0133] The above target test task cases are used to record the organizational structure between the target automated test cases.
[0134] Schematically, the target test task cases record information such as the target automated test cases corresponding to the target task, the execution order between the target automated test cases, and the parameter passing between the target automated test cases.
[0135] Schematically, please refer to Figure 9 , which shows the pre - preparation flowchart provided by an exemplary embodiment of the present application. Among them, the preparation process 900 includes a test interface writing link 901, an automated test case writing link 902, a test task case configuration link 903, a case grouping parameter configuration link 904, and a test start link 905.
[0136] In some embodiments, during the pre - preparation of automated testing, the tool server configures test parameters for the target task. The above test parameters include grouping labels and distribution time setting parameters. The above grouping labels are used to mark the nested relationship between test cases, that is, the grouping labels are used to mark the cases that access the data of the same execution terminal robot. The above distribution time setting parameters are used to control the distribution time interval of the test cases marked by the same grouping label to be less than the target interval, that is, the distribution time setting parameters are used to ensure that the time points at which the cases in the same group are distributed are close enough.
[0137] In summary, the method for generating test cases provided in the embodiments of the present application configures test task cases through pre-edited automated cases. The test cases corresponding to the test tasks are jointly composed of the automated cases and the test task cases. That is, the execution steps for completing the test tasks are stored through the automated cases, and the organizational structure between the automated cases is stored through the test task cases, so that during the automated test process, the tool server provides the execution step information for the execution terminal and obtains the corresponding test data, improving the test efficiency of the automated test process.
[0138] In one example, please refer to Figure 10 , which shows the automated test timing diagram provided by an exemplary embodiment of the present application. The execution terminal 1010 obtains an execution instruction (1001) from the core logic class 1021 of the tool server. Among them, the execution instruction includes the execution terminal identifier (player_id). The core logic class 1021 retains the uplink data (1002) to the robot class 1022. If the robot class 1022 determines that the sequence id is not the latest, it performs serialization (10021) from the Remote Dictionary Server (Redis) 1023. The robot class 1022 allocates transactions and cases through the task module 1024 (1003). The task module 1024 initializes by calling the sub-application interface from the core logic class 1021 (10031). The robot class 1022 controls the behavior tree module 1025 to execute the behavior tree tick (1004) and obtains private data (10041). The behavior tree module 1025 obtains global data from the task module 1024 (10042). The behavior tree module 1025 returns the execution instruction to the robot class 1022 (1005). The robot class 1022 returns the execution instruction to the core logic class 1021 (1006). At the same time, the robot class 1002 asynchronously saves the intermediate data to Redis 1023, and the core logic class 1021 returns the execution instruction to the execution terminal (1007).
[0139] Please refer to Figure 11 , which shows the structural block diagram of the test device of an application provided by an exemplary embodiment of the present application. The device includes the following modules:
[0140] A receiving module 1110, configured to receive test task information, where the test task information is used to indicate a target task for testing a target application;
[0141] A determining module 1120, configured to determine execution step information corresponding to the target task based on the test task information, where the execution step information includes execution steps for completing the target task;
[0142] A sending module 1130, configured to send the execution step information to an execution terminal corresponding to the target application, where the execution step information is used to instruct the execution terminal to run the target application to complete the execution step;
[0143] The receiving module 1110 is further configured to receive test data returned by the execution terminal, where the test data is data generated after completing the execution step;
[0144] A generating module 1140, configured to generate a test result based on the test data, where the test result is used to indicate the test completion degree of the target application for the target task.
[0145] In some alternative embodiments, as Figure 12 shown, the determining module 1120 further includes:
[0146] An obtaining unit 1121, configured to obtain a target test case according to the test task information, where the target test case is a pre-made test case;
[0147] An analyzing unit 1122, configured to analyze the target test case into a set of execution steps, where the execution steps in the set of execution steps are used to jointly complete the target test case;
[0148] A generating unit 1123, configured to generate the execution step information based on the set of execution steps.
[0149] In some alternative embodiments, the sending module 1130 further includes:
[0150] An encapsulating unit 1131, configured to encapsulate the execution step information with a target communication protocol to obtain a step data packet;
[0151] A sending unit 1132, configured to send the step data packet to the execution terminal.
[0152] In some alternative embodiments, the test task information indicates that at least two execution terminals participate in the test, and the at least two execution terminals include a target execution terminal, and the test task information includes the execution end to which the target execution terminal belongs in the target task;
[0153] The analyzing unit 1122 is further configured to extract behavior tree data from the target test case, where the behavior tree data includes the execution steps stored in a tree structure;
[0154] The analyzing unit 1122 is further configured to determine a set of execution steps corresponding to the target execution terminal from the behavior tree data based on the execution end to which the target execution terminal belongs in the target task.
[0155] In some alternative embodiments, the device further includes:
[0156] A configuration module 1150, configured to configure test parameters for the target task, where the test parameters include a grouping label and a distribution time setting parameter. The grouping label is used to mark the nested relationship between test cases, and the distribution time setting parameter is used to control the distribution time interval of test cases marked by the same grouping label to be less than a target interval.
[0157] In some alternative embodiments, the device further includes:
[0158] A storage module 1160, configured to store the test data in a target area, where the target area is used to store data corresponding to a virtual object automatically controlled by the execution terminal;
[0159] The receiving module 1110 is further configured to, in response to receiving an execution instruction for the target test case, call the test data from the target area;
[0160] The generating module 1140 is further configured to generate the test result of the target application for the target task based on the test data.
[0161] In some alternative embodiments, the target test case includes at least one target automation use case and a target test task use case. The automation use case is used to control the operations performed by the target application during testing, and the test task use case is used to organize the automation use cases to obtain the target test case;
[0162] The device further includes:
[0163] A prefabrication module 1170, configured to obtain automation use case information and test task configuration information. The automation use case information includes a target number of automation use cases, and the test task configuration information is used to indicate the target automation use cases included in the target test case;
[0164] The prefabrication module 1170 is further configured to screen out the target automation use cases from the target number of automation use cases based on the test task configuration information;
[0165] The prefabrication module 1170 is further configured to generate the target test task use case based on the relationship between the target automation use cases, and the target test task use case is used to record the organizational structure between the target automation use cases.
[0166] In some alternative embodiments, the execution terminal is configured to reflect the execution step information as an interaction event and a test interface call event. The interaction event is used to control a virtual object in the target application to perform a target interaction, and the test interface call event is used to drive an application engine in the target application to perform a test.
[0167] In some alternative embodiments, the execution terminal is configured to generate the test data by using interaction node data and test interface call data. The interaction node data is data recorded after the execution terminal controls the virtual object in the target application to perform the target interaction, and the test interface call data is data returned by the test interface after the execution terminal calls the test interface in the application engine according to the test interface call event.
[0168] In summary, for the application test device provided in the embodiments of the present application, when it is necessary to test a target application, the server sends the execution steps corresponding to the target task to the execution terminal according to the test task information, and the server generates a test result based on the test data returned by the execution terminal after completing the execution steps. That is, by adopting a method in which a remote server controls an application client in the execution terminal to perform a test, the data of multiple clients can be integrated into the server, and the execution of concurrent test tasks can be better coordinated, thereby automatically implementing the test process of the application and improving the test efficiency of complex use case scenarios.
[0169] It should be noted that: for the application test device provided in the above embodiments, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the application test device provided in the above embodiments and the embodiments of the application test method belong to the same concept, and the specific implementation process is detailed in the method embodiments and will not be repeated here.
[0170] Figure 13 FIG. shows a schematic structural diagram of a server provided by an exemplary embodiment of the present application. Specifically, it includes the following structure.
[0171] The server 1300 includes a Central Processing Unit (CPU) 1301, a system memory 1304 including a Random Access Memory (RAM) 1302 and a Read Only Memory (ROM) 1303, and a system bus 1305 connecting the system memory 1304 and the central processing unit 1301. The server 1300 also includes a mass storage device 1306 for storing an operating system 1313, application programs 1314, and other program modules 1315.
[0172] The mass storage device 1306 is connected to the central processing unit 1301 through a mass storage controller (not shown) connected to the system bus 1305. The mass storage device 1306 and its associated computer-readable medium provide non-volatile storage for the server 1300. That is, the mass storage device 1306 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc Read Only Memory (CD-ROM) drive.
[0173] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other solid-state memory technologies, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, magnetic tape cartridges, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that computer storage media is not limited to the above several. The above-mentioned system memory 1304 and mass storage device 1306 can be collectively referred to as memory.
[0174] In accordance with various embodiments of the present application, the server 1300 may also operate by connecting to a remote computer on the network via a network such as the Internet. That is, the server 1300 may be connected to the network 1312 through the network interface unit 1311 connected to the system bus 1305. Or rather, the network interface unit 1311 may also be used to connect to other types of networks or remote computer systems (not shown).
[0175] The above-mentioned memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.
[0176] Embodiments of the present application further provide a computer device, which includes a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, at least one program, the code set or the instruction set is loaded and executed by the processor to implement the application testing method provided by the above-mentioned method embodiments. Optionally, the computer device may be a terminal or a server.
[0177] Embodiments of the present application further provide a computer-readable storage medium, on which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, at least one program, the code set or the instruction set is loaded and executed by the processor to implement the application testing method provided by the above-mentioned method embodiments.
[0178] Embodiments of the present application further provide a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the application testing method described in any one of the above embodiments.
[0179] Optionally, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), solid state drives (SSD, Solid State Drives) or optical discs, etc. Among them, the random access memory may include resistive random access memory (ReRAM, Resistance RandomAccess Memory) and dynamic random access memory (DRAM, Dynamic Random Access Memory). The above-mentioned serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0180] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk, an optical disc, etc.
[0181] The above are only alternative embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A testing method for an application, characterized in that, the method includes: Receiving test task information, which is used to indicate a target task for testing a target application; Obtaining a target test case according to the test task information, where the target test case is a pre-made test case; according to the target execution terminal, parsing the target test case into a set of execution steps, and the execution steps in the set of execution steps are used to jointly complete the target test case; generating execution step information based on the set of execution steps, and the execution step information includes execution steps for completing the target task; Sending the execution step information to the execution terminal corresponding to the target application, and the execution step information is used to instruct the execution terminal to run the target application to complete the execution steps; Receiving test data returned by the execution terminal, where the test data is data generated after completing the execution steps; Generating a test result based on the test data, and the test result is used to indicate the test completion degree of the target application with the target task as the target.
2. The method according to claim 1, characterized in that, the sending the execution step information to the execution terminal corresponding to the target application includes: Encapsulating the execution step information with a target communication protocol to obtain a step data packet; Sending the step data packet to the execution terminal.
3. The method according to claim 1, characterized in that, the test task information indicates that at least two execution terminals participate in the test, and the at least two execution terminals include a target execution terminal, and the test task information includes the execution end to which the target execution terminal belongs in the target task; the parsing the target test case into a set of execution steps includes: Extracting behavior tree data from the target test case, where the behavior tree data includes the execution steps stored in a tree structure; Determining a set of execution steps corresponding to the target execution terminal from the behavior tree data based on the execution end to which the target execution terminal belongs in the target task.
4. The method according to claim 3, characterized in that, the method further includes: Configuring test parameters for the target task, where the test parameters include a grouping label and a distribution time setting parameter, the grouping label is used to mark the nested relationship between test cases, and the distribution time setting parameter is used to control the distribution time interval of test cases marked by the same grouping label to be less than a target interval.
5. The method according to any one of claims 1 to 4, characterized in that, the generating the test result based on the test data includes: Storing the test data in a target area, where the target area is used to store data corresponding to a virtual object automatically controlled by the execution terminal; Responding to receiving an execution instruction for the target test case, calling the test data from the target area; Generating the test result of the target application for the target task based on the test data.
6. The method according to any one of claims 1 to 4, characterized in that, The target test case includes at least one target automated test case and a target test task case. The automated test case is used to control the operations performed by the target application during testing, and the test task case is used to organize the automated test cases to obtain the target test case; The method further includes: Obtaining automated test case information and test task configuration information. The automated test case information includes a target number of automated test cases, and the test task configuration information is used to indicate the target automated test cases included in the target test case; Based on the test task configuration information, screening out the target automated test cases from the target number of automated test cases; Based on the relationships between the target automated test cases, generating the target test task case, which is used to record the organizational structure between the target automated test cases.
7. The method according to any one of claims 1 to 4, characterized in that The execution terminal is used to reflect the execution step information into an interaction event and a test interface call event. The interaction event is used to control a virtual object in the target application to perform a target interaction, and the test interface call event is used to drive an application engine in the target application to perform testing.
8. The method according to claim 7, characterized in that The execution terminal is used to generate the test data through interaction node data and call test interface data. The interaction node data is the data recorded after the execution terminal controls the virtual object in the target application to perform the target interaction, and the call test interface data is the data returned by the test interface after the execution terminal calls the test interface in the application engine according to the test interface call event.
9. A test device for an application, characterized in that The device includes: A receiving module, configured to receive test task information, where the test task information is used to indicate a target task for testing a target application; A determining module, configured to obtain a target test case according to the test task information. The target test case is a pre-made test case; according to a target execution terminal, parsing the target test case into a set of execution steps, and the execution steps in the set of execution steps are used to jointly complete the target test case; generating execution step information based on the set of execution steps, where the execution step information includes execution steps for completing the target task; A sending module, configured to send the execution step information to the execution terminal corresponding to the target application, where the execution step information is used to instruct the execution terminal to run the target application to complete the execution steps; The receiving module is further configured to receive test data returned by the execution terminal, where the test data is data generated after completing the execution steps; A generating module, configured to generate a test result based on the test data, where the test result is used to indicate the test completion degree of the target application with the target task as the goal.
10. The device according to claim 9, characterized in that The sending module further includes: An encapsulation unit, configured to encapsulate the execution step information in a target communication protocol to obtain a step data packet; A sending unit, configured to send the step data packet to the execution terminal.
11. The apparatus according to claim 9, wherein, the test task information indicates that at least two execution terminals participate in the test, the at least two execution terminals include a target execution terminal, and the test task information includes the execution end to which the target execution terminal belongs in the target task; the determining module is configured to: Extract behavior tree data from the target test case, where the behavior tree data includes the execution steps stored in a tree structure; Based on the execution end to which the target execution terminal belongs in the target task, determine an execution step set corresponding to the target execution terminal from the behavior tree data.
12. The apparatus according to claim 11, wherein, the apparatus further includes: A configuration module, configured to configure test parameters for the target task, where the test parameters include a grouping label and a distribution time setting parameter, the grouping label is used to mark the nesting relationship between test cases, and the distribution time setting parameter is used to control the distribution time interval of test cases marked by the same grouping label to be less than a target interval.
13. The apparatus according to any one of claims 9-12, wherein, the apparatus further includes: A storage module, configured to store the test data in a target area, where the target area is used to store data corresponding to a virtual object automatically controlled by the execution terminal; The receiving module is further configured to, in response to receiving an execution instruction for the target test case, call the test data from the target area; The generating module is further configured to generate the test result of the target application for the target task based on the test data.
14. The apparatus according to any one of claims 9-12, wherein, the target test case includes at least one target automation use case and a target test task use case, the automation use case is used to control the operations executed by the target application during testing, and the test task use case is used to organize the automation use cases to obtain the target test case; the apparatus further includes: A prefabrication module, configured to obtain automation use case information and test task configuration information, where the automation use case information includes a target number of automation use cases, and the test task configuration information is used to indicate the target automation use cases included in the target test case; The prefabrication module is further configured to screen out the target automation use cases from the target number of automation use cases based on the test task configuration information; The prefabrication module is further configured to generate the target test task use case based on the relationship between the target automation use cases, where the target test task use case is used to record the organizational structure between the target automation use cases.
15. The apparatus according to any one of claims 9-12, wherein, The execution terminal is used to reflect the execution step information into an interaction event and a test interface call event. The interaction event is used to control a virtual object in the target application to perform a target interaction, and the test interface call event is used to drive an application engine in the target application to perform testing.
16. The device according to claim 15, wherein, the execution terminal is used to generate the test data through interaction node data and call test interface data. The interaction node data is the data recorded after the execution terminal controls the virtual object in the target application to perform the target interaction, and the call test interface data is the data returned by the test interface after the execution terminal calls the test interface in the application engine according to the test interface call event.
17. A computer device, wherein, the computer device includes a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the test method of the application according to any one of claims 1 to 8.
18. A computer-readable storage medium, wherein, at least one program code is stored in the computer-readable storage medium. The program code is loaded and executed by a processor to implement the test method of the application according to any one of claims 1 to 8.
19. A computer program product, wherein, it includes a computer program or instruction. When the computer program or instruction is executed by a processor, it implements the test method of the application according to any one of claims 1 to 8.
Citation Information
Patent Citations
Application program testing method and device
CN113505082A