Method and device for predicting defect leakage condition of project to be put into production, equipment and medium
By constructing a project defect leakage prediction model, using random forest and K closest algorithm to preprocess and classify the test data of the project to be put into production, the post-production problems caused by defects that cannot be found in software testing are solved, and the prediction accuracy and Trustworthiness of risk assessment.
Patent Information
- Application Number
- CN202310964463.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2025-01-17
AI Technical Summary
During the software testing process, many projects fail to function after they are put into production due to defects that cannot be discovered, causing production problems and causing trouble to production.
By obtaining the target test attribute data of the test process of the project to be put into production, building a project defect leakage prediction model, using technologies such as random forest algorithm and K closest algorithm, preprocessing and classification of the data, predicting project defect leakage, and providing additional testing suggestions. to reduce production problems.
It improves the accuracy and trustworthiness of project defect leakage prediction, helps project managers estimate risks in advance, optimize test resources, and reduces the occurrence of production problems.
Smart Images

Figure CN119322737A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of artificial intelligence and information security, and can be used in the field of software testing. More specifically, it relates to a method, device, equipment, medium and program product for predicting defect leakage of a project to be put into production. Background Art
[0002] "Defect leakage" refers to the situation where defects should have been discovered during the project testing process but were not. In production practice, projects need to be tested before production, so as to discover all defects in the project through testing as much as possible, so as to debug and correct them in time, so that the project can run sequentially after production and avoid production problems. However, in reality, it is inevitable that some projects that have passed the test will expose problems that should have been discovered during the testing process but were not discovered after production (that is, there are defects leaking in the project), resulting in functional failure during the operation of the project, production problems, and causing great trouble to production. Summary of the invention
[0003] In view of the above problems, the present disclosure provides a method, device, equipment, medium and program product for predicting defect leakage of projects to be put into production. By evaluating the project testing process of the projects to be put into production, the risk of defect leakage of the projects to be put into production is predicted, which helps project managers, product managers and other testing management personnel to estimate project risks in advance and coordinate testing resources in advance to reduce or even avoid the occurrence of production problems.
[0004] In the first aspect of the embodiments of the present disclosure, a method for predicting defect leakage of a project to be put into production is provided. The method comprises: obtaining target test attribute data for describing the test process of the project to be put into production, wherein the target test attribute data comprises the values of m indicators, wherein m is an integer greater than 1; appending the target test attribute data to a first test attribute data set to update the first test attribute data set to a second test attribute data set, wherein each data in the first test attribute data set comprises the values of the m indicators, and the first test attribute data set comprises a training data set for training a defect leakage prediction model for a project, wherein each data in the training data set comprises, in addition to the values of the m indicators, a defect leakage classification label; performing data preprocessing based on the second test attribute data set to convert each data from the value of the m indicators into N characteristic labels; The value of the N feature is used to obtain a third test attribute data set, wherein N is an integer and 1≤N≤m; the values of the N features in each data in the third test attribute data set are used as inputs of the project defect leakage prediction model, and the project defect leakage prediction model is used to classify the defect leakage situation of each data to obtain a defect leakage classification result of each data; based on the comparison between the defect leakage classification result of the data in the training data set and the defect leakage situation classification label, the classification accuracy of the project defect leakage prediction model is determined; and when the classification accuracy is greater than or equal to a predetermined accuracy threshold, the defect leakage classification result of the project defect leakage prediction model for the target test attribute data is output to obtain prediction information on the defect leakage situation of the project to be put into production.
[0005] According to an embodiment of the present disclosure, data preprocessing is performed based on the second test attribute data set to convert each data from the value of the m indicators into the value of N features to obtain a third test attribute data set, including: based on the second test attribute data set, by a factor analysis method, each data is converted from the value of the m indicators into the value of N features, wherein the N features are N common factors obtained by aggregating the m indicators.
[0006] According to an embodiment of the present disclosure, the data preprocessing based on the second test attribute data set also includes: when there are missing values in the first data in the second test attribute data set on any first indicator, estimating and filling the missing values by using a K nearest neighbor algorithm.
[0007] According to an embodiment of the present disclosure, the estimating and filling of the missing values by the K nearest neighbor algorithm includes: calculating a first distance between the first data and other data in the second test attribute data set based on the values of the indicators other than the first indicator among the m indicators; determining the K nearest neighbors of the first data from the second test attribute data set based on the first distance; and estimating and filling the missing values based on the values of the K nearest neighbors on the first indicator.
[0008] According to an embodiment of the present disclosure, the estimating and filling of the missing values by the K nearest neighbor algorithm also includes training a KNN prediction model based on the training data set, wherein, during the training process of the KNN prediction model, based on the values of the m indicators, the second distance between each pair of data in the training data set is calculated; the category of each data in the training data set is determined according to the defect leakage classification label; the KNN prediction model is iteratively trained, wherein, in each round of iteration, the current value of K is first set, and then the KNN prediction model classifies the data in the training data set according to the K nearest neighbor algorithm based on the second distance and the current value of K, and compares the classification result with the category determined by the defect leakage classification label to calculate the prediction accuracy of the KNN prediction model; and when the prediction accuracy of the KNN prediction model meets a predetermined accuracy threshold, the iterative training of the KNN prediction model is stopped and the value of K is output.
[0009] According to an embodiment of the present disclosure, the data preprocessing based on the second test attribute data set also includes: according to the Laida criterion, eliminating outliers in each indicator in the second test attribute data set, wherein when an indicator is eliminated of outliers, the value of the indicator is converted to the missing value.
[0010] According to an embodiment of the present disclosure, the use of the project defect leakage prediction model to classify the defect leakage situation of each data includes: classifying into at least two categories: no defect leakage and defect leakage.
[0011] According to an embodiment of the present disclosure, the project defect leakage prediction model is a model constructed using a random forest algorithm. When the defect leakage classification result of the target test attribute data belongs to the category of defect leakage, the method further includes: obtaining the feature importance ranking of the N features according to the random forest feature importance ranking algorithm; selecting at least one important feature with a top ranking from the N features according to the feature importance ranking from high to low; determining the important indicator corresponding to the important feature from the m indicators based on the data preprocessing process; and outputting recommendation information for additional testing of the project to be put into production, the recommendation information for additional testing including optimizing the value of the important indicator and then performing additional testing on the project to be put into production.
[0012] The second aspect of the embodiment of the present disclosure provides a device for predicting the defect leakage of a project to be put into production. The device includes a data acquisition module, a data set update module, a data preprocessing module, a prediction module, a classification accuracy determination module and a prediction result output module. The data acquisition module is used to acquire target test attribute data for describing the test process of the project to be put into production, wherein the target test attribute data includes the values of m indicators, wherein m is an integer greater than 1. The data set update module is used to append the target test attribute data to the first test attribute data set to update the first test attribute data set to a second test attribute data set; wherein each data in the first test attribute data set includes the values of the m indicators, and the first test attribute data set includes a training data set for training a defect leakage prediction model for a project; wherein each data in the training data set includes, in addition to the values of the m indicators, a defect leakage classification label. The data preprocessing module is used to perform data preprocessing based on the second test attribute data set, convert each data from the values of the m indicators to the values of N features, and obtain a third test attribute data set, wherein N is an integer and 1≤N≤m. The prediction module is provided with the project defect leakage prediction model, which is used to use the values of the N features in each data in the third test attribute data set as the input of the project defect leakage prediction model, and use the project defect leakage prediction model to classify the defect leakage situation of each data to obtain the defect leakage classification result of each data. The classification accuracy determination module is used to determine the classification accuracy of the project defect leakage prediction model based on the comparison between the defect leakage classification result of the data in the training data set and the defect leakage situation classification label. The prediction result output module is used to output the defect leakage classification result of the target test attribute data by the project defect leakage prediction model when the classification accuracy is greater than or equal to a predetermined accuracy threshold, so as to obtain the prediction information of the defect leakage situation of the project to be put into production.
[0013] According to an embodiment of the present disclosure, the project defect leakage prediction model is a model constructed using a random forest algorithm. The device also includes a project test optimization module. The project test optimization module is used to: when the defect leakage classification result of the target test attribute data belongs to the category of defect leakage, obtain the feature importance ranking of the N features according to the random forest feature importance ranking algorithm; from the N features, select at least one important feature with a top ranking according to the feature importance ranking from high to low; based on the data preprocessing process, determine the important indicators corresponding to the important features from the m indicators; and output recommendation information for additional testing of the project to be put into production, the recommendation information for additional testing includes optimizing the value of the important indicator and then performing additional testing on the project to be put into production.
[0014] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided. The electronic device includes one or more processors and a memory. The memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above method.
[0015] According to a fourth aspect of the embodiments of the present disclosure, there is also provided a computer-readable storage medium on which executable instructions are stored, and when the instructions are executed by a processor, the processor executes the above method.
[0016] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program, which implements the above method when executed by a processor.
[0017] One or more of the above embodiments have the following advantages or beneficial effects: when predicting the defect leakage of a project to be put into production, the target test attribute data is mixed with the existing test attribute data set for preprocessing and model classification. In this way, even if there are omissions or missing indicators in the test attribute data collection of a certain project, or individual indicators may be abnormal, the prediction results of the project defect leakage prediction model can maintain considerable accuracy through processing and identification based on the overall data set. Moreover, after each classification, the effectiveness of the current classification is evaluated through the classification of the data in the training data set, and the reliability of the prediction results of the defect leakage of the project to be put into production can be accurately evaluated. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0019] Figure 1A schematic diagram showing an application scenario of a method, device, equipment, medium, and program product for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure;
[0020] Figure 2 A flowchart of a method for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 3 A schematic diagram schematically shows classification using a project defect leakage prediction model in one embodiment of the present disclosure;
[0022] Figure 4 A flowchart of data preprocessing in an embodiment of the present disclosure is schematically shown;
[0023] Figure 5 A flowchart of using a random forest algorithm to construct a project defect leakage prediction model in an embodiment of the present disclosure is schematically shown;
[0024] Figure 6 A flowchart for providing additional test suggestions for items predicted to have defects leaking out in one embodiment of the present disclosure is schematically shown;
[0025] Figure 7 A structural block diagram schematically shows a device for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure; and
[0026] Figure 8 The block diagram of an electronic device suitable for implementing the method for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0028] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0029] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0030] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0031] The embodiments of the present disclosure provide a method, apparatus, device and medium for predicting defect leakage of a project to be put into production, which are particularly suitable for the evaluation and management of projects to be put into production that have passed the test in a large enterprise (for example, a commercial bank) with an independent testing center. By collecting m indicators in the testing process of the project to be put into production, target test attribute data for describing the testing process of the project to be put into production are formed, and then a project defect leakage prediction model constructed by a machine learning algorithm is used to evaluate the testing process of the project to be put into production, and predict the risk of defect leakage in the project to be put into production, such as predicting whether there is defect leakage in the project to be put into production, or the degree of defect leakage when there is defect leakage, etc.
[0032] Figure 1 The application scenario diagram of the method, apparatus, device, medium and program product for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure is schematically shown.
[0033] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a terminal device 101, a database server 102, a management server 103, and a network 104. The network 104 is a medium for providing a communication link between the terminal device 101, the database server 102, and the management server 103. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0034] The user can operate in the terminal device 101 to specify the information of the project to be put into production for which defect leakage is to be predicted, interact with the database server 102 and the management server 103 through the network 104, and receive the prediction result in the terminal device 101.
[0035] The database server 102 can be used to manage a database storing various data of the project test process. The database server 102 can collect various indicators of the project test process of the project to be put into production from the managed database according to the information of the project to be put into production specified by the user in the terminal device 101, form target test attribute data, and provide the target test attribute data to the management server 103.
[0036] A project defect leakage prediction model may be deployed in the management server 103. The management server 103 may execute the method for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure, obtain target test attribute data through interaction with the database server 102, and use the project defect leakage prediction model to evaluate the test process of the project to be put into production, predict the defect leakage of the project to be put into production, and feed back the prediction result to the terminal device 101. Accordingly, the apparatus, device, medium and program product for predicting defect leakage of a project to be put into production provided by the embodiment of the present disclosure may also be set in the management server 103. It should be understood that Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present invention may be applied, to help those skilled in the art understand the technical content of the present invention, but do not mean that the present invention cannot be used in other devices, systems, environments or scenarios.
[0037] It should be noted that the method, device, equipment, medium and program product for predicting defect leakage of projects to be put into production according to the embodiments of the present disclosure can be used in the financial field, and can also be used in any field other than the financial field. The present disclosure does not limit the application field.
[0038] The following will be based on Figure 1 The scene described by Figure 2 to Figure 6 The method for predicting defect leakage of a project to be put into production in the disclosed embodiment is described in detail.
[0039] Figure 2 The flowchart of the method for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure is schematically shown.
[0040] like Figure 2 As shown, the method for predicting defect leakage of a project to be put into production may include operations S210 to S260.
[0041] In operation S210 , target test attribute data for describing a test process of a project to be put into production is acquired, wherein the target test attribute data includes values of m indicators, wherein m is an integer greater than 1.
[0042] M indicators such as project test management related information and human resource management related information can be selected to describe a project testing process. The m indicators may include but are not limited to: project function points, number of developers, number of years developers are responsible for a certain application, number of years the project leader has been employed, number of requirement items, number of test cases, number of testers, number of years testers are responsible for a certain application, number of internal interfaces involved in the project, number of external interfaces involved in the project, number of applications involved in the project, project testing time, number of submitted issues, time point of issue submission, number of confirmed defects, production strategy (invest in version but not business / invest in version and business), and 16 indicators of key project marks.
[0043] In operation S220, the target test attribute data is added to the first test attribute data set to update the first test attribute data set to a second test attribute data set. Each data in the first test attribute data set includes values of m indicators, and the first test attribute data set includes a training data set for training a defect leakage prediction model for a project; each data in the training data set includes, in addition to the values of the m indicators, a defect leakage classification label.
[0044] The project defect leakage prediction model is used to classify the defect leakage of the project, such as Figure 3 As shown, it can be classified into at least two categories: non-defect leakage and defect leakage. In another embodiment, the defect leakage can be further subdivided into more categories such as low leakage, high leakage, etc. according to the degree of defect leakage.
[0045] In order to train the project defect leakage prediction model, the values of the above m indicators and their defect leakage information in a large number of historical project tests can be collected to form a training data set. In the process of training the project defect leakage prediction model, the values of the m indicators in each historical project test process are used as predictive variables, and the defect leakage classification results are used as predicted variables.
[0046] The defect leakage classification label of each data in the training data set is used to characterize the category of the defect leakage of the project corresponding to the data. In one embodiment, the defect leakage of a project can be measured by the number of production problems that occur one month after a project is put into production. For example, if there are 0 production problems one month after the project is put into production, the defect leakage classification label is set to "no defect leakage"; if there are 2 or fewer production problems (not including 2 times) one month after the project is put into production, the defect leakage classification label is set to "low leakage"; if there are more than 2 production problems (including 2 times) one month after the project is put into production, the defect leakage classification label is set to "high leakage". In this way, the project defect leakage prediction model can be trained to classify projects into three categories: no defect leakage, low leakage and high leakage.
[0047] The values of the m indicators in the historical project testing process can be obtained from the test center project management platform database and the human resources management platform database through the database server 102. For example, the historical data of the above m variables for many years (for example, 15 years) are obtained, where the calculation method of the number of years that developers are responsible for a certain application and the number of years that testers are responsible for a certain application can be a simple sum of the number of years that developers or testers are responsible for a certain application. For example, there are 3 developers, and they are responsible for application A for 1 year, 2 years and 3 years respectively. Then, for this application of the project, the number of years that developers are responsible for a certain application is 1+2+3=6 years. In the production strategy, the investment in version but not business can be assigned a value of 0, and the investment in version and business can be assigned a value of 1.
[0048] The project defect leakage prediction model is trained using the training data set. By continuously adjusting the parameters of the project defect leakage prediction model until the classification accuracy of the project defect leakage prediction model meets the requirements, it can be used to predict the defect leakage of the project to be put into production.
[0049] It is understandable that the first test attribute data set may be entirely a training data set, or may include test attribute data of other projects to be put into production in addition to the training data set. That is, in some embodiments, the test attribute data of the projects to be put into production may be mixed into the training data set in batches to form the second test attribute data set.
[0050] In operation S230, data preprocessing is performed based on the second test attribute data set to convert each data from the value of m indicators to the value of N features to obtain a third test attribute data set, where N is an integer and 1≤N≤m.
[0051] The target test attribute data is mixed with the existing first test attribute data set to form a new test attribute data set, and then data preprocessing is performed based on the new test attribute data set as a whole.
[0052] The data preprocessing may include but is not limited to: data dimension compression, normalization, outlier removal, or missing value completion.
[0053] Among them, data dimension compression means that N is less than m, that is, the m indicators in each test data are compressed into N-dimensional features with smaller dimensions. This can be achieved through data dimensionality reduction methods such as principal component analysis and factor analysis.
[0054] Normalization processing can process the values of all indicators into the range of [0, 1], which is convenient for reducing the calculation amount of the project defect leakage prediction model.
[0055] Outlier removal can remove outliers under each indicator in the second test attribute data set. For example, the value distribution of each indicator can be estimated, and values with extremely small probability of occurrence can be regarded as outliers and removed.
[0056] Missing value completion, where missing values may be caused by incomplete data collection or by outlier removal. For missing values in the second test attribute data set, the missing value can be estimated based on the distribution of data in the second test attribute data set, or the K nearest neighbors of the data with missing values can be found based on the K nearest neighbor algorithm, and then the missing value can be estimated using the K nearest neighbors.
[0057] The data preprocessing in the above operation S230 may adopt only one preprocessing method or a combination of several preprocessing methods.
[0058] In operation S240, the values of N features in each data in the third test attribute data set are used as inputs of the project defect leakage prediction model, and the defect leakage prediction model is used to classify the defect leakage situation of each data to obtain the defect leakage classification result of each data.
[0059] In operation S250 , the classification accuracy of the project defect leakage prediction model is determined based on the comparison between the defect leakage classification results of the data in the training data set and the defect leakage situation classification labels.
[0060] In operation S260, when the classification accuracy is greater than or equal to a predetermined accuracy threshold, the defect leakage classification result of the project defect leakage prediction model for the target test attribute data is output to obtain prediction information on the defect leakage situation of the project to be put into production.
[0061] When the classification accuracy of the project defect leakage prediction model for the data in the training data set in the current classification satisfies or is greater than or equal to the predetermined accuracy threshold, it means that the current classification is valid. Therefore, the classification result of the above-mentioned target test attribute data by the project defect leakage prediction model can be used as the prediction result of the defect leakage situation of the project to be put into production, such as no defect leakage, low leakage or high leakage.
[0062] When the classification accuracy is lower than the predetermined accuracy threshold, it means that the current classification of the project defect leakage prediction model is invalid, and the project defect leakage prediction model needs to be optimized and trained again. In this case, data corresponding to the training data set can be screened out from the third test attribute data set preprocessed by operation S230 to optimize the project defect leakage prediction model. When the classification accuracy of the project defect leakage prediction model on the training data set is greater than or equal to the predetermined accuracy threshold, the project defect leakage prediction model is used to classify the target test attribute data in the third test attribute data set.
[0063] When predicting defect leakage of a project to be put into production, the disclosed embodiment mixes the target test attribute data with the existing test attribute data set and then performs preprocessing and model classification. The advantage of this is that even if there are omissions or missing indicators in the test attribute data collection of a certain project, or individual indicators may be abnormal, the prediction results of the project defect leakage prediction model can maintain a considerable degree of accuracy through processing and identification based on the overall data set.
[0064] Moreover, after each classification, the effectiveness of the current classification is evaluated by the classification of the data in the training data set, and the reliability of the prediction results of the defect leakage of the project to be put into production can be quantitatively evaluated, thereby ensuring that project managers, product managers and other test management personnel can estimate the risks of project production in advance and provide guidance information with reference significance.
[0065] Figure 4 The flowchart of data preprocessing in one embodiment of the present disclosure is schematically shown.
[0066] like Figure 4 As shown, according to this embodiment, the data preprocessing in operation S230 may include operations S231 to S233.
[0067] First, in operation S231, according to the Laida criterion, outliers in each indicator in the second test attribute data set are removed, wherein when an outlier is removed from an indicator, the value of the indicator is converted to a missing value.
[0068] Specifically, since the backend test management platform of an enterprise is often constantly updated, not every project's information is maintained completely and correctly. Some project information may have maintenance errors, that is, outliers. Therefore, the Laida criterion can be used to remove outliers. Taking the second test attribute data set shown in Table 1 as an example, an exemplary description is as follows.
[0069] Table 1
[0070] Project No. Function Points Number of test cases Number of questions 1 800 200 10 2 750 180 9 3 () 600 11 4 300 100 8 5 1200 450 16 ... ... ... ... 10000 1500 500 26
[0071] Referring to Table 1, assume that the total x of each indicator (i.e., each column in Table 1) is i It conforms to the normal distribution, and each column of data is judged according to the following formula:
[0072] P(|x i -μ|>3σ)≤0.003
[0073] Wherein, μ is the mean and σ is the standard deviation. For each column of data, data greater than μ+3σ or less than μ-3σ are considered outliers and are removed. Then continue to recalculate the mean deviation μ and standard deviation σ for the remaining data, and remove outliers according to the above formula until the deviation of all data in the column from the mean is less than 3σ. In this way, abnormal data with extremely low probability of occurrence can be removed from the second test attribute data set, reducing the classification interference of abnormal data on the project defect leakage prediction model, and improving the classification efficiency of the project defect leakage prediction model.
[0074] Next, in operation S232, when a certain data (referred to as "first data") in the second test attribute data set has a missing value on any first indicator, the missing value is estimated and filled using a K nearest neighbor algorithm (also referred to as a KNN algorithm).
[0075] Specifically, the first distance between the first data and other data in the second test attribute data can be calculated based on the values of the indicators other than the first indicator among the m indicators, and then the K nearest neighbors of the first data can be determined from the second test attribute data set based on the first distance, and finally the missing value can be estimated and filled based on the values of the K nearest neighbors on the first indicator. For example, the missing value can be estimated by the mean of the values of the K nearest neighbors on the first indicator; or the weight can be calculated by the relative size of the first distance between the K nearest neighbors and the first data, and then the values of the K nearest neighbors on the first indicator can be weighted averaged to estimate the missing value.
[0076] When the missing values are estimated and filled by the K nearest neighbor algorithm, the selection of the K value can be determined by training the KNN prediction model using the K nearest neighbor algorithm on the training data set. Specifically, in the process of training the KNN prediction model, on the training data set, based on the values of the above m indicators, the second distance between the two data in the training data set is calculated, and then the category of each data in the training data set is determined according to the defect leakage classification label, and then the KNN prediction model can be iteratively trained. In each round of iteration, the current value of K is first set, and then the KNN prediction model classifies the data in the training data set according to the K nearest neighbor algorithm based on the second distance and the current value of K, and compares the classification result with the category determined by the defect leakage classification label to calculate the prediction accuracy of the KNN prediction model. When the prediction accuracy of the KNN prediction model meets the predetermined accuracy threshold (for example, 90%), the iterative training of the KNN prediction model is stopped and the current value of K is output.
[0077] Here, we continue to refer to Table 1 for exemplary explanation. From Table 1 above, it can be found that the function points of the project with project number 3 (hereinafter referred to as project 3) are missing. According to the embodiment of the present disclosure, the missing values can be estimated and filled by the KNN algorithm.
[0078] Specifically, the data can be normalized first, and the normalization formula is as follows:
[0079]
[0080] Among them, c min is the minimum value, c max is the maximum value.
[0081] Assume that the maximum value of the function points in Table 1 is 5000 and the minimum value is 10, the maximum value of the test cases is 1000 and the minimum value is 50, and the maximum value of the problem number is 100 and the minimum value is 0. The result of normalization of Table 1 is shown in Table 2.
[0082] Table 2
[0083] Project No. Function Points Number of test cases Number of questions 1 0.16 0.16 0.1 2 0.15 0.14 0.09 3 0.58 0.11 4 0.06 0.05 0.08 5 0.24 0.42 0.16 ... ... ... ... 10000 0.30 0.47 0.26
[0084] Then, based on Table 2, the function points of project 3 are estimated and filled using the KNN algorithm. In the KNN algorithm, each sample can be represented by the nearest K neighboring values.
[0085] Specifically, before estimating and filling the missing values, the KNN prediction model can be trained on the training data set using the KNN algorithm. The training data set is classified according to the defect leakage situation based on the second distance between the data in the training data set (the distance calculated based on the values of the m indicators) by the KNN prediction model, so as to determine the value of the parameter K. Specifically, a training set and a test set are randomly split from the training data set, and K is set to 3, 4, and 5 respectively. The training model is obtained through the training set and the accuracy of the training model is tested through the test set. The K value with the highest prediction accuracy and its KNN prediction model are selected as the trained KNN prediction model. The training of the KNN prediction model can be performed before the data preprocessing of operation S230.
[0086] The K value with the highest prediction accuracy reflects that in the training data set, the test process of each item can be represented by the test processes of the K items closest to it. Based on this, in the embodiment of the present disclosure, for items with missing values, the K items closest to the test process of the item can be approximately found based on the values of other indicators, and then the missing values in the item can be estimated.
[0087] In one embodiment, the missing values are estimated by using the KNN algorithm in a weighted average manner as follows:
[0088]
[0089] q is the missing value to be filled on a certain indicator, and its surrounding neighboring values are c 0、c 1 、c 2 …c k . w is the weight, and the calculation formula is as follows:
[0090]
[0091] Among them, d k is the first distance (eg, Euclidean distance) between the Kth data and the first data with missing values.
[0092] In Table 2, the Euclidean distance between other projects and Project 3 can be calculated based on the values of the number of test cases and the number of problems in each project, and the K projects closest to Project 3, i.e., the K nearest neighbors, can be selected. Then, [0.58, 0.11] can be predicted based on the voting mechanism. For example, the estimated value of the missing value of the function point of Project 3 is 0.66, and it can be filled.
[0093] By estimating and filling missing values, the project defect leakage prediction model can more accurately predict the defect leakage of projects to be put into production under large sample conditions.
[0094] Next, in operation S233, based on the second test attribute data set, each data is converted from the value of m indicators to the value of N features through a factor analysis method, wherein the N features are N common factors obtained by aggregating the m indicators.
[0095] There may be correlations between the m indicators, especially when m is large, such as the case of m=16. For example, in general, the number of function points is proportional to the number of testers. Therefore, factor analysis can be performed based on the second test attribute data set to reduce the data dimension. By reducing the dimension of indicator variables through factor analysis and aggregating multiple indicators into N independent common factors, the dimensionality disaster in model training and prediction can be avoided to the greatest extent.
[0096] In one embodiment, when the m indicators are the 16 indicators in the previous example, in operation S233, factor analysis can be performed on these 16 indicators based on the second test attribute data set, using factor analysis methods such as those in SPSS software, to extract the following common factors: test workload factor (number of requirement items, number of function points, number of developers, number of testers, number of internal interfaces, number of external interfaces, number of applications involved, number of project use cases), developer years factor, tester years factor (number of years the tester has been responsible for a certain application, number of years the project leader has been employed), test duration factor (total project test duration, time point of problem submission), key project factor and key project flag factor, and use these common factors as N features to transform the data in the second test attribute data set.
[0097] In this way, after the test attribute data set is dimensionally compressed and then sent to the project defect leakage prediction model for classification, the data reliability is relatively high, which improves the classification efficiency of the model and reduces interference to the model.
[0098] Figure 5 The flowchart of using the random forest algorithm to construct a project defect leakage prediction model in one embodiment of the present disclosure is schematically shown.
[0099] like Figure 5 As shown, the project defect leakage prediction model of the embodiment of the present disclosure can be constructed using a random forest algorithm, wherein the construction process of the project defect leakage prediction model can include operations S501 to S506.
[0100] In operation S501, predictor variables and predicted variables are determined, and an indicator system is created. M indicators are established to describe the project test process. The m indicators are used as predictor variables, and the defect leakage classification results are used as predicted variables. It can be binary or multi-classified (e.g., three categories of no defect leakage, low leakage, and high leakage).
[0101] The database server 102 obtains historical data of the above m indicators of a large number of historical projects from databases (such as project test management systems and human resource management systems), and marks the defect leakage classification situations of these historical projects with defect leakage classification labels to form a training data set.
[0102] In operation S502, data preprocessing is performed, including but not limited to: removing outliers, filling missing values, and compressing and reducing dimensions. The preprocessed training data set is split into a training set and a test set.
[0103] In operation S503, a project defect leakage prediction model is constructed using a random forest algorithm, and the project defect leakage prediction model is trained using a training set.
[0104] Specifically, there are the following steps:
[0105] A certain number of samples (for example, 500) are extracted from the training set to form a training subset using the bootstrap random sampling method.
[0106] 500 decision trees are constructed using these 500 samples, and these trees are not pruned. R (R≤N) features are randomly selected for splitting, and the Gini coefficient method is selected as the splitting method. The Gini coefficient represents the probability that a randomly selected sample in the sample set is classified into the wrong category. The smaller the Gini coefficient, the higher the sample purity. The formula is:
[0107]
[0108] p i Represents the probability that the selected sample is the i-th class
[0109] Through the above 500 decision trees, a simple vote is performed on the training set to obtain the final classification decision of the sample and the project defect leakage prediction model.
[0110] In operation S504, the classification accuracy of the project defect leakage prediction model is tested. The test set data is input into the project defect leakage prediction model to obtain the classification result predicted by the project defect leakage prediction model, and compared with the defect leakage classification label (i.e., the true value) of the test set data to determine the classification accuracy of the project defect leakage prediction model. The accuracy can reach a predetermined accuracy threshold (e.g., above 80%) to be effective.
[0111] In operation S505 , the defect leakage situation of the project to be put into production is predicted using the trained project defect leakage prediction model.
[0112] In operation S506, the prediction model is dynamically trained and optimized by continuously introducing new data. As the number of test items increases, the test attribute data of the new items and the actual defect leakage situation after the project is put into production are combined with the data of the historical projects to continuously train the project defect leakage prediction model and continuously enhance the adaptability of the project defect leakage prediction model.
[0113] When using the random forest algorithm to build a project defect leakage prediction model, after constructing a large number of decision trees, the random forest can rank the importance of each feature to determine which features are most useful for the classification results. Based on this, when the project defect leakage prediction model predicts that the defect leakage of the project to be put into production is defect leakage (such as high leakage, low leakage), the project defect leakage prediction model can also give additional test suggestions based on the importance of the input features. For details, refer to Figure 6 's hint.
[0114] Figure 6 A flowchart for providing additional test suggestions for items predicted to have defects leaked is schematically shown in one embodiment of the present disclosure.
[0115] like Figure 6 As shown, combined Figure 1 According to an embodiment of the present disclosure, when the defect leakage situation of the project to be put into production obtained in operation S260 is defect leakage, operations S610 to S640 may be further performed after operation S260.
[0116] First, in operation S610, according to the random forest feature importance ranking algorithm, the feature importance ranking of N features is obtained. In the random forest, each tree is obtained based on a certain feature segmentation. Therefore, the feature importance can be determined by calculating the information gain or reduced impurity when each feature is segmented in all trees. For each decision tree, the feature ranking is given according to the impurity, and then the whole random forest is averaged to obtain the feature importance ranking.
[0117] Then in operation S620, at least one important feature ranked high is selected from the N features according to the order of feature importance from high to low.
[0118] Next, in operation S630, based on the mapping process of m indicators to N features in the data preprocessing process of the aforementioned operation S230, indicators corresponding to important features are determined, that is, important indicators are obtained.
[0119] Then, in operation S640, suggestion information for additional testing of the project to be put into production is output, and the suggestion information for additional testing includes performing additional testing on the project to be put into production after optimizing the values of important indicators.
[0120] In this way, for projects predicted to have defective leakage such as "low leakage" and "high leakage", corresponding additional testing suggestions can be given to reduce or even avoid production problems caused after the project is put into production.
[0121] Based on the above-mentioned methods for predicting the leakage of defects in a project to be put into production, the embodiment of the present disclosure also provides a device for predicting the leakage of defects in a project to be put into production. Figure 7 The device is described in detail.
[0122] Figure 7 The structural block diagram of the device 700 for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure is schematically shown.
[0123] like Figure 7 As shown, according to some embodiments of the present disclosure, the device 700 may include a data acquisition module 710, a data set update module 720, a data preprocessing module 730, a prediction module 740, a classification accuracy determination module 750 and a prediction result output module 760. According to other embodiments of the present disclosure, the device 700 may further include at least one of a project test optimization module 770 and a model dynamic optimization module 780. The device 700 may execute the aforementioned reference Figure 2 to Figure 6 The method described.
[0124] The data acquisition module 710 is used to acquire target test attribute data for describing the test process of the project to be put into production, wherein the target test attribute data includes values of m indicators, wherein m is an integer greater than 1.
[0125] The data set update module 720 is used to append the target test attribute data to the first test attribute data set to update the first test attribute data set to the second test attribute data set; wherein each data in the first test attribute data set includes the values of m indicators, and the first test attribute data set includes a training data set for the defect leakage prediction model of the training project; wherein each data in the training data set includes, in addition to the values of the m indicators, a defect leakage situation classification label.
[0126] The data preprocessing module 730 is used to perform data preprocessing based on the second test attribute data set, converting each data from the value of m indicators to the value of N features to obtain a third test attribute data set, where N is an integer and 1≤N≤m.
[0127] The prediction module 740 is provided with a project defect leakage prediction model, which is used to use the values of N features in each data in the third test attribute data set as the input of the project defect leakage prediction model, and use the project defect leakage prediction model to classify the defect leakage situation of each data to obtain the defect leakage classification result of each data.
[0128] The classification accuracy determination module 750 is used to determine the classification accuracy of the project defect leakage prediction model based on the comparison between the defect leakage classification results of the data in the training data set and the defect leakage situation classification labels.
[0129] The prediction result output module 760 is used to output the defect leakage classification result of the project defect leakage prediction model for the target test attribute data when the classification accuracy is greater than or equal to the predetermined accuracy threshold, so as to obtain prediction information on the defect leakage situation of the project to be put into production.
[0130] The project test optimization module 770 is used for: when the project defect leakage prediction model is a model constructed using the random forest algorithm, when the defect leakage classification result of the target test attribute data belongs to the defect leakage category, obtaining the feature importance ranking of N features according to the random forest feature importance ranking algorithm; selecting at least one important feature with a top ranking from the N features according to the feature importance ranking from high to low; determining the important indicators corresponding to the important features from the m indicators based on the data preprocessing process; and outputting recommendation information for additional testing of the project to be put into production, the recommendation information for additional testing including optimizing the values of the important indicators and then performing additional testing on the project to be put into production.
[0131] The model dynamic optimization module 780 is used to combine the test attribute data of the new project and the actual defect leakage situation after the project is put into production with the data of historical projects, continuously train the project defect leakage prediction model, and continuously enhance the adaptability of the project defect leakage prediction model.
[0132] According to an embodiment of the present disclosure, the data preprocessing module 730 may include at least one of a factor analysis submodule, a missing value filling submodule, and an outlier removal submodule.
[0133] The factor analysis submodule is used to convert each data from the value of m indicators to the value of N features through the factor analysis method based on the second test attribute data set, wherein the N features are N common factors obtained by aggregating the m indicators.
[0134] The missing value filling submodule is used to estimate and fill the missing value by using the K nearest neighbor algorithm when there is a missing value in any first indicator of the first data in the second test attribute data set.
[0135] The outlier elimination submodule is used to eliminate outliers in each indicator in the second test attribute data set according to the Laida criterion, wherein when an indicator is eliminated of outliers, the value of the indicator is converted into a missing value.
[0136] According to an embodiment of the present disclosure, any multiple modules among the data acquisition module 710, the data set update module 720, the data preprocessing module 730, the prediction module 740, the classification accuracy determination module 750, the prediction result output module 760, the project test optimization module 770, the model dynamic optimization module 780, the factor analysis submodule, the missing value filling submodule and the outlier removal submodule can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the data acquisition module 710, the data set update module 720, the data preprocessing module 730, the prediction module 740, the classification accuracy determination module 750, the prediction result output module 760, the project test optimization module 770, the model dynamic optimization module 780, the factor analysis sub-module, the missing value filling sub-module and the outlier removal sub-module can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the data acquisition module 710, the data set update module 720, the data preprocessing module 730, the prediction module 740, the classification accuracy determination module 750, the prediction result output module 760, the project test optimization module 770, the model dynamic optimization module 780, the factor analysis submodule, the missing value filling submodule and the outlier removal submodule can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is executed.
[0137] Figure 8 The block diagram of an electronic device suitable for implementing the method for predicting defect leakage of a project to be put into production according to an embodiment of the present disclosure is schematically shown.
[0138] like Figure 8As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0139] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0140] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.
[0141] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0142] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.
[0143] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present disclosure.
[0144] The above functions defined in the system / device of the embodiment of the present disclosure are executed when the computer program is executed by the processor 801. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0145] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0146] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0147] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0148] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0149] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0150] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for predicting defect leakage of a project to be put into production, comprising: Acquire target test attribute data for describing the test process of the project to be put into production, wherein the target test attribute data includes values of m indicators, wherein m is an integer greater than 1; Appending the target test attribute data to the first test attribute data set to update the first test attribute data set to a second test attribute data set; wherein each data in the first test attribute data set includes the values of the m indicators, and the first test attribute data set includes a training data set for training a defect leakage prediction model for a project; wherein each data in the training data set includes, in addition to the values of the m indicators, a defect leakage classification label; Performing data preprocessing based on the second test attribute data set, converting each data from the values of the m indicators to the values of N features, to obtain a third test attribute data set, where N is an integer and 1≤N≤m; Taking the values of the N features in each data in the third test attribute data set as inputs of the project defect leakage prediction model, and using the project defect leakage prediction model to classify the defect leakage situation of each data, to obtain the defect leakage classification result of each data; Determining the classification accuracy of the project defect leakage prediction model based on a comparison between the defect leakage classification results of the data in the training data set and the defect leakage situation classification labels; and When the classification accuracy is greater than or equal to a predetermined accuracy threshold, the defect leakage classification result of the project defect leakage prediction model for the target test attribute data is output to obtain prediction information on the defect leakage situation of the project to be put into production.
2. The method according to claim 1, wherein: The data preprocessing is performed based on the second test attribute data set, and each data is converted from the value of the m indicators to the value of N features to obtain the third test attribute data set, which includes: Based on the second test attribute data set, each data is converted from the value of the m indicators to the value of N features through a factor analysis method, wherein the N features are N common factors obtained by aggregating the m indicators.
3. The method according to claim 1, wherein: The performing data preprocessing based on the second test attribute data set further includes: When there are missing values in any first index of the first data in the second test attribute data set, the missing values are estimated and filled by using a K nearest neighbor algorithm.
4. The method according to claim 3, wherein: The estimating and filling the missing values by using the K nearest neighbor algorithm includes: Calculate a first distance between the first data and other data in the second test attribute data set based on values of indicators other than the first indicator among the m indicators; Based on the first distance, determining K nearest neighbors of the first data from the second test attribute data set; and The missing value is estimated and filled based on the values of the K nearest neighbors on the first index.
5. The method according to claim 4, wherein: The estimating and filling the missing values by the K nearest neighbor algorithm also includes training a KNN prediction model based on the training data set, wherein, during the training process of the KNN prediction model, Based on the values of the m indicators, calculate the second distance between any two data in the training data set; Determine the category of each data in the training data set according to the defect leakage classification label; Iteratively training the KNN prediction model, wherein in each round of iteration, firstly setting the current value of K, then the KNN prediction model classifies the data in the training data set according to the K nearest neighbor algorithm based on the second distance and the current value of K, and compares the classification result with the category determined by the defect leakage classification label, and calculates the prediction accuracy of the KNN prediction model; and When the prediction accuracy of the KNN prediction model meets a predetermined accuracy threshold, the iterative training of the KNN prediction model is stopped and the value of K is output.
6. The method according to claim 3, wherein: The performing data preprocessing based on the second test attribute data set further includes: According to the Laida criterion, outliers in each indicator in the second test attribute data set are eliminated, wherein when an indicator is eliminated of outliers, the value of the indicator is converted to the missing value.
7. The method according to any one of claims 1 to 6, wherein: The method of using the project defect leakage prediction model to classify the defect leakage situation of each data includes: It can be classified into at least two categories: non-defect leakage and defect leakage.
8. The method according to claim 7, wherein: The project defect leakage prediction model is a model constructed using a random forest algorithm. When the defect leakage classification result of the target test attribute data belongs to the category of defect leakage, the method further includes: Obtaining the feature importance ranking of the N features according to the random forest feature importance ranking algorithm; From the N features, sort them in descending order of importance, and select at least one important feature that ranks first; Based on the data preprocessing process, determining an important indicator corresponding to the important feature from the m indicators; and Outputting suggestion information for additional testing of the project to be put into production, wherein the suggestion information for additional testing includes optimizing the value of the important indicator and then performing additional testing on the project to be put into production.
9. A device for predicting the leakage of defects in a project to be put into production, comprising: A data acquisition module, used to acquire target test attribute data for describing the test process of the project to be put into production, wherein the target test attribute data includes values of m indicators, wherein m is an integer greater than 1; A data set updating module, used for appending the target test attribute data to the first test attribute data set, so as to update the first test attribute data set to a second test attribute data set; wherein each data in the first test attribute data set includes the values of the m indicators, and the first test attribute data set includes a training data set for training a defect leakage prediction model of a training project; wherein each data in the training data set includes, in addition to the values of the m indicators, a defect leakage classification label; A data preprocessing module, configured to perform data preprocessing based on the second test attribute data set, converting each data from the value of the m indicators to the value of N features, to obtain a third test attribute data set, wherein N is an integer and 1≤N≤m; A prediction module is provided with the project defect leakage prediction model, which is used to use the values of the N features in each data in the third test attribute data set as inputs of the project defect leakage prediction model, and classify the defect leakage situation of each data using the project defect leakage prediction model to obtain a defect leakage classification result for each data; A classification accuracy determination module, used to determine the classification accuracy of the project defect leakage prediction model based on the comparison between the defect leakage classification result of the data in the training data set and the defect leakage situation classification label; The prediction result output module is used to output the defect leakage classification result of the project defect leakage prediction model on the target test attribute data when the classification accuracy is greater than or equal to a predetermined accuracy threshold, so as to obtain prediction information on the defect leakage situation of the project to be put into production.
10. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 8.