A test data automatic generation import system, method, terminal and medium
By integrating an automatic test data generation and import system into a Spring Boot project, and utilizing Redis and Kafka to process dynamic data, the system addresses the issues of insufficient flexibility and security in the test data generation process, achieving fast, intelligent data import and improved system stability.
Patent Information
- Application Number
- CN202511127177.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-08-13
AI Technical Summary
Existing technologies lack flexibility and intelligence in the process of generating and importing test data, resulting in insufficient test data quality and applicability, cumbersome operation procedures, and difficulty in ensuring security, especially when dealing with dynamic data, where configuration is complex.
This paper presents a test data automatic generation and import system that can be integrated into a Spring Boot project as a plugin. It includes modules for environment configuration, workflow generation, automatic data generation, and pre-processing data. By utilizing Redis caching and Kafka message queues, it achieves intelligent and flexible data generation while ensuring system stability and security.
It enables rapid setup of the demonstration environment, improves work efficiency, meets diverse test data requirements, reduces user operation difficulty, and ensures system stability and security.
Smart Images

Figure CN120631788B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of testing, and specifically to a test data automatic generation and import system, method, terminal, and medium. Background Technology
[0002] The generation and import of test data is a crucial part of the entire software development and maintenance lifecycle. The lack of flexibility and intelligence in the test data generation process makes it difficult to meet the complex and ever-changing project requirements, resulting in a significant reduction in the quality and applicability of the test data. In addition, when connecting with customers and setting up demonstration environments, the existing operation process is cumbersome and lengthy, which is prone to system errors during data import, affecting the efficiency of project progress. Moreover, when data entry requires login or other operations as prerequisites, the existing technology is complex to configure and difficult to guarantee security when handling dynamic data such as CAPTCHAs, failing to meet the growing information security requirements. Summary of the Invention
[0003] To address the aforementioned issues, this invention provides a test data automatic generation and import system, method, terminal, and medium, enabling rapid setup of demonstration environments, improving work efficiency, achieving intelligent and flexible data generation, meeting diverse test data needs in different project scenarios, and ensuring system stability and security.
[0004] In a first aspect, the technical solution of the present invention provides a test data automatic generation and import system. This system is encapsulated as a plugin and integrated into a Spring Boot project via dependency injection. The system includes:
[0005] The environment configuration module is used to read pre-configured environment parameters from the standard configuration file of the Spring Boot project and start the system in a test or pre-production environment based on the read environment parameters;
[0006] The workflow generation module is used to select various maintenance selection box elements on the page by clicking with the mouse according to the test purpose, mark the data generation method in the text box, configure the method of obtaining the preceding data if the data entry requires the preceding data, record each operation step and the location information of related elements, and generate a workflow based on the recorded data; the data generation method includes using predetermined data and automatic generation.
[0007] The automatic data generation module is used to respond to the automatic generation method, load the automatic data generation model, and generate corresponding data based on context information and requirement information.
[0008] The front-end data processing module is used to retrieve the front-end data that is pre-stored in the Redis cache in response to the front-end data retrieval method;
[0009] The process management module is used to save and execute the workflow generated by the workflow generation module. Executing the workflow generates and imports test data. If there is an automatic data generation method, the automatic data generation module is called to generate the corresponding data. If the process requires pre-processing data, the pre-processing data module is called to obtain the corresponding pre-processing data.
[0010] In one optional implementation, the environment configuration module includes:
[0011] The environment parameter reading unit is used to read target fields from the standard configuration file of the Spring Boot project, and parse the port number, key and current environment from the target fields;
[0012] The system startup unit is used to determine whether the startup conditions are met based on the parsed current environment. If so, the system is started according to the port number and key; otherwise, a startup rejection is reported. Specifically, if the current environment is a test or pre-production environment, the startup conditions are met; otherwise, the startup conditions are not met.
[0013] In one optional implementation, the workflow generation module includes:
[0014] The page operation unit is used to select various maintenance selection box elements on the page by clicking with the mouse according to the test purpose, mark the data generation method in the text box, and configure the method of obtaining the preceding data if the data entry requires the preceding data.
[0015] The workflow recording unit is used to record each operation step and the location information of related elements;
[0016] The workflow generation unit is used to respond to submission operations and generate workflow processes based on recorded data.
[0017] In an optional implementation, each operation step and related element location information are recorded, specifically including:
[0018] Capture user actions via browser or front-end framework APIs;
[0019] Record the operation type, the location information of the target element, and the operation sequence.
[0020] In one optional implementation, a Kafka consumer is configured within the Spring Boot project. This Kafka consumer listens for and receives pre-processed data in real time, stores the received pre-processed data in a Redis cache, and sets a corresponding prefix identifier.
[0021] In one optional implementation, the preceding data acquisition method is the Redis prefix acquisition method, which may be in the form of a method or an internal interface.
[0022] Secondly, the technical solution of the present invention provides a method for automatically generating and importing test data. This method is based on the system described in any of the above claims and includes the following steps:
[0023] Integrate the system into the Spring Boot project as a plugin using dependency injection;
[0024] The system reads pre-configured environment parameters from the standard configuration file of the Spring Boot project and starts the system in the test or pre-production environment according to the read environment parameters;
[0025] Based on the test objective, select various maintenance checkbox elements on the page by clicking with the mouse, mark the data generation method in the text box, configure the data acquisition method if the data entry requires prior data, record each operation step and related element location information, and generate a workflow based on the recorded data; the data generation method includes using predetermined data and automatic generation.
[0026] The workflow is executed to generate and import test data. If an automatic data generation method exists during execution, the automatic data generation model is loaded to generate the corresponding data based on the context and requirements. If pre-process data is required during execution, the process is paused, and the pre-stored pre-process data is retrieved from the Redis cache according to the pre-process data retrieval method. The process is then resumed until it ends.
[0027] In one optional implementation, pre-configured environment parameters are read from the standard configuration file of the Spring Boot project, and the system is started in a test or pre-production environment based on the read environment parameters. Specifically, this includes:
[0028] Read the target fields from the standard configuration file of the Spring Boot project, and parse the port number, key, and current environment from the target fields;
[0029] The system is started based on the current environment as determined by the parsing. If the environment is a test or pre-production environment, the startup conditions are met; otherwise, the startup is rejected.
[0030] Thirdly, the technical solution of the present invention provides a terminal, comprising:
[0031] Memory, used to store test data automatically generated and imported by the program;
[0032] A processor, configured to implement the steps of the test data automatic generation and import method as described above when executing the test data automatic generation and import program.
[0033] Fourthly, the present invention provides a computer-readable storage medium storing a test data automatic generation and import program, wherein the test data automatic generation and import program, when executed by a processor, implements the steps of the test data automatic generation and import method as described in any of the above claims.
[0034] As can be seen from the above technical solutions, this application has the following advantages:
[0035] 1. The data import system of this application is introduced into the Spring Boot project in the form of a plugin dependency and only runs in a specific test or pre-production environment. This feature enables the rapid setup of a demonstration environment during the process of connecting with customers, which greatly improves work efficiency and reduces the time cost of integration.
[0036] 2. This application introduces an automatic data generation model, which realizes the intelligence and flexibility of data generation. Whether it is simple data format filling or data simulation in complex scenarios, the plugin can accurately generate data that meets the requirements and fully meet the diverse test data needs in different project scenarios.
[0037] 3. This application uses a page-based workflow entry method, which is intuitive and easy to understand, with simple interaction, greatly reducing the difficulty of user operation. At the same time, the system can automatically record and save the operation process, and users can reuse the saved process at any time, effectively reducing repetitive work and improving the overall efficiency of data entry.
[0038] 4. The front-end data processing module of this application adopts Redis technology and is further combined with Kafka to process front-end data such as login securely and efficiently. Furthermore, by reasonably configuring the Redis prefix acquisition method and strictly limiting the exposure of the interface in the production environment, the stability and security of the system are effectively guaranteed, and security risks caused by improper data processing are effectively avoided. Attached Figure Description
[0039] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a schematic block diagram of a test data automatic generation and import system provided in an embodiment of the present invention.
[0041] Figure 2 This is a schematic diagram of a method for automatically generating and importing test data, provided in an embodiment of the present invention.
[0042] Figure 3 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation
[0043] To make the purpose, features, and advantages of this application more apparent and understandable, specific embodiments and accompanying drawings will be used to clearly and completely describe the technical solution protected by this application. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0044] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this application and in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0045] Figure 1 This invention provides a schematic block diagram of an automatic test data generation and import system. In this embodiment, the automatic test data generation and import system 100 is encapsulated as a plugin and integrated into a Spring Boot project via dependency injection. Based on its functions, it can be divided into multiple functional modules, such as... Figure 1 As shown. The functional modules may include: an environment configuration module 110, a workflow generation module 120, an automatic data generation module 130, a pre-processing data module 140, and a workflow management module 150. The module referred to in this invention is a series of computer program segments that can be executed by at least one processor and perform a fixed function, and which are stored in memory.
[0046] The environment configuration module 110 is used to read pre-configured environment parameters from the standard configuration file of the Spring Boot project and start the system in a test or pre-production environment according to the read environment parameters.
[0047] The environment configuration module 110 configures the key environment parameters required for the plugin to run, specifically including exposing the designated port and setting the authentication key. When introducing the plugin into a Spring Boot project, developers can precisely set the port number and key through a standard configuration file, thereby ensuring that the plugin only runs normally in test and pre-production environments, fundamentally avoiding the potential risks caused by accidental activation in the production environment. It includes the following functional units.
[0048] The environment parameter reading unit 1101 is used to read target fields from the standard configuration file of the Spring Boot project and parse the port number, key and current environment from the target fields.
[0049] The system startup unit 1102 is used to determine whether the startup conditions are met based on the parsed current environment. If so, the system is started according to the port number and key; otherwise, the startup is rejected. If the current environment is a test or pre-production environment, the startup conditions are met; otherwise, the startup conditions are not met.
[0050] Developers can configure specific port numbers and keys for plugins in standard configuration files (such as application.yml or application.properties) of a Spring Boot project. For example:
[0051] plugin:
[0052] data-import:
[0053] port: 8081
[0054] key: "secure-key-123"
[0055] env: "test"# or "staging", not "production"
[0056] The plugin reads these configurations upon startup and determines the current environment based on the env field. If the environment is "production", the plugin will refuse to run.
[0057] The workflow generation module 120 is used to select various maintenance selection box elements on the page by clicking with the mouse according to the test purpose, mark the data generation method in the text box, configure the pre-data acquisition method if the data entry requires pre-data, record each operation step and related element location information, and generate a workflow based on the recorded data; the data generation method includes using predetermined data and automatic generation.
[0058] The workflow generation module 120 provides an innovative page-based workflow data entry function, similar to AutoHotkey, greatly reducing the user's learning curve. Users can easily select various maintenance checkboxes and other elements on the page by clicking with the mouse, freely mark pre-defined data in text boxes, or flexibly choose to generate data by AI. After all data is entered, clicking the submit button will successfully complete the entire workflow entry. Specifically, it includes the following functional units.
[0059] Page operation unit 1201 is used to select various maintenance selection box elements on the page by clicking with the mouse according to the test purpose. It marks the data generation method in the text box and configures the method for obtaining the preceding data if the data entry requires it. Specifically, it uses JavaScript to listen for mousedown and mouseup events, calculates the selection range, retrieves all elements within the range using document.elementsFromPoint(), and filters out operable elements such as input boxes and buttons. It pops up an operation menu for the text box, allowing users to select the data source method, including using pre-defined data and automatic generation, corresponding to manual input / automatic data generation models. If the operation requires preceding data such as a verification code, a pop-up window configures the Redis key prefix.
[0060] Workflow recording unit 1202 is used to record each operation step and related element location information. This unit 1202 accurately records operation steps, element location, and timing, including capturing user actions through browser or front-end framework APIs, recording the operation type, target element location information, and operation timing. Recorded operation types include clicks, input, navigation, and submission. Specifically, it listens to all interaction events, generates standardized operation objects, for example, in a browser environment, listens to DOM events through injected JavaScript; locates elements according to a priority strategy of data-testid>id>XPath>coordinate backup, and records operation intervals, inserting delay steps to ensure consistent playback timing. Each operation records a high-precision timestamp to ensure strict order consistency. If operation B depends on the result of operation A (e.g., the submit button is activated after input), a waitForElement condition is inserted.
[0061] The workflow generation unit 1203 is used to respond to submission operations and generate workflow processes based on recorded data. This unit 1203 generates an executable workflow file from the recorded operation sequence. Specifically, it merges operation records to generate a workflow file in JSON / XML format. Fields marked as AI-generated in the workflow file are replaced with generation rules to achieve dynamic data marking processing, and Redis / Kafka data retrieval logic is inserted into the workflow. For example, in a structured workflow file, input operations are individually labeled with their data source. Manually entered values are directly recorded, such as "value": "fixed data". AI generates record generation rules, such as "value": "generate mobile phone number". During execution, the automatic data generation module 130 is dynamically invoked.
[0062] After a user manually initiates the data entry process, they perform a series of operations on the target page, such as precisely clicking selection boxes and entering data in text boxes. The system records each step of the user's operation and the location information of relevant elements in real time and accurately. For data entry in text boxes, users can either manually enter predefined data or trigger the AI-generated data function with one click. At this time, the plugin's built-in artificial intelligence algorithm will quickly generate data that highly matches the user's needs based on preset rules and the context information of the current page. After the user completes all page operations and confirms submission, the system will automatically record and save the entire operation process for easy access later, significantly improving data entry efficiency.
[0063] The automatic data generation module 130 is used to respond to the automatic generation method, load the automatic data generation model, and generate corresponding data based on context information and requirement information.
[0064] The data auto-generation module 130, relying on artificial intelligence technology, can intelligently generate test data or pre-used data that fully meets the requirements based on the specific needs marked by the user in the text box. This data is used to populate dynamic content in the workflow. For example, in the "user registration" process, it generates test data such as random usernames, email addresses, and phone numbers; in the "order creation" process, it generates simulated data such as product names, prices, and quantities. The data generated by the data auto-generation model directly replaces the parts manually entered by the user, enabling the workflow to be executed automatically.
[0065] In some optional implementations, different automatic data generation models are selected based on the complexity of the requirements. For example, in simple scenarios, the automatic data generation model is a combination of rule templates and random generation, generating data based on predefined rules. In complex semantic scenarios, data conforming to the contextual semantics is generated based on a large language model. Alternatively, rule templates can be combined with neural network models to ensure that the data conforms to business logic. The input to the automatic data generation model is contextual information and user tagging requirements. The contextual information includes field descriptions of the current page and historical operation data. For example, the field descriptions of the current page are usernames (8-16 characters), and user tagging requirements are such as "generate phone number" or "simulate clothing product name". The output of the automatic data generation model is qualified text or structured data, such as {"username": "test_user123", "phone": "13800138000"}.
[0066] The front-end data processing module 140 is used to retrieve the front-end data that is pre-stored in the Redis cache in response to the front-end data retrieval method.
[0067] When data entry requires data login and pre-processing of data such as CAPTCHAs, the pre-processing data module 140 comes into play. This module pre-configures the sources of data such as CAPTCHAs in the project, for example, by using a Kafka message queue to push CAPTCHA data to the project and storing it in a Redis cache. Simultaneously, during the workflow entry phase, the Redis prefix retrieval method is pre-configured to be provided either via a method or an internal interface, and strict measures are taken to ensure that this interface is not exposed in the production environment, thus fully guaranteeing system security.
[0068] Specifically, the project precisely configures Kafka consumers to listen for and receive pre-requisite data such as CAPTCHAs in real time. The received data is then stored in Redis with a corresponding prefix identifier for easy retrieval and retrieval later. When storing CAPTCHAs and other data received from Kafka into Redis, a "prefix + timestamp" method is used to generate the storage key, with a reasonable expiration time set. Temporary data in Redis is automatically cleared after the workflow completes its operations. During the workflow entry process, users can choose the corresponding Redis prefix retrieval method (method or interface) through a dedicated configuration interface. When the system executes the process, it accurately retrieves the relevant pre-requisite data, such as CAPTCHAs, from Redis based on the user's configuration to complete critical operations such as login, ensuring that the pre-requisite conditions for data entry are met smoothly and guaranteeing data accuracy and timeliness.
[0069] The process management module 150 is used to save and execute the workflow generated by the workflow generation module. The execution of the workflow realizes the generation and import of test data. If there is an automatic data generation method, the automatic data generation module is called to generate the corresponding data. If the process requires the preceding data, the preceding data processing module is called to obtain the corresponding preceding data.
[0070] The workflow management module 150 is responsible for comprehensive management of the entered workflows, including core functions such as saving, loading, and executing workflows. Once a workflow is entered, users can conveniently call and execute the saved workflow at any time, significantly improving the overall efficiency of data import. Furthermore, module 150 also supports flexible editing and modification of workflows to adapt to different page layouts and diverse data entry needs. Executing a saved workflow involves a series of steps, such as clicking, inputting, and retrieving prerequisite data, enabling automatic data entry or test data generation without manual intervention.
[0071] The foregoing has described in detail an embodiment of an automatic test data generation and import system. Based on the automatic test data generation and import system described in the above embodiment, this invention also provides a corresponding automatic test data generation and import method.
[0072] Figure 2 This is a schematic flowchart illustrating a method for automatically generating and importing test data according to an embodiment of the present invention. Figure 2 The execution entity is the test data automatic generation and import system. The test data automatic generation and import method provided in this embodiment of the invention is executed by a computer device; correspondingly, the test data automatic generation and import system runs on the computer device. Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted.
[0073] like Figure 2 As shown, the method includes the following steps.
[0074] S1 integrates the system into the Spring Boot project as a plugin via dependency injection.
[0075] S2: The system reads pre-configured environment parameters from the standard configuration file of the Spring Boot project and starts the system in the test or pre-production environment according to the read environment parameters.
[0076] S3. Based on the test objective, select various maintenance selection box elements on the page by clicking with the mouse, mark the data generation method in the text box, configure the pre-data acquisition method if the data entry requires pre-data, record each operation step and related element location information, and generate a workflow based on the recorded data; the data generation method includes using predetermined data and automatic generation.
[0077] S4 executes the workflow process to generate and import test data. If there is an automatic data generation method during the execution process, the data generation model is loaded to generate the corresponding data according to the context information and requirement information. At the same time, if the process requires the previous data, the process execution is paused, and the pre-stored previous data is retrieved from the Redis cache according to the previous data retrieval method. Then the process continues to execute until the process ends.
[0078] In some optional implementations, pre-configured environment parameters are read from the standard configuration file of the Spring Boot project, and the system is started in a test or pre-production environment according to the read environment parameters. Specifically, this includes: reading target fields from the standard configuration file of the Spring Boot project, parsing the port number, key, and current environment from the target fields; determining whether the startup conditions are met based on the parsed current environment; if so, starting the system according to the port number and key; otherwise, rejecting the startup. Wherein, if the current environment is a test or pre-production environment, the startup conditions are met; otherwise, the startup conditions are not met.
[0079] The test data automatic generation and import method in this embodiment is based on the aforementioned test data automatic generation and import system. Therefore, the specific implementation method of this method can be found in the embodiment section of the test data automatic generation and import system above. Thus, the specific implementation method can be referred to the description of the corresponding embodiments, and will not be elaborated here.
[0080] Furthermore, since the test data automatic generation and import method in this embodiment is based on the aforementioned test data automatic generation and import system, its function corresponds to that of the above method, and will not be repeated here.
[0081] Figure 3 A schematic diagram of a terminal 300 provided in an embodiment of the present invention includes: a processor 310, a memory 320, and a communication unit 330. The processor 310 is used to implement the following steps when automatically generating and importing test data stored in the memory 320:
[0082] Integrate the system into the Spring Boot project as a plugin using dependency injection;
[0083] The system reads pre-configured environment parameters from the standard configuration file of the Spring Boot project and starts the system in the test or pre-production environment according to the read environment parameters;
[0084] Based on the test objective, select various maintenance checkbox elements on the page by clicking with the mouse, mark the data generation method in the text box, configure the data acquisition method if the data entry requires prior data, record each operation step and related element location information, and generate a workflow based on the recorded data; the data generation method includes using predetermined data and automatic generation.
[0085] The workflow is executed to generate and import test data. If an automatic data generation method exists during execution, the automatic data generation model is loaded to generate the corresponding data based on the context and requirements. If pre-process data is required during execution, the process is paused, and the pre-stored pre-process data is retrieved from the Redis cache according to the pre-process data retrieval method. The process is then resumed until it ends.
[0086] The terminal 300 includes a processor 310, a memory 320, and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation of the present invention. It can be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0087] The memory 320 can be used to store the execution instructions of the processor 310. The memory 320 can be implemented by any type of volatile or non-volatile memory terminal 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. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 is able to perform some or all of the steps in the above method embodiments.
[0088] The processor 310 serves as the control center of the storage terminal, connecting various parts of the electronic terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 310 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.
[0089] The communication unit 330 is used to establish a communication channel, enabling the storage terminal to communicate with other terminals. It can receive user data sent by other terminals or send user data to other terminals.
[0090] The present invention also provides a computer storage medium, which may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0091] The present invention also provides a computer storage medium, which may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0092] The computer storage medium stores a test data automatic generation and import program. When the test data automatic generation and import program is executed by the processor, it performs the following steps:
[0093] Integrate the system into the Spring Boot project as a plugin using dependency injection;
[0094] The system reads pre-configured environment parameters from the standard configuration file of the Spring Boot project and starts the system in the test or pre-production environment according to the read environment parameters;
[0095] Based on the test objective, select various maintenance checkbox elements on the page by clicking with the mouse, mark the data generation method in the text box, configure the data acquisition method if the data entry requires prior data, record each operation step and related element location information, and generate a workflow based on the recorded data; the data generation method includes using predetermined data and automatic generation.
[0096] The workflow is executed to generate and import test data. If an automatic data generation method exists during execution, the automatic data generation model is loaded to generate the corresponding data based on the context and requirements. If pre-process data is required during execution, the process is paused, and the pre-stored pre-process data is retrieved from the Redis cache according to the pre-process data retrieval method. The process is then resumed until it ends.
[0097] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or other media capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, server, or a second terminal, network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0098] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0099] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0100] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0101] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A test data automatic generation and import system, characterized in that, The system is encapsulated as a plugin and integrated into a Spring Boot project via dependency injection. The system includes: The environment configuration module is used to read pre-configured environment parameters from the standard configuration file of the Spring Boot project and start the system in a test or pre-production environment based on the read environment parameters; The workflow generation module is used to select various maintenance selection box elements on the page by clicking with the mouse according to the test purpose, mark the data generation method in the text box, configure the method of obtaining the preceding data if the data entry requires the preceding data, record each operation step and the location information of related elements, and generate a workflow based on the recorded data; the data generation method includes using predetermined data and automatic generation. The automatic data generation module is used to respond to the automatic generation method, load the automatic data generation model, and generate corresponding data based on context information and requirement information. The front-end data processing module is used to retrieve the front-end data that is pre-stored in the Redis cache in response to the front-end data retrieval method; The process management module is used to save and execute the workflow generated by the workflow generation module. The execution of the workflow realizes the generation and import of test data. If there is an automatic data generation method, the automatic data generation module is called to generate the corresponding data. If the process requires the preceding data, the preceding data processing module is called to obtain the corresponding preceding data. The environment configuration module includes: The environment parameter reading unit is used to read target fields from the standard configuration file of the Spring Boot project, and parse the port number, key and current environment from the target fields; The system startup unit is used to determine whether the startup conditions are met based on the parsed current environment. If so, the system is started according to the port number and key; otherwise, a startup rejection is reported. Specifically, if the current environment is a test or pre-production environment, the startup conditions are met; otherwise, the startup conditions are not met. The Spring Boot project internally configures a Kafka consumer, which listens for and receives pre-processed data in real time, stores the received pre-processed data in a Redis cache, and sets a corresponding prefix identifier. The preceding data is retrieved using Redis prefix retrieval methods, including either method-based or internal interface-based methods.
2. The test data automatic generation and import system according to claim 1, characterized in that, The workflow generation module includes: The page operation unit is used to select various maintenance selection box elements on the page by clicking with the mouse according to the test purpose, mark the data generation method in the text box, and configure the method of obtaining the preceding data if the data entry requires the preceding data. The workflow recording unit is used to record each operation step and the location information of related elements; The workflow generation unit is used to respond to submission operations and generate workflow processes based on recorded data.
3. The test data automatic generation and import system according to claim 2, characterized in that, Record each operation step and the location information of related elements, specifically including: Capture user actions via browser or front-end framework APIs; Record the operation type, the location information of the target element, and the operation sequence.
4. A method for automatically generating and importing test data, characterized in that, This method, implemented based on the system described in any one of claims 1 to 3, includes the following steps: Integrate the system into the Spring Boot project as a plugin using dependency injection; The system reads pre-configured environment parameters from the standard configuration file of the Spring Boot project and starts the system in the test or pre-production environment according to the read environment parameters; Based on the test objective, select various maintenance checkbox elements on the page by clicking with the mouse, mark the data generation method in the text box, configure the data acquisition method if the data entry requires prior data, record each operation step and related element location information, and generate a workflow based on the recorded data; the data generation method includes using predetermined data and automatic generation. The workflow is executed to generate and import test data. If an automatic data generation method exists during execution, the automatic data generation model is loaded to generate the corresponding data based on the context and requirements. If pre-process data is required during execution, the process is paused, and the pre-stored pre-process data is retrieved from the Redis cache according to the pre-process data retrieval method. The process is then resumed until it ends.
5. The method for automatically generating and importing test data according to claim 4, characterized in that, The system reads pre-configured environment parameters from the standard configuration file of the Spring Boot project and starts the system in a test or pre-production environment based on these parameters. Specifically, this includes: Read the target fields from the standard configuration file of the Spring Boot project, and parse the port number, key, and current environment from the target fields; The system is started based on the current environment as determined by the parsing. If the environment is a test or pre-production environment, the startup conditions are met; otherwise, the startup is rejected.
6. A terminal, characterized in that, include: Memory, used to store test data automatically generated and imported by the program; A processor is configured to implement the steps of the test data automatic generation and import method as described in claim 4 or 5 when executing the test data automatic generation and import program.
7. A computer-readable storage medium, characterized in that, The readable storage medium stores a test data automatic generation and import program, which, when executed by a processor, implements the steps of the test data automatic generation and import method as described in claim 4 or 5.
Citation Information
Patent Citations
Automatic test data generation method
CN104133772A
Low-code interface automation system, electronic equipment and storage medium
CN115422063A