Test method, device, electronic device and storage medium
By downloading and decompressing the test files in the preset tool chain platform, and automatically compiling and storing the results, it solves the problems of low efficiency and high cost caused by manual testing in the existing technology, realizes automated testing, improves efficiency and reduces costs. cost.
Patent Information
- Application Number
- CN202210769607.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2042-06-30
AI Technical Summary
In the existing technology, the testing methods rely on manual implementation, which are inefficient, high cost, and rigid in indicator system, which cannot meet the needs of business development.
Determine the configuration object to be managed in the preset tool chain platform, download the test file compression package to the preset shared space, decompress and compile to obtain the compilation result, store the result in a text file, and complete the test of the middleware code based on the data distribution service .
It provides an automated testing method that saves labor, improves testing efficiency, and reduces testing costs. It is suitable for testing code generated by the SOA tool chain platform.
Smart Images

Figure CN115114164B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of testing technology, and specifically to a testing method, device, electronic device and storage medium. Background Art
[0002] With the development of intelligent connected vehicles, service-oriented architecture (SOA) is gaining more and more attention. An important principle of SOA architecture is its flexibility, loose coupling and reuse capability. SOA tool chain platform is a service management platform based on Web pages, which can manage and configure applications, services, methods, data types, and generate code based on the configured applications, services, methods, and data. After downloading, the code generated by SOA tool chain needs to be compiled and run in Linux environment to test the correctness of the generated code.
[0003] The testing method of related technologies mainly relies on manual implementation, and the test results need to be observed and recorded manually, resulting in low testing efficiency and high testing costs. Summary of the invention
[0004] In view of the above-mentioned shortcomings of the prior art, the embodiments of the present invention provide a testing method, an apparatus, an electronic device and a storage medium to solve the technical problem that the indicator system in the related technology is relatively rigid and cannot meet the development needs of the business.
[0005] An embodiment of the present invention provides a testing method, the testing method comprising:
[0006] Determine the configuration object to be managed in the preset tool chain platform, and download the test file compression package of the configuration object to be managed to the preset shared space, the test file compression package includes the data distribution service middleware code generated by the preset tool chain platform, and the configuration object to be managed includes at least one of an application, a service, a method, and a data type;
[0007] Detecting that the test file compressed package exists in the preset shared space, decompressing and compiling the test file compressed package to obtain a compilation result;
[0008] The compilation result is stored in a preset text file to complete the test of the data distribution service middleware code.
[0009] In one embodiment of the present invention, if the compilation result includes successful compilation, storing the compilation result in a preset text file includes:
[0010] If there are client applications and server applications that rely on the data distribution service middleware code, start the client applications and server applications;
[0011] Detecting the communication status between the client application and the server application;
[0012] The compilation result and the communication status are stored in the preset text file.
[0013] In one embodiment of the present invention, the method for determining whether there are client applications and server applications that rely on the data distribution service middleware code includes:
[0014] Get the name of the compilation result file of the compilation result generated after compilation;
[0015] If the compilation result file name includes a client application identifier and a server application identifier, it is determined that there are client applications and server applications that depend on the data distribution service middleware code.
[0016] In one embodiment of the present invention, it is detected that the test file compressed package exists in the preset shared space, and decompressing and compiling the test file compressed package includes:
[0017] If it is detected that the preset file directory of the preset shared space includes a compressed package in a preset format, determining that the test file compressed package exists in the preset shared space;
[0018] Decompress the test file compressed package to obtain a decompressed folder;
[0019] If the decompressed folder includes a subfolder with a preset name, create a new folder in the decompressed folder;
[0020] Compile and test the data distribution service middleware code in the newly created folder.
[0021] In one embodiment of the present invention, if the decompressed folder does not include a subfolder with a preset name, the testing method further includes:
[0022] It indicates that there is an error in the data distribution service middleware code.
[0023] In one embodiment of the present invention, compiling and testing the data distribution service middleware code in the newly created folder includes:
[0024] Enter the newly created folder and execute a preset automatic compilation tool to compile and test the data distribution service middleware code.
[0025] In one embodiment of the present invention, before determining the configuration object to be managed in the preset tool chain platform, the testing method further includes:
[0026] Set up a preset shared space that can be accessed by both the code generation end and the code compilation end;
[0027] Among them, the code generation end is deployed with a preset tool chain platform, and the code compilation end is used to detect the existence of the test file compression package in the preset shared space, decompress and compile the test file compression package, obtain the compilation result, and store the compilation result in a preset text file to complete the test of the data distribution service middleware code.
[0028] The embodiment of the present invention further provides a testing device, the testing device comprising:
[0029] A download module, used to determine the configuration object to be managed in the preset tool chain platform, and download the test file compression package of the configuration object to be managed to the preset shared space, wherein the test file compression package includes the data distribution service middleware code generated by the preset tool chain platform, and the configuration object to be managed includes at least one of an application, a service, a method, and a data type;
[0030] A compiling module, used for detecting that the test file compressed package exists in the preset shared space, decompressing and compiling the test file compressed package, and obtaining a compilation result;
[0031] The storage module is used to store the compilation result in a preset text file to complete the test of the data distribution service middleware code.
[0032] An embodiment of the present invention further provides an electronic device, including:
[0033] one or more processors;
[0034] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the electronic device implements the testing method as described in any one of the above embodiments.
[0035] An embodiment of the present invention further provides a computer-readable storage medium on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the test method described in any one of the above embodiments.
[0036] Beneficial effects of the embodiments of the present invention: The testing method, device, electronic device and storage medium in the embodiments of the present invention, by determining the configuration object to be managed in a preset tool chain platform, and downloading the test file compression package of the configuration object to be managed to a preset shared space, detects the existence of the test file compression package in the preset shared space, decompresses and compiles the test file compression package to obtain the compilation result, and stores the compilation result to a preset text file to complete the test of the data distribution service middleware code, thereby providing an automated testing method, saving manpower, improving testing efficiency and reducing testing costs.
[0037] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0039] Figure 1 is a schematic diagram of an implementation environment of a testing method shown in an exemplary embodiment of the present application;
[0040] Figure 2 is a flow chart of a testing method shown in an exemplary embodiment of the present application;
[0041] Figure 3 is a flowchart of SOA tool chain platform code downloading shown in an exemplary embodiment of the present application;
[0042] Figure 4 is a schematic diagram of a decompressed folder shown in an exemplary embodiment of the present application;
[0043] Figure 5 is a flowchart of a Linux-side DDS middleware code test shown in an exemplary embodiment of the present application;
[0044] Figure 6 is a block diagram of a testing device shown in an exemplary embodiment of the present application;
[0045] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0046] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0047] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0048] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0049] Figure 1 is a schematic diagram of an implementation environment of a test system shown in an exemplary embodiment of the present application, such as Figure 1 As shown, the system includes a SOA tool chain platform 101, a vehicle-side device 102, and a code testing device 103, wherein the SOA tool chain platform can be deployed on the Windows side, and by selecting a certain version of a certain application and downloading it, the code file N, such as the DDS (Data Distribute Service) middleware code, is downloaded to the Windows directory; after the download is completed, the code file is copied to the shared directory of Windows and the vehicle-side. The vehicle-side device monitors whether the code file N exists through the automation in the code testing device set by it. If the code file N exists, it is decompressed and compiled, and the compilation result is output to a preset text file for subsequent pulling of the test result. Among them, the vehicle-side can be a Linux system, or an Android system, or a Linux virtual machine, etc.
[0050] With the development of intelligent connected vehicles, service-oriented architecture (SOA) is gaining more and more attention. An important principle of SOA architecture is its flexibility, loose coupling and reuse capability. SOA tool chain platform is a service management platform based on Web pages, which can manage and configure applications, services, methods, data types, and generate codes based on the configured applications, services, methods and data. After downloading, the codes generated by SOA tool chain need to be compiled and run in Linux environment to test the correctness of the generated codes. The testing methods in related technologies have the following problems:
[0051] 1. Manual selection of services is required;
[0052] 2. Manually select download;
[0053] 3. Manually decompress the compressed package of the generated code;
[0054] 4. Manually enter the command and copy it to the target system environment;
[0055] 5. You need to manually enter commands for compilation and manually check the compilation results;
[0056] 6. Manually input commands to run the Client and Server, and manually observe the output and print messages;
[0057] In view of the above problems, it is urgent to improve the testing efficiency. To this end, the present invention provides an automated testing method, device, electronic device, storage medium and computer program.
[0058] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a testing method shown in an exemplary embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the testing method at least includes steps S201 to S203, which are described in detail as follows:
[0059] Step S201: determine the configuration object to be managed in the preset tool chain platform, and download the test file compression package of the configuration object to be managed to the preset shared space.
[0060] Among them, the test file compression package includes the data distribution service middleware code generated by the preset tool chain platform. The configuration objects to be managed include but are not limited to at least one of applications, services, methods, data types, etc. The preset tool chain platform includes but is not limited to the SOA tool chain management platform, etc. The preset shared space can be accessed by the Windows side where the preset tool chain platform is located, and the Linux side in the subsequent testing process, or the car side, or the Android system, or the Linux virtual machine, etc. The format of the test file compression package is the preset format.
[0061] The test method provided in this implementation tests the DDS middleware code generated for at least one of the applications, services, methods, data types, etc. configured on the SOA tool chain management platform. The method is suitable for downloading, decompressing and testing the code generated by the applications, services and their methods and data configured on the SOA tool chain platform in the form of a test file compression package. The method can realize test automation and open up the technical path from selecting services on a Web page to running code in the virtual machine Linux environment.
[0062] In one embodiment, downloading a test file compression package of the configuration object to be managed to a preset shared space includes:
[0063] Download the test file compressed package to a local folder. After the download is complete, copy the complete test file compressed package in the local folder to the preset shared space.
[0064] In one embodiment, step S201 is applied to the Windows side, and the test process is controlled by a script configured by a technician in this field, such as a Python script, to import the Selenium framework, automate the operation of the web page through the Python script, select the service (application, method, data type), click Download, and select to download a specific file (test file compressed package) to the Windows directory. After the download is complete, the test file compressed package is copied to the Linux shared directory (preset shared space).
[0065] In one embodiment, before determining the configuration object to be managed in the preset tool chain platform, the testing method further includes:
[0066] Start the automated testing tool to detect the login status of the preset tool chain platform. If the user is not logged in, the user is prompted to log in. After the login is completed, the automated testing tool automatically selects the configuration object to be managed.
[0067] In one embodiment, see Figure 3 , Figure 3 FIG. 1 is a flowchart of SOA tool chain platform code downloading shown in an exemplary embodiment of the present application. Figure 3As shown, this step is applied to the Windows side. First log in to the SOA tool chain platform and select Remember login; then use the Selenium framework to perform page operations through the Python script, select Application Deployment under the Deployment Management page, select MPU Deployment, select a version of a certain application, then click Download, select the code file, select the access path, the path is the shared folder of the Linux virtual machine and Windows, click the Save button, and confirm to save the default file name (the default name is determined by the code generation rules of the SOA tool chain platform, application name_version number_code_mpu.tgz or application name_version number_code_mcu.tgz, such as musicApp_V9.0.0_code_mpu.tgz) in the format of a .tgz compressed package. The preset format is .tgz. At the beginning, first start the Python script. If the script fails to start, it will prompt to check the Python environment. After the script is successfully started, the Selenium framework is started. If the Selenium framework fails to start, the Selenium framework operating environment is checked. If the Selenium framework is successfully started, the SOA tool chain platform is logged in. If the login is successful, the service or application is selected, and the generated code is packaged into a test file compression package for download. If you are not logged in, you are prompted to log in first. During the download process, the download status is monitored. If the download fails, a prompt is required to indicate the download failure. If the download is successful, the test file compression package is saved in the preset shared idle.
[0068] In one embodiment, before determining the configuration object to be managed in the preset tool chain platform, the testing method further includes:
[0069] Set up a preset shared space that can be accessed by both the code generation end and the code compilation end;
[0070] Among them, the code generation end is deployed with a preset tool chain platform, and the code compilation end is used to detect the existence of a test file compression package in the preset shared space, decompress and compile the test file compression package, obtain the compilation result, and store the compilation result in a preset text file to complete the test of the data distribution service middleware code.
[0071] For example, the code generation end can be a Windows end, and the code compilation end can be a car computer end, a Linux system, an Android system, or a Linux virtual machine, etc.
[0072] Step S202: Detecting that a test file compression package exists in the preset shared space, decompressing and compiling the test file compression package to obtain a compilation result.
[0073] The compilation result includes compilation success or compilation failure.
[0074] The existence of a test file compression package in the preset shared space can be achieved through a timed monitoring method. Once it is found that there is a test file compression package that has not been decompressed in the preset shared space, it will be decompressed.
[0075] In one embodiment, it is detected that there is a test file compressed package in the preset shared space, and decompressing and compiling the test file compressed package includes:
[0076] If it is detected that the preset file directory of the preset shared space includes a compressed package of the preset format, it is determined that the test file compressed package exists in the preset shared space;
[0077] Decompress the test file compressed package to obtain the decompressed folder;
[0078] If the unzipped folder contains subfolders with preset names, create a new folder in the unzipped folder;
[0079] Compile and test the data distribution service middleware code in the newly created folder.
[0080] In one embodiment, if the decompressed folder does not include a subfolder with a preset name, the testing method further includes:
[0081] The prompt is based on the data distribution service middleware code error. At this time, it means that the data distribution service middleware code in the test file compression package obtained earlier is abnormal and cannot be compiled later. You can remind relevant staff to check the cause of the error.
[0082] For example, see Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a decompressed folder shown in an exemplary embodiment of the present application. Figure 4 As shown, the decompressed folder includes several subfolders. Take the default subfolder named gen as an example. Figure 4 is an example of a qualified decompressed folder. It should be noted that the folder type, name, number, etc. Figure 4 It is only used as an example and is not used to limit the testing method in this embodiment.
[0083] In one embodiment, compiling and testing the data distribution service middleware code in the newly created folder includes:
[0084] Enter the newly created folder and execute the preset automatic compilation tool to compile and test the data distribution service middleware code. The preset automatic compilation tool includes but is not limited to cmake, make command, etc.
[0085] If the decompressed folder includes a subfolder with a preset name, create a build folder (new folder) in the same directory as the subfolder with the preset name, enter the build folder, execute the cmake and make commands to compile and test the code generated by the SOA tool chain platform, and output the compilation results to a compilation result file in text format (the preset text file).
[0086] Step S203, storing the compilation result into a preset text file to complete the test of the data distribution service middleware code.
[0087] In one embodiment, if the compilation result includes successful compilation, storing the compilation result to a preset text file includes:
[0088] If there are client applications and server applications that rely on the data distribution service middleware code, start the client application and server application;
[0089] Detect the communication status between the client application and the server application, the communication status includes communication success or communication failure;
[0090] Store the compilation results and communication status values in a preset text file.
[0091] In one embodiment, the method for determining whether there is a client application and a server application that are dependent on the data distribution service middleware code includes:
[0092] Get the name of the compilation result file of the compilation result generated after compilation;
[0093] If the compilation result file name includes the client application identifier and the server application identifier, it is determined that there are client applications and server applications that depend on the data distribution service middleware code.
[0094] For example, see Figure 5 , Figure 5 FIG. 1 is a flowchart of a Linux-side DDS middleware code test shown in an exemplary embodiment of the present application. Figure 5As shown, this step can be run on the Linux virtual machine side, the vehicle side, the Linux system or the Android system, etc. At this time, log in to the vehicle side (or Linux system or Android system) or the Linux virtual machine through the Python script running on Windows, and start the Shell script with the following functions after successful login: The Shell script automatically loops to detect the newly added compressed package (test file compressed package) in the shared directory, and after decompression, it automatically compiles and outputs the compilation result to a text file (preset text file), thereby testing the DDS-based middleware code from the SOA tool chain platform, detecting whether the code generated by the SOA tool chain can be compiled, and if the Client (client application) and Server (server application) based on the DDS middleware code exist, automatically start the Client and Server, thereby testing whether the middleware code based on the DDS communication protocol can communicate.
[0095] The Linux virtual machine sets up a shared directory with Windows in advance. The Shell script scans the compressed package named application name.tgz in the shared directory, decompresses the compressed package, opens the folder generated after decompression, and determines whether the folder contains a gen subfolder (the code generated by the SOA tool chain is stored in this folder, with a preset name subfolder). If it does, create a build folder (a new folder) in the same directory as the gen folder, enter the build folder, execute the cmake and make commands to compile and test the code generated by the SOA tool chain platform, and output the compilation results to a text-formatted compilation result file. If there are already Client applications and Server applications that rely on the generated code, the Client and Server applications are automatically started to detect whether the CS (Client, Server) communication is successful, and further detect and verify the DDS middleware code, and output the results to a text-formatted log file; if the decompressed folder does not contain a gen subfolder, it is directly determined that the code generated by the SOA tool chain is wrong. During the startup of the Shell automation program on the Linux side, the startup status is monitored. If the startup fails, the startup failure is prompted. If the compilation fails, the compilation failure is stored in a text file. If the compilation succeeds, determine whether the application (client application and server application) exists. If not, the compilation failure is stored in a text file. If it exists, on the one hand, the compilation failure is stored in the text file, and on the other hand, the communication between the Client and the Server is detected to be successful. If the communication is successful, the DDS code communication success is stored in the text file. If the communication fails, the DDS code communication failure is stored in the text file.
[0096] The testing method provided in the above embodiment determines the configuration object to be managed in the preset tool chain platform, and downloads the test file compression package of the configuration object to be managed to the preset shared space, detects the existence of the test file compression package in the preset shared space, decompresses and compiles the test file compression package to obtain the compilation result, and stores the compilation result to a preset text file to complete the test of the data distribution service middleware code, thereby providing an automated testing method, saving manpower, improving testing efficiency, and reducing testing costs.
[0097] The test method provided in the above embodiment supports batch selection of multiple services or applications on the Web automation page to download codes, and batch compilation of codes generated by the SOA tool chain platform by the Linux-side automation script. Instead of manually selecting services or applications on the page and downloading, manually copying, decompressing, and compiling, all automated methods are used to output the compiled test results to a preset text file, which greatly facilitates the code testing of DDS middleware generated for different services and applications, reduces the test complexity and test time, manpower and other costs; improves the test efficiency of code tests generated in various scenarios, and can directly obtain formatted result output files.
[0098] The automatic selection of services, downloading of codes, automatic decompression, and automatic compilation are realized through an automated method, thereby testing the correctness of the code generated by the SOA tool chain platform. Compared with the test method in the related art, the SOA tool chain platform is manually operated, the service is manually selected, the type of code to be downloaded is selected, download is clicked, and the save path is selected; then the compressed package of the downloaded code is manually transferred to the vehicle side (Linux, Android or virtual machine environment) through other software; then the downloaded code is decompressed on the vehicle side, the corresponding subfolder is found, and then the compilation command is manually entered, the compilation result is checked by naked eyes, the client and server programs are manually started, and the print results of the client and server programs are observed by naked eyes. Compared with the test method provided in this embodiment, the manual operation workload is large, the service scenarios configured by the SOA tool chain platform cannot be effectively covered, and effective testing cannot be carried out. The automated testing method provided in this embodiment mainly refers to the selection of downloading the code automatically generated based on the DDS middleware by operating the SOA tool chain platform page through the Web automated testing tool Selenium; decompressing, compiling, running, and testing the code from the SOA tool chain platform through Shell scripts.
[0099] Figure 6 is a block diagram of a test device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The device may also be applicable to other exemplary implementation environments and specifically configured in other devices, and this embodiment does not limit the implementation environment to which the device is applicable.
[0100] like Figure 6 As shown, the exemplary testing device 600 includes:
[0101] The download module 601 is used to determine the configuration object to be managed in the preset tool chain platform, and download the test file compression package of the configuration object to be managed to the preset shared space, the test file compression package includes the data distribution service middleware code generated by the preset tool chain platform, and the configuration object to be managed includes at least one of an application, a service, a method, and a data type;
[0102] The compiling module 602 is used to detect that there is a test file compressed package in the preset shared space, decompress and compile the test file compressed package, and obtain a compilation result;
[0103] The storage module 603 is used to store the compilation result into a preset text file to complete the test of the data distribution service middleware code.
[0104] It should be noted that the test device provided in the above embodiment is different from the test device provided in the above embodiment. Figure 2 The test method provided belongs to the same concept, and the specific way in which each module and unit performs the operation has been described in detail in the method embodiment, which will not be repeated here. In practical applications, the test device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0105] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the test methods provided in the above-mentioned embodiments.
[0106] Figure 7 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0107] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703, such as executing the method described in the above embodiment. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, the ROM 702 and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0108] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0109] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.
[0110] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0111] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0112] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0113] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the test method as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0114] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the test method provided in each of the above embodiments.
[0115] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A testing method, characterized in that: The test method includes: A preset shared space is set that is accessible to both the code generation end and the code compilation end; wherein the code generation end is deployed with a preset tool chain platform, and the code compilation end is used to detect the presence of a test file compression package in the preset shared space, decompress and compile the test file compression package, obtain a compilation result, and store the compilation result in a preset text file to complete the test of the data distribution service middleware code; Determine the configuration object to be managed in the preset tool chain platform, and download the test file compression package of the configuration object to be managed to the preset shared space, the test file compression package includes the data distribution service middleware code generated by the preset tool chain platform, and the configuration object to be managed includes at least one of an application, a service, a method, and a data type; Detecting that the test file compressed package exists in the preset shared space, decompressing and compiling the test file compressed package to obtain a compilation result; The compilation result is stored in a preset text file to complete the test of the data distribution service middleware code.
2. The testing method according to claim 1, characterized in that: If the compilation result includes successful compilation, storing the compilation result in a preset text file includes: If there are client applications and server applications that rely on the data distribution service middleware code, start the client applications and server applications; Detecting the communication status between the client application and the server application; The compilation result and the communication status are stored in the preset text file.
3. The testing method according to claim 2, characterized in that: Methods for determining whether there are client applications and server applications that rely on the data distribution service middleware code include: Get the name of the compilation result file of the compilation result generated after compilation; If the compilation result file name includes a client application identifier and a server application identifier, it is determined that there are client applications and server applications that depend on the data distribution service middleware code.
4. The testing method according to claim 1, characterized in that: Detecting that the test file compressed package exists in the preset shared space, and decompressing and compiling the test file compressed package includes: If it is detected that the preset file directory of the preset shared space includes a compressed package in a preset format, determining that the test file compressed package exists in the preset shared space; Decompress the test file compressed package to obtain a decompressed folder; If the decompressed folder includes a subfolder with a preset name, create a new folder in the decompressed folder; Compile and test the data distribution service middleware code in the newly created folder.
5. The testing method according to claim 4, characterized in that: If the decompressed folder does not include a subfolder with a preset name, the testing method further includes: It prompts that there is an error in the data distribution service middleware code.
6. The testing method according to claim 4, characterized in that: Compiling and testing the data distribution service middleware code in the newly created folder includes: Enter the newly created folder and execute a preset automatic compilation tool to compile and test the data distribution service middleware code.
7. A testing device, characterized in that: The testing device comprises: A download module is used to set a preset shared space that can be accessed by both the code generation end and the code compilation end, wherein the code generation end is deployed with a preset tool chain platform, and the code compilation end is used to detect the presence of a test file compression package in the preset shared space, decompress and compile the test file compression package, obtain a compilation result, and store the compilation result in a preset text file to complete the test of the data distribution service middleware code, determine the configuration object to be managed in the preset tool chain platform, and download the test file compression package of the configuration object to be managed to the preset shared space, wherein the test file compression package includes the data distribution service middleware code generated by the preset tool chain platform, and the configuration object to be managed includes at least one of an application, a service, a method, and a data type; A compiling module, used for detecting that the test file compressed package exists in the preset shared space, decompressing and compiling the test file compressed package, and obtaining a compilation result; The storage module is used to store the compilation result in a preset text file to complete the test of the data distribution service middleware code.
8. An electronic device, characterized in that: include: one or more processors; A storage device, used for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the testing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the testing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Test method and apparatus
CN107229542A
Test platform establishment method based on virtualization technology
CN107995064A