Software test data generation method based on big data

Through the software test data generation method based on big data, the test error-reported perception value and historical data are used to adjust the data generation method and quantity, and the distorted data are introduced, which solves the problem of untargetedness and accuracy of test data in the existing technology, and improves the problem of The efficiency and coverage of the test ensure the accuracy of the test and the robustness of the system.

CN118626401BActive Publication Date: 2024-11-15SANMEN ZHENSHUN ELECTRONIC PROD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411110062.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-15
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

In the prior art, the analysis accuracy of software test data is low, resulting in large workload and low efficiency, untargeted test data, and insufficient test accuracy.

Method used

Using a software test data generation method based on big data, we can determine the input definition of the target software, obtain historical test data, generate test input data sets, adjust the data generation method and data volume using the test error perception value, and introduce distorted data to increase diversity and coverage to ensure the accuracy and comprehensiveness of the test data.

Benefits of technology

Improve the acquisition efficiency and accuracy of the test input dataset, enhance the coverage and depth of the test, ensure the independence and comprehensiveness of the test, discover potential problems, improve the robustness and performance of the system, and save test resources. and time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626401B_ABST
    Figure CN118626401B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of software test data generation, and in particular to a software test data generation method based on big data, the method comprising obtaining historical test data of each benchmark software; obtaining a first test input data set of a target software based on an input definition of the target software and testing the target software to obtain a first output data set; determining a first test error perception value of the first output data set, and determining a generation method of a second test input data set based on the first test error perception value; obtaining a second test input data set to test the target software to obtain a second output data set corresponding to the second test input data set; determining a second test error perception value of the second output data set to determine whether the generation method / data volume of the second test input data set needs to be adjusted; the present invention improves the accuracy of software test data generation by improving the accuracy of test data analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software test data generation, and in particular to a software test data generation method based on big data. Background Art

[0002] Nowadays, most products, especially Internet products, use databases to store data. Each function of the product also relies on corresponding business data. Therefore, in software testing, the preparation and maintenance of test data becomes a very important aspect. Traditional test data generation methods may tend to generate similar or repeated test data, resulting in insufficient test coverage and failure to fully cover various situations and boundary conditions of the software.

[0003] Chinese patent application publication number: CN114020647A discloses a software test data generation method based on a software network, comprising the following steps: step 1, collecting the source code of the software to be tested; step 2, establishing a software network based on the source code; step 3, calculating the important nodes of the software network; step 4, designing a fitness function based on the important nodes; step 5, generating test data based on a multi-objective intelligent algorithm; step 6, outputting a test data set after the test data generation process stops; the invention can complete the construction of a software test data generation method based on a software network, can help software testers design test data that meets the requirements, and design test data with higher software defect detection capabilities while reducing costs and shortening time, and has high practical application value.

[0004] It can be seen that the existing technology has problems such as low accuracy of test data analysis, resulting in high software testing workload and low efficiency, and low test accuracy of test data due to non-targeted analysis of software test data. Summary of the invention

[0005] To this end, the present invention provides a software test data generation method based on big data, so as to overcome the problems in the prior art of large software testing workload and low efficiency due to low accuracy of test data analysis, and low test accuracy of test data due to non-targeted analysis of software test data.

[0006] To achieve the above object, the present invention provides a method for generating software test data based on big data, comprising:

[0007] Determine several benchmarking software based on the business type of the target software, and obtain historical test data of each benchmarking software;

[0008] Acquire a first test input data set of the target software based on the input definition of the target software, test the target software based on the first test input data set, and obtain a first output data set corresponding to the first test input data set;

[0009] Determine a first test error perception value of the first output data set, and determine a method for generating a second test input data set based on the first test error perception value, including generating based on the first test input data set and generating based on excluding the first test input data set;

[0010] Acquire a second test input data set to test the target software;

[0011] Based on the second test input data set, obtaining a second output data set corresponding to the second test input data set from the target software;

[0012] Determine a second test error perception value of the second output data set, and determine whether a generation method / data volume of the second test input data set needs to be adjusted based on the second test error perception value;

[0013] Among them, the test error perception value is determined according to the test error rate, the discrete degree of error distribution, the error type fluctuation and the discrete degree of distribution of output data.

[0014] Further, the method of determining the generation method of the second test input data set includes:

[0015] Obtaining the first test error perception value, comparing the first test error perception value with a first preset error perception value, and obtaining a first comparison result;

[0016] The method of generating the second test input data set is determined based on the first comparison result, wherein:

[0017] If the first test error perception value is greater than or equal to the first preset error perception value, determining that the second test input data set is generated based on the first test input data set;

[0018] If the first test error perception value is less than the first preset error perception value, it is determined that the second test input data set is generated based on excluding the first test input data set.

[0019] Furthermore, the generation of the second test input data set includes:

[0020] Obtaining a method for generating the second test input data set and determining a data source range;

[0021] Determine the data volume of the second test input data set based on the first test error perception value and the data volume of the first test input data;

[0022] A determined amount of test data is acquired within the data source range to generate the second test input data set.

[0023] Further, obtaining the first test input data set includes:

[0024] determining an input definition of the target software;

[0025] Selecting test data that meets the input definition from the historical test data to form a defined data set;

[0026] A first preset number of data is selected from the defined internal data set to form a first test input data set.

[0027] Furthermore, the first preset number is determined according to the error rate of historical test data.

[0028] Further, generating the second test input data set based on the first test input data set includes:

[0029] Obtain each test input data corresponding to the error data in the first test input data;

[0030] Perform distortion based on each test input data to generate a number of distorted data;

[0031] Generate the second test input data set based on selecting a second preset amount of distorted data from the distorted data;

[0032] The second preset number is determined according to the data volume of the first test input data and the first test error perception value.

[0033] Further, generating the second test input data set based on excluding the first test input data set includes:

[0034] Excluding data in the first test input data set from the historical test data to generate an excluded data set;

[0035] Comparing the amount of data in the excluded data set with a third preset amount to obtain a second comparison result;

[0036] Determining whether the data in the excluded data set needs to be distorted based on the second comparison result;

[0037] generating the second test input data set based on the excluded data set or the distorted excluded data set;

[0038] Among them, the third preset number is determined according to the data volume of the first test input data and the first test error perception value.

[0039] Furthermore, the distortion includes performing arithmetic operations, concatenating, or performing random processing after concatenation on the target data and the correct data / error data in the first test input data set.

[0040] Further, the determining whether the generation method / data volume of the second test input data set needs to be adjusted based on the second test error perception value includes:

[0041] The second test error perception value is compared with the second preset error perception value to obtain a third comparison result, wherein:

[0042] If the second test error perception value is less than or equal to the second preset error perception value, it is determined to adjust the data volume of the second test input data set, wherein, if the current generation method of the second test input data set is based on the first test input data set, the generation method is adjusted to be based on excluding the first test input data set;

[0043] The adjustment value of the data volume of the second test input data set is determined according to the ratio of the second test error perception value to the second preset error perception value.

[0044] Furthermore, the test error perception value is calculated by multiplying the test error rate, the error distribution discreteness, the error type fluctuation, and the output data distribution discreteness with the corresponding influence coefficients and then summing them up.

[0045] Compared with the prior art, the beneficial effect of the present invention lies in that the present invention first determines the input definition of the target software to determine the various input types required by the software, verifies the valid input range, identifies the boundary conditions of the input, and determines how the software handles invalid input, and then selects test data that meets the input definition from several historical test data of benchmark software to form a defined data set to create a first test input data set, and determines to select a first preset number of data from the defined data set to form the first test input data set based on the error rate of the historical test data and the data volume of the historical test data. The above method improves the acquisition efficiency and acquisition accuracy of the test input data set, thereby improving the test accuracy of the generated software test data.

[0046] Furthermore, the present invention selects a different method for generating a second test input data set by comparing the first test error perception value with the first preset error perception value. If the first test error perception value is greater than or equal to the first preset error perception value, the purpose of selecting to generate the second test input data set based on the first test input data set is to utilize the existing test data set in the hope of more comprehensively discovering problems in these data and improving the coverage and depth of the test. By generating a new test data set based on the first test input data set, it can be ensured that the new test data set has a high correlation with the known test set, which helps to continue and expand the effectiveness of the existing test. If the first test error perception value is less than the first preset error perception value, the purpose of selecting to generate the second test input data set based on excluding the first test input data set is to focus on new and untested scenarios or data while excluding those already covered in the existing test data set, thereby discovering possible hidden problems. By excluding the existing test data set to generate a new test data set, the independence and comprehensiveness of the test can be ensured, and repeated testing of situations that have already been covered can be avoided, thereby improving the efficiency and pertinence of the test.

[0047] Furthermore, by introducing distorted data, the present invention can increase the diversity and coverage of test data, thereby more comprehensively evaluating the robustness and performance of the system. Distorted data usually represents boundary conditions or abnormal conditions. These data may cause the system to exhibit unusual behavior, which helps to test the performance of the system under extreme conditions. Distorted data can reveal the system's ability to handle abnormal conditions, and help to discover potential vulnerabilities, logical errors or performance problems. Distorted data can simulate noise, interference or erroneous input in the real world, making the test closer to the actual use environment and improving the authenticity and reliability of the test. Selecting a second preset number of distorted data can ensure that the test covers sufficient abnormal conditions, thereby improving the test coverage of various aspects of the system. By introducing distorted data, the robustness and fault tolerance of the system to abnormal conditions can be evaluated to ensure that the system can operate correctly and stably when facing abnormal conditions.

[0048] Furthermore, the present invention can determine the relationship between the actual data volume and the expected data volume by comparing the data volume in the excluded data set with the third preset volume, thereby evaluating the adequacy and adaptability of the test data. Based on the second comparison result, it can be determined whether the data in the excluded data set needs to be further distorted. If the data volume is insufficient or the data is not diverse enough, it may be necessary to introduce distortion to increase data diversity and coverage. A second test input data set is generated based on the excluded data set or the excluded data set after distortion. This process aims to provide more comprehensive and diverse test data to evaluate the performance of the system in various situations. The process of generating the second test input data set should aim to increase test coverage, ensure that the system can operate correctly in various situations, and discover potential problems and vulnerabilities.

[0049] Furthermore, the present invention can adjust the test data volume and generation method by comparing the actual test error perception value with the preset error perception value to ensure the adequacy and representativeness of the test data, thereby improving the test effect and accuracy. According to the comparison result of the error perception value, adjusting the data volume and generation method can increase the diversity and coverage of the test data, which is helpful to discover problems and potential risks of the system under different situations. Adjusting the test data volume and generation method can verify the system's processing capabilities for different data volumes and types, and help evaluate the robustness and stability of the system. Adjusting the test data volume according to actual conditions can avoid excessive generation of test data, save test resources and time, and improve the efficiency and cost-effectiveness of the test. By adjusting the test data generation method, new data situations can be introduced, which is helpful to discover problems and abnormal situations that may not have been covered in previous tests. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a flowchart of the method for generating software test data based on big data of the present invention;

[0051] Figure 2 A flowchart for determining a generation method of a second test input data set in a software test data generation method based on big data according to the present invention;

[0052] Figure 3 The present invention is a flowchart for determining whether the generation method / data volume of the second test input data set needs to be adjusted in the software test data generation method based on big data. DETAILED DESCRIPTION

[0053] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0054] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0055] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.

[0056] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0057] See also Figure 1-Figure 3 As shown, Figure 1 It is a flowchart of the method for generating software test data based on big data of the present invention; Figure 2 A flowchart for determining a generation method of a second test input data set in a software test data generation method based on big data according to the present invention; Figure 3 The present invention is a flowchart for determining whether the generation method / data volume of the second test input data set needs to be adjusted in the software test data generation method based on big data.

[0058] The method for generating software test data based on big data in an embodiment of the present invention includes:

[0059] Step S1, determining a number of benchmarking software based on the business type of the target software, and obtaining historical test data of each benchmarking software;

[0060] Step S2, obtaining a first test input data set of the target software based on the input definition of the target software, testing the target software based on the first test input data set, and obtaining a first output data set corresponding to the first test input data set;

[0061] Step S3, determining a first test error perception value of the first output data set, and determining a method for generating a second test input data set based on the first test error perception value, including generating based on the first test input data set and generating based on excluding the first test input data set;

[0062] Step S4, obtaining a second test input data set to test the target software;

[0063] Step S5, based on the second test input data set, obtaining a second output data set corresponding to the second test input data set from the target software;

[0064] Step S6: determine a second test error perception value of the second output data set, and determine whether the generation method / data volume of the second test input data set needs to be adjusted based on the second test error perception value.

[0065] The historical test data described in the embodiment of the present invention includes but is not limited to "input data sets of several benchmarking software, output data sets of several benchmarking software, and test error rates", which can be obtained through big data in several historical software tests, and used as the implementation basis of the embodiment of the present invention. The benchmarking software described is of the same business type as the target of the present invention. Those skilled in the art can determine the benchmarking software in the historical software test records according to the business type, thereby determining the historical test data of each benchmarking software, which will not be repeated here.

[0066] Specifically, in step S2, obtaining the first test input data set includes:

[0067] determining an input definition of the target software;

[0068] Selecting test data that meets the input definition from the historical test data to form a defined data set;

[0069] A first preset number of data is selected from the defined internal data set to form a first test input data set.

[0070] In the embodiment of the present invention, the first preset number is 10 to 50 times the product of the error rate of the historical test data and the data volume of the historical test data. The first preset number of data can be randomly obtained in the defined data set to form a first test input data set, but the above value is not limited to this. Technical personnel in this field can also adjust the value according to actual needs.

[0071] The present invention first determines the input definition of the target software to determine the various input types required by the software, verifies the valid input range, identifies the boundary conditions of the input, and determines how the software handles invalid input. Then, test data that meets the input definition is selected from the historical test data of several benchmark software to form a defined data set to create a first test input data set. The first preset number of data is selected from the defined data set to form the first test input data set based on the error rate of the historical test data and the data volume of the historical test data. The above method improves the acquisition efficiency and accuracy of the test input data set, thereby improving the accuracy of the generated software test data.

[0072] Specifically, in step S3, determining the generation method of the second test input data set includes:

[0073] Obtaining the first test error perception value, comparing the first test error perception value with a first preset error perception value, and obtaining a first comparison result;

[0074] The method of generating the second test input data set is determined based on the first comparison result, wherein:

[0075] If the first test error perception value P1 is greater than or equal to the first preset error perception value P10, it is determined that the second test input data set is generated based on the first test input data set;

[0076] If the first test error perception value P1 is less than the first preset error perception value P10, it is determined that the second test input data set is generated based on excluding the first test input data set.

[0077] It can be understood that, in the embodiment of the present invention, the first comparison result is a comparison result between the first test error perception value and the first preset error perception value.

[0078] In a specific embodiment, when P1≥P10, determining that the second test input data set is generated based on the first test input data set;

[0079] When P1<P10, it is determined that the second test input data set is generated based on excluding the first test input data set.

[0080] Specifically, the test error perception value Pi is calculated by the following formula:

[0081] ;

[0082] Wherein, i=1, 2, Si represents the test error rate in the i-th test, S0 represents the preset test error rate, α represents the influence coefficient of the test error rate on the first test error perception value, preferably, its value is set to 0.26, Di represents the discrete degree of error distribution in the i-th test, D0 represents the preset discrete degree of error distribution, β represents the influence coefficient of the discrete degree of error distribution on the first test error perception value, preferably, its value is set to 0.23, Bi represents the error type fluctuation in the i-th test, B0 represents the preset error type fluctuation, θ represents the influence coefficient of the error type fluctuation on the first test error perception value, preferably, its value is set to 0.23, Yi represents the distribution discrete degree of output data in the i-th test, Y0 represents the preset output data distribution discrete degree, γ represents the influence coefficient of the output data distribution discrete degree on the first test error perception value, preferably, its value is set to 0.27. It can be understood that the values ​​of each influence coefficient are not limited to this, and those skilled in the art can also adjust the value according to actual needs.

[0083] It can be understood that the larger the value of the error distribution discreteness, the more evenly the errors obtained by testing the target software with the test data are distributed in the target software program. The error distribution discreteness can be determined according to any method of calculating the discreteness in the prior art, and as long as it can characterize the error distribution of the test data in the target software program, it falls within the protection scope of the present invention. The larger the value of the error type fluctuation, the more error types are obtained by testing the target software with the test data. The error type fluctuation can be determined according to any method of calculating fluctuation or type in the prior art, and as long as it can characterize the number of error types of the test data in the target software program, it falls within the protection scope of the present invention.

[0084] In an embodiment of the present invention, the first test error perception value is calculated by substituting the test error rate, error distribution discreteness, error type fluctuation and output data distribution discreteness when the first test input data set is used to test the target software into the calculation formula of the test error perception value, and the second test error perception value is calculated by substituting the test error rate, error distribution discreteness, error type fluctuation and output data distribution discreteness when the second test input data set is used to test the target software into the calculation formula of the test error perception value.

[0085] The test error rate in the embodiment of the present invention refers to the ratio of the number of erroneous data found in software testing to the total number of test data, the error distribution dispersion degree is the variance of the number of errors, the error type fluctuation is the standard deviation or mean absolute deviation of the change in the error type, the value of the preset test error rate is the historical average of several benchmark software test error rates, the preset error distribution dispersion degree is the historical average of several benchmark software test error distribution dispersion degrees, the error type fluctuation is the historical average of several benchmark software error type fluctuations, and the output data The distribution dispersion degree is the historical average of the distribution dispersion degrees of output data of several benchmarking software. The value of the first preset error perception value P10 is set to S1=0.8S0, D1=0.8D0, B1=0.8B0 and Y1=0.8Y0, and the value of the preset error perception value is calculated. The value of the second preset error perception value P20 is set to S2=S0, D2=D0, B2=B0 and Y2=Y0, and the preset error perception value is calculated. However, the above values ​​are not limited to this, and technical personnel in this field can also adjust the value according to actual needs.

[0086] The present invention selects a different method for generating a second test input data set by comparing the first test error perception value with the first preset error perception value. If the first test error perception value is greater than or equal to the first preset error perception value, the purpose of selecting to generate the second test input data set based on the first test input data set is to utilize the existing test data set in the hope of more comprehensively discovering problems in these data and improving the coverage and depth of the test. By generating a new test data set based on the first test input data set, it can be ensured that the new test data set has a high correlation with the known test set, which helps to continue and expand the effectiveness of the existing test. If the first test error perception value is less than the first preset error perception value, the purpose of selecting to generate the second test input data set based on excluding the first test input data set is to focus on new and untested scenarios or data while excluding those already covered in the existing test data set, thereby discovering possible hidden problems. By excluding the existing test data set to generate a new test data set, the independence and comprehensiveness of the test can be ensured, and repeated testing of situations that have already been covered can be avoided, thereby improving the efficiency and pertinence of the test.

[0087] Specifically, in step S4, the generation of the second test input data set includes:

[0088] Obtaining a method for generating the second test input data set and determining a data source range;

[0089] Determine the data volume of the second test input data set based on the first test error perception value and the data volume of the first test input data;

[0090] A determined amount of test data is acquired within the data source range to generate the second test input data set.

[0091] In the embodiment of the present invention, the data volume of the second test input data set is 300% to 400% of the product of the first test error perception value and the data volume of the first test input data, but the above value is not limited to this, and technical personnel in this field can also adjust the value according to actual needs.

[0092] Specifically, when it is determined that the second test input data set is generated based on the first test input data set, generating the second test input data set based on the first test input data set includes:

[0093] Obtain each test input data corresponding to the error data in the first test input data;

[0094] Perform distortion based on each test input data to generate a number of distorted data;

[0095] Generate the second test input data set based on selecting a second preset amount of distorted data from the distorted data;

[0096] Among them, the value of the second preset number is 50% to 200% of the product of the data volume of the first test input data and the first test error perception value, but the above value is not limited to this, and technical personnel in this field can also adjust the value according to actual needs.

[0097] In the embodiment of the present invention, the distortion includes performing arithmetic operation, splicing or shuffling after splicing on the target data and the correct data / error data in the first test input data set, and may also intercept a part after splicing. In step S4, each test input data is subjected to arithmetic operation, splicing or shuffling after splicing on the correct data and / or error data in the first test input data set.

[0098] By introducing distorted data, the present invention can increase the diversity and coverage of test data, thereby more comprehensively evaluating the robustness and performance of the system. Distorted data usually represents boundary conditions or abnormal conditions. These data may cause the system to exhibit unusual behaviors, which helps to test the performance of the system under extreme conditions. Distorted data can reveal the system's ability to handle abnormal conditions, and help to discover potential vulnerabilities, logical errors or performance problems. Distorted data can simulate noise, interference or erroneous input in the real world, making the test closer to the actual use environment and improving the authenticity and reliability of the test. Selecting a second preset number of distorted data can ensure that the test covers sufficient abnormal conditions, thereby improving the test coverage of various aspects of the system. By introducing distorted data, the robustness and fault tolerance of the system to abnormal conditions can be evaluated, thereby ensuring that the system can operate correctly and stably when facing abnormal conditions.

[0099] Specifically, in step S4, when it is determined that the second test input data set is generated based on excluding the first test input data set, generating the second test input data set based on excluding the first test input data set includes:

[0100] Excluding data in the first test input data set from the historical test data to generate an excluded data set;

[0101] Compare the number N of data in the excluded data set with a third preset number N0 to obtain a second comparison result;

[0102] Determining whether the data in the excluded data set needs to be distorted based on the second comparison result;

[0103] The second test input data set is generated based on the excluded data set or the distorted excluded data set.

[0104] It is understandable that, if N<N0, the data in the exclusion data set and the correct data and / or error data in the first test input data set are subjected to arithmetic operation, concatenation or random processing after concatenation to generate the distorted exclusion data set.

[0105] It can be understood that, in the embodiment of the present invention, the second comparison result is a comparison result of the number of data in the excluded data set and a third preset number.

[0106] In a specific embodiment, when N<N0, it is determined that the data in the excluded data set needs to be distorted;

[0107] When N≥N0, it is determined that the data in the excluded data set does not need to be distorted;

[0108] Among them, the value of the third preset number is 2 to 5 times the product of the data volume of the first test input data and the first test error perception value, but the above value is not limited to this, and technical personnel in this field can also adjust the value according to actual needs.

[0109] The present invention can determine the relationship between the actual data volume and the expected data volume by comparing the data quantity in the exclusion data set with the third preset quantity, thereby evaluating the adequacy and adaptability of the test data. Based on the second comparison result, it can be determined whether the data in the exclusion data set needs to be further distorted. If the data volume is insufficient or the data is not diverse enough, it may be necessary to introduce distortion to increase data diversity and coverage. A second test input data set is generated based on the exclusion data set or the exclusion data set after distortion. This process aims to provide more comprehensive and diverse test data to evaluate the performance of the system in various situations. The process of generating the second test input data set should aim to increase test coverage, ensure that the system can operate correctly in various situations, and discover potential problems and vulnerabilities.

[0110] In step S6, determining whether the generation method / data volume of the second test input data set needs to be adjusted based on the second test error perception value includes:

[0111] The second test error perception value is compared with the second preset error perception value to obtain a third comparison result, wherein:

[0112] If the second test error perception value P2 is less than or equal to the second preset error perception value P20, it is determined to adjust the data amount of the second test input data set, wherein, if the current generation method of the second test input data set is based on the first test input data set, the generation method is adjusted to be based on excluding the first test input data set;

[0113] The adjustment value of the data volume of the second test input data set is determined according to the ratio of the second test error perception value to the second preset error perception value.

[0114] It can be understood that the third comparison result in the embodiment of the present invention is a comparison result between the second test error perception value and the second preset error perception value.

[0115] In a specific embodiment, when P≤P20, it is determined to adjust the data volume of the second test input data set;

[0116] When P2>P20, it is determined that the data size of the second test input data set is not adjusted.

[0117] In step S6, when it is determined that the data volume M of the second test input data set is adjusted, it is determined that the data volume of the second test input data set is adjusted by the adjustment coefficient K and the generation method of the second test input data set is adjusted to be based on excluding the first test input data set.

[0118] The adjustment coefficient K is calculated and set by the following formula:

[0119] ;

[0120] The data size M' of the adjusted second test input data set is set to M'=K×M.

[0121] When the determination in the embodiment of the present invention is to adjust the data amount of the second test input data set, if the current generation method of the second test input data set is based on the first test input data set, the generation method is adjusted to be generated based on excluding the first test input data set; if the current generation method of the second test input data set is generated based on excluding the first test input data set, the generation method of the second test input data set is not adjusted.

[0122] The present invention can adjust the test data volume and generation method by comparing the actual test error perception value with the preset error perception value to ensure the adequacy and representativeness of the test data, thereby improving the test effect and accuracy. According to the comparison result of the error perception value, adjusting the data volume and generation method can increase the diversity and coverage of the test data, which is helpful to discover problems and potential risks of the system under different situations. Adjusting the test data volume and generation method can verify the system's processing capabilities for different data volumes and types, and help evaluate the robustness and stability of the system. Adjusting the test data volume according to actual conditions can avoid excessive generation of test data, save test resources and time, and improve the efficiency and cost-effectiveness of the test. By adjusting the test data generation method, new data situations can be introduced, which is helpful to discover problems and abnormal situations that may not have been covered in previous tests.

[0123] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A method for generating software test data based on big data, characterized in that: include: Determine several benchmarking software based on the business type of the target software, and obtain historical test data of each benchmarking software; Acquire a first test input data set of the target software based on the input definition of the target software, test the target software based on the first test input data set, and obtain a first output data set corresponding to the first test input data set; Determine a first test error perception value of the first output data set, and determine a method for generating a second test input data set based on the first test error perception value, including generating based on the first test input data set or generating based on excluding the first test input data set; Acquire a second test input data set to test the target software; Based on the second test input data set, obtaining a second output data set corresponding to the second test input data set from the target software; Determine a second test error perception value of the second output data set, and determine whether a generation method or a data amount of the second test input data set needs to be adjusted based on the second test error perception value; Among them, the test error perception value is determined according to the test error rate, the discrete degree of error distribution, the error type fluctuation and the discrete degree of distribution of output data.

2. The method for generating software test data based on big data according to claim 1, characterized in that: The method of determining the generation of the second test input data set includes: Obtaining the first test error perception value, comparing the first test error perception value with a first preset error perception value, and obtaining a first comparison result; The method of generating the second test input data set is determined based on the first comparison result, wherein: If the first test error perception value is greater than or equal to the first preset error perception value, determining that the second test input data set is generated based on the first test input data set; If the first test error perception value is less than the first preset error perception value, it is determined that the second test input data set is generated based on excluding the first test input data set.

3. The method for generating software test data based on big data according to claim 2, characterized in that: The generation of the second test input data set includes: Obtaining a method for generating the second test input data set and determining a data source range; Determine the data volume of the second test input data set based on the first test error perception value and the data volume of the first test input data; A determined amount of test data is acquired within the data source range to generate the second test input data set.

4. The method for generating software test data based on big data according to claim 1, characterized in that: Acquiring the first test input data set includes: determining an input definition of the target software; Selecting test data that meets the input definition from the historical test data to form a defined data set; A first preset number of data is selected from the defined internal data set to form a first test input data set.

5. The method for generating software test data based on big data according to claim 4, characterized in that: The first preset number is determined according to the error rate of historical test data.

6. The method for generating software test data based on big data according to claim 1, characterized in that: Generating the second test input data set based on the first test input data set includes: Obtain each test input data corresponding to the error data in the first test input data; Perform distortion based on each test input data to generate a number of distorted data; Generate the second test input data set based on selecting a second preset amount of distorted data from the distorted data; The second preset number is determined according to the data volume of the first test input data and the first test error perception value.

7. The method for generating software test data based on big data according to claim 1, characterized in that: Generating the second test input data set based on excluding the first test input data set includes, Excluding data in the first test input data set from the historical test data to generate an excluded data set; Comparing the amount of data in the excluded data set with a third preset amount to obtain a second comparison result; Determining whether the data in the excluded data set needs to be distorted based on the second comparison result; generating the second test input data set based on the excluded data set or the distorted excluded data set; Among them, the third preset number is determined according to the data volume of the first test input data and the first test error perception value.

8. The method for generating software test data based on big data according to claim 6 or 7, characterized in that: The distortion includes performing arithmetic operation, concatenation, or random processing after concatenation on the target data and the correct data or error data in the first test input data set.

9. The method for generating software test data based on big data according to claim 1, characterized in that: The determining whether the generation method or data volume of the second test input data set needs to be adjusted based on the second test error perception value includes: The second test error perception value is compared with the second preset error perception value to obtain a third comparison result, wherein: If the second test error perception value is less than or equal to the second preset error perception value, it is determined to adjust the data volume of the second test input data set, wherein, if the current generation method of the second test input data set is based on the first test input data set, the generation method is adjusted to be based on excluding the first test input data set; The adjustment value of the data volume of the second test input data set is determined according to the ratio of the second test error perception value to the second preset error perception value.

10. The method for generating software test data based on big data according to claim 1, characterized in that: The test error perception value is calculated by multiplying the test error rate, the error distribution discreteness, the error type fluctuation, and the output data distribution discreteness with the corresponding influence coefficients and then summing them up.