A test data generation method, device, equipment and medium

By analyzing the data table characteristics in the database to generate test data close to real data, the problem that the existing technology cannot accurately describe real data and verify system robustness is solved, and system optimization and robustness verification in a big data environment is achieved.

CN112328499BActive Publication Date: 2025-01-14HANGZHOU DBAPPSECURITY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011364238.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-27
Publication Date
2025-01-14
Estimated Expiration
2040-11-27

AI Technical Summary

Technical Problem

Existing test data generation solutions cannot accurately describe real data, and cannot effectively verify and optimize the robustness of the system, especially in big data environments.

Method used

By querying the pre-selected data tables in the database of the test system, extracting the target data fields, and analyzing their external correlation characteristics, internal correlation characteristics and field characteristics, these characteristics are used to generate tests that are close to the real data. Data, used to verify the robustness and optimization direction of the system.

Benefits of technology

The generated test data is small and the real data, which can accurately describe the operation of the system, help to optimize the system in a big data environment, and can generate a large amount of test data to verify the robustness of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112328499B_ABST
    Figure CN112328499B_ABST
Patent Text Reader

Abstract

The present application discloses a test data generation method, device, equipment, and medium, the method comprising: querying a pre-selected data table in a database corresponding to a system to be tested and extracting a target data field in the data table; analyzing the target data field to determine the external association characteristics, internal association characteristics, and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables other than the current data table, the internal association characteristics are the association characteristics between the target data fields in the current data table, and the field characteristics are the characteristics of the target data fields; generating test data using the external association characteristics, the internal association characteristics, and the field characteristics, so as to test the system to be tested using the test data. The test data generated in this way is less different from the real data generated by the actual operation of the system, and can accurately describe the real data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a test data generating method, device, equipment, and medium. Background Art

[0002] In system development, test data generation is always involved. When the system is not completed, test data is constructed to verify the feasibility of the solution. When problems are found online, data can be modified to reproduce the problems and then solve them. Whether it is pre-verification or in-process solution, data generation plays an important role.

[0003] Among the existing data generation schemes, the mainstream data generation scheme is limited to unit testing and integration testing, which is helpful for system usability verification, but cannot provide guarantees for the robustness of the system. In addition, the generated test data is greatly different from the real data, and cannot accurately describe the real data, and it is also impossible to predict the optimization direction of the system under big data. Therefore, how to generate test data to ensure that the generated test data can both accurately describe the real data and verify the robustness of the system is a problem that technicians in this field need to solve. Summary of the invention

[0004] In view of this, the purpose of this application is to provide a test data generation method, device, equipment, and medium that can test the robustness of the system, and the generated test data is slightly different from the real data generated by the actual operation of the system, and can accurately describe the real data, so as to predict the optimization direction of the system under big data. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a test data generating method, comprising:

[0006] Querying a pre-selected data table in the database corresponding to the system to be tested and extracting target data fields in the data table;

[0007] Analyze the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics represent the association characteristics between the target data fields in the current data table, and the field characteristics represent the characteristics of the target data field;

[0008] Test data is generated using the external association feature, the internal association feature, and the field feature, so as to test the system to be tested using the test data.

[0009] Optionally, querying a pre-selected data table in a database corresponding to the system to be tested and extracting a target data field in the data table includes:

[0010] Get the data table information and preset data field information set by the user;

[0011] A data table corresponding to the data table information is queried in a database corresponding to the system to be tested, and a target data field corresponding to the preset data field information in the data table is extracted.

[0012] Optionally, after querying a pre-selected data table in the database corresponding to the system to be tested and extracting a target data field in the data table, the method further includes:

[0013] Get data field deletion information;

[0014] The data field corresponding to the data field deletion information in the target data field is deleted.

[0015] Optionally, the generating test data by using the external association feature, the internal association feature and the field feature includes:

[0016] Obtain the amount of test data to be generated;

[0017] The test data having the same data volume as the test data to be generated is generated by using the external association feature, the internal association feature and the field feature.

[0018] Optionally, after analyzing the target data field to determine the external association features, internal association features and field features of the data table, the method further includes:

[0019] The system to be tested is optimized according to the external association characteristics, the internal association characteristics and the field characteristics.

[0020] Optionally, analyzing the target data field to determine the internal association characteristics of the data table includes:

[0021] The target data field is analyzed using a linear discriminant analysis method and a forward search method to determine the internal correlation characteristics of the data table.

[0022] Optionally, analyzing the target data field to determine the internal association characteristics of the data table includes:

[0023] The target data field is analyzed using a linear discriminant analysis method and a backward search method to determine the internal correlation characteristics of the data table.

[0024] In a second aspect, the present application discloses a test data generating device, comprising:

[0025] An information collection module is used to query a pre-selected data table in the database corresponding to the system to be tested and extract target data fields in the data table;

[0026] A field analysis module is used to analyze the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics represent the association characteristics between the target data fields in the current data table, and the field characteristics represent the characteristics of the target data field;

[0027] The data generation module is used to generate test data using the external association feature, the internal association feature and the field feature, so as to test the system to be tested using the test data.

[0028] In a third aspect, the present application discloses an electronic device, comprising:

[0029] Memory and processor;

[0030] Wherein, the memory is used to store computer programs;

[0031] The processor is used to execute the computer program to implement the test data generating method disclosed above.

[0032] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned disclosed test data generating method when executed by a processor.

[0033] It can be seen that the present application first queries the pre-selected data table in the database corresponding to the system to be tested and extracts the target data field in the data table, and then analyzes the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics are the association characteristics between the target data fields in the current data table, and the field characteristics are the characteristics of the target data fields. Then, the external association characteristics, the internal association characteristics and the field characteristics can be used to generate test data so as to use the test data to test the system to be tested. It can be seen from this that the present application first extracts the target data fields from the data table in the database of the system to be tested, and then analyzes the extracted target data fields to obtain the external correlation characteristics, internal correlation characteristics and field characteristics of the data table, and then generates test data based on the external correlation characteristics, internal correlation characteristics and field characteristics. In this way, the test data is generated based on the existing real data of the system to be tested, which can make the difference between the generated test data and the real data generated by the actual operation of the system small, and can accurately describe the real data so as to predict the optimization direction of the system under big data, and can generate a large amount of test data to test the robustness of the system to be tested. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0035] Figure 1 A flow chart of a test data generating method disclosed in this application;

[0036] Figure 2 A flow chart of a specific test data generating method disclosed in this application;

[0037] Figure 3 A flow chart of a specific test data generating method disclosed in this application;

[0038] Figure 4 A schematic diagram of the structure of a test data generating device disclosed in this application;

[0039] Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] See also Figure 1 As shown, the embodiment of the present application discloses a test data generating method, the method comprising:

[0042] Step S11: querying a pre-selected data table in the database corresponding to the system to be tested and extracting target data fields in the data table.

[0043] During the specific implementation process, when it is necessary to test the system to be tested, it may be necessary to generate test data corresponding to the system to be tested. The generated test data needs to be close to the data generated during the actual operation of the system to be tested. In this way, when the system to be tested is tested using the generated test data, the actual situation of the system to be tested can be tested.

[0044] So specifically, it is necessary to first query the pre-selected data table in the database corresponding to the system to be tested and extract the target data field in the data table. The data table can be pre-selected by the tester. Considering that in actual applications, it is unlikely to perform a full-scale stress test and stability test on all modules in the system to be tested, and the full-scale test can also be divided into tests of each sub-module, the data field is collected at the table level, and there is no need to collect the entire database.

[0045] Step S12: Analyze the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics are the association characteristics between the target data fields in the current data table, and the field characteristics are the characteristics of the target data field.

[0046] It can be understood that after obtaining the target data field, it is necessary to analyze the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics are the association characteristics between the target data fields in the current data table, and the field characteristics are the characteristics of the target data field.

[0047] That is, by analyzing the target data field, the characteristics of other data tables associated with the data table, the association characteristics between different target data tables in the data table, and the characteristics of the target data field itself are determined.

[0048] Among them, the external association feature can be the number of associated tables, the number of foreign keys in a single associated table, etc. Generally speaking, there will be a logical association or an implicit association between different fields in the same table. This kind of association is ubiquitous and is an indispensable feature when constructing test data. For example, taking the order table as an example, the start time of an order must be later than the end time, and the time range from the start to the end is one of the internal association features; there is also a relationship between the order status and the payment amount. When the status is unpaid, the payment amount is 0, and it is not 0 when it has been paid. This is also an internal association feature. The field feature is the feature of the field itself, which can be the numerical distribution interval of the field and the proportion of the number of each interval, or whether the field value is continuous or discrete, or the data length, etc.

[0049] Based on the target data field analysis, the characteristics that each data in the data table needs to meet in different dimensions are obtained, so that the generated test data can be closer to the actual value generated by the system to be tested, and the robustness and feasibility of the system to be tested can be more reliably tested, so that the test results are reliable and a reliable direction is provided for the optimization of the system to be tested.

[0050] Step S13: Generate test data using the external association feature, the internal association feature and the field feature, so as to test the system to be tested using the test data.

[0051] After obtaining the external correlation feature, the internal correlation feature and the field feature, test data may be generated based on the external correlation feature, the internal correlation feature and the field feature, so as to test the system to be tested using the test data.

[0052] The external association features, the internal association features and the field features can be exported into text, which can be imported into the preset test data generation system to generate a specified amount of test data close to the real data. In this way, other servers can be used to quickly generate test data in the future, so as to achieve "generate in one place and run everywhere". It is generally used to amplify the data, that is, to generate a large amount of test data, and verify the robustness and stability of the system to be tested based on a large amount of real data.

[0053] It can be seen that the present application first queries the pre-selected data table in the database corresponding to the system to be tested and extracts the target data field in the data table, and then analyzes the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics are the association characteristics between the target data fields in the current data table, and the field characteristics are the characteristics of the target data fields. Then, the external association characteristics, the internal association characteristics and the field characteristics can be used to generate test data so as to use the test data to test the system to be tested. It can be seen from this that the present application first extracts the target data fields from the data table in the database of the system to be tested, and then analyzes the extracted target data fields to obtain the external correlation characteristics, internal correlation characteristics and field characteristics of the data table, and then generates test data based on the external correlation characteristics, internal correlation characteristics and field characteristics. In this way, the test data is generated based on the existing real data of the system to be tested, which can make the difference between the generated test data and the real data generated by the actual operation of the system small, and can accurately describe the real data so as to predict the optimization direction of the system under big data, and can generate a large amount of test data to test the robustness of the system to be tested.

[0054] See also Figure 2 As shown, the embodiment of the present application discloses a specific test data generation method, which includes:

[0055] Step S21: querying a pre-selected data table in the database corresponding to the system to be tested and extracting target data fields in the data table.

[0056] First, it is necessary to query the pre-selected data table in the database corresponding to the system to be tested and extract the target data field in the data table. Specifically, the data table information and preset data field information set by the user can be obtained; the data table corresponding to the data table information in the database corresponding to the system to be tested is queried and the target data field corresponding to the preset data field information in the data table is extracted. That is, which data tables in the database need to be queried and fields extracted can be manually specified.

[0057] Step S22: Acquire data field deletion information, and delete the data field corresponding to the data field deletion information in the target data field.

[0058] In practical applications, after the target data field is extracted, operations such as screening need to be performed on the extracted target data field, so data field deletion information needs to be obtained to delete the data field corresponding to the data field deletion information in the target data field.

[0059] In this way, by extracting data fields through manual intervention, data fields can be obtained more accurately, avoiding the introduction of unnecessary noise, and also speeding up the collection process.

[0060] Step S23: Analyze the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics are the association characteristics between the target data fields in the current data table, and the field characteristics are the characteristics of the target data field.

[0061] In a specific application, in the process of analyzing the target data field and determining the internal correlation characteristics of the data table, the target data field can be analyzed by a linear discriminant analysis method and a forward search method to determine the internal correlation characteristics of the data table. Alternatively, the target data field can be analyzed by a linear discriminant analysis method and a backward search method to determine the internal correlation characteristics of the data table.

[0062] That is, the linear discriminant analysis method may be used to generate the features of each target data field first, and then the relationship between the features may be determined by forward search or backward search to determine the internal correlation features.

[0063] Forward search, that is, only one data field will be selected at the beginning, and then the next data field will be selected, and the features will be calculated together with the data field in the previous step, and the cross-validation error of the model will be calculated. Other data fields will be selected in turn to calculate features. Finally, the feature with the smallest cross-validation error will be selected and placed in the selected data field, and the previous step will be repeated until all data fields have been traversed. Backward search, that is, starting from all data fields, the number of data fields will be reduced in turn, and the cross-validation error will be calculated. Repeat this process, remove the field with the largest error from the candidate list, and repeat the previous step until only one data field is left.

[0064] Step S24: Generate test data using the external association feature, the internal association feature, and the field feature, so as to test the system to be tested using the test data.

[0065] After obtaining the external correlation feature, the internal correlation feature and the field feature, the test data can be generated using the external correlation feature, the internal correlation feature and the field feature, so as to test the system to be tested using the test data.

[0066] Specifically, the data volume of the test data to be generated is obtained; and the test data having the same data volume as the test data to be generated is generated by using the external association feature, the internal association feature and the field feature.

[0067] Step S25: Optimizing the system to be tested according to the external association characteristics, the internal association characteristics and the field characteristics.

[0068] In the actual implementation process, after the external correlation features, the internal correlation features and the field features are determined, the system to be tested can also be optimized according to the external correlation features, the internal correlation features and the field features. That is, after the external correlation features, the internal correlation features and the field features are obtained, the operation status of the system to be tested can be obtained, so the optimization and other operations can be performed according to the system to be tested.

[0069] In practical applications, the test data generation method can be used in the following scenarios:

[0070] The public security situation awareness platform in a certain place has been running online for more than three years, and has accumulated a large amount of real data. The test data generated by using the above test data can be used as benchmark data for performance testing.

[0071] During major events (such as the G20), hacker activities are more frequent, generating a large amount of attack data. Scenarios where a large amount of data enters in a short period of time can retain their characteristics to facilitate future system optimization.

[0072] A network information platform conducts supervision work, and the background needs to manually enter various simulation data to facilitate the display of the large screen. According to the data characteristics of the demonstration scene, this test data generation can also have outstanding performance.

[0073] In a public security project in a certain place, the query page for hidden dangers is abnormally slow. A business query takes about 6 seconds. The maximum amount of data in the background related table data does not exceed 700,000, which obviously cannot meet the performance requirements. It is necessary to optimize the related queries. The process is as follows: First, the scenario is refined: query the hidden danger data that has not been processed within one month. Then the data fields are proposed and the external correlation features, internal correlation features and field features of the data are sorted and analyzed. Then test data can be generated based on the external correlation features, internal correlation features and field features. See Figure 3As shown in Figure 2, it is the specific process of generating test data.

[0074] The external correlation features, internal correlation features, and field features of the collated and analyzed data are as follows:

[0075] External association features: Hidden dangers are associated with five tables, including units, websites, and scanning tasks. Scanning tasks one by one revealed tens of thousands of hidden dangers, but only a few hundred were seen in the backend. Through analysis, it can be seen that in a real environment, data deletion does not actually delete the data, but instead marks the data as deleted through a certain field, which is called soft deletion. In this scenario, a large amount of data was soft deleted, which is suspected to be human operation or systemic problems.

[0076] Internal correlation characteristics: Relationship between time and status: Most of the unprocessed and in-processing states are distributed in the past 10 days; most of the data status 10 days ago was completed. Through analysis, it can be seen that a special system scan has been carried out recently, resulting in a large amount of data not being processed recently, and some data is being processed. The start time and end time of the website's hidden danger scan: Most websites will be scanned within 2 hours, a small number will be completed within 2-5 hours, and some websites have no end time. Through analysis, it can be seen that websites with longer scanning time have more subdomains, and the very few websites that have not been scanned have invalid or transferred website links.

[0077] Own characteristics: Hidden danger start time: 80% of the data were newly added in the past month. Through analysis, it can be seen that a special system scan has been carried out recently. Hidden danger status: The status can be enumerated: unprocessed, processing, completed; data distribution of each status: unprocessed accounts for less than 1%, processing accounts for 10%, and completed accounts for nearly 90%.

[0078] Based on the above features, we can also get the following optimization suggestions: Check whether the system has loopholes. It is also recommended to put the soft deleted fields into the existing index as a joint index to speed up the table connection. Specify the time and status when querying to speed up the query efficiency. The backend regularly processes invalid websites. There are only three hidden danger states. Although the distinction is not high, some states can filter a large amount of data according to the data distribution, and new state indexes can be added.

[0079] See also Figure 4 As shown, the embodiment of the present application discloses a test data generating device, comprising:

[0080] The information collection module 11 is used to query a pre-selected data table in the database corresponding to the system to be tested and extract the target data field in the data table;

[0081] A field analysis module 12 is used to analyze the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics represent the association characteristics between the target data fields in the current data table, and the field characteristics represent the characteristics of the target data field;

[0082] The data generating module 13 is used to generate test data using the external association feature, the internal association feature and the field feature, so as to test the system to be tested using the test data.

[0083] It can be seen that the present application first queries the pre-selected data table in the database corresponding to the system to be tested and extracts the target data field in the data table, and then analyzes the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics are the association characteristics between the target data fields in the current data table, and the field characteristics are the characteristics of the target data fields. Then, the external association characteristics, the internal association characteristics and the field characteristics can be used to generate test data so as to use the test data to test the system to be tested. It can be seen from this that the present application first extracts the target data fields from the data table in the database of the system to be tested, and then analyzes the extracted target data fields to obtain the external correlation characteristics, internal correlation characteristics and field characteristics of the data table, and then generates test data based on the external correlation characteristics, internal correlation characteristics and field characteristics. In this way, the test data is generated based on the existing real data of the system to be tested, which can make the difference between the generated test data and the real data generated by the actual operation of the system small, and can accurately describe the real data so as to predict the optimization direction of the system under big data, and can generate a large amount of test data to test the robustness of the system to be tested.

[0084] In some specific implementation processes, the information acquisition module 11 is used to: obtain data table information and preset data field information set by the user; query the data table corresponding to the data table information in the database corresponding to the test system and extract the target data field corresponding to the preset data field information in the data table.

[0085] In some specific implementations, the test data generating device further includes:

[0086] The field deletion module is used to obtain data field deletion information; and delete the data field corresponding to the data field deletion information in the target data field.

[0087] In some specific implementation processes, the data generation module 13 is used to: obtain the data volume of the test data to be generated; and generate test data with the same data volume as the test data to be generated using the external association features, the internal association features and the field features.

[0088] In some specific implementations, the test data generating device further includes:

[0089] An optimization module is used to optimize the system to be tested according to the external association characteristics, the internal association characteristics and the field characteristics.

[0090] In some specific implementations, the field analysis module 12 is used to analyze the target data field using a linear discriminant analysis method and a forward search method to determine the internal correlation characteristics of the data table.

[0091] In some specific implementations, the field analysis module 12 is used to analyze the target data field using a linear discriminant analysis method and a backward search method to determine the internal correlation characteristics of the data table.

[0092] Figure 5 As shown, it is a structural schematic diagram of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 can specifically implement the test data generating method steps disclosed in the aforementioned embodiment.

[0093] Generally, the electronic device 20 in this embodiment includes: a processor 21 and a memory 22 .

[0094] Among them, the processor 21 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 21 may be implemented using at least one of DSP (digital signal processing), FPGA (field-programmable gate array), and PLA (programmable logic array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (central processing unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (graphics processing unit), which is responsible for rendering and drawing images that need to be displayed on the display screen. In some embodiments, the processor 21 may include an AI (artificial intelligence) processor, which is used to process computing operations related to machine learning.

[0095] The memory 22 may include one or more computer-readable storage media, which may be non-transitory. The memory 22 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In this embodiment, the memory 22 is at least used to store the following computer program 221, wherein after the computer program is loaded and executed by the processor 21, the test data generation method steps disclosed in any of the aforementioned embodiments can be implemented.

[0096] In some embodiments, the electronic device 20 may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a sensor 26 , a power source 27 , and a communication bus 28 .

[0097] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the electronic device 20, and may include more or fewer components than shown in the figure.

[0098] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the test data generating method disclosed in any of the aforementioned embodiments.

[0099] Among them, the specific process of the above-mentioned test data generating method can refer to the corresponding content disclosed in the aforementioned embodiment, and will not be repeated here.

[0100] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0101] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0102] Finally, it should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a series of processes, methods, articles or equipment containing other elements include not only those elements, but also other elements not explicitly listed, or also include elements inherent to such processes, methods, articles or equipment. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or equipment that includes the elements.

[0103] The above is a detailed introduction to a test data generation method, device, equipment, and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A test data generation method, characterized in that: include: Querying a pre-selected data table in the database corresponding to the system to be tested and extracting target data fields in the data table; Analyze the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics represent the association characteristics between the target data fields in the current data table, and the field characteristics represent the characteristics of the target data field; Generate test data using the external association feature, the internal association feature, and the field feature, so as to test the system to be tested using the test data; The target data field is analyzed to determine the internal correlation characteristics of the data table, including: Generate features of each of the target data fields using a linear discriminant analysis method, and then determine the relationship between the features using a forward search or a backward search to determine the internal correlation features; Determining the internal correlation feature by forward search includes: selecting a data field as a first data field, then selecting a next data field as a second data field, using the feature of the first data field and the feature of the second data field to jointly calculate the internal correlation feature, and calculating the cross-validation error, sequentially selecting other data fields to calculate the corresponding internal correlation features, selecting the internal correlation feature with the smallest cross-validation error, and putting it into the selected data field, repeating the step of selecting a data field as the first data field until all data fields are traversed to obtain all internal correlation features; Using backward search to determine the internal correlation features includes: starting from all data fields, reducing the number of data fields in turn, and calculating the cross-validation error based on the features in the candidate list after each reduction of the data fields, repeating this process, removing the data field with the largest error from the candidate list, until only one data field remains to obtain the internal correlation features.

2. The test data generation method according to claim 1, characterized in that: The step of querying a pre-selected data table in a database corresponding to the system to be tested and extracting a target data field in the data table includes: Get the data table information and preset data field information set by the user; A data table corresponding to the data table information is queried in a database corresponding to the system to be tested, and a target data field corresponding to the preset data field information in the data table is extracted.

3. The test data generating method according to claim 1, characterized in that: After querying the pre-selected data table in the database corresponding to the system to be tested and extracting the target data field in the data table, the method further includes: Get data field deletion information; The data field corresponding to the data field deletion information in the target data field is deleted.

4. The test data generating method according to claim 1, characterized in that: The generating test data by using the external association feature, the internal association feature and the field feature includes: Obtain the amount of test data to be generated; The external association feature, the internal association feature, and the field feature are used to generate test data having the same data volume as the test data to be generated.

5. The test data generating method according to claim 1, characterized in that: After analyzing the target data field to determine the external association features, internal association features and field features of the data table, the method further includes: The system to be tested is optimized according to the external association characteristics, the internal association characteristics and the field characteristics.

6. The test data generating method according to any one of claims 1 to 5, characterized in that: The step of analyzing the target data field to determine the internal association characteristics of the data table includes: The target data field is analyzed using a linear discriminant analysis method and a forward search method to determine the internal correlation characteristics of the data table.

7. The test data generating method according to any one of claims 1 to 5, characterized in that: The step of analyzing the target data field to determine the internal association characteristics of the data table includes: The target data field is analyzed using a linear discriminant analysis method and a backward search method to determine the internal correlation characteristics of the data table.

8. A test data generating device, characterized in that: include: An information collection module is used to query a pre-selected data table in the database corresponding to the system to be tested and extract target data fields in the data table; A field analysis module is used to analyze the target data field to determine the external association characteristics, internal association characteristics and field characteristics of the data table, wherein the external association characteristics represent the association characteristics between the current data table and other tables except the current data table, the internal association characteristics represent the association characteristics between the target data fields in the current data table, and the field characteristics represent the characteristics of the target data field; A data generation module, used to generate test data using the external association feature, the internal association feature and the field feature, so as to test the system to be tested using the test data; The field analysis module is specifically used to generate the features of each target data field using a linear discriminant analysis method, and then determine the relationship between the features using a forward search or a backward search to determine the internal correlation feature; Determining the internal correlation feature by forward search includes: selecting a data field as a first data field, then selecting a next data field as a second data field, using the feature of the first data field and the feature of the second data field to jointly calculate the internal correlation feature, and calculating the cross-validation error, sequentially selecting other data fields to calculate the corresponding internal correlation features, selecting the internal correlation feature with the smallest cross-validation error, and putting it into the selected data field, repeating the step of selecting a data field as the first data field until all data fields are traversed to obtain all internal correlation features; Using backward search to determine the internal correlation features includes: starting from all data fields, reducing the number of data fields in turn, and calculating the cross-validation error based on the features in the candidate list after each reduction of the data fields, repeating this process, removing the data field with the largest error from the candidate list, until only one data field remains to obtain the internal correlation features.

9. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store computer programs; The processor is used to execute the computer program to implement the test data generating method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the test data generating method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Test data acquisition method and device, computer equipment and readable storage medium

    CN111290948A

  • Test data generation method and device

    CN111382083A