Test case processing method and device, computer device and storage medium

By establishing a quality assessment model based on support vector regression, the quality of test cases can be automatically evaluated, solving the problem of time-consuming manual review and achieving rapid, comprehensive, and low-cost test case evaluation.

CN116204444BActive Publication Date: 2025-12-05INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310396306.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2025-12-05
Estimated Expiration
2043-04-14

AI Technical Summary

Technical Problem

In existing technologies, the quality assessment of test cases relies on manual review, which is time-consuming, untimely, incomplete, and slow. It is especially difficult to conduct effective assessments when project schedules are tight, and the labor costs are high.

Method used

The support vector regression model is trained using a sample test case set and sample quality scores to establish a quality assessment model, automatically evaluate the quality of test cases, and identify features to be improved through attribution analysis.

Benefits of technology

It enables timely, comprehensive, and rapid evaluation of test case quality, improving evaluation efficiency and reducing labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116204444B_ABST
    Figure CN116204444B_ABST
Patent Text Reader

Abstract

The application relates to a test case processing method and device, computer equipment and a storage medium, and relates to the technical field of artificial intelligence. The method comprises the following steps: obtaining a target test case set to be evaluated; extracting target case set features of the target test case set; inputting the target case set features into a quality evaluation model to obtain target quality scores of the target case set features. According to the above scheme, by introducing the quality evaluation model, the target case set features of the target test case set are input into the quality evaluation model, so that the target quality scores of the target case set features can be obtained. Compared with the mode of manually reviewing the quality of test cases in the related art, timely, comprehensive and rapid automatic evaluation of the quality of test cases is realized, which not only improves the efficiency of test case evaluation, but also reduces the labor cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a test case processing method, apparatus, computer device, and storage medium. Background Technology

[0002] To ensure that test cases can accurately verify the integrity of a specific function or feature of a software application when used for software testing, it is necessary to evaluate the quality of the test cases.

[0003] Currently, test cases are often evaluated through manual review. After the tests are completed, the cases are reflected on based on data such as code coverage and the rate of missed issues, and any omissions or deficiencies are identified and addressed.

[0004] However, manual review is time-consuming and often cannot comprehensively review all test cases. Especially when project deadlines are tight, manual review is often delayed and cannot timely, comprehensively and quickly assess the quality of test cases, which urgently needs improvement. Summary of the Invention

[0005] Therefore, it is necessary to provide a test case processing method, device, computer equipment, and storage medium to address the above-mentioned technical problems, which can timely, comprehensively, and quickly evaluate the quality of test cases without requiring manual review, thus reducing labor costs.

[0006] Firstly, this application provides a test case processing method, which includes:

[0007] Obtain the target test case set to be evaluated;

[0008] Extract the target test case set features;

[0009] The target case set features are input into the quality assessment model to obtain the target quality score of the target test case set; the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0010] In one embodiment, the target test case set features are extracted, including:

[0011] Based on the feature extraction rules, the features of the target test case set under each feature item are extracted and normalized to obtain the feature values ​​of the target test case set under each feature item.

[0012] The feature values ​​of the target test case set under each feature item are concatenated to obtain the target test case set features.

[0013] In one embodiment, the method further includes:

[0014] Compare the target quality score with a set quality threshold;

[0015] If the comparison result is that the target quality score is lower than the set quality threshold, a comparison test case set is obtained from the sample test case set; wherein, the functional module type corresponding to the comparison test case set is the same as the functional module type corresponding to the target test case set, and the sample quality score of the comparison test case set is higher than the set quality threshold.

[0016] By using a comparative test case set, attribution analysis is performed on the target test case set to obtain the features of the target test case set that need to be improved.

[0017] In one embodiment, a comparative test case set is used to perform attribution analysis on the target test case set to obtain the features to be improved in the target test case set, including:

[0018] Based on the feature values ​​of each comparative test case set under each variable feature item, determine the overall feature value of each comparative test case set under each variable feature item;

[0019] Based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item, the feature items to be improved in the target test case set are determined.

[0020] In one embodiment, based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item, the feature items to be improved in the target test case set are determined, including:

[0021] For each variable feature, if the difference between the overall feature value of each comparative test case set under the variable feature and the feature value of the target test case set under the variable feature is greater than the set difference threshold, then the variable feature is regarded as a candidate improvement feature.

[0022] Based on the overall feature values ​​of each comparative test case set under the candidate improvement feature items, and the features of the target test case set, the feature items to be improved in the target test case set are determined.

[0023] In one embodiment, based on the overall feature values ​​of each comparative test case set under the candidate improvement feature items, and the features of the target test case set, the feature items to be improved for the target test case set are determined, including:

[0024] Select the target feature and other features from the candidate promotion features;

[0025] The overall feature values ​​of each comparative test case set under the target feature item are used to replace the feature values ​​corresponding to the target feature item in the target case set features to obtain new case set features;

[0026] The features of the new case set are input into the quality assessment model to obtain a new quality score;

[0027] If the new quality score is less than the set quality threshold, the target feature item will be used as the feature item to be improved in the target test case set, and other features items will be used as new candidate features to be improved. The new case set features will be used as new target case set features. Then, the operation of selecting the target feature item and other features from the candidate features to be improved will be performed until the new quality score is greater than the set quality threshold.

[0028] In one embodiment, the method further includes:

[0029] The sample quality score of the sample test case set is determined based on the review score of the testers, the code coverage of the sample test case set during execution, and the problem leakage rate of the sample test case set after execution.

[0030] Secondly, this application also provides a test case processing apparatus, which includes:

[0031] The first acquisition module is used to acquire the target test case set to be evaluated.

[0032] The feature extraction module is used to extract the target test case set features;

[0033] The first determining module is used to input the features of the target case set into the quality assessment model to obtain the target quality score of the target test case set; wherein, the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0034] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0035] Obtain the target test case set to be evaluated;

[0036] Extract the target test case set features;

[0037] The target case set features are input into the quality assessment model to obtain the target quality score of the target test case set; the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0038] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0039] Obtain the target test case set to be evaluated;

[0040] Extract the target test case set features;

[0041] The target case set features are input into the quality assessment model to obtain the target quality score of the target test case set; the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0042] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0043] Obtain the target test case set to be evaluated;

[0044] Extract the target test case set features;

[0045] The target case set features are input into the quality assessment model to obtain the target quality score of the target test case set; the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0046] The aforementioned test case processing method, apparatus, computer equipment, and storage medium train the support vector regression model using a sample test case set and its sample quality scores, introduce a quality assessment model, and then obtain the target quality score for the target test case set. Compared to the manual review of test case quality in related technologies, this method achieves timely, comprehensive, and rapid automatic evaluation of test case quality, which not only improves the efficiency of test case evaluation but also reduces labor costs. Attached Figure Description

[0047] Figure 1 This is a diagram illustrating the application environment of a test case processing method in one embodiment;

[0048] Figure 2 This is a flowchart illustrating the test case processing method in one embodiment;

[0049] Figure 3 This is a flowchart illustrating the attribution analysis of a target test case set in one embodiment.

[0050] Figure 4 This is a flowchart illustrating the process of determining the features to be improved in a target test case set in one embodiment;

[0051] Figure 5 This is a flowchart illustrating the process of determining the features to be improved in a target test case set in another embodiment;

[0052] Figure 6 This is a flowchart illustrating the process of determining the features to be improved in a target test case set in another embodiment;

[0053] Figure 7 This is a flowchart illustrating the test case processing method in another embodiment;

[0054] Figure 8 This is a structural block diagram of a test case processing device in one embodiment;

[0055] Figure 9 This is a structural block diagram of the test case processing device in another embodiment;

[0056] Figure 10 This is a structural block diagram of the test case processing device in yet another embodiment;

[0057] Figure 11 This is a structural block diagram of the test case processing device in another embodiment;

[0058] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0060] The test case processing method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store data required by server 104, such as feature extraction rules. The data storage system can be integrated onto server 104 or placed on the cloud or other network servers. Optionally, the user can input the target test case set to be evaluated into terminal 102. Server 104 retrieves the target test case set from terminal 102; then extracts the target test case set features; and then inputs these features into a quality assessment model to obtain the target quality score of the target test case set. Further, server 104 can send the target quality score of the target test case set to terminal 102, which then displays the target quality score to the user. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0061] In one embodiment, such as Figure 2 As shown, a test case processing method is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:

[0062] S201, Obtain the target test case set to be evaluated.

[0063] In this embodiment, a test case is a set of code used for software testing; a test case set is all test cases corresponding to the same functional module; a target test case set is the test case set that needs to be evaluated for quality; and a functional module can be a login function or a search function, etc.

[0064] Specifically, in this embodiment, users can input the test case set that needs to be evaluated into the terminal through the integrated visual interface, and the server can obtain the target test case set to be evaluated from the terminal in real time.

[0065] S202, Extract the target test case set features.

[0066] In this embodiment, the case set features may include fixed features and variable features; wherein, the fixed features may include multiple feature items such as the functional module type corresponding to the test case set and the qualifications of the case writer; the variable features may include multiple feature items such as the number of cases, the functional point coverage of the case set, the case element missing rate, and whether the expected result is unique.

[0067] One possible approach is to input the target test case set into a feature extraction network, which then extracts features from the target test case set to obtain the target test case set features.

[0068] Another possible approach is to extract the features of the target test case set under each feature item according to the feature item extraction rules, and then normalize them to obtain the feature values ​​of the target test case set under each feature item; then concatenate the feature values ​​of the target test case set under each feature item to obtain the target test case set features.

[0069] The feature extraction rule is a pre-defined rule for extracting each feature. Optionally, each feature corresponds to a specific extraction rule. For example, the feature for test case set function point coverage might have the feature extraction rule t / T*100%; where t is the number of function points in the test case set; and T is the total number of module function points in the corresponding functional module of the test case set, which can be obtained from the software requirements specification of the corresponding functional module.

[0070] Optionally, the normalization process for features under different types of feature items also varies. These different types of feature items can be categorized into continuous feature items (such as the functional coverage rate of the case set), categorical feature items (such as the qualifications of the case writer), and discrete feature items (such as the number of cases), among others.

[0071] For example, the normalization process for continuous feature items is to perform direct normalization; for instance, if the feature point coverage rate of the case set is 80%, it is directly normalized to 0.8. The normalization process for categorical feature items is to first encode each category, replace the original value with the encoded value, and then perform normalization; for instance, if the qualifications of case writers are divided into Level 1, Level 2, Level 3, and Level 4, they are encoded as 01, 02, 03, and 04 respectively, and then normalized to 0.25, 0.5, 0.75, and 1 respectively. The normalization process for discrete feature terms is as follows: First, the discrete values ​​are segmented, and the index value of each segment is used as the feature value of that type of feature term. Then, normalization is performed. For example, if the number of cases is distributed between 1 and 100, it is first divided into 5 segments: 1-10, 11-30, 31-70, 71-90, and 91-100. The index values ​​of each segment are 10, 30, 70, 90, and 100, respectively. Then, the normalization is performed to obtain values ​​of 0.1, 0.3, 0.7, 0.9, and 1.

[0072] Specifically, for each feature item, the features of the target test case set under that feature item are extracted according to the feature item extraction rule corresponding to that feature item. Then, based on the type to which the feature item belongs, the normalization processing method corresponding to that type is used to normalize the features of the target test case set under that feature item, obtaining the feature value of the target test case set under that feature item. Based on the same processing method, the feature value of the target test case set under each feature item is determined. And according to the set order, the feature values ​​of the target test case set under each feature item are concatenated to obtain the target test case set feature. For example, if the feature values ​​of the target test case set under each feature item are determined to be 0.8, 0.25, 0.5, 0.75 and 1, then the feature values ​​can be concatenated as (0.8, 0.25, 0.5, 0.75, 1), which is the target test case set feature.

[0073] S203, input the features of the target case set into the quality assessment model to obtain the target quality score of the target test case set.

[0074] The quality assessment model is trained on the support vector regression model using the sample test case set and its sample quality scores. Optionally, the sample quality scores of the sample test case set can be obtained through manual review by users.

[0075] To ensure that the target quality scores of the target test case set obtained based on the quality assessment model are more accurate, the quality assessment model itself needs to be more accurate as well. Building upon the above embodiments, a further optional method for determining sample quality scores is provided to ensure that the training loss determined by the predicted quality scores and sample quality scores is more accurate, thereby ensuring that the quality assessment model trained from the training loss is more accurate.

[0076] Optionally, the sample quality score of the sample test case set can be determined based on the review score of the tester on the sample test case set, the code coverage of the sample test case set during execution, and the problem leakage rate of the sample test case set after execution.

[0077] Specifically, the sample quality score can be determined based on a pre-defined logic for determining the sample test case set. This score is determined by the tester's review score, the code coverage rate during execution, and the issue leakage rate after execution. For example, the sample quality score can be calculated using a 3:3:4 ratio: tester's review score * 30% + code coverage rate during execution * 30% + issue leakage rate after execution * 40%.

[0078] In one implementation, the quality assessment model can be obtained as follows: a support vector regression model is constructed, the sample test case set is input into the support vector regression model, and the parameters in the support vector regression model are optimized using a genetic algorithm to obtain the predicted quality score of the sample test case set; the training loss is determined based on the predicted quality score and the sample quality score of the sample test case set; the support vector regression model is iteratively trained using the training loss until a preset training stopping condition is reached to obtain the trained support vector regression model, i.e., the quality assessment model.

[0079] Specifically, the features of the target case set are input into the trained quality assessment model, and the quality assessment model outputs the target quality score of the features of the target case set.

[0080] In the above test case processing method, the support vector regression model is trained by using the sample test case set and the sample quality score of the sample test case set, and a quality assessment model is introduced. Then, by introducing the quality assessment model, the target quality score of the target test case set can be obtained. Compared with the method of manually reviewing the quality of test cases in related technologies, this method realizes timely, comprehensive and fast automatic evaluation of test case quality, which not only improves the efficiency of test case evaluation, but also reduces labor costs.

[0081] Based on determining the target quality score for the target test case set, it is necessary to further identify the reasons affecting the low quality score of the target test case set; therefore, in one embodiment, an optional method for attribution analysis of the target test case set is provided. For example... Figure 3 As shown, the specific steps may include:

[0082] S301, compare the target quality score with the set quality threshold.

[0083] S302. If the comparison result is that the target quality score is lower than the set quality threshold, then obtain the comparison test case set from the sample test case set.

[0084] S303, using a comparative test case set, performs attribution analysis on the target test case set to obtain the features of the target test case set that need to be improved.

[0085] Among them, the functional module types corresponding to the comparative test case set are the same as those corresponding to the target test case set, and the sample quality score of the comparative test case set is higher than the set quality threshold.

[0086] Optionally, select a sample test case set from all sample test case sets that has the same functional module type as the target test case set; compare the sample quality score of each selected sample test case set with a set threshold; for each selected sample test case set, if the sample quality score of the sample test case set is greater than the set quality threshold, then the selected sample test case set is used as a comparison test case set; based on the above method, all comparison test case sets are determined.

[0087] Specifically, the target quality score is compared with a set quality threshold. If the target quality score is lower than the threshold, a comparison test case set is obtained from the sample test case set. Both the comparison test case set and the target test case set are then input into a pre-trained attribution analysis model, which outputs the feature items to be improved for the target test case set. Alternatively, for each feature item in the comparison test case set, the average feature value of all comparison test case sets under that feature item is determined based on their feature values. The feature value of the target test case set under that feature item is compared with the average feature value of all comparison test case sets under that feature item. If the feature value of the target test case set under that feature item is less than the average feature value of all comparison test case sets under that feature item, then that feature item is considered the feature item to be improved for the target test case set.

[0088] In this embodiment, an optional method for attribution analysis of a target test case set is provided. By introducing a set quality threshold, a comparison test case set is determined based on the comparison result of the target quality score and the set quality threshold. Then, based on the comparison test case set and the target test case set, the features to be improved in the target test case set are determined. Furthermore, the user can improve and enhance the corresponding content of the target test case set based on the features to be improved.

[0089] In one embodiment, based on the above embodiment, S303 further employs a comparative test case set to perform attribution analysis on the target test case set, obtaining a detailed explanation of the features to be improved in the target test case set. For example... Figure 4 As shown, the specific steps may include the following:

[0090] S401, based on the feature values ​​of each comparative test case set under each variable feature item, determine the overall feature value of each comparative test case set under each variable feature item.

[0091] In this context, the overall feature value of each comparative test case set under each variable feature term is the value determined based on the feature values ​​of all comparative test case sets under that variable feature term.

[0092] Specifically, the method for determining the overall eigenvalue differs for different types of variable features. For continuous variable features, the average eigenvalue of each test case set under the continuous variable feature is determined based on its eigenvalue, which is the overall eigenvalue of the test case set under the continuous variable feature. For discrete variable features, the average eigenvalue of each test case set under the discrete variable feature is determined based on its eigenvalue, and the integer value of the average eigenvalue is rounded to the nearest integer, which is the overall eigenvalue of the test case set under the discrete variable feature. For categorical variable features, the average eigenvalue of each test case set under the categorical variable feature is determined based on its eigenvalue, and the one with the largest average eigenvalue is taken as the overall eigenvalue.

[0093] S402, based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item, determine the feature items to be improved in the target test case set.

[0094] Specifically, for each variable feature, the overall feature value of each comparative test case set under that variable feature is calculated, and the difference between the overall feature value and the feature value of the target test case set under that variable feature is calculated. The variable feature corresponding to the largest difference is taken as the feature to be improved in the target test case set.

[0095] To accurately improve and enhance the target test case set, it is necessary to make the identified improvement items of the target test case set more precise. Therefore, in one embodiment, an optional method for determining the improvement features of the target test case set is provided. For example... Figure 5 As shown, the specific steps may include the following:

[0096] S501, for each variable feature item, if the difference between the overall feature value of each comparative test case set under the variable feature item and the feature value of the target test case set under the variable feature item is greater than the set difference threshold, then the variable feature item is regarded as a candidate improvement feature item.

[0097] S502, based on the overall feature values ​​of each comparative test case set under the candidate improvement feature items, and the features of the target test case set, determine the feature items to be improved for the target test case set.

[0098] Specifically, for each variable feature term, the difference between the overall feature value of each comparative test case set under that variable feature term and the feature value of the target test case set under that variable feature term is calculated and compared with a set difference threshold. If the difference is greater than the set difference threshold, the variable feature term is selected as a candidate feature term to be improved. Further, the overall feature values ​​of each comparative test case set under the candidate feature term and the feature value of the target test case set can be input into a pre-trained attribution analysis model, which then outputs the feature terms to be improved for the target test case set. Alternatively, based on a pre-defined logic for determining the feature terms to be improved, the feature terms to be improved for the target test case set can be determined according to the overall feature values ​​of each comparative test case set under the candidate feature term and the feature values ​​of the target test case set under the candidate feature term.

[0099] In this embodiment, by introducing an overall feature value, the feature items to be improved in the target test case set are determined based on the overall feature value of each comparative test case set under each variable feature item, providing an optional method for quickly determining the feature items to be improved.

[0100] In one embodiment, based on the above embodiment, a detailed explanation is provided regarding S502, which determines the features to be improved in the target test case set based on the overall feature values ​​of each comparative test case set under the candidate improvement feature items, and the features of the target test case set. For example... Figure 6 As shown, the specific steps include the following:

[0101] S601, Select the target feature and other features from the candidate enhancement features.

[0102] S602, using the overall feature value of each comparative test case set under the target feature item, replaces the feature value corresponding to the target feature item in the target case set feature to obtain the new case set feature.

[0103] S603: Input the features of the new case set into the quality assessment model to obtain a new quality score.

[0104] S604, determine whether the new quality score is greater than the set quality threshold. If not, proceed to S605; if yes, proceed to S606.

[0105] S605, the target feature is taken as the feature to be improved in the target test case set, and other features are taken as new candidate features to be improved, and the new case set features are taken as new target case set features, and then return to execute S601.

[0106] S606, the target feature items are taken as the feature items to be improved in the target test case set.

[0107] Specifically, any candidate feature can be selected as the target feature; or, based on the difference between the overall feature value of each comparative test case set under each variable feature and the feature value of the target test case set under each variable feature, the candidate features can be sorted in descending order, and the candidate feature with the highest ranking can be selected as the target feature.

[0108] The remaining candidate improvement features are then used as other features. Next, the feature values ​​corresponding to the target feature in the target case set features are replaced with the overall feature values ​​of each comparative test case set under the target feature, resulting in new case set features. These new case set features are then input into the quality assessment model, which outputs a new quality score. The new quality score is compared to a set quality threshold. If the new quality score is less than the threshold, the target feature is used as a feature to be improved in the target test case set. Since the target test case set may contain multiple features to be improved, to identify all of them, it is necessary to further determine whether other features also contain features to be improved. In this case, other features are used as new candidate improvement features, and the new case set features are used as new target case set features. The process of selecting the target feature and other features from the candidate improvement features is repeated until the new quality score is greater than the set quality threshold, thus obtaining all features to be improved.

[0109] In this embodiment, by introducing new case set features, a new quality score is obtained based on the new case set features, and then the items to be improved in the target test case set are determined based on the new quality score. Based on this method, all feature items that may have a low impact on the quality of the target test case set can be identified as items to be improved.

[0110] Additionally, in one embodiment, this application also provides an optional example of a test case processing method. Combined with Figure 7 As shown, the specific process includes:

[0111] S701, Obtain the target test case set to be evaluated.

[0112] S702, according to the feature extraction rules, extract the features of the target test case set under each feature item, and perform normalization processing to obtain the feature values ​​of the target test case set under each feature item.

[0113] S703, concatenate the feature values ​​of the target test case set under each feature item to obtain the target test case set features.

[0114] S704. Input the features of the target case set into the quality assessment model to obtain the target quality score of the target test case set.

[0115] The quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality scores of the sample test case set.

[0116] Optionally, the sample quality score of the sample test case set can be determined based on the review score of the tester on the sample test case set, the code coverage of the sample test case set during execution, and the problem leakage rate of the sample test case set after execution.

[0117] S705 compares the target quality score with a set quality threshold.

[0118] S706 If the comparison result is that the target quality score is lower than the set quality threshold, then obtain the comparison test case set from the sample test case set.

[0119] Among them, the functional module types corresponding to the comparative test case set are the same as those corresponding to the target test case set, and the sample quality score of the comparative test case set is higher than the set quality threshold.

[0120] S707, based on the feature values ​​of each comparative test case set under each variable feature item, determine the overall feature value of each comparative test case set under each variable feature item.

[0121] S708, for each variable feature item, if the difference between the overall feature value of each comparative test case set under the variable feature item and the feature value of the target test case set under the variable feature item is greater than the set difference threshold, then the variable feature item is regarded as a candidate improvement feature item.

[0122] S709. Based on the overall feature values ​​of each comparative test case set under the candidate improvement feature items, and the features of the target test case set, determine the feature items to be improved for the target test case set.

[0123] Optionally, select the target feature and other features from the candidate improvement features; use the overall feature value of each comparative test case set under the target feature to replace the feature value corresponding to the target feature in the target case set features to obtain new case set features; input the new case set features into the quality assessment model to obtain a new quality score; if the new quality score is less than the set quality threshold, then the target feature is used as the feature to be improved in the target test case set, and the other features are used as new candidate improvement features, and the new case set features are used as new target case set features, and return to execute the operation of selecting the target feature and other features from the candidate improvement features until the new quality score is greater than the set quality threshold.

[0124] The specific processes of S701-S709 described above can be found in the description of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.

[0125] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0126] Based on the same inventive concept, this application also provides a test case processing apparatus for implementing the test case processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more test case processing apparatus embodiments provided below can be found in the limitations of the test case processing method described above, and will not be repeated here.

[0127] In one embodiment, such as Figure 8 As shown, a test case processing device 1 is provided, comprising: a first acquisition module 10, a feature extraction module 20, and a first determination module 30, wherein:

[0128] The first acquisition module 10 is used to acquire the target test case set to be evaluated.

[0129] The feature extraction module 20 is used to extract the target test case set features.

[0130] The first determining module 30 is used to input the features of the target case set into the quality assessment model to obtain the target quality score of the target test case set; wherein, the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0131] In one embodiment, the feature extraction module 20 described above can be specifically used for:

[0132] Based on the feature extraction rules, the features of the target test case set under each feature item are extracted and normalized to obtain the feature values ​​of the target test case set under each feature item. The feature values ​​of the target test case set under each feature item are concatenated to obtain the target test case set features.

[0133] In one embodiment, such as Figure 9 As shown, the test case processing device 1 further includes:

[0134] Comparison module 40 is used to compare the target quality score with a set quality threshold;

[0135] The second acquisition module 50 is used to acquire a comparison test case set from the sample test case set if the comparison result is that the target quality score is lower than the set quality threshold; wherein the functional module type corresponding to the comparison test case set is the same as the functional module type corresponding to the target test case set, and the sample quality score of the comparison test case set is higher than the set quality threshold.

[0136] The second determining module 60 is used to perform attribution analysis on the target test case set using a comparative test case set to obtain the features to be improved in the target test case set.

[0137] In one embodiment, such as Figure 10 As shown, the second determining module 60 specifically includes:

[0138] The first determining unit 61 is used to determine the overall feature value of each comparative test case set under each variable feature item based on the feature value of each comparative test case set under each variable feature item.

[0139] The second determining unit 62 is used to determine the feature items to be improved in the target test case set based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item.

[0140] In one embodiment, such as Figure 11 As shown, the second determining unit 62 specifically includes:

[0141] The first determining subunit 621 is used to, for each variable feature item, if the difference between the overall feature value of each comparative test case set under the variable feature item and the feature value of the target test case set under the variable feature item is greater than a set difference threshold, then the variable feature item is taken as a candidate improvement feature item.

[0142] The second determining subunit 622 is used to determine the feature items to be improved in the target test case set based on the overall feature values ​​of each comparative test case set under the candidate improvement feature items and the features of the target case set.

[0143] In one embodiment, the second determining subunit 622 described above can specifically be used for:

[0144] Select the target feature and other features from the candidate improvement features; replace the feature values ​​corresponding to the target feature in the target case set features with the overall feature values ​​of each comparative test case set under the target feature, and obtain new case set features; input the new case set features into the quality assessment model to obtain a new quality score; if the new quality score is less than the set quality threshold, then the target feature is used as the feature to be improved in the target test case set, and the other features are used as new candidate improvement features, and the new case set features are used as new target case set features, and return to the process of selecting the target feature and other features from the candidate improvement features until the new quality score is greater than the set quality threshold.

[0145] In one embodiment, the test case processing device 1 further includes:

[0146] The third determination module is used to determine the sample quality score of the sample test case set based on the review score of the tester on the sample test case set, the code coverage of the sample test case set during execution, and the problem leakage rate of the sample test case set after execution.

[0147] Each module in the aforementioned test case processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0148] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores test case processing data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a test case processing method.

[0149] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0150] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0151] Obtain the target test case set to be evaluated;

[0152] Extract the target test case set features;

[0153] The target case set features are input into the quality assessment model to obtain the target quality score of the target test case set; the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0154] In one embodiment, when the processor executes the logic of the computer program to extract the target test case set features, it specifically implements the following steps:

[0155] Based on the feature extraction rules, the features of the target test case set under each feature item are extracted and normalized to obtain the feature values ​​of the target test case set under each feature item. The feature values ​​of the target test case set under each feature item are concatenated to obtain the target test case set features.

[0156] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0157] The target quality score is compared with a set quality threshold. If the target quality score is lower than the set quality threshold, a comparison test case set is obtained from the sample test case set. The functional module type corresponding to the comparison test case set is the same as that corresponding to the target test case set, and the sample quality score of the comparison test case set is higher than the set quality threshold. Using the comparison test case set, attribution analysis is performed on the target test case set to obtain the features to be improved in the target test case set.

[0158] In one embodiment, when the processor executes the logic in the computer program that uses a comparative test case set to perform attribution analysis on the target test case set and obtains the features to be improved in the target test case set, the following steps are specifically implemented:

[0159] Based on the feature values ​​of each comparative test case set under each variable feature item, determine the overall feature value of each comparative test case set under each variable feature item; based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item, determine the feature items to be improved in the target test case set.

[0160] In one embodiment, when the processor executes the logic in the computer program to determine the feature items to be improved in the target test case set based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item, the processor specifically implements the following steps:

[0161] For each variable feature, if the difference between the overall feature value of each comparative test case set under the variable feature and the feature value of the target test case set under the variable feature is greater than a set difference threshold, then the variable feature is regarded as a candidate feature to be improved. Based on the overall feature value of each comparative test case set under the candidate feature to be improved and the feature of the target test case set, the feature to be improved of the target test case set is determined.

[0162] In one embodiment, when the processor executes the logic in the computer program to determine the feature items to be improved in the target test case set based on the overall feature values ​​of each comparative test case set under the candidate improved feature items and the features of the target test case set, the processor specifically implements the following steps:

[0163] Select the target feature and other features from the candidate improvement features; replace the feature value corresponding to the target feature in the target case set features with the overall feature value of each comparative test case set under the target feature, and obtain the new case set features; input the new case set features into the quality assessment model to obtain a new quality score; if the new quality score is less than the set quality threshold, then the target feature is used as the feature to be improved in the target test case set, and the other features are used as new candidate improvement features, and the new case set features are used as new target case set features, and return to execute the operation of selecting the target feature and other features from the candidate improvement features until the new quality score is greater than the set quality threshold.

[0164] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0165] The sample quality score of the sample test case set is determined based on the review score of the testers, the code coverage of the sample test case set during execution, and the problem leakage rate of the sample test case set after execution.

[0166] The principles and specific processes of the computer equipment provided above in implementing each embodiment can be found in the description of the test case processing method embodiment in the foregoing embodiments, and will not be repeated here.

[0167] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0168] Obtain the target test case set to be evaluated;

[0169] Extract the target test case set features;

[0170] The target case set features are input into the quality assessment model to obtain the target quality score of the target test case set; the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0171] In one embodiment, when the logic for training the encoding network in the computer program is executed by the processor, the following steps are specifically implemented:

[0172] Based on the feature extraction rules, the features of the target test case set under each feature item are extracted and normalized to obtain the feature values ​​of the target test case set under each feature item. The feature values ​​of the target test case set under each feature item are concatenated to obtain the target test case set features.

[0173] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0174] The target quality score is compared with a set quality threshold. If the target quality score is lower than the set quality threshold, a comparison test case set is obtained from the sample test case set. The functional module type corresponding to the comparison test case set is the same as that corresponding to the target test case set, and the sample quality score of the comparison test case set is higher than the set quality threshold. Using the comparison test case set, attribution analysis is performed on the target test case set to obtain the features to be improved in the target test case set.

[0175] In one embodiment, when the logic of using a comparative test case set to perform attribution analysis on the target test case set and obtaining the features to be improved in the target test case set is executed by the processor, the following steps are specifically implemented:

[0176] Based on the feature values ​​of each comparative test case set under each variable feature item, determine the overall feature value of each comparative test case set under each variable feature item; based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item, determine the feature items to be improved in the target test case set.

[0177] In one embodiment, when the logic in the computer program that determines the feature items to be improved in the target test case set based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item is executed by the processor, the following steps are specifically implemented:

[0178] For each variable feature, if the difference between the overall feature value of each comparative test case set under the variable feature and the feature value of the target test case set under the variable feature is greater than a set difference threshold, then the variable feature is regarded as a candidate feature to be improved. Based on the overall feature value of each comparative test case set under the candidate feature to be improved and the feature of the target test case set, the feature to be improved of the target test case set is determined.

[0179] In one embodiment, when the logic in the computer program that determines the feature items to be improved in the target test case set based on the overall feature values ​​of each comparative test case set under the selected improvement feature items, and the features of the target test case set, is executed by the processor, the following steps are specifically implemented:

[0180] Select the target feature and other features from the candidate improvement features; replace the feature values ​​corresponding to the target feature in the target case set features with the overall feature values ​​of each comparative test case set under the target feature, and obtain new case set features; input the new case set features into the quality assessment model to obtain a new quality score; if the new quality score is less than the set quality threshold, then the target feature is used as the feature to be improved in the target test case set, and the other features are used as new candidate improvement features, and the new case set features are used as new target case set features, and return to execute the operation of selecting the target feature and other features from the candidate improvement features until the new quality score is greater than the set quality threshold.

[0181] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0182] The sample quality score of the sample test case set is determined based on the review score of the testers, the code coverage of the sample test case set during execution, and the problem leakage rate of the sample test case set after execution.

[0183] The principles and specific processes of implementing the computer-readable storage medium provided above can be found in the description of the test case processing method embodiment in the foregoing embodiments, and will not be repeated here.

[0184] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0185] Obtain the target test case set to be evaluated;

[0186] Extract the target test case set features;

[0187] The target case set features are input into the quality assessment model to obtain the target quality score of the target test case set; the quality assessment model is obtained by training the support vector regression model using the sample test case set and the sample quality score of the sample test case set.

[0188] In one embodiment, when the logic for training the encoding network in the computer program is executed by the processor, the following steps are specifically implemented:

[0189] Based on the feature extraction rules, the features of the target test case set under each feature item are extracted and normalized to obtain the feature values ​​of the target test case set under each feature item. The feature values ​​of the target test case set under each feature item are concatenated to obtain the target test case set features.

[0190] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0191] The target quality score is compared with a set quality threshold. If the target quality score is lower than the set quality threshold, a comparison test case set is obtained from the sample test case set. The functional module type corresponding to the comparison test case set is the same as that corresponding to the target test case set, and the sample quality score of the comparison test case set is higher than the set quality threshold. Using the comparison test case set, attribution analysis is performed on the target test case set to obtain the features to be improved in the target test case set.

[0192] In one embodiment, when the logic of using a comparative test case set to perform attribution analysis on the target test case set and obtaining the features to be improved in the target test case set is executed by the processor, the following steps are specifically implemented:

[0193] Based on the feature values ​​of each comparative test case set under each variable feature item, determine the overall feature value of each comparative test case set under each variable feature item; based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item, determine the feature items to be improved in the target test case set.

[0194] In one embodiment, when the logic in the computer program that determines the feature items to be improved in the target test case set based on the difference between the overall feature value of each comparative test case set under each variable feature item and the feature value of the target test case set under each variable feature item is executed by the processor, the following steps are specifically implemented:

[0195] For each variable feature, if the difference between the overall feature value of each comparative test case set under the variable feature and the feature value of the target test case set under the variable feature is greater than a set difference threshold, then the variable feature is regarded as a candidate feature to be improved. Based on the overall feature value of each comparative test case set under the candidate feature to be improved and the feature of the target test case set, the feature to be improved of the target test case set is determined.

[0196] In one embodiment, when the logic in the computer program that determines the feature items to be improved in the target test case set based on the overall feature values ​​of each comparative test case set under the selected improvement feature items, and the features of the target test case set, is executed by the processor, the following steps are specifically implemented:

[0197] Select the target feature and other features from the candidate improvement features; replace the feature values ​​corresponding to the target feature in the target case set features with the overall feature values ​​of each comparative test case set under the target feature, and obtain new case set features; input the new case set features into the quality assessment model to obtain a new quality score; if the new quality score is less than the set quality threshold, then the target feature is used as the feature to be improved in the target test case set, and the other features are used as new candidate improvement features, and the new case set features are used as new target case set features, and return to execute the operation of selecting the target feature and other features from the candidate improvement features until the new quality score is greater than the set quality threshold.

[0198] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0199] The sample quality score of the sample test case set is determined based on the review score of the testers, the code coverage of the sample test case set during execution, and the problem leakage rate of the sample test case set after execution.

[0200] The principles and specific processes of implementing the computer program products provided above can be found in the descriptions of the test case processing method embodiments in the foregoing embodiments, and will not be repeated here.

[0201] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0202] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0203] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A test case processing method, characterized by, The method comprises: acquiring a target test case set to be evaluated; extracting target case set features of the target test case set; inputting the target case set features into a quality evaluation model to obtain a target quality score of the target test case set, wherein the quality evaluation model is obtained by training a support vector regression model using a sample test case set and sample quality scores of the sample test case set; comparing the target quality score with a set quality threshold; if the comparison result is that the target quality score is lower than the set quality threshold, acquiring a comparison test case set from the sample test case set, wherein the comparison test case set corresponds to the same functional module type as the target test case set, and the sample quality score of the comparison test case set is higher than the set quality threshold; using the comparison test case set to perform attribution analysis on the target test case set to obtain a feature item to be improved of the target test case set.

2. The method of claim 1, wherein, The extracting the target case set features of the target test case set comprises: extracting features of the target test case set under each feature item according to a feature item extraction rule and performing normalization processing to obtain feature values of the target test case set under each feature item; splicing the feature values of the target test case set under each feature item to obtain the target case set features of the target test case set.

3. The method of claim 1, wherein, The using the comparison test case set to perform attribution analysis on the target test case set to obtain a feature item to be improved of the target test case set comprises: determining overall feature values of each comparison test case set under each variable feature item according to the feature values of each comparison test case set under each variable feature item; determining the feature item to be improved of the target test case set according to differences between the overall feature values of each comparison test case set under each variable feature item and the feature values of the target test case set under each variable feature item.

4. The method of claim 3, wherein, The determining the feature item to be improved of the target test case set according to differences between the overall feature values of each comparison test case set under each variable feature item and the feature values of the target test case set under each variable feature item comprises: for each variable feature item, if the difference between the overall feature values of each comparison test case set under the variable feature item and the feature value of the target test case set under the variable feature item is greater than a set difference threshold, the variable feature item is taken as a candidate improved feature item; determining the feature item to be improved of the target test case set according to the overall feature values of each comparison test case set under the candidate improved feature item and the target case set features.

5. The method of claim 4, wherein, The determining the feature item to be improved of the target test case set according to the overall feature values of each comparison test case set under the candidate improved feature item and the target case set features comprises: selecting a target feature item and other feature items from the candidate improved feature items; replace the feature value corresponding to the target feature item in the target case set feature with the overall feature value of each comparison test case set under the target feature item to obtain a new case set feature; input the new case set feature into the quality evaluation model to obtain a new quality score; if the new quality score is less than the set quality threshold, take the target feature item as a to-be-improved feature item of the target test case set, take the other feature items as new candidate improved feature items, and take the new case set feature as a new target case set feature, return to execute the operation of selecting the target feature item and the other feature items from the candidate improved feature items until the new quality score is greater than the set quality threshold.

6. The method of claim 1, wherein, The method further comprises: determine a sample quality score of the sample test case set according to a review score of the sample test case set by a test party, a code coverage rate of the sample test case set when executed, and a problem leakage rate of the sample test case set after execution.

7. A test case processing apparatus characterized by comprising: The device comprises: a first acquisition module configured to acquire a target test case set to be evaluated; a feature extraction module configured to extract a target case set feature of the target test case set; a first determination module configured to input the target case set feature into a quality evaluation model to obtain a target quality score of the target test case set; wherein the quality evaluation model is obtained by training a support vector regression model using a sample test case set and a sample quality score of the sample test case set; a comparison module configured to compare the target quality score with a set quality threshold; a second acquisition module configured to, if the comparison result is that the target quality score is lower than the set quality threshold, acquire a comparison test case set from the sample test case set; wherein the comparison test case set corresponds to a same functional module type as a functional module type corresponding to the target test case set, and a sample quality score of the comparison test case set is higher than the set quality threshold; a second determination module configured to perform attribution analysis on the target test case set using the comparison test case set to obtain a to-be-improved feature item of the target test case set.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Test case processing method and related equipment

    CN110321285A

  • Fuzzy test case screening method and device, electronic equipment and storage medium

    CN115237766A