Method, system and device for testing software product, equipment and medium
The automated testing framework is built through GTest engine and test services, which solves the problem of low efficiency of traditional manual testing, realizes automated testing of Unreal Engine software products, improves development and release efficiency, and meets the compatibility needs of multi-platforms.
Patent Information
- Application Number
- CN202411677898.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-11-21
AI Technical Summary
Traditional manual-based software product testing methods are inefficient, which affects the development and release efficiency of software products. Especially in software products developed by Unreal Engine, it is difficult to meet the needs of rapid development and multi-platform compatibility.
The GTest engine and test services are used to build an automated test framework. The GTest engine responds to the startup instructions of the software product to be tested, automatically loads the initialization and test cases, and executes the test cases through the test services, obtains the execution results and returns them to the software product to be tested.
It realizes C++ interface and UI automation testing of Unreal Engine development software products, improves testing efficiency, shortens development cycle, and meets the needs of multi-platform compatibility.
Smart Images

Figure CN119807022A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, system, device, equipment and medium for testing software products. Background Art
[0002] With the rapid development of Unreal Engine (UE) technology, the demand for testing software products developed using Unreal Engine is growing. Developers can ensure the quality of software products by performing C++ interface and user interface (UI) related tests on each software product developed.
[0003] However, the traditional manual-based software product testing method has low testing efficiency, which greatly affects the development and release efficiency of related software products. Summary of the invention
[0004] In view of the above problems, embodiments of the present application provide a method, system, apparatus, device and medium for testing a software product, so as to overcome the above problems or at least partially solve the above problems.
[0005] A first aspect of an embodiment of the present application provides a method for testing a software product, the method being applied to a GTest engine, comprising:
[0006] In response to receiving a start instruction sent by the software product to be tested, performing an initialization operation of GTest and a loading operation of each test case, wherein the software product to be tested is developed using the Unreal Engine, and the each test case includes: each test case related to a C++ interface test of the software product to be tested, and / or each test case related to a user interface UI test of the software product to be tested;
[0007] Execute each test case loaded by the GTest engine through the test service to obtain the execution result of each test case;
[0008] The execution results of each test case are returned to the software product to be tested.
[0009] As a possible implementation manner, the various test cases at least include various test cases related to UI testing of the software product to be tested;
[0010] The executing each test case loaded by the GTest engine through the test service to obtain the execution result of each test case includes:
[0011] A UI test instruction is sent to the test daemon through the test service, so that the test daemon requests the UI automated test framework, and performs UI operations on the software product to be tested according to each test case related to the UI test, so as to obtain the execution results of each test case related to the UI test, wherein the software product to be tested, the GTest engine and the test service are deployed on a first device, the test daemon and the UI automated test framework are deployed on a second device, and the first device and the second device are different devices.
[0012] As a possible implementation, when executing UI testing across software products, the UI automation testing framework implements UI operations on software products that are returned to the device system background based on a preset communication method, and the preset communication method includes: locks and conditional variables, file communication, and at least one of socket communication.
[0013] As a possible implementation, the test service executes each test case based on a pre-configured C++ class and AsyncTask, and a GTestPlugin blueprint class is pre-added in the Unreal Engine, and the GTestPlugin blueprint class encapsulates the initialization logic and execution logic of GTest;
[0014] The method further comprises:
[0015] Configure a C++ class inherited from the GTestPlugin blueprint class, the C++ class is used to provide the test service with the ability to execute multiple test cases in parallel;
[0016] An AsyncTask is configured in a component Component of the Unreal Engine, and the AsyncTask is used to provide the test service with a capability of executing test cases in an asynchronous task execution manner.
[0017] As a possible implementation, the method further includes:
[0018] The semantic big model is used to study and analyze historical test data to generate test cases and their corresponding assertions.
[0019] As a possible implementation, the method further includes:
[0020] Analyze the coverage of each test case by using a code coverage analysis tool;
[0021] The performance analysis tool is used to perform performance analysis on the software product to be tested during the execution of each test case.
[0022] According to a second aspect of an embodiment of the present application, a system for testing a software product is provided, the system comprising a GTest engine and a testing service, wherein:
[0023] The GTest engine is used to execute the initialization operation of GTest and the loading operation of each test case in response to receiving the startup instruction sent by the software product to be tested, wherein the software product to be tested is developed using the Unreal Engine, and the each test case includes: each test case related to the C++ interface test of the software product to be tested, and / or each test case related to the user interface UI test of the software product to be tested;
[0024] The GTest engine is further used to send execution instructions of each test case loaded by the GTest engine to the test service;
[0025] The test service is used to execute each test case loaded by the GTest engine according to the received execution instruction, and return the execution result of each test case to the GTest engine;
[0026] The GTest engine is also used to return the execution results of each test case to the software product under test.
[0027] According to a third aspect of an embodiment of the present application, there is provided a device for testing a software product, the device being applied to a GTest engine, comprising:
[0028] An instruction receiving module, configured to execute an initialization operation of GTest and a loading operation of each test case in response to receiving a startup instruction sent by a software product to be tested, wherein the software product to be tested is developed using Unreal Engine, and the various test cases include: various test cases related to C++ interface testing of the software product to be tested, and / or various test cases related to user interface UI testing of the software product to be tested;
[0029] A test execution module, used to execute each test case loaded by the GTest engine through a test service, and obtain the execution result of each test case;
[0030] The result sending module is used to return the execution result of each test case to the software product to be tested.
[0031] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for testing a software product described in the first aspect are implemented.
[0032] According to a fifth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the method for testing a software product as described in the first aspect are implemented.
[0033] According to a sixth aspect of an embodiment of the present application, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the method for testing a software product as described in the first aspect of an embodiment of the present application.
[0034] The embodiments of the present application include the following advantages: the GTest engine automatically loads the initialization part and the test case part of GTest in response to receiving the startup instruction sent by the software product to be tested, and then calls the test service to execute each test case loaded by itself, and returns the execution results of each test case to the software product to be tested. In this way, based on GTest, automated testing of software products developed by the Unreal Engine is implemented (i.e., automated testing of C++ interfaces and / or UIs is implemented), which can improve testing efficiency and further improve the development and release efficiency of related software products. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 is an implementation flow chart of a method for testing a software product in an embodiment of the present application;
[0037] Figure 2 It is a schematic diagram of a test calling process in an embodiment of the present application;
[0038] Figure 3 is a test call timing diagram in an embodiment of the present application;
[0039] Figure 4 is another test call timing diagram in an embodiment of the present application;
[0040] Figure 5 is a structural diagram of a system for testing a software product in an embodiment of the present application;
[0041] Figure 6 is a structural diagram of a device for testing a software product in an embodiment of the present application;
[0042] Figure 7It is a schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0043] To facilitate understanding of the technical solutions provided by the present application, the main technical concepts involved in the embodiments of the present application are briefly described below.
[0044] Unreal Engine: It is a software product development engine. Compared with other software product development engines, Unreal Engine is more efficient and versatile, and can directly preview the development effects of software products, so it has been widely used.
[0045] GTest: is a test framework generated for writing C++ tests on different platforms (such as Linux, Mac OS X, Windows, Cygwin, Windows CE and Symbian, etc.), which can be used to write and run test cases for various tests.
[0046] Macaca: It is a testing solution for user-side software, providing related functions such as automation drive, environment support, peripheral tools and integration solutions, aiming to solve problems in testing, automation and performance on the terminal.
[0047] Appium: is an open source cross-platform mobile application automation testing framework that supports automated testing on iOS and Android platforms. It can use the same application programming interface (API) to write cross-platform test scripts.
[0048] Test case: a description of a test task for a specific software product, including test objectives, test environment, input data, test steps, expected results, test scripts, etc.
[0049] Assertions are mechanisms used to verify the expected results of a test case. If the expected results do not match the actual results, the related test is determined to have failed. This allows you to check whether a program or system behaves as expected after performing certain operations or running certain code.
[0050] Socket: An interface for applications to communicate through network protocols.
[0051] At present, for software products developed using Unreal Engine (such as Unreal Engine 4), manual testing is usually used to implement C++ interface and UI-related testing of related software products, resulting in a long testing cycle and high testing costs for related software products, and it is difficult to meet the increasingly shortened development cycle requirements and multi-platform compatibility requirements, which in turn affects the development and release efficiency of related software products.
[0052] In response to the problems existing in the above-mentioned related technologies, the embodiments of the present application propose a method, system, device, equipment and medium for testing software products. Through the automated testing framework suitable for Unreal Engine composed of GTest engine and testing service, C++ interface automated testing and UI automated testing are implemented for software products developed by Unreal Engine, thereby improving the testing efficiency so as to quickly complete the quality assurance activities of related software products, thereby meeting the increasingly shortened development cycle requirements, and by applying GTest to the testing of software products developed by Unreal Engine, the cross-platform compatibility of the test can be guaranteed, thereby meeting the multi-platform compatibility requirements of the software products.
[0053] In conjunction with the accompanying drawings, a method, system, device, equipment and medium for testing a software product provided by an embodiment of the present application are described in detail below through some embodiments and their application scenarios.
[0054] First, refer to Figure 1 FIG. 1 is a flowchart of a method for testing a software product provided in an embodiment of the present application. The method for testing a software product is applied to a GTest engine. The method includes the following steps:
[0055] Step S11: In response to receiving a startup instruction sent by the software product to be tested, executing the initialization operation of GTest and the loading operation of each test case, wherein the software product to be tested is developed using the Unreal Engine, and the various test cases include: various test cases related to the C++ interface test of the software product to be tested, and / or various test cases related to the user interface UI test of the software product to be tested.
[0056] Among them, the C++ interface test of the software product to be tested may include: unit test, functional test and integration test, etc.; the UI test of the software product to be tested mainly refers to: when the software product developed by the Unreal Engine is running on a mobile terminal (such as running on terminals related to Android, iOS and other systems), the page controls related to the software product are tested by simulating touch screen operations, such as automatically logging into WeChat to find a friend and sending a message.
[0057] In the specific implementation, the GTest engine (which can be constructed by developers writing code in advance) will initialize GTest (such as setting the running environment of the test case, etc.) according to the pre-configured GTest initialization logic and execution logic after receiving the startup instruction sent by the software product to be tested, and then call the GTest interface to collect relevant test cases to realize the loading of test cases.
[0058] Optionally, a modular design may be adopted for the test scripts in the test cases to facilitate management and maintenance, thereby improving the reusability of the test scripts.
[0059] It should be noted that, considering that the programming language used to develop software products using the Unreal Engine is usually C++, this application therefore configures the GTest engine to apply GTest to the testing process of software products developed by the Unreal Engine (i.e., the software products to be tested), so as to achieve automated testing of related software products, and with the help of GTest's ability to run on multiple platforms, the cross-platform compatibility of the test is guaranteed, thereby meeting the multi-platform compatibility requirements of software products developed by the Unreal Engine.
[0060] Step S12: Execute each test case loaded by the GTest engine through the test service to obtain the execution result of each test case.
[0061] In a specific implementation, the test service may include one or more threads, and the GTest engine executes the test cases in serial or parallel manner through one or more threads in the test service to obtain the execution results of the test cases (e.g., pass, fail, skip, error, blocked, etc.).
[0062] Step S13: Return the execution results of each test case to the software product to be tested.
[0063] In a specific implementation, the GTest engine returns the execution results of the various test cases to the software product under test, thereby completing the automated testing of the software product under test.
[0064] It is understandable that the aforementioned automated testing process can be integrated into the continuous integration process, so that the test can be automatically run after each code submission, which can greatly improve the development and release efficiency of related software products. Among them, continuous integration means that developers submit code every day for daily construction to produce deliverables (i.e., software products to be tested). The deliverables are not tested and therefore cannot guarantee quality. By combining with automated testing, it is possible to automatically execute automated testing after the deliverables are built, and deliverables that pass the test can be considered to meet the quality standards.
[0065] By adopting the technical solution of the embodiment of the present application, the GTest engine will automatically load the initialization part and the test case part of GTest in response to receiving the startup instruction sent by the software product to be tested, and then call the test service to execute each test case loaded by itself, and return the execution results of each test case to the software product to be tested. In this way, based on GTest, automated testing of software products developed by Unreal Engine is realized (i.e., automated testing of C++ interfaces and / or UIs is realized), which can improve testing efficiency and further improve the development and release efficiency of related software products.
[0066] As a possible implementation manner, the various test cases at least include various test cases related to UI testing of the software product to be tested;
[0067] The executing each test case loaded by the GTest engine through the test service to obtain the execution result of each test case includes:
[0068] A UI test instruction is sent to the test daemon through the test service, so that the test daemon requests the UI automated test framework, and performs UI operations on the software product to be tested according to each test case related to the UI test, so as to obtain the execution results of each test case related to the UI test, wherein the software product to be tested, the GTest engine and the test service are deployed on a first device, the test daemon and the UI automated test framework are deployed on a second device, and the first device and the second device are different devices.
[0069] Among them, the UI automation testing framework can be Macaca, Appium, etc.
[0070] In specific implementation, refer to Figure 2 As shown in the schematic diagram of the test call process, the software product to be tested, the GTest engine and the test service can be deployed on a first device such as a mobile terminal (such as a mobile phone), and the test daemon and the UI automation test framework can be deployed on a second device such as a personal computer (PC) or a personal consumer computer (Macintosh, Mac).
[0071] When executing UI testing, the GTest engine sends UI testing instructions to the test daemon (TestDeamon) through the test service (also known as GCloudWorkThread), and the test daemon (i.e., the server) initiates a request for UI operations (e.g., UI click operations) involved in each test case related to the UI test to the UI automation test framework (e.g., Macaca), and the UI automation test framework then performs UI operations on the software product to be tested (e.g., QQ or WeChat), obtains the execution results of each UI operation (i.e., the execution results of each test case), and returns the execution results to the GTest engine through the test daemon, and the GTest engine thereby obtains the execution results of each test case related to the UI test. In this way, the present application provides a cross-platform UI testing solution based on UI automation test frameworks such as Macaca, which can ensure the compatibility of the test framework, facilitate the seamless connection between mobile devices and desktop applications, and thus support testing of software products on different platforms such as iOS, Android, and Windows.
[0072] In this implementation, the GTest engine communicates and interacts with the UI automation test framework through the test service and the test daemon, thereby applying the UI automation test framework to the UI testing of software products developed by the Unreal Engine, which can reduce the implementation complexity of related test processes. In addition, with the help of the cross-platform and cross-terminal UI testing capabilities of the UI automation test framework, it is possible to avoid maintaining multiple test cases in multi-terminal and multi-platform testing scenarios.
[0073] Optionally, a GTestPlugin blueprint class can be added to an Unreal Engine (such as Unreal Engine 4) to use the GTestPlugin blueprint class to provide an interactive interface with the UI automated testing framework, which allows the test script to communicate with the Unreal Engine environment, thereby enabling the sending of relevant test commands and the receiving of execution results.
[0074] Optionally, when executing UI testing across software products, the UI automation testing framework implements UI operations on the software product returned to the device system background based on a preset communication method, and the preset communication method includes: locks and conditional variables, file communication, and at least one of socket communication.
[0075] In this implementation, considering that the UI automation testing framework is performing UI testing across software products, such as performing UI testing of simulated click operations on multiple mobile phone software, since the tested mobile phone software will be suspended by the system after returning to the background of the mobile phone system and cannot receive new instructions, the above-mentioned preset communication method can be used, such as using timers, locks, and environment variables to communicate with the mobile phone software related to UI operations to achieve simulated click operations, thereby decoupling the UI operation from the test logic in an asynchronous control manner, so that the UI operation can be executed in the background without affecting the execution of the test logic related to the test case in the system foreground.
[0076] Optionally, the UI automation testing framework can also be based on the above-mentioned preset communication method and according to the execution order of the test logic (which can be indicated by the GTest engine through the test service and the test daemon process), pull the relevant software products under test that have completed the UI operation back to the system foreground, thereby ensuring that the execution order of the UI operation and the execution order of the test logic can be correctly matched, thereby improving the accuracy and reliability of the test.
[0077] As a possible implementation, the test service executes each test case based on a pre-configured C++ class and AsyncTask, and a GTestPlugin blueprint class is pre-added in the Unreal Engine, and the GTestPlugin blueprint class encapsulates the initialization logic and execution logic of GTest;
[0078] The method further comprises:
[0079] Configure a C++ class inherited from the GTestPlugin blueprint class, the C++ class is used to provide the test service with the ability to execute multiple test cases in parallel;
[0080] An AsyncTask is configured in a component Component of the Unreal Engine, and the AsyncTask is used to provide the test service with a capability of executing test cases in an asynchronous task execution manner.
[0081] In the specific implementation, a GTestPlugin blueprint class is added to the Unreal Engine (such as Unreal Engine 4), which encapsulates the initialization and execution logic of GTest, and can ensure that the test cases can run seamlessly in the Unreal Engine environment.
[0082] It should be noted that some logic arrangement and control can be implemented based on the GTestPlugin blueprint class. For example, the initialization logic of GTest and the execution logic of the test case can be implemented in the GTestPlugin blueprint class; thus, after adding the GTestPlugin blueprint class in the Unreal Engine, the GTest engine can use the GTestPlugin blueprint class to call the GTest interface to implement the collection and execution of test cases, so that developers can configure and manage test cases without writing code.
[0083] A C++ class inherited from the GTestPlugin blueprint class is configured to achieve deep integration with the Unreal Engine, so that the test service can subsequently utilize the multi-threading capability of the Unreal Engine based on the C++ class to achieve parallel execution of test cases, thereby further improving test efficiency.
[0084] Adding the implementation of AsyncTask in the Unreal Engine component to execute asynchronous tasks allows the test service to subsequently utilize the Unreal Engine's asynchronous execution mechanism based on AsyncTask, so that the test case can be executed without blocking the main thread, thereby improving the stability and efficiency of the test. The main thread refers to the main thread of the software product developed by the Unreal Engine, which is driven by the Unreal Engine (which can be understood as the driver of the Unreal Engine's world).
[0085] Optionally, after creating a World in the Unreal Engine and adding the Component (which has the implementation of the AsyncTask added) to the World, the GTestPlugin blueprint class is bound to the Unreal Engine so that the Unreal Engine is responsible for the underlying driving work, such as driving the execution of the AsyncTask bound to the Component, thereby ensuring that relevant test cases can be executed in any environment of the Unreal Engine (such as the environment associated with the editor and the game runtime).
[0086] Optionally, users can also customize and extend the functions of the above GTest engine and test services through the plug-in mechanism to meet the needs of specific scenarios.
[0087] For example, refer to Figure 3As shown in the test call timing diagram, the software product to be tested (such as the game thread of the Unreal Engine) sends a startup instruction to the GTest engine (also known as GTestModule). The GTest engine performs the initialization operation of GTest and the loading operation of each test case based on the C++ class, loads the test cases testConn1 and testFunc related to the C++ interface test, and then executes each test case loaded by the GTest engine through the test service. Specifically, the test service is based on AsyncTask, and executes testConn1 and testFunc asynchronously and in parallel in a multi-threaded manner without blocking the main thread, obtains the execution results of the two test cases, and returns the execution results of the two test cases to the GTest engine, and the GTest engine returns the execution results of the two test cases to the software product to be tested.
[0088] Based on the above examples and embodiments, the present application adds a GTestPlugin blueprint class in the Unreal Engine to implement the initialization and control logic of GTest, and adds a C++ class of the Unreal Engine (which inherits from the GTestPlugin blueprint class) to implement multi-threaded asynchronous task execution. Therefore, the present application implements a C++ interface automated testing method based on the asynchronous task execution mechanism of the Unreal Engine, which can improve test efficiency while ensuring the asynchronous execution capability of the test.
[0089] As a possible implementation, the method further includes:
[0090] The semantic big model is used to study and analyze historical test data to generate test cases and their corresponding assertions.
[0091] In this embodiment, the present application applies machine learning technology and natural language processing technology to software product testing, and uses a semantic big model to learn and analyze historical test data to automatically and efficiently generate test cases and assertions, and can quickly expand test cases and assertions. For example, developers can input the description text of the test requirements into the semantic big model to obtain relevant test cases and assertions, thereby reducing the time and cost of manually writing and maintaining test cases and assertions, and improving the richness of test cases and assertions, which is conducive to improving the efficiency and accuracy of testing.
[0092] As a possible implementation, the method further includes:
[0093] Analyze the coverage of each test case by using a code coverage analysis tool;
[0094] The performance analysis tool is used to perform performance analysis on the software product to be tested during the execution of each test case.
[0095] During the specific implementation, code coverage analysis tools such as gcov can be used to analyze the test case coverage to ensure that the test cases can fully cover the relevant functions of the software product (for example, they can fully cover the functions of the C++ interface).
[0096] Considering that test cases are closely related to users' actual usage scenarios, during the execution of test cases, performance analysis tools can be used to collect information on resource usage during the process, such as the freezing of mobile phone screen drawing, and the consumption of resources such as the central processing unit (CPU), memory, and network input / output (IO), so as to conduct more in-depth performance testing and optimization.
[0097] For example, refer to Figure 4 As shown in the test call timing diagram, the software product to be tested sends a start instruction to the GTest engine. The GTest engine executes the initialization operation of GTest and the loading operation of each test case based on the C++ class, and loads the test case testConn1 related to the C++ interface test and the test case testLogin related to the UI test (i.e., the test case for the login test). Then, each test case loaded by the GTest engine is executed through the test service. Specifically, the test service is based on AsyncTask, and uses other threads other than the main thread to execute testConn1 on the software product to be tested in the foreground of the system, and uses another thread to send a UI test instruction to the test daemon process, so that the test daemon process requests the UI automated testing framework, and performs UI operations on the software product to be tested (such as QQ or WeChat) in the background of the system according to testLogin. The GTest engine can thereby obtain the execution results of the test case testConn1 related to the C++ interface test and the test case testLogin related to the UI test. Finally, the GTest engine returns the obtained execution results to the software product to be tested, thereby ending the test process. Therefore, this application implements an automated testing method for software products developed for the Unreal Engine, which can realize C++ interface automated testing and UI automated testing, thereby quickly completing quality assurance activities for related software products and ensuring the cross-platform compatibility and asynchronous execution capabilities of the test, so that it can seamlessly connect to major cloud testing platforms and realize large-scale concurrent testing.
[0098] Based on the above examples and embodiments, the method for testing a software product provided in this application can at least achieve the following optimization effects:
[0099] 1. Improve testing efficiency: By building an automated testing framework for Unreal Engine, the time and cost of manually testing software products developed by Unreal Engine can be greatly reduced, so that quality assurance activities for related software products can be completed quickly to increase the speed of development and release.
[0100] 2. Ensure test quality: Automated testing can cover more test scenarios, improve the comprehensiveness and accuracy of testing, and through asynchronous execution and multi-threading technology, it can improve the stability and reliability of testing.
[0101] 3. Cross-platform compatibility: The automated testing framework supports cross-platform integration testing on mobile devices, which can ensure the compatibility of software products on different devices and operating systems.
[0102] 4. Simplify test maintenance: The decoupling of UI operations and test logic makes UI debugging and test case maintenance easier, and the simple interface and unit test implementation of the automated testing framework can reduce the complexity of test maintenance.
[0103] 5. Seamless integration with Unreal Engine: The automated testing framework follows the operating logic of Unreal Engine, and its implementation is based on the native support of Unreal Engine, ensuring seamless integration with Unreal Engine.
[0104] 6. Strong scalability: The design of the automated testing framework has good scalability and can easily adapt to new testing requirements and software product features.
[0105] 7. Significant practical application effects: In practical applications, a large number of automated test cases can be written and executed in a short period of time, which significantly improves the testing efficiency. Developers have discovered and fixed multiple potential problems based on the execution results of the test cases, greatly improving the quality of software products.
[0106] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the order of the actions described, because according to the embodiments of the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0107] Second, Figure 5 : is a schematic diagram of the structure of a system for testing a software product in an embodiment of the present application, wherein the system includes a GTest engine and a testing service, wherein:
[0108] The GTest engine is used to execute the initialization operation of GTest and the loading operation of each test case in response to receiving the startup instruction sent by the software product to be tested, wherein the software product to be tested is developed using the Unreal Engine, and the each test case includes: each test case related to the C++ interface test of the software product to be tested, and / or each test case related to the user interface UI test of the software product to be tested;
[0109] The GTest engine is further used to send execution instructions of each test case loaded by the GTest engine to the test service;
[0110] The test service is used to execute each test case loaded by the GTest engine according to the received execution instruction, and return the execution result of each test case to the GTest engine;
[0111] The GTest engine is also used to return the execution results of each test case to the software product under test.
[0112] By adopting the technical solution of the embodiment of the present application, the GTest engine will automatically load the initialization part and the test case part of GTest in response to receiving the startup instruction sent by the software product to be tested, and then call the test service to execute each test case loaded by itself, and return the execution results of each test case to the software product to be tested. In this way, based on GTest, automated testing of software products developed by Unreal Engine is realized (i.e., automated testing of C++ interfaces and / or UIs is realized), which can improve testing efficiency and further improve the development and release efficiency of related software products.
[0113] Optionally, the various test cases include at least various test cases related to the UI test of the software product to be tested, the system further includes a test daemon and a UI automated test framework, the software product to be tested, the GTest engine and the test service are deployed on a first device, the test daemon and the UI automated test framework are deployed on a second device, the first device and the second device are different devices, wherein:
[0114] The GTest engine is further used to send UI test instructions to the test daemon process through the test service;
[0115] The test daemon is used to, in response to receiving the UI test instruction, request the UI automated test framework to perform UI operations on the software product to be tested according to each test case related to the UI test, so as to obtain the execution results of each test case related to the UI test;
[0116] The test daemon is also used to send the execution results of each test case to the GTest engine through the test service.
[0117] Optionally, when executing UI testing across software products, the UI automation testing framework implements UI operations on the software product returned to the device system background based on a preset communication method, and the preset communication method includes: locks and conditional variables, file communication, and at least one of socket communication.
[0118] Optionally, the test service executes each test case based on a pre-configured C++ class and AsyncTask, a GTestPlugin blueprint class is pre-added in the Unreal Engine, and the GTestPlugin blueprint class encapsulates the initialization logic and execution logic of GTest;
[0119] The GTest engine is further used to configure a C++ class inherited from the GTestPlugin blueprint class and to configure an AsyncTask in the component Component of the Unreal Engine. The C++ class is used to provide the test service with the ability to execute multiple test cases in parallel, and the AsyncTask is used to provide the test service with the ability to execute test cases in an asynchronous task execution manner.
[0120] Optionally, the GTest engine is also used to learn and analyze historical test data using a semantic big model to generate test cases and their corresponding assertions.
[0121] Optionally, the GTest engine is further used to analyze the coverage of each test case through a code coverage analysis tool, and to perform performance analysis on the software product to be tested during the execution of each test case through a performance analysis tool.
[0122] Thirdly, Figure 6 : is a schematic diagram of a device for testing a software product according to an embodiment of the present application, the device is applied to a GTest engine, and includes:
[0123] The instruction receiving module 610 is used to execute the initialization operation of GTest and the loading operation of each test case in response to receiving the start instruction sent by the software product to be tested, wherein the software product to be tested is developed using the Unreal Engine, and the each test case includes: each test case related to the C++ interface test of the software product to be tested, and / or each test case related to the user interface UI test of the software product to be tested;
[0124] The test execution module 620 is used to execute each test case loaded by the GTest engine through the test service to obtain the execution result of each test case;
[0125] The result sending module 630 is used to return the execution result of each test case to the software product under test.
[0126] By adopting the technical solution of the embodiment of the present application, the GTest engine will automatically load the initialization part and the test case part of GTest in response to receiving the startup instruction sent by the software product to be tested, and then call the test service to execute each test case loaded by itself, and return the execution results of each test case to the software product to be tested. In this way, based on GTest, automated testing of software products developed by Unreal Engine is realized (i.e., automated testing of C++ interfaces and / or UIs is realized), which can improve testing efficiency and further improve the development and release efficiency of related software products.
[0127] Optionally, the various test cases include at least various test cases related to UI testing of the software product to be tested;
[0128] The test execution module 620 is also used to send UI test instructions to the test daemon through the test service, so that the test daemon requests the UI automated test framework to perform UI operations on the software product under test according to the various test cases related to the UI test, so as to obtain the execution results of the various test cases related to the UI test, wherein the software product under test, the GTest engine and the test service are deployed on a first device, the test daemon and the UI automated test framework are deployed on a second device, and the first device and the second device are different devices.
[0129] Optionally, when executing UI testing across software products, the UI automation testing framework implements UI operations on the software product returned to the device system background based on a preset communication method, and the preset communication method includes: locks and conditional variables, file communication, and at least one of socket communication.
[0130] Optionally, the test service executes each test case based on a pre-configured C++ class and AsyncTask, a GTestPlugin blueprint class is pre-added in the Unreal Engine, and the GTestPlugin blueprint class encapsulates the initialization logic and execution logic of GTest;
[0131] The device also includes a configuration module, configured to perform the following steps:
[0132] Configure a C++ class inherited from the GTestPlugin blueprint class, the C++ class is used to provide the test service with the ability to execute multiple test cases in parallel;
[0133] An AsyncTask is configured in a component Component of the Unreal Engine, and the AsyncTask is used to provide the test service with a capability of executing test cases in an asynchronous task execution manner.
[0134] Optionally, the device further comprises:
[0135] The generation module is used to use the semantic big model to learn and analyze historical test data and generate test cases and their corresponding assertions.
[0136] Optionally, the device further comprises an analysis module, configured to perform the following steps:
[0137] Analyze the coverage of each test case by using a code coverage analysis tool;
[0138] The performance analysis tool is used to perform performance analysis on the software product to be tested during the execution of each test case.
[0139] It should be noted that the device embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.
[0140] The present application also provides an electronic device, referring to Figure 7 , Figure 7 Schematic diagram of an electronic device proposed in an embodiment of the present application. Figure 7 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. A computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement the steps in the method for testing a software product disclosed in the embodiment of the present application.
[0141] The embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the method for testing a software product as disclosed in the embodiment of the present application is implemented.
[0142] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method for testing a software product as disclosed in the embodiment of the present application.
[0143] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0144] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0145] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, systems, devices, storage media, and program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0146] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0147] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0148] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0149] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0150] The above is a detailed introduction to a method, system, device, equipment and medium for testing a software product provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a person skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for testing a software product, characterized in that: Applied to the GTest engine, the method includes: In response to receiving a start instruction sent by the software product to be tested, performing an initialization operation of GTest and a loading operation of each test case, wherein the software product to be tested is developed using the Unreal Engine, and the each test case includes: each test case related to a C++ interface test of the software product to be tested, and / or each test case related to a user interface UI test of the software product to be tested; Execute each test case loaded by the GTest engine through the test service to obtain the execution result of each test case; The execution results of each test case are returned to the software product to be tested.
2. The method according to claim 1, characterized in that The various test cases at least include various test cases related to the UI test of the software product to be tested; The executing each test case loaded by the GTest engine through the test service to obtain the execution result of each test case includes: A UI test instruction is sent to the test daemon through the test service, so that the test daemon requests the UI automated test framework, and performs UI operations on the software product to be tested according to each test case related to the UI test, so as to obtain the execution results of each test case related to the UI test, wherein the software product to be tested, the GTest engine and the test service are deployed on a first device, the test daemon and the UI automated test framework are deployed on a second device, and the first device and the second device are different devices.
3. The method according to claim 2, characterized in that When executing UI testing across software products, the UI automation testing framework implements UI operations on software products returned to the device system background based on a preset communication method, and the preset communication method includes: locks and conditional variables, file communication, and at least one of socket communication.
4. The method according to claim 1, characterized in that: The test service executes each test case based on a pre-configured C++ class and AsyncTask, and a GTestPlugin blueprint class is pre-added in the Unreal Engine, and the GTestPlugin blueprint class encapsulates the initialization logic and execution logic of GTest; The method further comprises: Configure a C++ class inherited from the GTestPlugin blueprint class, the C++ class is used to provide the test service with the ability to execute multiple test cases in parallel; An AsyncTask is configured in a component Component of the Unreal Engine, and the AsyncTask is used to provide the test service with a capability of executing test cases in an asynchronous task execution manner.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The semantic big model is used to study and analyze historical test data to generate test cases and their corresponding assertions.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Analyze the coverage of each test case by using a code coverage analysis tool; The performance analysis tool is used to perform performance analysis on the software product to be tested during the execution of each test case.
7. A system for testing a software product, characterized in that: The system includes a GTest engine and a testing service, wherein: The GTest engine is used to execute the initialization operation of GTest and the loading operation of each test case in response to receiving the startup instruction sent by the software product to be tested, wherein the software product to be tested is developed using the Unreal Engine, and the each test case includes: each test case related to the C++ interface test of the software product to be tested, and / or each test case related to the user interface UI test of the software product to be tested; The GTest engine is further used to send execution instructions of each test case loaded by the GTest engine to the test service; The test service is used to execute each test case loaded by the GTest engine according to the received execution instruction, and return the execution result of each test case to the GTest engine; The GTest engine is also used to return the execution results of each test case to the software product under test.
8. A device for testing a software product, characterized in that: Applied to the GTest engine, the device comprises: An instruction receiving module, configured to execute an initialization operation of GTest and a loading operation of each test case in response to receiving a startup instruction sent by a software product to be tested, wherein the software product to be tested is developed using Unreal Engine, and the various test cases include: various test cases related to C++ interface testing of the software product to be tested, and / or various test cases related to user interface UI testing of the software product to be tested; A test execution module, used to execute each test case loaded by the GTest engine through a test service, and obtain the execution result of each test case; The result sending module is used to return the execution result of each test case to the software product to be tested.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method for testing a software product according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method for testing a software product according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for realizing regional controller equipment test based on GoogleTest test framework
CN111016978A
Test method and device of unit to be tested, electronic equipment and storage medium
CN115470113A
Automatic testing method and device, equipment and storage medium
CN118606160A