Code data test file generation method and device, equipment and storage medium
By configuring the test database and generating test files, the problem of scalable testing caused by the complexity of big data test code logic is solved, and efficient test result generation and error debugging are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2022-09-21
- Publication Date
- 2026-04-24
AI Technical Summary
Existing big data test code is complex, making testing difficult to scale and prone to errors, and debugging is time-consuming.
A method for generating code data test files is provided. This method obtains the code data to be tested and configures a matching test database. The test is performed in the database according to the configuration information, and the test results are generated. If the results are the same as the preset values, a test file is generated.
This enabled large-scale testing, reduced workload, saved time, and improved testing efficiency.
Smart Images

Figure CN115421727B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a method, apparatus, device and storage medium for generating code data test files. Background Technology
[0002] Currently, existing testing tools for big data platforms include TestDFSIO, a tool included with Hadoop for benchmarking HDFS performance, and MRbench, a tool included with Hadoop for testing job response speed. However, there are virtually no tools available for testing the code logic of big data applications.
[0003] However, due to the increasingly complex logic of big data test code, the overall workload is large, making it impossible to carry out testing work on a large scale. Furthermore, it is prone to errors, and troubleshooting errors is very time-consuming.
[0004] Therefore, a method for generating code data test files is needed to overcome the above problems. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for generating code data test files, which enables large-scale testing and saves time.
[0006] Firstly, this application provides a method for generating code data test files, including:
[0007] Obtain the code data to be tested, and configure the test database that matches the code data to be tested;
[0008] Based on the configuration information, the code data to be tested is tested in the test database to obtain the test results;
[0009] If the test result is the same as the preset value in the test database, then the code data to be tested will be used to generate a test file.
[0010] In one example, the step of testing the code data to be tested in the test database according to the configuration information and obtaining the test results includes:
[0011] Based on the configuration information, determine the code script information in the code data to be tested;
[0012] Based on the code script information, obtain metadata information that matches the code script information from the test database;
[0013] The test results are generated based on the metadata information and the code data to be tested.
[0014] In one example, generating the test result based on the metadata information and the code data to be tested includes:
[0015] The metadata information is calculated according to the logic of the code data to be tested to obtain the test data information;
[0016] The test results are generated by processing the test data according to the type of test database.
[0017] In one example, retrieving metadata information matching the code script information from the test database based on the code script information includes:
[0018] Based on the code script information, establish a connection between the code script information and the test database;
[0019] Based on the connection relationship, the code script information is parsed to obtain metadata information that matches the code script information in the test database.
[0020] In one example, the method further includes:
[0021] The test file is displayed to the user through an interface for the user to process.
[0022] In one example, the interface displays the following: configuration information of the code data to be tested; wherein, the configuration information includes process attribute information, node attribute information, and connection attribute information; wherein, the node attribute information includes one or more of the following: command line execution node attribute information, SQL execution node attribute information, job execution node attribute information, result comparison node attribute information, and data node attribute information.
[0023] Secondly, this application provides a code data test file generation apparatus, the apparatus comprising:
[0024] The acquisition unit is used to acquire the code data to be tested and configure the test database that matches the code data to be tested.
[0025] The determining unit is configured to test the code data to be tested in the test database according to the configuration information, and obtain the test results.
[0026] The generation unit is used to generate a test file from the code data to be tested if the test result is the same as a preset value in the test database.
[0027] In one example, the identified unit includes:
[0028] The first determining module is used to determine the code script information in the code data to be tested based on the configuration information.
[0029] The acquisition module is used to acquire metadata information that matches the code script information from the test database based on the code script information.
[0030] The generation module is used to generate the test results based on the metadata information and the code data to be tested.
[0031] In one example, the generated module includes:
[0032] The calculation submodule is used to calculate the metadata information according to the logic of the code data to be tested, so as to obtain the test data information;
[0033] The generation submodule is used to generate the test results from the test data information according to the type of the test database.
[0034] In one example, the module is retrieved, including:
[0035] A submodule is established to establish a connection between the code script information and the test database based on the code script information.
[0036] The parsing submodule is used to parse the code script information according to the connection relationship to obtain metadata information that matches the code script information in the test database.
[0037] In one example, the device further includes:
[0038] The display unit is used to display the test file to the user terminal through the interface for the user terminal to process.
[0039] In one example, the interface displays the following: configuration information of the code data to be tested; wherein, the configuration information includes process attribute information, node attribute information, and connection attribute information; wherein, the node attribute information includes one or more of the following: command line execution node attribute information, SQL execution node attribute information, job execution node attribute information, result comparison node attribute information, and data node attribute information.
[0040] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0041] The memory stores computer-executed instructions;
[0042] The processor executes computer execution instructions stored in the memory to implement the method as described in the first aspect.
[0043] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect.
[0044] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0045] This application provides a method, apparatus, device, and storage medium for generating code data test files. The method involves acquiring code data to be tested and configuring a test database matching the code data. Based on the configuration information, the code data is tested in the test database to obtain test results. If the test results match a preset value in the test database, a test file is generated from the code data. This technical solution enables large-scale testing and saves time. Attached Figure Description
[0046] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0047] Figure 1 This is a flowchart illustrating a method for generating code data test files according to Embodiment 1 of this application;
[0048] Figure 2 This is a schematic diagram of a comparison details interface provided according to Embodiment 1 of this application;
[0049] Figure 3 This is a flowchart illustrating a method for generating code data test files according to Embodiment 2 of this application;
[0050] Figure 4 This is a schematic diagram of a metadata information connection relationship provided according to Embodiment 2 of this application;
[0051] Figure 5 This is a table diagram illustrating test results according to Embodiment 2 of this application;
[0052] Figure 6 This is a schematic diagram of an interface provided according to Embodiment 2 of this application;
[0053] Figure 7 This is a schematic diagram of process attribute information provided according to Embodiment 2 of this application;
[0054] Figure 8This is a schematic diagram of command line execution node attribute information provided according to Embodiment 2 of this application;
[0055] Figure 9 This is a schematic diagram of SQL execution node attribute information provided in Embodiment 2 of this application;
[0056] Figure 10 This is a schematic diagram of job execution node attribute information provided in Embodiment 2 of this application;
[0057] Figure 11 This is a schematic diagram of result comparison node attribute information provided in Embodiment 2 of this application;
[0058] Figure 12 This is a schematic diagram of data node attribute information provided according to Embodiment 2 of this application;
[0059] Figure 13 This is a schematic diagram of a code data test file generation device according to Embodiment 3 of this application;
[0060] Figure 14 This is a schematic diagram of a code data test file generation device according to Embodiment 4 of this application;
[0061] Figure 15 This is a block diagram illustrating an electronic device according to an exemplary embodiment.
[0062] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0063] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0064] The code data test file generation method provided in this application aims to solve the above-mentioned technical problems in the prior art.
[0065] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0066] Figure 1 This is a flowchart illustrating a method for generating code data test files according to Embodiment 1 of this application. Embodiment 1 includes the following steps:
[0067] S101. Obtain the code data to be tested and configure the test database that matches the code data to be tested.
[0068] In one example, the code data to be tested refers to the code data in the test database, which can calculate the data information to be calculated based on the preset data information in the database.
[0069] In this embodiment, different code data to be tested corresponds to different test databases, including DB2, Oracle, Sybase, and SQL Server databases. The parameters configured for the test database include: ETL server IP, username, password, database username, and database password. These parameters can be modified and deleted through the test database configuration interface. Furthermore, the configured test database parameters are saved to the test data design interface and test data management interface of the test database.
[0070] S102. Based on the configuration information, test the code data to be tested in the test database and obtain the test results.
[0071] In this embodiment, the configuration information includes the parameter information and data path information of the test database. Based on the data path information, the data information required for the code data to be tested can be determined, and the code data to be tested can be tested using the determined data information to obtain the test results.
[0072] S103. If the test result is the same as the preset value in the test database, then generate a test file from the code data to be tested.
[0073] In this embodiment, the test results are a CSV file, and the preset values in the test database are also stored in a CSV file. Comparing the two provides comparison details, which can be viewed in the comparison details section of the test data management interface. Specifically, you can view... Figure 2The diagram shows an interface illustrating the comparison details. If the test result matches the preset value in the test database, the comparison details interface displays "Successful," indicating the comparison passed, and generates a test file.
[0074] This application provides a method, apparatus, device, and storage medium for generating code data test files. The method involves acquiring code data to be tested and configuring a test database matching the code data. Based on the configuration information, the code data is tested in the test database to obtain test results. If the test results match preset values in the test database, a test file is generated from the code data. This technical solution enables large-scale testing and saves time.
[0075] Figure 3 This is a flowchart illustrating a method for generating code data test files according to Embodiment 2 of this application. Embodiment 2 includes the following steps:
[0076] S301. Obtain the code data to be tested and configure the test database that matches the code data to be tested.
[0077] For example, this step can refer to step S101 above, and will not be repeated here.
[0078] S302. Based on the configuration information, determine the code script information in the code data to be tested.
[0079] In this embodiment, the code script information can be SQL script information. The location of the code script information is determined by the data path information in the configuration information, and the code script information is run.
[0080] S303. Based on the code script information, retrieve the metadata information that matches the code script information from the test database.
[0081] In one example, based on the code script information, metadata information matching the code script information is retrieved from the test database, including:
[0082] Based on the code script information, establish a connection between the code script information and the test database;
[0083] Based on the connection relationship, the code script information is parsed to obtain metadata information that matches the code script information in the test database.
[0084] In this embodiment, after connecting to the test database and establishing a connection based on the code script information, the code script information is executed to obtain the connection relationships between metadata information. For details, please refer to... Figure 4 The diagram shown illustrates a metadata information connection relationship. Figure 4As can be seen, the two nodes on the left, DB_01.TABLE_01 and DB_02.TABLE_02, are located one above the other. DB refers to the name of the test database, and TABLE refers to the name of the data table in the test database; these are the source of the metadata information calculated in the SQL script. The node on the right, DB_01.TABLE_03, is the target data table after the SQL script calculation. The metadata information obtained from DB_01.TABLE_01 and DB_02.TABLE_02, after being calculated by the SQL script, is stored in the DB_01.TABLE_03 table.
[0085] S304. Generate test results based on metadata information and code data to be tested.
[0086] In one example, test results are generated based on metadata information and the code data to be tested, including:
[0087] The metadata information is calculated according to the logic of the code data to be tested to obtain the test data information;
[0088] The test data is used to generate test results based on the type of test database.
[0089] In this embodiment, the database type includes HIVE or MPPDB. The command to obtain metadata information through MPPDB is as follows: gsql -h ${DBHOST} -d ${DBNAME} -p 25308 -U ${USERNAME} -W ${PASSWORD} -c"\d+${SCHEMANAME}.${TABLENAME}".
[0090] In this embodiment, the test results can be found in [reference needed]. Figure 5 The table shown is a schematic diagram of one type of test results.
[0091] S305. If the test result is the same as the preset value in the test database, then generate a test file from the code data to be tested.
[0092] The test file is displayed to the user through the interface for the user to process.
[0093] In this embodiment, the test file can be downloaded and viewed by the user. For details, please refer to [link / reference]. Figure 6 .
[0094] In one example, the interface displays the following: configuration information for the code data to be tested; wherein, the configuration information includes process attribute information, node attribute information, and connection attribute information; wherein, the node attribute information includes one or more of the following: command line execution node attribute information, SQL execution node attribute information, job execution node attribute information, result comparison node attribute information, and data node attribute information.
[0095] In this embodiment, Figure 6 The diagram illustrates an interface that includes various attribute information, specifically: process attribute information, node attribute information, and connection attribute information. The process attribute information displays an ID that does not require user editing. For more details, please refer to [link to relevant documentation]. Figure 7 This is a schematic diagram illustrating process attribute information.
[0096] Furthermore, for node attribute information, users need to click on the node that has been dragged into the workflow orchestration canvas. After clicking, the node attributes tab will display the attribute information that needs to be configured for the currently selected node. The attribute information that needs to be configured for each type of node is as follows:
[0097] Command line execution of node attribute information, such as Figure 8 The attribute configuration box contains seven attribute entries. The ID is a unique node ID automatically generated by the system when the user drags this node into the workflow orchestration canvas. The environment name is the information of the currently executed test database, and its name is "Command Line Execution." These three entries are automatically generated and do not require user configuration. In the node description input box, the user can enter a custom command description for the node. If the command to be executed is a shell command, a shell file must be entered, uploaded to the test environment ETL scheduling server, and the script execution command must be entered in the "Linux command" input box below. If only a simple Linux command needs to be executed, simply write the command in the "Linux command" input box.
[0098] SQL execution node attribute information, such as Figure 9 The attribute configuration box contains five attribute entries. The ID is a unique node ID automatically generated by the system when the user drags this node into the workflow orchestration canvas. The environment name is the information of the currently executed test database, named "SQL Execution." These three entries are automatically generated and do not require user configuration. In the node description input box, the user can enter a custom command execution node description.
[0099] Furthermore, it also includes job execution node attribute information, such as... Figure 10The attribute configuration box contains five attribute entries. The ID is a unique node ID automatically generated by the system when the user drags this node into the workflow orchestration canvas, and its name is "Job Execution." The above three entries are automatically generated and do not require user configuration. In the node description input box, the user can enter a custom command execution node description. In the "Batch Date" input box, enter the batch date of the code data to be tested, in the format YYYYMMDD. Finally, select the code data to be tested from the "Job Name" dropdown menu.
[0100] The results are compared with the node attribute information, such as Figure 11 This node has four attributes: a node ID automatically generated by the system, a node name "Result Comparison", and the first two attributes do not require user configuration.
[0101] Data node attribute information, such as Figure 12 Each data node contains five attribute information: a node ID automatically generated by the system, a node name generated based on the job corresponding to the data node, a job name corresponding to the data node, a note, and the code data currently to be tested.
[0102] This application provides a method, apparatus, device, and storage medium for generating code data test files. It generates test results by retrieving metadata information matching the code script information from a test database, and then generating test results based on the metadata information and the code data to be tested. Using this technical solution, users can achieve highly automated test result generation with simple configuration, significantly reducing the workload of the entire testing process and improving the efficiency of testers.
[0103] Figure 13 This is a schematic diagram of a code data test file generation device provided according to Embodiment 3 of this application.
[0104] Specifically, the device 130 in Embodiment 3 includes:
[0105] The acquisition unit 1301 is used to acquire the code data to be tested and configure the test database that matches the code data to be tested.
[0106] Unit 1302 is used to test the code data to be tested in the test database according to the configuration information and obtain the test results.
[0107] The generation unit 1303 is used to generate a test file from the code data to be tested if the test result is the same as the preset value in the test database.
[0108] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the above-described device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0109] Figure 14 This is a schematic diagram of a code data test file generation device provided according to Embodiment 4 of this application.
[0110] Specifically, the device 140 in Embodiment 4 includes:
[0111] The acquisition unit 1401 is used to acquire the code data to be tested and configure the test database that matches the code data to be tested.
[0112] Unit 1402 is used to test the code data to be tested in the test database according to the configuration information and obtain the test results.
[0113] The generation unit 1403 is used to generate a test file from the code data to be tested if the test result is the same as the preset value in the test database.
[0114] In one example, unit 1402 is defined as including:
[0115] The first determining module 14021 is used to determine the code script information in the code data to be tested based on the configuration information.
[0116] The acquisition module 14022 is used to retrieve metadata information that matches the code script information from the test database based on the code script information.
[0117] The generation module 14023 is used to generate test results based on metadata information and the code data to be tested.
[0118] In one example, module 14023 is generated, including:
[0119] The calculation submodule 140231 is used to calculate the metadata information according to the logic of the code data to be tested, and obtain the test data information.
[0120] The generation submodule 140232 is used to generate test results from test data information according to the type of test database.
[0121] In one example, retrieving module 14022 includes:
[0122] Create submodule 140221 to establish a connection between the code script information and the test database based on the code script information;
[0123] The parsing submodule 140222 is used to parse the code script information according to the connection relationship and obtain the metadata information that matches the code script information in the test database.
[0124] In one example, the device also includes:
[0125] The display unit 1404 is used to display the test file to the user terminal through the interface for the user terminal to process.
[0126] In one example, the interface displays the following: configuration information for the code data to be tested; wherein, the configuration information includes process attribute information, node attribute information, and connection attribute information; wherein, the node attribute information includes one or more of the following: command line execution node attribute information, SQL execution node attribute information, job execution node attribute information, result comparison node attribute information, and data node attribute information.
[0127] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the above-described device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0128] Figure 15 This is a block diagram illustrating an electronic device according to an exemplary embodiment. The device may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc.
[0129] Device 1500 may include one or more of the following components: processing component 1502, memory 1504, power supply component 1506, multimedia component 1508, audio component 1510, input / output (I / O) interface 1512, sensor component 1514, and communication component 1516.
[0130] Processing component 1502 typically controls the overall operation of device 1500, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 1502 may include one or more processors 1520 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1502 may include one or more modules to facilitate interaction between processing component 1502 and other components. For example, processing component 1502 may include a multimedia module to facilitate interaction between multimedia component 1508 and processing component 1502.
[0131] Memory 1504 is configured to store various types of data to support the operation of device 1500. Examples of this data include instructions for any application or method operating on device 1500, contact data, phonebook data, messages, pictures, videos, etc. Memory 1504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0132] Power supply component 1506 provides power to various components of device 1500. Power supply component 1506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 1500.
[0133] Multimedia component 1508 includes a screen that provides an output interface between the device 1500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1508 includes a front-facing camera and / or a rear-facing camera. When the device 1500 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0134] Audio component 1510 is configured to output and / or input audio signals. For example, audio component 1510 includes a microphone (MIC) configured to receive external audio signals when device 1500 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1504 or transmitted via communication component 1516. In some embodiments, audio component 1510 also includes a speaker for outputting audio signals.
[0135] I / O interface 1512 provides an interface between processing component 1502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0136] Sensor assembly 1514 includes one or more sensors for providing status assessments of various aspects of device 1500. For example, sensor assembly 1514 may detect the on / off state of device 1500, the relative positioning of components such as the display and keypad of device 1500, changes in position of device 1500 or a component of device 1500, the presence or absence of user contact with device 1500, orientation or acceleration / deceleration of device 1500, and temperature changes of device 1500. Sensor assembly 1514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1514 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0137] Communication component 1516 is configured to facilitate wired or wireless communication between device 1500 and other devices. Device 1500 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 1516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1516 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0138] In an exemplary embodiment, the apparatus 1500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0139] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1504 including instructions, which can be executed by a processor 1520 of the device 1500 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0140] A non-transitory computer-readable storage medium, wherein when the instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to execute the aforementioned method for generating code data test files for the electronic device.
[0141] This application also discloses a computer program product, including a computer program that, when executed by a processor, implements the method described in this embodiment.
[0142] Various embodiments of the systems and technologies described above in this application can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or electronic device.
[0144] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0145] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0146] The systems and technologies described herein can be implemented in computing systems that include back-end components (e.g., as data electronic devices), or computing systems that include middleware components (e.g., application electronic devices), or computing systems that include front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0147] Computer systems can include client and electronic devices. Clients and electronic devices are generally geographically separated and typically interact via communication networks. The client-electronic device relationship is created by computer programs running on the respective computers and having a client-electronic device relationship with each other. The electronic device can be a cloud electronic device, also known as a cloud computing electronic device or cloud host, a host product within the cloud computing service system, addressing the shortcomings of traditional physical hosts and VPS services ("Virtual Private Server," or simply "VPS") in terms of management difficulty and weak business scalability. The electronic device can also be an electronic device in a distributed system or an electronic device incorporating blockchain technology. It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application is achieved, and this is not limited herein.
[0148] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0149] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for generating code data test files, characterized in that, The method includes: Obtain the code data to be tested, and configure the test database that matches the code data to be tested; Based on the configuration information, the code data to be tested is tested in the test database to obtain the test results; If the test result is the same as the preset value in the test database, then the code data to be tested will be used to generate a test file. The step of testing the code data to be tested in the test database according to the configuration information and obtaining the test results includes: Based on the configuration information, determine the code script information in the code data to be tested; Based on the code script information, obtain metadata information that matches the code script information from the test database; The metadata information is calculated according to the logic of the code data to be tested to obtain the test data information; The test results are generated by processing the test data according to the type of test database.
2. The method according to claim 1, characterized in that, The step of retrieving metadata information matching the code script information from the test database based on the code script information includes: Based on the code script information, establish a connection between the code script information and the test database; Based on the connection relationship, the code script information is parsed to obtain metadata information that matches the code script information in the test database.
3. The method according to claim 1 or 2, characterized in that, The method further includes: The test file is displayed to the user through an interface for the user to process.
4. The method according to claim 3, characterized in that, The interface display includes the following: configuration information of the code data to be tested; wherein, the configuration information includes process attribute information, node attribute information and connection attribute information; wherein, the node attribute information includes one or more of the following: command line execution node attribute information, SQL execution node attribute information, job execution node attribute information, result comparison node attribute information and data node attribute information.
5. A code data test file generation device, characterized in that, The device includes: The acquisition unit is used to acquire the code data to be tested and configure the test database that matches the code data to be tested. The determining unit is configured to test the code data to be tested in the test database according to the configuration information, and obtain the test results. A generation unit is used to generate a test file from the code data to be tested if the test result is the same as the preset value in the test database. The determining unit is specifically configured to: determine the code script information in the code data to be tested according to the configuration information; obtain metadata information matching the code script information from the test database according to the code script information; calculate the metadata information according to the logic of the code data to be tested to obtain test data information; and generate the test result according to the test data information based on the type of the test database.
6. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-4.
8. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Unit test code file generation method, electronic device and storage medium
CN111459495A
Test file generation method and device, equipment and medium
CN112817864A