Test data generation method and device, medium and program product
By deploying database configuration components and test data generation components in the data processing platform, test data generation without needing to understand the internal interface logic of the system is achieved. This solves the problem of low test data generation efficiency in existing technologies, improves the efficiency of test data generation, and simplifies the operation process.
Patent Information
- Application Number
- CN202511213723.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, test data generation requires testers to understand the system's internal interface query logic and technical architecture, resulting in a cumbersome and inefficient data preparation process. Non-professional testers cannot generate test data efficiently.
By deploying database configuration components, test requirement input components, and test data generation components in the data processing platform, business test data can be generated without understanding the internal interface logic of the system. This includes configuring database attribute information, establishing data connections, inputting test requirement information, and obtaining business test data.
It simplifies the test data generation process, reduces the learning cost, improves the efficiency of test data generation, and has a wider range of applications without requiring knowledge of the system's internal interface query logic.
Smart Images

Figure CN120973685A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of development testing, and in particular to a test data generation method, device, medium and program product. BACKGROUND
[0002] The test data generation process is number generation, which is a preparation work before data testing, and refers to a process of generating test data through a specific tool or platform in the fields of interface automation testing and number generation script. In the performance test script preparation stage, the parameters in the script generally need to be numbered to better simulate the real environment.
[0003] In the process of implementing the present application, the applicant found that there are at least the following problems in the prior art:
[0004] In the prior art, the tester needs to understand the specific data tables involved in each model query, the association relationship of each table, the field query display logic, and master the maintenance method of each type of database data table data, and directly number the tables to be queried; or prepare upstream and related associated table test data, run related batch jobs, and generate the data of the tables to be queried by batch; or apply for part of the production table data, which is imported into the test environment after desensitization for use by the front-end page and interface query. No matter which way is adopted, the number generation personnel need to have a considerable understanding of the system internal query logic and technical architecture, and the data preparation process is relatively cumbersome and lengthy, and the test support personnel are not professional technical testers, and cannot guarantee the test data generation efficiency. SUMMARY
[0005] The present application provides a test data generation method, device, medium and program product, which can prepare business test data without understanding the system internal interface query logic and technical architecture, thereby improving the test data generation efficiency.
[0006] In a first aspect, the embodiments of the present application provide a test data generation method applied to a data processing platform, wherein a database configuration component, a test requirement input component and a test data generation component are deployed in the data processing platform; the database configuration component is connected with the test requirement input component, and the test requirement input component is connected with the test data generation component; and the method comprises:
[0007] The database configuration component is configured to configure attribute information of a system under test database in the data processing platform, and establish a data connection between the data processing platform and the system under test database through a preset connection mode, wherein the attribute information of the system under test database is used to describe identification information and login information of the system under test database;
[0008] The test requirement input component is used to input test requirement information of the database of the system under test, and send the test requirement information of the database of the system under test to the test data generation component;
[0009] The test data generation component is used to acquire service test data from the database of the system under test according to the test requirement information of the database of the system under test, based on the data connection between the database of the system under test and the test data generation component, in response to a test data generation instruction, to generate the service test data.
[0010] In a second aspect, the embodiments of the present application further provide a test data generation apparatus applied to a data processing platform, wherein a database configuration component, a test requirement input component and a test data generation component are deployed in the data processing platform; the database configuration component is connected with the test requirement input component, and the test requirement input component is connected with the test data generation component; the apparatus comprises an information configuration module, an information input module and a data generation module; wherein,
[0011] The information configuration module is used to configure attribute information of a database of a system under test in the data processing platform through the database configuration component, and establish a data connection between the database of the system under test and the data processing platform through a preset connection mode, wherein the attribute information of the database of the system under test is used to describe identification information and login information of the database of the system under test;
[0012] The information input module is used to input test requirement information of the database of the system under test through the test requirement input component, and send the test requirement information of the database of the system under test to the test data generation component;
[0013] The data generation module is used to acquire service test data from the database of the system under test according to the test requirement information of the database of the system under test, based on the data connection between the database of the system under test and the test data generation component, in response to a test data generation instruction, to generate the service test data.
[0014] In a third aspect, the embodiments of the present application provide a storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the test data generation method according to any of the embodiments of the present application.
[0015] In a fourth aspect, the embodiments of the present application provide a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the test data generation method according to any of the embodiments of the present application.
[0016] The embodiment of the present application provides a test data generation method, device, medium and program product. That is, in the technical solution of the present application, the connection with the database of the measured system can be established through the component, and the corresponding business test data can be obtained by inputting the test requirement information. In the prior art, the tester needs to understand the specific data table involved in each model query, the association relationship of each table, the field query display logic, and master the maintenance method of each type of database data table data; if the tester does not understand the related content, the test data cannot be effectively generated. Therefore, compared with the prior art, the test data generation method, device, medium and program product provided by the embodiment of the present application can realize the preparation of business test data without understanding the internal interface query logic and technical architecture of the system, greatly reduce the learning cost of test data preparation work, simplify the difficulty of number generation to the greatest extent, and then improve the generation efficiency of test data; and the technical solution of the embodiment of the present application is simple and convenient, easy to popularize, and has a wider application range. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A flowchart of a test data generation method provided by an embodiment of the present application is shown in the figure.
[0018] Figure 2 A flowchart of a test data generation method provided by another embodiment of the present application is shown in the figure.
[0019] Figure 3 A flowchart of a test data generation method provided by another embodiment of the present application is shown in the figure.
[0020] Figure 4 A structural diagram of a test data generation device provided by an embodiment of the present application is shown in the figure.
[0021] Figure 5 A structural diagram of an electronic device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0022] The present application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, and not to limit the present application. In addition, it should be noted that, in order to facilitate description, only the parts related to the present application are shown in the drawings, not all structures.
[0023] Figure 1A flowchart of a test data generation method provided by an embodiment of the present application is shown in FIG. 1. The method can be executed by a test data generation apparatus or an electronic device, which can be implemented in software and / or hardware, and can be integrated into any smart device with network communication function. The test data generation method is applied to a data processing platform (e.g., a test data preparation tool / software), which is provided with a database configuration component, a test requirement input component, and a test data generation component. The database configuration component is connected to the test requirement input component, and the test requirement input component is connected to the test data generation component. As shown in FIG. 1, the test data generation method can include the following steps: Figure 1
[0024] S101, configuring attribute information of a system under test database in the data processing platform by the database configuration component, and establishing data connection between the system under test database and the data processing platform by a preset connection mode.
[0025] In this step, the attribute information of the system under test database is used to describe the identification information and login information of the system under test database. The identification information can include, but is not limited to, database identification, database type, database IP, database port, and database library name. The login information can include, but is not limited to, username and password. The database identification is a name identification customized by the user, which can be used to identify different test environments. The user needs to provide an invitation code when registering to increase the security of the tool. By configuring the attribute information of the system under test database, and using a standard application program interface for connecting and operating the database as the preset connection mode to establish data connection between the system under test database and the data processing platform.
[0026] S102, inputting test requirement information of the system under test database by the test requirement input component, and sending the test requirement information of the system under test database to the test data generation component.
[0027] In this step, the test requirement information of the system under test database is the number generation requirement. When entering the test requirement information of the system under test database, the test requirement entry component can support the pull-down selection of "database identifier", the pull-down selection of "data scenario major category", and "data scenario minor category"; wherein, the "database identifier" is the environment information configured by the user; the "data scenario major category" and "data scenario minor category" are the number generation scenarios supported by the data processing platform by default (two-level classification can be provided) or the number generation scenarios extended and maintained by the user in the "number generation scenario extension function". For example, the data scenario major category is risk information, and the number generation scenario risk 2 is a person subject to public credit information. In addition, different preset input lists can be displayed according to the selection of different "data scenario categories" for selection or input, such as "certificate type" (pull-down selection items can be provided), "certificate number", and "whether history" (two options of "yes" and "no" can be provided).
[0028] S103, in response to the test data generation instruction, based on the data connection between the system under test database, the test data generation component acquires the business test data from the system under test database according to the test requirement information of the system under test database, to generate the business test data.
[0029] In this step, the test data generation instruction is a test data generation request triggered by the user equipment, for example, the selection / click of the "generate" button.
[0030] Preferably, the test data generation component acquires the business test data from the system under test database according to the test requirement information of the system under test database, including:
[0031] The business test scenario corresponding to the test requirement information of the system under test database is acquired, and the corresponding connection interface is determined based on the business test scenario; the test data generation component calls the connection interface corresponding to the business test scenario, and acquires the business test data from the system under test database according to the test requirement information of the system under test database.
[0032] In this step, different number generation interfaces can be realized for different data scenarios. For the same data scenario major category, the same interface can be used, and different number generation scenarios can be distinguished by different input parameters when calling. For example, the user enters the request input parameters inStr1, inStr2,..., inStrn, and the request number as the interface request parameters in the front desk of the tool, and the tool replaces them when actually requesting.
[0033] The test data generation method proposed in the embodiments of the present application realizes data interaction with the system under test database through different connection interfaces, ensures independent use of the data channel under different test scenarios, facilitates acquisition of test data, and can avoid cross-influence in the test data generation process.
[0034] Preferably, the test data generation component calls the connection interface corresponding to the business test scenario, and acquires the business test data from the database of the system under test according to the test requirement information of the database of the system under test, including:
[0035] If the test data generation instruction is used to describe the first preset generation strategy, the test data generation component calls the connection interface corresponding to the business test scenario, acquires a target test data corresponding to the test requirement information of the database of the system under test from the database of the system under test, and determines the target test data as the business test data; if the test data generation instruction is used to describe the second preset generation strategy, the test data generation component calls the connection interface corresponding to the business test scenario, acquires a plurality of target test data corresponding to the test requirement information of the database of the system under test from the database of the system under test, and determines the plurality of target test data as the business test data.
[0036] In this step, the first preset generation strategy and the second preset generation strategy are respectively used to describe different data limit numbers, the first preset generation strategy is used to describe a single data, and the second preset generation strategy is used to describe at least two data. The embodiment sets a "data number" option (default 1) in the tool, and can support preparing a plurality of data according to the input number (limiting the input data type and the value interval range).
[0037] The test data generation method provided in the embodiment of the application can recognize the number of business test data, and perform corresponding processing according to the user instruction. When the user instruction is a plurality of data, a plurality of data is automatically prepared according to the input number, which effectively meets the user demand and improves the user stickiness.
[0038] The test data generation method provided by the embodiment of the application first configures attribute information of a system under test database in a data processing platform through a database configuration component, and establishes data connection with the system under test database through a preset connection mode. The attribute information of the system under test database is used to describe identification information and login information of the system under test database. Then, test requirement information of the system under test database is input through a test requirement input component, and the test requirement information of the system under test database is sent to a test data generation component. Finally, in response to a test data generation instruction, business test data is obtained from the system under test database according to the test requirement information of the system under test database through the test data generation component based on the data connection with the system under test database, so as to generate the business test data. That is, in the technical solution of the application, the connection with the system under test database can be established through a component, and the corresponding business test data can be obtained by inputting the test requirement information. In the prior art, a tester needs to understand specific data tables involved in each model query, association relationship of each table, field query display logic, and maintenance method of each type of database data table data. If the tester does not understand the related content, the test data cannot be effectively generated. Therefore, compared with the prior art, the test data generation method, device, medium and program product provided by the embodiment of the application can prepare the business test data without understanding the internal interface query logic and technical architecture of the system, greatly reduce the learning cost of test data preparation work, simplify the difficulty of data generation to the greatest extent, and further improve the generation efficiency of the test data. In addition, the technical solution of the embodiment of the application is simple and convenient, easy to popularize, and has a wider application range.
[0039] Figure 2 The flowchart of the test data generation method provided by another embodiment of the application is shown. Based on the above technical solution, further optimization and extension can be performed, and the above various optional embodiments can be combined. A test data storage component is also deployed in the data processing platform, and the test data storage component is connected with the test data generation component. As shown in Figure 2 the test data generation method can include the following steps:
[0040] S201, receive the business test data sent by the test data generation component, and store the business test data through the test data storage component.
[0041] Preferably, the business test data includes a plurality of business sub-data; the test data storage component stores the business test data, including:
[0042] obtain the data type corresponding to each business sub-data, and determine the data storage table corresponding to each business sub-data according to the data type corresponding to each business sub-data; and store each business sub-data into the corresponding data storage table through the test data storage component.
[0043] In this step, the data storage table can include: a user table, a user login log table, a measured system database list table, a data scenario table, a number generation requirement table, a number generation log record table, and a data automatic cleaning timing queue table. The data belonging class is used to identify different data storage tables, such as a first belonging class for identifying the user table, a second belonging class for identifying the user login log table, a third belonging class for identifying the measured system database list table, a fourth belonging class for identifying the data scenario table, a fifth belonging class for identifying the number generation requirement table, a sixth belonging class for identifying the number generation log record table, and a seventh belonging class for identifying the data automatic cleaning timing queue table. The user table includes fields such as "user id", "user name", "password (encrypted storage)", "registration time", and the like. The user login log table includes fields such as "user id", "user name", "login time", and the like. Each time a user logs in successfully, a record is made. The measured system database list table includes fields such as "database identification", "database type", "database IP", "database port", "database library name", "user name", "password", and the like. The data scenario table includes fields such as "data scenario major category", "data scenario minor category", "number of input parameters 1", "meaning of input parameter 1", "data type of input parameter 1", "meaning of input parameter 2", "data type of input parameter 2",..., "meaning of input parameter 50", "data type of input parameter 50" (i.e., up to 50 input parameters are supported, and unused fields can be empty), "number generation interface request URL", "number generation interface request message" (wherein specific parameters are replaced with $inStr1, $inStr2,..., $inStrn, corresponding to input parameters 1,..., n), "data cleaning request URL", "data cleaning interface request message" (wherein if parameters are needed, specific parameters can be replaced with $inStr1, $inStr2,..., $inStrn, corresponding to input parameters 1,..., n), "whether to expand scenarios", "scenario maintenance user", and the like. The number generation requirement table includes fields such as "number generation requirement id", "data scenario major category", "data scenario minor category", "inStr1" (i.e., input value 1), "inStr2",..., "inStr50" (unused input value fields can be empty), "number of entries", "whether to automatically clean", "data validity period (in hours)", "number generation user", "application number generation time", and the like. The number generation log record table includes fields such as "number generation requirement id", "number generation execution time", "success identifier", "number generation result return details", "data cleaning interface request message" (different from the field with the same name in the data scenario table, the request parameters in the request message here are actual values), "whether to clean", "cleaning method", "cleaning time", "cleaning user", and the like. The data automatic cleaning timing queue table includes fields such as "number generation requirement id", "expiration time", "execution status", "success flag", and the like.
[0044] For the case of association between tables, for example, the data of a "discredited person (personal)" scene of a certain "ID number" needs to be created first in the "id table", and then a risk information associated with the id needs to be created in the "risk list table". When implementing the data creation requirement, the tool creation interface will first query whether the record of the "ID number" exists in the "id table". If it exists, the id information is directly obtained, and only the associated risk data is created in the "risk list table", thereby avoiding redundant data creation. The interface output parameters include "success or failure flag", "data creation result return details", and "data cleaning interface request message". The data creation interface needs to provide "data creation result return details" as output parameters. When the data creation is successful, it is recommended that the field content be "specific data creation SQL" (relational database) or "specific key value and value value" (non-relational database). When the data creation fails, the field content is the specific error reason. The data creation interface synchronously generates the "data cleaning interface request message" when preparing to create data, which is used as an output parameter when calling the data cleaning interface. The three fields are all recorded in the "data creation log record table". After the user maintains the data creation requirement in the foreground, the corresponding data creation interface is called asynchronously, and the related log table is written. The data creation interface considers data dependency compression, identifies reusable basic data entities, avoids repeated generation, and reduces redundant data creation.
[0045] The test data generation method provided in the embodiments of the present application uses a relational database for data storage, and stores different business sub-data in corresponding data storage tables respectively, so that the partition storage of different types of business data is realized.
[0046] Preferably, the method further includes:
[0047] The scene extension indication sent by the user equipment is received, and the scene extension indication includes: a plurality of data classification items, the data classification items being used to identify different data test requirements; and in response to the scene extension indication, a test requirement entry component is used to generate a test requirement entry corresponding to each data classification item.
[0048] In this step, support input "data scene category", "data scene subcategory", "input 1 name", "input 1 type"... "input n name", "input n type", "number creation interface request url", "number creation interface request message" (where the specific parameters are replaced by $inStr1, $inStr2,..., $inStrn corresponding to input 1... input n), "data cleaning request url", "data cleaning interface request message" (if parameters are required, the specific parameters can be replaced by $inStr1, $inStr2,..., $inStrn corresponding to input 1... input n). "Data cleaning request url" and "data cleaning request message" are optional inputs. If not entered, "whether to automatically clean up" is not available in "number creation requirement input". For user-extended number creation scenarios, a list query is also provided, and modification and deletion are supported.
[0049] When viewing number creation history, a list of number creation history viewing functions is provided, and the display fields include "username", "operation time", "whether successful", "whether cleaned up", "data scene category", "data scene subcategory", "input list", "number of rows", "number creation result return details", etc. A "manual cleaning" button is provided, which can be clicked when "whether successful" is "yes" and "whether cleaned up" is "no" (otherwise, it is grayed out). Clicking the button provides two options: "call data cleaning interface" and "I have cleaned up the data cleaning state". For scenarios extended in function 3, "call data cleaning interface" is only available if "data cleaning request url" and "data cleaning request message" have been entered, otherwise it is grayed out. When the user clicks "call data cleaning interface" and confirms again, the tool calls the corresponding data cleaning interface, and if the call is successful, the data record state is set to "cleaned up"; when the user clicks "I have cleaned up the data cleaning state", the data record state is directly set to "cleaned up". The list query supports filtering and displaying according to "data scene category", "data scene subcategory", "whether successful", and "whether cleaned up". This enables classification query of successful number creation results. The number log viewing and classification filtering viewing functions can to a certain extent avoid user redundancy in number creation. Before number creation, the user can check whether the same type of business scenario has been created before through this function, and directly reuse it. At the same time, data testing assets can be accumulated.
[0050] The test data generation method proposed in the embodiments of the present application can extend business data preparation scenarios to apply business development and objectively migrate to other business systems for use. At the same time, it can support users to extend scenarios according to number creation requirements, and improve the richness of number creation scenarios.
[0051] S202, acquire the storage identifier field corresponding to the service test data.
[0052] S203, if the storage identifier field corresponding to the service test data is the first preset field, generate the timing cleaning task corresponding to the service test data in the preset timing queue table.
[0053] S204, detect whether the timing cleaning task corresponding to the service test data satisfies the preset timing strategy in real time; if it is detected that the timing cleaning task corresponding to the service test data satisfies the preset timing strategy, call the data cleaning interface to delete the service test data from the test data storage component.
[0054] In this step, after successfully calling the interface, the "data cleaning interface request message" returned by the interface is written into the "data cleaning interface request message" field of the "data log record table". The first preset field is used to describe the "timing automatic cleaning" field. For the "timing automatic cleaning", if the user has entered the automatic timing cleaning related field (such as "whether to automatically clean" selected "yes") when entering the data logging requirement in the foreground, and the data logging task is successfully executed, a record will be added in the "data automatic cleaning timing queue table" (i.e. the preset timing queue table) to record the timing cleaning task corresponding to the service test data. Configure the timing cleaning task, scan the record in the "data automatic cleaning timing queue table" with "expiration time" < "system time" and "execution status" as unexecuted, associate the "data logging scene table" and the "data log record table", obtain the "data cleaning request url" and the "data cleaning interface request message", and execute the automatic cleaning after the "data validity period (hours)" entered by the user expires, call the cleaning interface, and realize the cleaning.
[0055] For the "extended scene" and the user maintaining the "data cleaning request url" and the "data cleaning request message", after the user enters the data logging requirement and executes the data logging in the foreground, the tool will directly write the actual parameters in the "data cleaning message" entered by the user when extending the data logging scene into the "data log record table".
[0056] The test data generation method provided by the embodiment of the application can select a data survival validity period. If the validity period (hours) is selected and input, the system will execute automatic cleaning after the data expires. By setting the automatic timing cleaning mechanism, the situation that the tester forgets to clean up the specific test data (such as abnormal data and a large number of pressure test data prepared for temporary capacity expansion pressure test) when testing a specific scene is effectively avoided.
[0057] Figure 3 The flowchart of the test data generation method provided by another embodiment of the application. Based on the above technical solutions, further optimization and extension can be performed, and the above various optional embodiments can be combined. For example, Figure 3As shown, the test data generation method can include the following steps:
[0058] S301, receiving service test data sent by a test data generation component, and storing the service test data through a test data storage component.
[0059] S302, obtaining a storage identification field corresponding to the service test data.
[0060] S303, if the storage identification field corresponding to the service test data is a second preset field, updating a data generation record corresponding to the service test data in a test generation log.
[0061] S304, in response to a data viewing request sent by a user equipment, sending the data generation record corresponding to the service test data to the user equipment; in response to a data access request sent by the user equipment, displaying the service test data to the user equipment; and in response to a data cleaning request sent by the user equipment, deleting the service test data from the test data storage component.
[0062] In this step, the second preset field is used to describe the "manual cleaning" field. For "manual cleaning", the user can manually trigger the data cleaning request in the foreground through the "number generation history viewing" function. For the "extended scenario" and the user does not maintain the "data cleaning request url" and "data cleaning request message", the "data cleaning interface request message" of the "number generation log record table" is left blank, only supporting the user to manually execute the cleaning operation outside the tool, and manually setting the cleaning state in the "number generation history viewing" function.
[0063] The test data generation method provided by the embodiment of the present application provides a user manual cleaning method, which maximizes the convenience of user data cleaning; and by setting the history viewing function, the user can effectively trace the historical number generation.
[0064] It should be noted that the information collected by the present disclosure is information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards of relevant countries and regions, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal.
[0065] Figure 4 The structural diagram of the test data generation device provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, Figure 4As shown, the test data generation device is applied to a data processing platform, and the data processing platform is deployed with a database configuration component, a test requirement input component and a test data generation component; the database configuration component is connected with the test requirement input component, and the test requirement input component is connected with the test data generation component; the test data generation device comprises an information configuration module 401, an information input module 402 and a data generation module 403; wherein,
[0066] The information configuration module 401 is configured to configure attribute information of a system under test database in the data processing platform through the database configuration component, and establish a data connection between the system under test database and the data processing platform through a preset connection mode; the attribute information of the system under test database is used to describe identification information and login information of the system under test database;
[0067] The information input module 402 is configured to input test requirement information of the system under test database through the test requirement input component, and send the test requirement information of the system under test database to the test data generation component;
[0068] The data generation module 403 is configured to, in response to a test data generation instruction, acquire business test data from the system under test database according to the test requirement information of the system under test database through the test data generation component based on the data connection between the system under test database and the data processing platform, so as to generate the business test data.
[0069] The test data generation device described above can execute the method provided in any embodiment of the application, and has the corresponding function modules and beneficial effects of executing the method. Technical details not described in detail in the embodiment can be referred to the test data generation method provided in any embodiment of the application.
[0070] The embodiment of the application further provides a computer program product.
[0071] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits, computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0072] Figure 5A structural schematic diagram of an electronic device is provided for an embodiment of the present application, referring to Figure 5 , Figure 5 The electronic device 12 shown is merely an example and should not be taken as limiting the scope of functionality or use of embodiments of the present application. As shown in Figure 5 , the electronic device 12 is in the form of a general-purpose computing device. Components of the electronic device 12 can include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 to the processing unit 16.
[0073] The bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics bus, a processor or local bus using any of a variety of bus architectures. By way of example, these architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0074] The electronic device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by the electronic device 12 and includes both volatile and non-volatile media, removable and non-removable media.
[0075] The system memory 28 can include computer system readable media in the form of volatile memory, such as random access memory 30 (RAM) and / or cache memory 32. The electronic device 12 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 34 can be provided for reading from and writing to non-removable, non-volatile magnetic media (e.g., a "hard drive"). Figure 5 not shown, a magnetic hard disk drive for reading from and writing to non-removable, non-volatile magnetic media (e.g., a "hard drive"). Although not specifically shown, such can Figure 5 include a magnetic floppy disk drive for reading from and writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable, non-volatile optical disk (e.g., a "CD-ROM" or "DVD"). In these instances, each can be connected to the bus 18 by one or more data media interfaces. The memory 28 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the present application.
[0076] Program / utility 40 having a set of program modules 46 can be stored in memory 28 by way of example, such program modules 46 include an operating system, one or more application programs, other program modules, and program data, each or some combination thereof, which can include implementation of the network environment in each or some combination of the examples. Program modules 46 generally carry out the functions and / or methodologies of embodiments described herein.
[0077] Electronic device 12 can also communicate with one or more external devices 14 such as a keyboard or pointing device, a display 24, etc.; one or more devices that enable a user to interact with electronic device 12; and / or one or more devices that enable electronic device 12 to communicate with one or more other computing devices. Such communication can be via input / output interface 22. Still yet, electronic device 12 can communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), and / or a public network, such as the Internet, via network adapter 20. As depicted, network adapter 20 communicates with the other components of electronic device 12 via bus 18. It should be appreciated that although not shown, other hardware and / or software modules could be used in conjunction with electronic device 12. Such Figure 5 As previously mentioned, processing unit 16 executes instructions, which, for this example, are stored in system memory 28. In this manner, processing unit 16 can be transformed into a special purpose processor in a special purpose computing environment. In this manner, computer system 10 can implement an application specific computing system. In this manner, processing unit 16 can be said to perform functions and / or methods described herein.
[0078] The embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize a test data generation method provided by all the embodiments of the present application, and is applied to a data processing platform, wherein a database configuration component, a test requirement input component and a test data generation component are deployed in the data processing platform; the database configuration component is connected with the test requirement input component, the test requirement input component is connected with the test data generation component, and the method comprises the following steps: attribute information of a system under test database is configured in the data processing platform through the database configuration component, and data connection between the system under test database and the data processing platform is established through a preset connection mode, and the attribute information of the system under test database is used for describing identification information and login information of the system under test database; test requirement information of the system under test database is input through the test requirement input component, and the test requirement information of the system under test database is sent to the test data generation component; in response to a test data generation instruction, business test data is acquired from the system under test database according to the test requirement information of the system under test database through the test data generation component based on the data connection between the system under test database and the data processing platform, so that the business test data is generated. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, but is not limited to, an electronic device, a device or a component of an electronic device, a magnetic device, an optical device, an electromagnetic device, an infrared device or a semiconductor device, or any combination of the above. More specific examples (non-exhaustive list) of the computer readable storage medium include: an electrical connection with one or more conductive wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution electronic device, device or component.
[0079] The computer readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, in which a computer readable program code is borne. Such a propagated data signal can take multiple forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution electronic device, device or component.
[0080] The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, etc., or any suitable combination of the above.
[0081] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0082] It is to be understood that the above description is merely a preferred embodiment of the application and the applied technical principles. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, modifications and substitutions can be made without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A method for generating test data, characterized in that, It is applied to a data processing platform, which is equipped with a database configuration component, a test requirement input component, and a test data generation component. The database configuration component is connected to the test requirement input component, and the test requirement input component is connected to the test data generation component; the method includes: The database configuration component configures the attribute information of the database under test in the data processing platform, and establishes a data connection with the database under test through a preset connection method. The attribute information of the database under test is used to describe the identification information and login information of the database under test. The test requirement information of the system under test database is entered through the test requirement input component, and the test requirement information of the system under test database is sent to the test data generation component. In response to a test data generation instruction, based on the data connection with the database of the system under test, the test data generation component retrieves business test data from the database of the system under test according to the test requirement information of the database of the system under test, so as to generate the business test data.
2. The method according to claim 1, characterized in that, The step of obtaining business test data from the database of the system under test according to the test requirements information of the database of the system under test through the test data generation component includes: Obtain the business test scenario corresponding to the test requirement information of the database of the system under test, and determine the corresponding connection interface based on the business test scenario; The test data generation component calls the connection interface corresponding to the business test scenario to obtain business test data from the database of the system under test according to the test requirements information of the database of the system under test.
3. The method according to claim 2, characterized in that, The step of calling the connection interface corresponding to the business test scenario through the test data generation component, and obtaining business test data from the database of the system under test according to the test requirement information of the database of the system under test, includes: If the test data generation instruction is used to describe the first preset generation strategy, then the connection interface corresponding to the business test scenario is called through the test data generation component, and a corresponding target test data is obtained from the database of the system under test according to the test requirement information of the database of the system under test, and the target test data is determined to be business test data. If the test data generation instruction is used to describe the second preset generation strategy, then the test data generation component calls the connection interface corresponding to the business test scenario, obtains multiple target test data from the database of the system under test according to the test requirement information of the database of the system under test, and determines the multiple target test data as business test data.
4. The method according to claim 1, characterized in that, The method further includes: Receive a scenario extension instruction sent by a user equipment, the scenario extension instruction including: multiple data classification items, the data classification items being used to identify different data testing requirements; In response to the scenario expansion instruction, the test requirement entry item corresponding to each of the data category items is generated through the test requirement entry component.
5. The method according to claim 1, characterized in that, The data processing platform also deploys a test data storage component, which is connected to the test data generation component; the method further includes: Receive the business test data sent by the test data generation component, and store the business test data through the test data storage component; Obtain the storage identifier field corresponding to the business test data; if the storage identifier field corresponding to the business test data is a first preset field, then generate a scheduled cleanup task corresponding to the business test data in the preset scheduled queue list; The system continuously monitors whether the scheduled cleanup task corresponding to the business test data meets the preset timing strategy. If the system detects that the scheduled cleanup task corresponding to the business test data meets the preset timing strategy, it calls the data cleanup interface to delete the business test data from the test data storage component.
6. The method according to claim 5, characterized in that, The method further includes: If the storage identifier field corresponding to the business test data is the second preset field, then the data generation record corresponding to the business test data is updated in the test generation log; In response to a data viewing request sent by a user device, a data generation record corresponding to the service test data is sent to the user device; in response to a data access request sent by the user device, the service test data is displayed to the user device; and in response to a data cleanup request sent by the user device, the service test data is deleted from the test data storage component.
7. The method according to claim 5, characterized in that, The business test data includes multiple business sub-data; storing the business test data through the test data storage component includes: Obtain the data class corresponding to each of the business sub-data, and determine the data storage table corresponding to each of the business sub-data based on the data class corresponding to each of the business sub-data; The test data storage component stores each of the business sub-datas into its corresponding data storage table.
8. A test data generation device, characterized in that, It is applied to a data processing platform, which is equipped with a database configuration component, a test requirement input component, and a test data generation component. The database configuration component is connected to the test requirement input component, and the test requirement input component is connected to the test data generation component; the device includes: an information configuration module, an information input module, and a data generation module; wherein... The information configuration module is used to configure the attribute information of the database of the system under test in the data processing platform through the database configuration component, and to establish a data connection with the database of the system under test through a preset connection method. The attribute information of the database of the system under test is used to describe the identification information and login information of the database of the system under test. The information input module is used to input the test requirement information of the database of the system under test through the test requirement input component, and send the test requirement information of the database of the system under test to the test data generation component. The data generation module is used to respond to a test data generation instruction and, based on the data connection with the database of the system under test, obtain business test data from the database of the system under test according to the test requirement information of the database of the system under test through the test data generation component to generate the business test data.
9. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the test data generation method as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the test data generation method as described in any one of claims 1 to 7.