Code testing method, device and system
By using historical test data to automate the testing of business systems, the problems of high cost and low efficiency of manual testing and writing test scripts in existing technologies are solved, and low-cost and efficient code testing is achieved.
Patent Information
- Application Number
- CN202410681895.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-03-15
- Filing Date
- 2024-05-28
- Publication Date
- 2025-09-19
AI Technical Summary
In the prior art, during the testing process of modifying business system codes and their associated functional modules, the development costs of manual testing and writing test scripts are high, and the testing efficiency is low.
The modified business system is automatically tested by utilizing the historical test data of the target function, including obtaining and verifying historical input parameters, historical intermediate data, and historical processing results to ensure the accuracy and comprehensiveness of the test results.
It achieves low-cost automated testing of business systems, reduces testing costs, improves testing efficiency and accuracy, and ensures the quality of modified code.
Smart Images

Figure CN120670280A_ABST
Abstract
Description
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 15, 2024, with application number 202410307496.0 and application name “A Method for Improving Testing Efficiency”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a code testing method, device, and system. Background Art
[0003] Business systems consist of multiple functional modules. Software developers can modify the code of these modules, such as adding new code or modifying existing code, to expand and optimize the functionality of the business system. A functional module is often associated with multiple other modules, and modifying the code of one module can affect the operation of related modules. To ensure the proper operation of the business system, the modified code and its related modules must be tested to verify their proper operation. If not, the modified code needs to be optimized.
[0004] Typically, technicians can manually test the modified code and its associated functional modules. However, manual testing is labor-intensive and inefficient. Alternatively, technicians can write test scripts, which are then executed by processing equipment to simulate human testing operations, thereby testing the modified code and its associated functional modules. However, test script development is costly and time-consuming. Summary of the Invention
[0005] The present application provides a code testing method, device and system, which can solve the problem of difficulty in quickly testing modified code and its associated functions in a business system.
[0006] In a first aspect, a code testing method is provided. The method includes testing a target function in a second business system based on historical test data of the target function to obtain a current processing result. The second business system is a business system obtained by modifying a function of a first business system. The first business system includes at least one function. The historical test data of the target function includes historical input parameters, historical intermediate data, and historical processing results when testing the target function in the first business system. Furthermore, the current processing result is verified based on historical processing results in the historical test data to obtain a test result for the target function in the second business system.
[0007] Compared to manually testing functional modules and writing test scripts to test functional modules, the code testing method provided in the embodiments of the present application utilizes historical test data of the target function to perform automated testing of each target function in the modified business system, i.e., the second business system. This method eliminates the need for manual testing and coding test scripts, is cost-effective, and can quickly and comprehensively test each functional module in the modified business system. Furthermore, the historical test data includes data used to test the target function over a period of time, resulting in high data reliability. Testing the target function based on this historical test data can effectively ensure the accuracy of the test results.
[0008] In one possible implementation, testing the target function in the second business system based on historical test data of the target function to obtain the current processing result includes: executing the target function in the second business system based on historical input parameters, processing historical intermediate data, and obtaining the current processing result.
[0009] In the code testing method provided in the embodiment of the present application, when testing the target function in the second business system, the input parameters of the target function are historical input parameters, and the intermediate data processed when executing the target function are historical intermediate data. This ensures that the process of testing the target function in the second business system and the process of testing the target function in the first business system in historical time process the same data, thereby ensuring the accuracy of the test results of the target function in the second business system.
[0010] In another possible implementation, the first business system includes an interception function, and the method further includes executing the interception function to obtain historical input parameters, historical intermediate data, and historical processing results of the target function during testing of the target function in the first business system, and saving the historical input parameters, historical intermediate data, and historical processing results to a target storage medium. Furthermore, historical test data of the target function may be obtained from the target storage medium.
[0011] By adding an interception function to the first business system and executing the interception function to obtain data during the test of the target function in the first business system, historical test data of the target function can be automatically and conveniently collected, thereby reducing testing costs.
[0012] In another possible implementation, the historical test data includes at least one of the following: historical test data for testing the target function in the first business system in a development environment; or historical test data for testing the target function in the first business system in a test environment.
[0013] By obtaining historical test data of the target function in the first business system in multiple environments such as development environment and test environment, the historical test data of the target function is made more diversified, and then the target function in the second business system can be tested in multiple situations based on the historical test data to see whether it operates normally, and the test results are more accurate.
[0014] In another possible implementation manner, the second business system includes the modified target function, or the second business system includes the target function and the modified function other than the target function.
[0015] In addition to the modified functions, the second business system may also include unmodified functions. In the code testing method provided in the embodiment of the present application, the target functions to be tested may include the modified functions, and may also include unmodified functions in addition to the modified functions. This allows comprehensive testing of each function in the second business system, thereby better ensuring or improving the quality of the modified code.
[0016] In another possible implementation, the target function includes a first function and a second function. The method includes testing the first function in the second business system based on historical test data of the first function to obtain a current processing result of the first function, and further verifying the current processing result of the first function based on the historical processing result of the first function to obtain a test result of the first function in the second business system. The method also includes testing the second function in the second business system based on historical test data of the second function to obtain a current processing result of the second function, and further verifying the current processing result of the second function based on the historical processing result of the second function to obtain a test result of the second function in the second business system.
[0017] Testing multiple functions together can ensure that each function in the second business system is tested quickly and efficiently.
[0018] In another possible implementation, in response to the modified code submission instruction, the target function in the second business system is tested based on historical test data of the target function.
[0019] After receiving the modified code submission instruction, the target function in the second business system is automatically tested, making the modified code submission process more intelligent.
[0020] In another possible implementation, when the test result indicates that the current processing result verification fails, the modified function submission of the second business system fails.
[0021] The test result indicates that the failure of the current processing result verification may reflect that there are problems with the code quality of the modified function. At this time, it is automatically determined that the submission of the modified function has failed. This not only makes the modified code submission process intelligent, but also ensures that the modified function with quality problems cannot be submitted successfully.
[0022] In another possible implementation, when the test result indicates that the current processing result has been verified, the modified function of the second business system is submitted successfully.
[0023] The test result indicates that the current processing result verification has passed, which reflects that there is no problem with the code quality of the modified function. At this time, it is automatically determined that the modified function has been submitted successfully, which not only makes the modified code submission process intelligent, but also ensures the code quality of the modified function after successful submission.
[0024] In another possible implementation, the second business system is deployed in a target system, and the method further includes: testing the function to be tested in the target system based on historical test data of the function to be tested, and obtaining a current processing result of the function to be tested, wherein the historical test data of the function to be tested includes historical input parameters, historical intermediate data, and historical processing results when testing the function to be tested. Furthermore, verifying the current processing result of the function to be tested based on the historical processing results of the function to be tested, and obtaining a test result of the function to be tested in the target system.
[0025] After the second business system is deployed to the target system, the historical test data of each function in the target system can be used to perform automated testing on each function in the target system, thereby achieving low-cost, fast and comprehensive testing of each functional module in the target system, and better understanding whether the target system where the second business system is deployed can operate normally, thereby better ensuring or improving the quality of the modified code.
[0026] In another possible implementation, in response to the test instruction, the function to be tested in the target system is tested according to the historical test data of the function to be tested.
[0027] After receiving the test instruction, the functions in the target system where the second business system is deployed are automatically tested, making the test process more intelligent.
[0028] In another possible implementation, the method further includes displaying at least one of historical data parameters, historical intermediate data, and historical processing results.
[0029] By displaying historical data parameters, historical intermediate data, and historical processing results, technicians can understand historical test data more intuitively and clearly, providing a better user experience.
[0030] In a second aspect, a code testing device is provided, comprising a testing module and a verification module. The testing module is configured to test a target function in a second business system based on historical test data of the target function, and obtain a current processing result. The second business system is a business system obtained by modifying the functions of the first business system. The historical test data of the target function includes historical input parameters, historical intermediate data, and historical processing results when testing the target function in the first business system. The verification module is configured to verify the current processing result based on the historical processing results, and obtain a test result for the target function in the second business system.
[0031] In one possible implementation, the test module may be used to execute a target function in the second business system according to historical input parameters, process historical intermediate data, and obtain a current processing result.
[0032] In another possible implementation, the apparatus may further include an interception module configured to, during testing of a target function in the first business system, obtain historical input parameters, historical intermediate data, and historical processing results of the target function, and to save the historical input parameters, historical intermediate data, and historical processing results to a target storage medium. Furthermore, the testing module may obtain historical test data of the target function from the target storage medium.
[0033] In another possible implementation, the historical test data of the target function includes at least one of the following: historical test data of the target function in the first business system tested in a development environment; or historical test data of the target function in the first business system tested in a test environment.
[0034] In another possible implementation, the second business system includes the modified target function, or the second business system includes the target function and the modified function other than the target function.
[0035] In another possible implementation, the target function includes a first function and a second function. The testing module may be used to test the first function in the second business system based on historical test data of the first function, thereby obtaining a current processing result of the first function. The verification module may be used to verify the current processing result of the first function based on the historical processing results of the first function, thereby obtaining a test result of the first function in the second business system. The testing module may also be used to test the second function in the second business system based on historical test data of the second function, thereby obtaining a current processing result of the second function. The verification module may also be used to verify the current processing result of the second function based on the historical processing results of the second function, thereby obtaining a test result of the second function in the second business system.
[0036] In another possible implementation, the test module may also be configured to respond to a modified code submission instruction and test the target function in the second business system based on historical test data of the target function.
[0037] In another possible implementation, the verification module may also be configured to fail to submit the modified function of the second business system when the test result indicates that the verification of the current processing result fails.
[0038] In another possible implementation, the verification module may also be configured to submit the modified function of the second business system successfully when the test result indicates that the current processing result has passed verification.
[0039] In another possible implementation, the second business system is deployed in the target system. The testing module may be further configured to test the function to be tested in the target system based on historical test data of the function to be tested, thereby obtaining a current processing result of the function to be tested. The historical test data of the function to be tested includes historical input parameters, historical intermediate data, and historical processing results when testing the function to be tested. Furthermore, the verification module may be further configured to verify the current processing result of the function to be tested based on the historical processing results of the function to be tested, thereby obtaining a test result of the function to be tested in the target system.
[0040] In another possible implementation, the test module may also be configured to respond to a test instruction and test the function to be tested based on historical test data of the function to be tested.
[0041] In another possible implementation, the device further includes a display module, which is configured to display at least one of historical data parameters, historical intermediate data, and historical processing results.
[0042] In a third aspect, a code testing system is provided. The system includes at least one device configured to test a target function in a second business system based on historical test data of the target function to obtain a current processing result. The second business system is a business system obtained by modifying the functions of the first business system. The historical test data of the target function includes historical input parameters, historical intermediate data, and historical processing results when testing the target function in the first business system. The system further verifies the current processing result based on historical processing results in the historical test data to obtain a test result for the target function in the second business system.
[0043] In one possible implementation, at least one device is configured to execute a target function in the second business system according to historical input parameters, process historical intermediate data, and obtain a current processing result.
[0044] In another possible implementation, the first business system includes an interception function, and the at least one device is further configured to, during testing of a target function in the first business system, execute the interception function to obtain historical input parameters, historical intermediate data, and historical processing results of the target function, and to save the historical input parameters, historical intermediate data, and historical processing results to a target storage medium. Furthermore, historical test data of the target function may be obtained from the target storage medium.
[0045] In another possible implementation, the historical test data includes at least one of the following: historical test data for testing the target function in the first business system in a development environment; or historical test data for testing the target function in the first business system in a test environment.
[0046] In another possible implementation manner, the second business system includes the modified target function, or the second business system includes the target function and the modified function other than the target function.
[0047] In another possible implementation, the target function includes a first function and a second function. At least one device is configured to test the first function in the second business system based on historical test data of the first function, obtain a current processing result of the first function, and further verify the current processing result of the first function based on the historical processing result of the first function to obtain a test result of the first function in the second business system. At least one device is further configured to test the second function in the second business system based on historical test data of the second function, obtain a current processing result of the second function, and further verify the current processing result of the second function based on the historical processing result of the second function to obtain a test result of the second function in the second business system.
[0048] In another possible implementation, the at least one device is further configured to respond to a modified code submission instruction and test the target function in the second business system based on historical test data of the target function.
[0049] In another possible implementation, the at least one device is further configured to, when the test result indicates that the verification of the current processing result fails, cause the modified function of the second business system to fail to be submitted.
[0050] In another possible implementation, the at least one device is further configured to submit the modified function of the second business system successfully when the test result indicates that the current processing result has been verified successfully.
[0051] In another possible implementation, the second business system is deployed in the target system, and the at least one device is further configured to: test the function to be tested in the target system based on historical test data of the function to be tested, and obtain a current processing result of the function to be tested, where the historical test data of the function to be tested includes historical input parameters, historical intermediate data, and historical processing results when testing the function to be tested; and further, verify the current processing result of the function to be tested based on the historical processing results of the function to be tested, to obtain a test result of the function to be tested in the target system.
[0052] In another possible implementation, the at least one device is further configured to respond to a test instruction and test the function to be tested in the target system according to historical test data of the function to be tested.
[0053] In another possible implementation, at least one device is further configured to display at least one of historical data parameters, historical intermediate data, and historical processing results.
[0054] In a fourth aspect, a computing device is provided, comprising a processor and a memory, wherein the processor is configured to execute instructions stored in the memory, so that the computing device executes the code testing method described in the first aspect.
[0055] In a fifth aspect, a computing cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory. The processor of at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the code testing method described in the first aspect.
[0056] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed by a computing device, causes the computing device to execute the code testing method as described in the first aspect.
[0057] In a seventh aspect, a computer-readable storage medium is provided, which includes computer program instructions. When the computer program instructions are executed by a computer device, the computer device executes the code testing method as described in the first aspect.
[0058] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods.
[0059] The following description includes more details about the implementation methods provided by the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A schematic diagram of the architecture of a code testing system provided in an embodiment of the present application;
[0061] Figure 2Schematic diagram of the code testing method provided in this embodiment Figure 1 ;
[0062] Figure 3 A schematic diagram of the process of testing a target function based on historical test data provided in an embodiment of the present application;
[0063] Figure 4 Schematic diagram of the code testing method provided in this embodiment Figure 2 ;
[0064] Figure 5 A flowchart of a method for acquiring historical test data provided in an embodiment of the present application;
[0065] Figure 6 Schematic diagram of the modified code submission process provided in the embodiment of this application;
[0066] Figure 7 A schematic diagram of the test display interface provided in an embodiment of the present application;
[0067] Figure 8 A schematic diagram of the historical test data display interface provided in an embodiment of the present application;
[0068] Figure 9 A schematic diagram of the structure of a code testing device provided in an embodiment of the present application;
[0069] Figure 10 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0070] Figure 11 A schematic diagram of the structure of a computing cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] To facilitate understanding, the terms involved in this application are first introduced.
[0072] Business systems refer to systems used to process or manage business activities in various business areas. For example, a business system may include an Enterprise Resource Planning System (ERP System), which is used to manage the company's daily business activities.
[0073] The business system can be used to process or manage one or more business activities. For example, the business system can be used to process or manage sales affairs, or the EPR system can be used to manage financial affairs, sales affairs, production activities, etc.
[0074] A business system may include multiple functional modules (or business scenarios). For example, an EPR system may include multiple functional modules such as order query and order save. A functional module may have multiple associated functional modules.
[0075] In some implementations, a business system can be composed of multiple microservices. This means that the business system can be split into multiple microservices. Each microservice can include one or more functional modules, and each microservice can be independently deployed, run, and upgraded. Therefore, microservices can also be considered independent small business systems.
[0076] In the embodiment of the present application, the business system may refer to a complete system for processing or managing business activities, such as an EPR system, or may refer to a microservice.
[0077] Developers can modify the functional modules of the business system. For example, they can modify the code of one or more functional modules, add new code to the business system to add new functional modules, etc. This allows the functions of the business system to be expanded and optimized.
[0078] After modifying a functional module in a business system, the modified functional module (i.e., the modified code) and its associated functional modules within the modified business system must be tested to verify that each functional module is functioning properly. If not, the modified code must be optimized. Business systems can include numerous functional modules, making it difficult to quickly and comprehensively test each functional module within a modified business system.
[0079] In the embodiments of the present application, for ease of distinction, the business system requiring functional modification may be referred to as a first business system (e.g., a microservice), where the first business system includes at least one function. The business system resulting from the functional modification of the first business system may be referred to as a second business system (e.g., a modified microservice).
[0080] Modifying the functions of the first business system may include modifying the codes of one or more existing functions of the first business system, or may include adding new functions to the first business system.
[0081] An embodiment of the present application provides a code testing method. The method tests a target function in a second business system based on historical test data of the target function, obtaining a current processing result. The historical test data for the target function includes historical input parameters, historical intermediate data, and historical processing results when testing the target function in a first business system. The current processing result is then verified based on the historical processing results in the historical test data, obtaining a test result for the target function in the second business system.
[0082] Through the code testing method provided by the embodiment of the present application, after the functional module of the first business system is modified, the historical test data of the target function can be used to automatically test the target function in the modified second business system. Compared with manually testing functional modules and writing test scripts to test functional modules, the code testing method provided by the embodiment of the present application does not require manual testing and coding of test scripts by personnel, has low cost, and can also quickly and efficiently test the functional modules in the modified business system. In addition, in the code testing method provided by the embodiment of the present application, the target function may include multiple functional modules in the second business system, thereby comprehensively testing whether each functional module in the second business system is operating normally, helping to improve the quality of the modified code. In addition, the historical test data includes data for testing the target function in historical time, and the data reliability is high. Testing the target function based on historical test data can better guarantee the accuracy of the test results.
[0083] The following describes the system architecture provided by the embodiment of this application. Figure 1 , the embodiment of the present application provides a schematic diagram of the architecture of a code testing system. The code testing system 100 can be used to implement the code testing method proposed in the embodiment of the present application.
[0084] like Figure 1 As shown, the code testing system 100 includes a data acquisition device 110 , a testing device 120 and an operation device 130 .
[0085] The data acquisition device 110 can be used to collect historical test data of functions. The historical test data of functions collected by the data acquisition device 110 is stored in the database 140, so that the test device 120, the operation device 130 or other devices can obtain the historical test data of the required functions from the database 140. Figure 5 How the data collection device 110 acquires historical test data of a function is described in more detail.
[0086] The test device 120 can obtain historical test data of the target function from the database 140 and execute the code testing method provided in the embodiment of the present application, for example Figure 2 The code testing method described above tests the target function in the second business system (i.e., the modified business system obtained by functionally modifying the first business system, such as the modified microservice). Figure 2 and Figure 3 How the test device 120 tests the target function in the modified business system is described in more detail.
[0087] The second business system can be deployed on the operation device 130, and the operation device 130 can run the second business system. In some implementations, the target system is deployed on the operation device 130, and the second business system can be deployed in the target system. For example, the target system includes an ERP system, and the business system includes microservices of the ERP system. Then, the modified microservices can be deployed in the ERP system on the operation device 130. In some implementations, the operation device 130 can obtain historical test data of the function to be tested from the database 140 and execute the code testing method provided in the embodiment of the present application, for example Figure 4 The code testing method is described to test the function to be tested in the target system. Figure 4 How the operating device 130 tests the function to be tested in the target system is described in more detail.
[0088] The data acquisition device 110 can be a server or cloud, or a terminal such as a mobile phone terminal, a laptop computer, an AR / VR device, etc. that can be used for data acquisition. The data acquisition device 110 may include a first I / O interface 111 and a first processor 112. The data acquisition device 110 may also include a first business system 113. Users such as technicians can use the client device 150 or the input device ( Figure 1 (not shown) sends a request for testing the function of the first business system 113 to the first I / O interface 111. After receiving the request, the first processor 112 of the data acquisition device 110 can execute the steps of the historical test data acquisition method provided in the embodiment of the present application, such as Figure 5 The steps in the historical test data acquisition method described in the above method are used to obtain the historical test data of the function.
[0089] The test device 120 can be a server or a cloud, or a terminal such as a mobile phone terminal, a laptop computer, AR / VR, etc. The test device 120 may include a second I / O interface 121 and a second processor 122. The test device 120 may also include a second business system 123. The second I / O interface 121 of the test device 120 is used to interact with external devices for data, such as for transmitting historical test data of the target function obtained from the database 140. The second processor 112 of the test device 120 can execute the steps of the code testing method provided in the embodiment of the present application, such as Figure 2 The steps in the code testing method described in are performed to test the target function in the second business system 123.
[0090] The operating device 130 can be a server or a cloud, etc., or a terminal, such as a mobile terminal, a laptop, AR / VR, etc. The operating device 130 may include a third I / O interface 131 and a third processor 132. The operating device 130 may also include a target system 133, and the second business system may be deployed in the target system. The third I / O interface 131 of the operating device 130 is used to interact with external devices for data, such as for transmitting historical test data of the function to be tested obtained from the database 140. The third processor 132 of the operating device 130 can execute the steps in the code testing method provided in the embodiment of the present application, such as Figure 4 The steps in the code testing method described in the embodiment are used to test the function to be tested in the target system 133.
[0091] It is worth noting that Figure 1 This is only a schematic diagram of the architecture of a code testing system provided in an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation.
[0092] For example, in Figure 1 In the embodiment, the database 140 is a component outside the data collection device 110 . In other cases, the database 140 may also be included in the data collection device 110 .
[0093] For another example, the test device 120 is a device other than the data acquisition device 110. In other cases, the test device 120 and the data acquisition device 110 may be the same device. Furthermore, the first I / O interface 111 and the second I / O interface 121 may be the same I / O interface. Furthermore, the first processor 112 and the second processor 122 may be the same processor.
[0094] For another example, the operating device 130 is a device other than the testing device 120. In other cases, the operating device 130 and the testing device 120 may be the same device. Furthermore, the second I / O interface 121 and the third I / O interface 131 may be the same I / O interface. Furthermore, the second processor 122 and the third processor 132 may be the same processor.
[0095] The code testing system and code testing method provided in the embodiments of the present application (for example, Figure 2 or Figure 4 The code testing method provided can be applied to various scenarios where functions in modified business systems need to be tested.
[0096] For example, it can be applied to the scenario of self-testing the code of the modified function during the software development process. As an example, specifically, the technician can modify the function of the first business system on the test device 120 through the client device 150 or the input device to obtain the second business system. Then, the test device 120 can obtain the historical test data of the modified function, as well as the code testing method provided by the embodiment of the present application (for example Figure 2 The modified function in the second business system is tested using a code testing method to obtain a test result of the modified function.
[0097] For another example, it can be applied to the code pipeline, the code into the quality of the access control scene. As an example, specifically, the client device 150 or the input device can submit the modified function to the test device 120, and the test device 120 can obtain the second business system based on the modified function and the first business system. Then, the test device 120 can obtain the historical test data of the target function, and the code testing method provided by the embodiment of the present application (for example Figure 2 The target function in the second business system is tested using a code testing method to obtain a test result of the target function in the second business system. Then, the testing device 120 can also determine whether the modified function is successfully submitted based on the test result.
[0098] For another example, it can be applied to system deployment scenarios such as CI / CD (Continuous Integration / Continuous Deployment) or system automation testing scenarios. As an example, specifically, the second business system obtained after functional modification of the first business system can be deployed on the target system on the running device 130, and the target system may include a system in a test environment and a system in a production environment. Then, the running device 130 can obtain historical test data of the function, as well as the code testing method provided by the embodiment of the present application (for example Figure 4 The functions in the target system are tested using a code testing method) to obtain test results of the functions of the target system.
[0099] The following describes the code testing method provided by the embodiment of the present application. Figure 1 The code testing method provided in the embodiment of the present application can be executed by the testing device 120, for example, by a processor of the testing device 120.
[0100] Figure 2 This is a flow diagram of the code testing method provided in the embodiment of the present application. Figure 1 .like Figure 2 As shown, the code testing method includes the following steps.
[0101] Step 210: Test the target function in the second business system according to the historical test data of the target function to obtain the current processing result.
[0102] The target function may include one or more functions in the first business system. For example, if the first business system is a microservice for managing financial transactions, the target function may include one or more functions in the microservice, such as generating accounting documents and initially confirming sales revenue.
[0103] When the target function includes multiple functions, for each function, the function in the second business system may be tested based on the historical test data of the function in step 210. For example, if the target functions include a first function and a second function, step 210 may include testing the first function in the second business system based on the historical test data of the first function, and testing the second function in the second business system based on the historical test data of the second function, etc.
[0104] In some implementations, the target function in the second business system under test may include one or more of the following: the modified function, and functions other than the modified function. Thus, the code testing method provided in embodiments of the present application can test each function in the second business system, such as the modified function and functions associated with the modified function.
[0105] The test method for each function can be similar. The following text mainly uses one function as an example to explain the test method in detail.
[0106] The testing device 120 may obtain the historical test data of the target function from a storage medium storing historical test data of various functions, such as the database 140 .
[0107] The historical test data of the target function includes: data when the target function in the first business system is tested once or multiple times in the historical time.
[0108] Specifically, the data when testing the target function in the first business system once in historical time includes: the input parameters of the target function (which may be called historical input parameters), the intermediate data in the process of executing the target function according to the input parameters (which may be called historical intermediate data), and the processing results obtained when the target function is executed (which may be called historical processing results).
[0109] For example, the target function includes "Initial Confirmation of Sales Revenue." The historical input parameters for this function include input parameters obtained in response to the Initial Confirmation of Sales Revenue request. For example, the input parameters include information about a verification rule used to confirm sales revenue, specifically including the verification rule ID information.
[0110] Historical intermediate data during the "Initial Sales Revenue Recognition" process based on historical input parameters for this process may include: validation rules obtained from the rules database and sales contract details obtained from the sales database during the process of confirming sales revenue based on validation rules. Specific validation rules may include price currency type, price list information, base price, upper and lower price limits, etc.
[0111] The historical processing results obtained upon completion of the "Initial Confirmation of Sales Revenue" process may include the results of validating the sales contract data according to the verification rules. For example, the historical processing results may include a result indicating that the sales revenue verification passed, or a result indicating that the sales revenue verification failed.
[0112] For details on how to obtain historical test data for the target function, see Figure 4 and its related descriptions.
[0113] In the embodiment of the present application, taking the target function including one function as an example, testing the target function in the second business system according to the historical test data of the target function may specifically include the following process:
[0114] The target function in the second business system is executed according to the historical input parameters, and the historical intermediate data is processed to obtain the current processing result of the target function.
[0115] As an example, the target function includes "Initial Recognition of Sales Revenue". Testing "Initial Recognition of Sales Revenue" in the second business system specifically includes:
[0116] Execute the "Initial Revenue Confirmation" in the modified business system based on the historical input parameters of "Initial Revenue Confirmation";
[0117] Processing the historical intermediate data for "initial recognition of sales revenue," for example, confirming the sales contract data included in the historical intermediate data based on the verification rules included in the historical intermediate data;
[0118] The current processing result of "initial confirmation of sales revenue" is obtained, for example, the result of confirming the sales contract data according to the verification rules is obtained, and the result indicates that the sales revenue verification has passed.
[0119] In some implementations, a function in a business system may include multiple function methods. When the function is executed according to input parameters, the multiple function methods are executed in sequence according to the method call chain.
[0120] For example, when input parameters are fed into a function, a first function method (also known as an entry method) is first executed to process the input parameters, a second function method (also known as an intermediate method) is then executed to obtain intermediate data, and a third function method (also known as a result method) is then executed to process the intermediate data to obtain a result. When executing the second function method, the intermediate data may be obtained from objects outside the current function, such as databases or application programming interfaces (APIs).
[0121] When testing the target function in the second business system based on historical test data, it may include inputting historical input parameters of the target function into the target function, and then executing the target function in sequence according to the method call link, including multiple function methods.
[0122] For example, Figure 3 As shown, when testing the target function in the second business system based on historical test data, the historical input parameters are input into the target function, the first function method is executed first to process the historical input parameters, then the second function method is executed to obtain the historical intermediate data, and then the third function method is executed to process the historical intermediate data to obtain the current processing result.
[0123] When executing the second function method, the historical intermediate data in the historical test data can be directly used as the intermediate data obtained by the second function method, that is, the historical intermediate data is used as the intermediate data for the simulation. In other words, when executing the second function method, there is no need to obtain intermediate data from objects outside the current function, such as databases, APIs, etc.
[0124] In some implementations, step 210 may be performed based on a modified code submission instruction. For example, if a developer modifies a function(s) in the first business system and the developer performs a first instruction operation on the test device 120 via the client device 150 or input device to instruct the submission of the modified code (the modified code, i.e., the modified function), the test device 120 receives / generates the modified code submission instruction, responds to the modified code submission instruction, and performs step 210 to test the target function in the second business system.
[0125] As an example, Figure 6 This is a schematic diagram of the modified code submission process provided in the embodiment of this application. Figure 6 As shown, the test display interface may include an icon 610 for "Submit modified code". The developer may click on the icon 610 through the client device 150 or the input device to indicate the submission of the modified code. At this time, the test device 120 receives / generates a modified code submission instruction, and responds to the modified code submission instruction, executing step 210 to test the target function in the modified business system and obtain the test result of the target function.
[0126] Step 220: Verify the current processing result based on the historical processing result to obtain the test result of the target function in the second business system.
[0127] Verifying the current processing result based on the historical processing results may include: verifying whether the current processing result and the historical processing results are the same.
[0128] The test result of the target function may include a first test result or a second test result.
[0129] The first test result may indicate that the current processing result of the target function has failed verification. Verification failure may mean that the current processing result is different from the historical processing result.
[0130] The second test result may indicate that the current processing result of the target function has passed verification. A verification failure may indicate that the current processing result is the same as the historical processing result.
[0131] In some implementations, the test results of the target function of the second business system may also be displayed for personnel to review.
[0132] In some implementations, after a developer modifies a function in the first business system and submits the modified function, when executing steps 210 and 220 , it can be determined whether the modified function is successfully submitted based on the test result of the target function.
[0133] For example, when the test result of the target function indicates that the current processing result has passed verification, the modified function is submitted successfully. The test result of the target function may include test results of multiple functions in the second business system. In some implementations, when the test results of multiple functions all indicate that the current processing result has passed verification, the modified function fails to be submitted.
[0134] The test result indicates that the current processing result verification has passed, which reflects that there is no problem with the code quality of the modified function. At this time, it is automatically determined that the modified function has been submitted successfully, which not only makes the modified code submission process intelligent, but also ensures the code quality of the modified function after successful submission.
[0135] For another example, when the test result of the target function indicates that the current processing result verification fails, the modified function submission fails. In some implementations, when the test results of one or more functions indicate that the current processing result verification fails, the modified function submission fails.
[0136] The test result indicates that the failure of the current processing result verification may reflect that there are problems with the code quality of the modified function. At this time, it is automatically determined that the submission of the modified function has failed. This not only makes the modified code submission process intelligent, but also ensures that the modified function with quality problems cannot be submitted successfully.
[0137] In some implementations, when the modified function fails to be submitted, the modified function may not be merged into the code base of the business system. When the modified function is successfully submitted, the modified function may be merged into the code base of the business system.
[0138] In some implementations, when the submission of a modified function fails, the process can return to the code modification step, allowing developers to optimize the code of the modified function and improve code quality.
[0139] Optionally, in some implementations, after step 210 and step 220 are completed, the following steps may be continued: Figure 4 The middle steps are step 230 and step 240.
[0140] Figure 4 This is a flow diagram of the code testing method provided in the embodiment of the present application. Figure 2 . Figure 4 The main steps are shown in step 230 and step 240, and steps 210-220 are not shown in the figure. Figure 4 As shown in Figure 4 As shown, the code testing method may further include the following steps.
[0141] Step 230: Deploy the second business system to the target system.
[0142] In passing Figure 2 After testing the target function in the second business system in steps 210 and 220, if the modified function is successfully submitted, the second business system can be deployed on the target system. For example, the second business system can be deployed on the target system on the running device 130.
[0143] The target system may include a system in a test environment. Deploying the second business system in the test environment is equivalent to deploying the second business system in the test environment. For example, the first business system is a microservice in an EPR system, and the second business system is a modified microservice. The system in the test environment may include the EPR system in the test environment.
[0144] The target system may also include a system in a production environment. Deploying the second business system in a system in a production environment is also referred to as deploying the second business system in a production environment. For example, the first business system is a microservice in an EPR system, and the second business system is a modified microservice. The system in a production environment may include the EPR system in the production environment.
[0145] Step 240: Test the function to be tested in the target system.
[0146] After deploying the second business system to the target system, you can test whether the functions in the target system are running normally. If the functions in the target system are not running normally, you can continue to optimize the code of the modified functions in the second business system to improve the code quality.
[0147] The functions to be tested in the target system may be referred to as functions to be tested. The functions to be tested may include functions in the second business system or other functions in the target system except the second business system, for example, functions in other business systems except the second business system.
[0148] The method for testing the function to be tested in the target system can be similar to the method for testing the target function in the second business system. That is, the function to be tested can be tested based on the historical test data of the function to be tested to obtain the current processing result of the function to be tested, and then the current processing result can be verified based on the historical processing results of the function to be tested to obtain the test result of the function to be tested. For more details about the testing method, please refer to Figure 2 and related instructions.
[0149] The historical test data of the function to be tested may include: data from one or more tests of the function to be tested in the business system where the function to be tested is located in the historical time. The method for obtaining the historical test data of the function to be tested is similar to that of the target function. For more details, please refer to Figure 2 and Figure 5 and related instructions.
[0150] In some implementations, step 240 may be performed based on a test instruction. For example, a technician, such as an operation and maintenance personnel, may perform a second instruction operation on the test device 120 or the operation device 130 via the client device 150 or the input device to instruct a test. In this case, the test device 120 or the operation device 130 receives / generates the test instruction, responds to the test instruction, and performs step 240 to test the function to be tested in the target system.
[0151] As an example, Figure 7 As shown, the "system test" icon 710 can be displayed through the test display interface, and the technician can click the icon 710 through the input device to indicate the test. At this time, the test device 120 receives / generates the test instruction, responds to the test instruction, and executes step 240 to test the function to be tested in the target system to obtain the test result of the function to be tested.
[0152] In some implementations, the test results of the function to be tested of the target system may also be displayed for personnel to review.
[0153] In some implementations, Figure 2 and Figure 4The code testing method provided can be implemented through various feasible program modules or hardware modules. As an example, a software development kit (SDK) can be written and deployed in the business system, and the SDK can be executed to execute Figure 2 and Figure 4 The provided code tests the method.
[0154] The code testing method provided in the embodiments of this application is low-cost to implement and can quickly and comprehensively test various functional modules in a modified business system or target system. As an example, the code testing method provided in the embodiments of this application can quickly test 146 functions in a modified business system or target system, and the total testing time is as short as approximately 3 seconds.
[0155] The following describes the historical test data acquisition method provided by the embodiment of the present application. The historical test data acquisition method provided by the embodiment of the present application can be Figure 1 The code test system 100 is shown as an example. Specifically, the historical test data acquisition method provided in the embodiment of the present application can be executed by the data acquisition device 110, for example, by a processor of the data acquisition device 110.
[0156] Figure 5 FIG. 1 is a flow chart of a method for acquiring historical test data provided in an embodiment of the present application. Figure 5 As shown, the method includes the following steps.
[0157] Step 510: During the test of the target function in the first business system, the interception function is executed to obtain the historical input parameters, historical intermediate data, and historical processing results of the target function.
[0158] The interception function can be implemented through various feasible program modules or hardware modules, and the interception function can be executed together with the target function.
[0159] As an example, an SDK can be written to implement the interception function, which can be deployed in the business system and executed along with the target function in the business system. The interception technology can be implemented using various feasible interception technologies such as AOP.
[0160] In some implementations, as described above, a function in a business system may include multiple function methods. When the function is executed according to input parameters, the multiple function methods are executed in sequence according to the method call chain.
[0161] As an example, the specific process of executing the interception function may include: in the process of testing the target function in the first business system, when the historical input parameters are input into the target function, intercepting the historical data parameters; when the second function method is executed to obtain historical intermediate data, intercepting the historical intermediate data; when the third function method is executed to process the historical intermediate data to obtain a historical processing result, intercepting the historical processing result.
[0162] Step 520: Save the historical input parameters, historical intermediate data, and historical processing results to a target storage medium.
[0163] The target storage medium, such as the database 140 , may include various storage media that can be used to store historical test data of the target function, such as the physical memory of the data acquisition device 110 or a cloud platform.
[0164] In some implementations, when the interception function is executed, the historical test data of the target function can be stored in the form of field names and field values. Thus, the historical test data of the target function can be saved as structured data.
[0165] As an example, historical test data of a target function may include a plurality of fields and field values related to the target function as shown below:
[0166] The first field is such as "Target Function Name", and the field value of the first field is such as "Initial Recognition of Sales Revenue";
[0167] The second field is such as "method name", and the field value of the second field is such as "first function method name", "second function method name", "third function method name", etc.;
[0168] The third field may be "method content", and the field value of the third field may be "historical input parameters of the target function", "historical intermediate data in the process of executing the target function according to historical input parameters", or "historical processing results obtained at the end of executing the target function".
[0169] Figure 5 The provided historical test data acquisition method can automatically and conveniently collect historical test data of functions in the business system by adding an interception function to the business system and executing the interception function to obtain data during the process of testing functions in the business system, thereby reducing testing costs.
[0170] In some implementations, Figure 5 In the method, historical test data of the target function can be obtained when the target function is tested in at least one operating environment such as a development environment and a test environment.
[0171] For example, a development environment is deployed on the data acquisition device 110, and a first business system is deployed in the development environment. When the developer tests the target function of the business system in the development environment (such as when performing a self-test on the target function), the data acquisition device 110 can execute an interception function to obtain historical test data of the target function.
[0172] For another example, a test environment is deployed on the data acquisition device 110, and a first business system is deployed in the test environment. When the tester tests the target function in the business system in the test environment (such as when performing system integration testing (SIT testing) on the target function), the data acquisition device 110 can execute the interception function to obtain the historical test data of the target function. Alternatively, when the business personnel test the target function in the business system in the test environment (such as when performing user acceptance testing (UAT testing) on the target function), the data acquisition device 110 can execute the interception function to obtain the historical test data of the target function.
[0173] By obtaining historical test data of the target function in the first business system in multiple environments such as development environment and test environment, the historical test data of the target function is made more diversified, and then the target function in the second business system can be tested in multiple situations based on the historical test data to see whether it operates normally, and the test results are more accurate.
[0174] The business scenarios of large-scale business systems are relatively complex. During the replacement of software R&D technicians, relying solely on the transfer of business scenario knowledge between personnel will lead to the easy loss of business scenario knowledge. New technicians cannot quickly and completely inherit all the business scenario knowledge of the previous personnel. Figure 5 The provided historical test data acquisition method can automatically record the test data of each technician testing the functions of the business system in the historical time, thereby automatically recording the business scenario knowledge of the business system, so that when the technician is replaced, the business scenario knowledge can be quickly and completely transferred based on the recorded historical test data.
[0175] In some implementations, the data acquisition device 110, the test device 120, the operation device 130, or other devices may also display historical test data for a function, such as at least one of the function's historical input parameters, historical intermediate data, and historical processing results. This allows technicians to intuitively view historical test data, facilitate a clear understanding of the content of the historical test data, and enhance user experience.
[0176] As an example, Figure 8As shown, the historical test data display interface may include historical test data 810 of the target function. The historical test data 810 of the target function may include the aforementioned multiple fields and field values related to the target function.
[0177] In some implementations, technicians can also adjust the historical test data of the target function as needed, such as deleting unnecessary data, modifying data as needed, etc. In this way, the historical test data can be made more consistent with the technicians' expectations, resulting in better test results.
[0178] It is understood that in order to implement the functions in the above embodiments, the computing device includes hardware structures and / or software modules corresponding to the execution of each function. It should be readily apparent to those skilled in the art that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a manner driven by computer software depends on the specific application scenario and design constraints of the technical solution.
[0179] Combined with the above Figures 2 to 8 , describes in detail the code testing method provided by the embodiment of the present application, and will be combined with Figure 9 , describing the apparatus provided in the present application. These apparatuses can be used to implement the functions of the devices or processors in the above method embodiments, and thus can also achieve the beneficial effects possessed by the above method embodiments.
[0180] Figure 9 This is a schematic diagram of the structure of the code testing device provided in the embodiment of the present application. Figure 9 As shown, the code testing device 900 includes a testing module 910 and a verification module 920. In some implementations, the code testing device 900 may further include an interception module 930 or a display module 940.
[0181] The test module 910 is used to test the target function in the second business system based on the historical test data of the target function to obtain the current processing result. The second business system is a business system obtained by modifying the function of the first business system. The historical test data of the target function includes the historical input parameters, historical intermediate data and historical processing results when testing the target function in the first business system. For details about this operation, please refer to Figure 2 Relevant content of step 210.
[0182] Verification module 920 is used to verify the current processing result based on the historical processing result, and obtain the test result of the target function in the second business system. Figure 2 Relevant content of step 220.
[0183] The interception module 930 is used to obtain the historical input parameters, historical intermediate data and historical processing results of the target function during the test of the target function in the first business system, and save the historical input parameters, historical intermediate data and historical processing results to the target storage medium. Figure 5 Related content.
[0184] In some implementations, the test module 910 may also be used to obtain historical test data of the target function from the target storage medium. Figure 2 Relevant content of step 210.
[0185] In some implementations, the test module 910 can also be used to execute the target function in the second business system according to the historical input parameters, process the historical intermediate data, and obtain the current processing result. Figure 2 Relevant content of step 210.
[0186] In some implementations, the historical test data of the target function includes at least one of the following: historical test data of the target function in the first business system tested in a development environment; or historical test data of the target function in the first business system tested in a test environment. For details about the historical test data, see Figure 2 Step 210 and Figure 5 Related content.
[0187] In some implementations, the second business system includes the modified target function, or the second business system includes the target function and the modified function other than the target function. For more details about the second business system, see Figure 2 Relevant content of step 210.
[0188] In some implementations, the test module 910 can also be used to respond to the modified code submission instruction and test the target function in the second business system based on the historical test data of the target function. Figure 2 Related content.
[0189] In some implementations, the verification module 920 may also be used to fail to submit the modified function of the second business system when the test result indicates that the current processing result verification fails. Figure 2 Relevant content of step 220.
[0190] In some implementations, the verification module 920 can also be used to submit the modified function of the second business system successfully when the test result indicates that the current processing result has been verified. Figure 2 Relevant content of step 220.
[0191] In some implementations, the second business system is deployed in the target system. The test module 910 can also be used to test the function to be tested in the target system based on the historical test data of the function to be tested, and obtain the current processing result of the function to be tested. The historical test data of the function to be tested includes the historical input parameters, historical intermediate data and historical processing results when testing the function to be tested. And the verification module 920 can also be used to verify the current processing result of the function to be tested based on the historical processing result of the function to be tested, and obtain the test result of the function to be tested in the target system. For details about this operation, please refer to Figure 4 Related content.
[0192] In some implementations, the test module 910 can also be used to respond to a test instruction and test the function to be tested based on historical test data of the function to be tested. Figure 4 Related content.
[0193] The display module 940 is used to display at least one of the historical input parameters, historical intermediate data and historical processing results. Figure 5 Related content.
[0194] It should be noted that Figure 9 The figure is only a structural diagram of the device, and the positional relationship between the test module 910, the verification module 920, the interception module 930, and the display module 940 shown in the figure does not constitute any limitation.
[0195] For example, in Figure 9 In the embodiment, the test module 910, the verification module 920, the interception module 930, and the display module 940 are all provided in one device. However, in some implementations, the interception module 930 and the test module 910, the verification module 920, and the display module 940 may be provided in different devices. For example, the test module 910 and the verification module 920 may be provided in a first device, and the interception module 930 may be provided in a second device.
[0196] Optionally, the test module 910, the verification module 920, the interception module 930, and the display module 940 may each include multiple submodules, and the multiple submodules may be deployed to implement part of the functions of the corresponding modules, for example, to implement the aforementioned Figure 2-Figure 5 One or more steps.
[0197] The apparatus can be implemented by software or hardware. As an example, the implementation of the code testing apparatus 900 is described below.
[0198] As an example of a software functional unit, the code testing device 900 may include code running on a computing instance. The computing instance may be at least one of a physical host (computing device), a virtual machine, a container, and other computing devices. Furthermore, the above-mentioned computing device may be one or more. For example, the code testing device 900 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the application may be distributed in the same region or in different regions. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same AZ or in different AZs, and each AZ includes one data center or multiple data centers with close geographical locations. Generally, a region may include multiple AZs.
[0199] Similarly, the multiple hosts / virtual machines / containers running the code can be distributed within the same VPC or across multiple VPCs. Typically, a VPC is located within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0200] As an example of a hardware functional unit, a module can include at least one computing device, such as a server. Alternatively, code testing device 900 can be implemented using an ASIC or a PLD. The PLD can be implemented using a CPLD, FPGA, GAL, or any combination thereof.
[0201] The multiple computing devices included in the code testing apparatus 900 can be distributed in the same region or in different regions. The multiple computing devices included in the code testing apparatus 900 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the code testing apparatus 900 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0202] The present application also provides a computing device 1000. Figure 10As shown, computing device 1000 includes: bus 1002, processor 1004, memory 1006, and communication interface 1008. Processor 1004, memory 1006, and communication interface 1008 communicate with each other via bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1000. Optionally, processor 1004 of computing device 1000 can be connected to a display and input device (not shown) via communication interface 1008.
[0203] The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 The bus 1002 may include a path for transmitting information between various components of the computing device 1000 (eg, the memory 1006, the processor 1004, and the communication interface 1008).
[0204] The processor 1004 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP). In the embodiment of the present application, the processor 1004 is used to execute the embodiments of the present application. Figure 2 、 Figure 4 Any of the provided code testing methods or Figure 5 The steps or operations of the method for obtaining historical test data are provided.
[0205] The memory 1006 may include volatile memory, such as random access memory (RAM). The processor 1004 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0206] The memory 1006 stores executable program codes, and the processor 1004 executes the executable program codes to respectively implement the functions of the aforementioned communication module 1010, the data processing module 1020, and the display module 1030, thereby implementing the training set processing method in Example 1, the model training method in Example 2, and the model training method in Example 3 provided in the embodiments of the present application. That is, the memory 1006 stores the program codes for executing the embodiments of the present application. Figure 2 、 Figure 4 Instructions in either the provided code test method or Figure 5 Provides instructions for obtaining historical test data.
[0207] The communication interface 1008 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1000 and other devices or a communication network.
[0208] The display may include various display devices such as plasma display, liquid crystal display, etc. that can realize the display function. The computing device 1000 can realize the embodiment of the present application through the display Figure 2 、 Figure 4 Any of the provided code test methods involve display functions or Figure 5 The provided method for acquiring historical test data involves a display function.
[0209] Input devices may include various input devices that can realize information / signal input, such as keyboard, mouse, touch screen, etc.
[0210] This application also provides a computing device cluster 1100. Figure 11 As shown, the computing device cluster includes at least one computing device 1000. The memory 1006 in one or more computing devices 1000 in the computing device cluster may store the same data for executing the process provided in the embodiment of the present application. Figure 2 、 Figure 4 Instructions in either the provided code test method or Figure 5 Provides instructions for obtaining historical test data.
[0211] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store the memory 1006 for executing the program provided in the embodiment of the present application. Figure 2 、 Figure 4 Instructions for any of the code test methods or Figure 5 Some instructions of the historical test data acquisition method, such as for executing Figure 2 Instructions for some steps in the code test method, Figure 4 Instructions for some steps in the code test method, Figure 5In other words, the combination of one or more computing devices 1000 can jointly execute the instructions for executing the method provided in the embodiment of the present application. Figure 2 、 Figure 4 Instructions for any of the code test methods or Figure 5 Instructions for the historical test data acquisition method.
[0212] It should be noted that the memory 1006 in different computing devices 1000 in the computing device cluster can store different instructions, each for executing a portion of the functions of the training set processing device for model training. In other words, the instructions stored in the memory 1006 in different computing devices 1000 can implement the functions of one or more of the aforementioned testing module 910, verification module 920, interception module 930, and display module 940.
[0213] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network.
[0214] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store the memory 1006 for executing the program provided in the embodiment of the present application. Figure 2 、 Figure 4 Instructions in either the provided code test method or Figure 5 In other words, the combination of one or more computing devices 1000 can jointly execute the instructions for executing the method for obtaining historical test data provided in the embodiment of the present application. Figure 2 、 Figure 4 Instructions for any code test method in Figure 5 Instructions for the historical test data acquisition method.
[0215] The present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. The instructions included in the computer program product may include instructions for executing the embodiments of the present application. Figure 2 、 Figure 4 Instructions in either the provided code test method or Figure 5 The provided historical test data acquisition method instructions. When the computer program product is run on at least one computing device, the at least one computing device executes the embodiment of the present application. Figure 2 、 Figure 4 Any of the provided code testing methods or Figure 5 The steps or operations of the method for obtaining historical test data are provided.
[0216] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the instructions in the present application. Figure 2 、 Figure 4 Any of the provided code testing methods or Figure 5 The steps or operations of the method for obtaining historical test data are provided.
[0217] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present application.
[0218] The terms "first", "second", "third" and "fourth" in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects rather than to limit a specific order.
[0219] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
Claims
1. A code testing method, characterized in that: The first business system includes at least one function, and the method includes: testing a target function in a second business system according to historical test data of the target function, and obtaining a current processing result, where the second business system is a business system obtained by modifying the function of the first business system, and the historical test data of the target function includes historical input parameters, historical intermediate data, and historical processing results when testing the target function in the first business system; The current processing result is verified according to the historical processing result to obtain the test result of the target function in the second business system.
2. The method according to claim 1, characterized in that The testing of the target function in the second business system according to the historical test data of the target function to obtain the current processing result includes: The target function in the second business system is executed according to the historical input parameters, and the historical intermediate data is processed to obtain the current processing result.
3. The method according to claim 1 or 2, characterized in that The first business system includes an interception function, and the method further includes: During the test of the target function in the first business system, executing the interception function to obtain the historical input parameters, the historical intermediate data, and the historical processing results of the target function, and saving the historical input parameters, the historical intermediate data, and the historical processing results to a target storage medium; Acquire historical test data of the target function from the target storage medium.
4. The method according to any one of claims 1 to 3, characterized in that The historical test data of the target function includes at least one of the following: Historical test data for testing the target function in the first business system in a development environment; or Historical test data of testing the target function in the first business system under a test environment.
5. The method according to any one of claims 1 to 4, characterized in that The second business system includes the modified target function; or the second business system includes the target function and modified functions other than the target function.
6. The method according to any one of claims 1 to 5, characterized in that Testing the target function in the second business system according to the historical test data of the target function includes: In response to the modified code submission instruction, the target function in the second business system is tested according to the historical test data of the target function.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When the test result indicates that the current processing result has been verified, the modified function of the second business system is submitted successfully.
8. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When the test result indicates that the current processing result verification fails, the modified function submission of the second business system fails.
9. The method according to any one of claims 1 to 7, characterized in that The second business system is deployed in the target system, and the method further includes: Testing the function to be tested in the target system according to historical test data of the function to be tested, and obtaining a current processing result of the function to be tested, wherein the historical test data of the function to be tested includes historical input parameters, historical intermediate data, and historical processing results when testing the function to be tested; The current processing result of the function to be tested is verified according to the historical processing result of the function to be tested, so as to obtain the test result of the function to be tested in the target system.
10. The method according to claim 9, characterized in that Testing the function to be tested according to historical test data of the function to be tested includes: In response to the test instruction, the function to be tested is tested according to the historical test data of the function to be tested.
11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: At least one of the historical input parameters, the historical intermediate data, and the historical processing results is displayed.
12. A code testing device, characterized in that: The device includes a testing module and a verification module; The testing module is configured to test a target function in a second business system based on historical test data of the target function to obtain a current processing result, where the second business system is a business system obtained by modifying a function of a first business system, the first business system including at least one function, and the historical test data of the target function includes historical input parameters, historical intermediate data, and historical processing results when testing the target function in the first business system; The verification module is used to verify the current processing result according to the historical processing result to obtain the test result of the target function in the second business system.
13. A code testing system, characterized in that: The system comprises at least one device configured to: testing a target function in a second business system according to historical test data of the target function, obtaining a current processing result, wherein the second business system is a business system obtained by modifying a function of a first business system, the first business system including at least one function, and the historical test data of the target function includes historical input parameters, historical intermediate data, and historical processing results when testing the target function in the first business system; The current processing result is verified according to the historical processing result to obtain the test result of the target function in the second business system.
14. A computing device, characterized in that The computing device includes a processor and a memory; the processor is configured to execute instructions stored in the memory, so that the computing device performs the method according to any one of claims 1 to 11.
15. A computing cluster, characterized in that: comprising at least one computing device, each computing device including a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in a memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 11.
16. A computer program product comprising instructions, characterized in that When the instructions are executed by at least one computing device, the at least one computing device is caused to perform the method according to any one of claims 1 to 11.
17. A computer-readable storage medium, characterized in that The method comprises computer program instructions, which, when executed by at least one computing device, cause the at least one computing device to perform the method according to any one of claims 1 to 11.