Test risk identification method and system based on artificial intelligence

By collecting test data and adjusting model bias using adaptive learning rate and feedback mechanism, the deviation problem of machine learning models under test data imbalance is solved, sensitive identification and resource optimization of failed use cases are achieved, and testing efficiency and quality are improved.

CN119988240BActive Publication Date: 2025-08-08SHANDONG YUNZE INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510473834.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-08-08
Estimated Expiration
2045-04-16

AI Technical Summary

Technical Problem

In the case of unbalanced test data, existing machine learning models tend to predict successful use cases and ignore failed use cases, resulting in high-risk areas being underestimated, resulting in waste of test resources and inefficiency.

Method used

By collecting test case execution results and test environment status data, extracting dependency outliers and network delay high-frequency values between code modules, building a data prediction model, and adjusting the bias of the machine learning model using adaptive learning rate and feedback mechanism to improve sensitivity to failed use cases.

Benefits of technology

Accurately evaluate the deviation of predicted results of machine learning models, reduce the possibility of high-risk areas being ignored, optimize the allocation of test resources, improve test efficiency, and reduce costs and cycles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988240B_ABST
    Figure CN119988240B_ABST
Patent Text Reader

Abstract

The present invention discloses a test risk identification method and system based on artificial intelligence, which specifically relates to the field of data processing technology. By introducing an adaptive learning rate and feedback mechanism, an improved test risk identification method is provided to address the data imbalance problem existing in the testing process of existing machine learning models. By comprehensively collecting test data, including test case execution results and test environment status, dependency anomalies between code modules and high-frequency values of network delay are extracted, a data prediction model is constructed, and the deviation of the prediction result is comprehensively calculated based on these data. By dynamically adjusting the model's bias towards successful use cases, the ability to identify failed use cases and high-risk areas is enhanced, effectively avoiding high-risk areas from being underestimated or normal use cases from being misjudged as high-risk, thereby improving prediction accuracy, optimizing the configuration of test resources, reducing invalid test reviews, significantly improving test efficiency, and reducing costs and cycles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a test risk identification method and system based on artificial intelligence. Background Art

[0002] AI-based test risk identification refers to the use of AI technologies, particularly machine learning and data analysis algorithms, to automatically identify potential risks during software testing. These risks may include incomplete test coverage, unstable test environments, and potentially overlooked defects. Specifically, AI-based test risk identification systems typically rely on big data analysis, pattern recognition, and predictive models to monitor and evaluate the testing process in real time. AI models can automatically identify which test cases may be at high risk of failure and which areas may be overlooked due to insufficient resources or limited testing time, thereby providing decision support to the testing team. This not only effectively saves time and resources, but also prevents software defects and quality issues at an earlier stage.

[0003] The existing technology has the following shortcomings:

[0004] Existing technologies use machine learning algorithms (such as decision trees, support vector machines, and deep learning) to train data and identify common failure patterns and potential high-risk areas during testing. However, in test data, the number of test cases that execute normally far outweighs the number of test cases that fail. This data imbalance causes machine learning models to favor successful test cases while overlooking the minority of failed test cases. This bias can lead to underestimation of high-risk test areas, thus missing critical defects. Furthermore, because machine learning models are overly biased towards predicting successful test cases, they may also incorrectly predict failures for some successful test cases. As a result, previously normal test cases are mistakenly classified as high-risk, wasting testing resources and time on unnecessary test reviews. Such misjudgments can lead to inefficiencies in the entire testing process, increasing testing costs and cycle time. Summary of the Invention

[0005] The purpose of the present invention is to provide a test risk identification method and system based on artificial intelligence to address the shortcomings of the background technology.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a test risk identification method based on artificial intelligence, comprising:

[0007] Collect comprehensive test data, including test case execution results and test environment status;

[0008] Extract dependency anomalies between code modules from test case execution results, and extract high-frequency network latency values from test environment status;

[0009] Build a data prediction model, input the dependency outliers and high-frequency network latency values into the data prediction model for comprehensive calculation, and judge whether there is a deviation in the prediction result of the machine learning model according to the calculation result;

[0010] When there is a prediction deviation, for the failed test cases and high-risk test areas, by introducing an adaptive learning rate and a feedback mechanism, gradually reduce the bias of the machine learning model towards the successful test cases, improve the sensitivity to the failed test cases, and feedback the adjusted prediction result to the test team.

[0011] Preferably, extract the dependency outliers between code modules from the execution results of test cases, and extract the high-frequency network latency values from the test environment status, including:

[0012] Use a directed graph to represent the code modules and their dependencies. The nodes represent the code modules, and the edges represent the dependencies between the modules. Calculate the current shortest distance from the source node Vi to the node u and mark it as dist[u]. Let S represent the set of nodes that have been processed, indicating that the shortest paths from the source node Vi to these nodes have been found. Let Q represent the set of unprocessed nodes, indicating the set of nodes closest to the source node. Set the weight of the edge eij as w(eij), representing the dependency strength from Vi to Vj. Set the shortest distance of each node dist[Vi]=0, indicating that the distance of the source node is 0. For the node Vj, initialize dist[Vj]=∞. Initialize S and Q. Select a node u with the shortest distance in Q, move the node u to the processed set S, and remove u from Q. For all adjacent nodes v of the node u, check whether there is a shorter path: If dist[u]+w(euv)<dist[v], then update dist[v]=dist[u]+w(euv), where w(euv) is the weight of the edge euv, representing the dependency strength between the code modules Vu and Vv. Set the dependency strength calculation formula: ; where: represents the number of function calls between modules, represents the code coupling degree, reflects the data interaction frequency, c, β, γ are weight coefficients. Update the shortest path of v until there are no nodes in Q. After calculating the shortest path of each module through the Dijkstra algorithm, calculate the dependency outliers, and the expression is: ; In the formula, AWD is the dependency outlier, which is the shortest path from Vi to Vj, mean(dist) is the average value of the shortest paths between all modules, and std(dist) is the standard deviation of the shortest paths between all modules.

[0013] Preferably, the high-frequency value of network delay is extracted from the test environment state. The method for obtaining the high-frequency value of network delay is: collecting network delay data over a period of time, converting the time domain signal of network delay to the frequency domain through fast Fourier transform, and obtaining the amplitude spectrum by calculating the complex amplitude of the Fourier transform: Where: A(k) is the amplitude of the kth frequency component, Re(F(k)) and Im(F(k)) represent the real and imaginary parts of the Fourier transform result, respectively. A frequency threshold is set, and components with frequencies greater than the threshold are regarded as high-frequency components. The calculation expression for extracting the amplitude of all high-frequency parts is: ; It is the sum of the amplitudes of all high-frequency components. The calculated sum of the amplitudes of all high-frequency components is used as the high-frequency value of the network delay.

[0014] Preferably, a data prediction model is constructed, and the dependency outliers and the high-frequency values of network delay are input into the data prediction model for comprehensive calculation. Specifically, the dependency outliers and the high-frequency values of network delay are normalized so that they are both between [0,1], and the prediction result deviation index of the machine learning model is calculated based on the normalized dependency outliers and the high-frequency values of network delay.

[0015] Preferably, the obtained prediction result deviation index of the machine learning model is compared with a pre-set standard threshold. If the prediction result deviation index of the machine learning model is greater than or equal to the pre-set standard threshold, it means that the prediction result of the machine learning model is deviated, and a warning signal is generated at this time; if the prediction result deviation index of the machine learning model is less than the pre-set standard threshold, it means that the prediction result of the machine learning model is not deviated, and no warning signal is generated at this time.

[0016] Preferably, when there is a deviation in the prediction result, the weight of the machine learning model is adjusted by introducing an adaptive learning rate and feedback mechanism, specifically:

[0017] Set the learning rate of the current model to η, the strength of the feedback signal to F, the prediction result deviation index to PDI, and update the learning rate. The expression is: ;in: is the updated learning rate, is the current learning rate, γ is the adjustment coefficient of the feedback mechanism, which controls the amplitude of the learning rate change, and F is the strength of the feedback signal;

[0018] Dynamically adjust the weights in the training data based on the feedback signal, reduce the weight of successful use cases, set the current model's prediction weight for each use case to , where represents the weight of use case i, and the feedback signal of the deviation is F. Adjust the weight of each use case: ;in: is the updated weight of use case i, and v is the adjustment coefficient, which determines the impact of deviation feedback on weight adjustment.

[0019] The present invention also provides a test risk identification system based on artificial intelligence, including a data acquisition module, a data extraction module, a data prediction module and a test adjustment module;

[0020] Data acquisition module: collects comprehensive test data, including test case execution results and test environment status;

[0021] Data extraction module: extracts abnormal values of dependencies between code modules from the test case execution results, and extracts high-frequency values of network delay from the test environment status;

[0022] Data prediction module: Builds a data prediction model, inputs dependency anomalies and high-frequency network delay values into the data prediction model for comprehensive calculation, and uses the calculation results to determine whether the prediction results of the machine learning model are biased;

[0023] Test Adjustment Module: When prediction deviation occurs, for failed cases and high-risk test areas, by introducing adaptive learning rate and feedback mechanism, the machine learning model gradually reduces the bias towards successful cases, increases sensitivity to failed cases, and feeds back the adjusted prediction results to the testing team.

[0024] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0025] 1. By collecting comprehensive test data, extracting outliers in dependencies between code modules and high-frequency values of network latency, and inputting these into a data prediction model for comprehensive calculation, this invention accurately assesses whether there are biases in the prediction results of machine learning models. When biases are detected, an adaptive learning rate and feedback mechanism are used to adjust the model's bias toward successful cases and enhance the model's sensitivity to failed cases, thereby reducing the likelihood of high-risk areas being overlooked, improving testing efficiency, and reducing testing costs.

[0026] 2. By dynamically adjusting the model's learning process and optimizing test resource allocation, this invention avoids the misclassification of normal use cases as high-risk during testing, reducing ineffective reviews and wasted resources. Furthermore, the optimized prediction results can provide more accurate decision support for the testing team, making testing more efficient and accurate, significantly improving the quality of software testing, shortening the testing cycle, and reducing overall testing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0028] Figure 1 Flow chart of the method of the present invention.

[0029] Figure 2 It is a system module diagram of the present invention. DETAILED DESCRIPTION

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0031] Example 1, please refer to Figure 1 As shown, the test risk identification method based on artificial intelligence described in this embodiment includes:

[0032] Collect comprehensive test data, including test case execution results and test environment status;

[0033] Extract dependency anomalies between code modules from test case execution results, and extract high-frequency network latency values from test environment status;

[0034] Build a data prediction model, input dependency anomalies and high-frequency network delay values into the data prediction model for comprehensive calculation, and use the calculation results to determine whether the prediction results of the machine learning model are biased;

[0035] When prediction deviation occurs, for failed cases and high-risk test areas, by introducing adaptive learning rate and feedback mechanism, the machine learning model's bias towards successful cases is gradually reduced, the sensitivity to failed cases is increased, and the adjusted prediction results are fed back to the testing team.

[0036] Collecting comprehensive test data is a key step in achieving AI-based test risk identification. This process involves collecting and organizing all test-related data, ensuring the comprehensiveness and multidimensionality of the data, thereby providing a sufficient information foundation for subsequent analysis and prediction. Specifically, the collected data can be divided into the following two categories:

[0037] Test case execution result data: Test case status: Records the execution results of each test case, including whether it passed, failed, and the reason for failure. For example, for functional test cases, this might include "Functionality normal" or "Functionality abnormal"; for performance tests, this might include "Passed performance benchmark" or "Failed to meet the standard." Execution time and duration: Records the execution timestamp and duration of each test case. By analyzing this data, you can determine whether certain test cases failed to complete as expected due to excessive resource consumption or excessive execution time. Error type and error message: Detailed records of the error message, exception stack trace, error code segment, or related logs when the test case fails. Error messages provide clues to potential failure modes for subsequent analysis. Coverage data: Coverage tools are used to record which code paths or functional modules are covered by test cases and which are not. This helps identify potential testing blind spots, especially high-risk areas. Input data and expected output: Records the input conditions and expected output of the test case. When the actual output is inconsistent with the expected output, it can help analyze the cause of the problem. Retry count and repair history: If a test case fails and is retried, record the number of retries after the failure, as well as whether a repair was performed after the failure and the results of the repair. This data can be used to measure the stability of certain test cases.

[0038] Test environment status data: Hardware resource usage: Records hardware resource usage during testing, such as CPU, memory, and disk space usage. This data can help analyze whether resource bottlenecks are affecting test case execution results. Network latency and bandwidth: For network-dependent tests (such as distributed systems and cloud services), record network metrics such as latency, bandwidth, and packet loss rate during testing to assess the impact of network performance on test results. Operating system and dependent environment: Records environmental data such as the operating system version, dependent library versions, and framework versions during test execution. Different operating system or dependent library versions may lead to inconsistent test results. Environment stability data: Records events such as system crashes, restarts, and failures, which may cause test case execution failures or inaccurate results. Concurrency and load: During performance or stress testing, record data such as the number of concurrent users, request rate, and response time to evaluate system performance under different loads. External system and interface status: If a test relies on external systems or interfaces (such as databases and third-party APIs), recording the status of external systems (such as response time and service availability) can help analyze whether test failures are related to external factors.

[0039] Data collection methods and tools: Automated testing tools: Use automated testing tools (such as Selenium, JUnit, and TestNG) to record the execution status, logs, and execution time of test cases. Tools can automatically collect detailed test data and reduce human intervention. Monitoring tools: Use performance monitoring tools (such as New Relic, Prometheus, and Nagios) to collect real-time resource usage, network performance, operating system status, etc. of the test environment. Log management system: Use centralized log management tools (such as ELK Stack and Splunk) to collect detailed test environment and application logs, and extract key information from them during the test execution process. Version control system: By integrating with a version control system (such as Git), records of each code submission, change, repair, and rollback are recorded to analyze the impact of code changes on test results.

[0040] Integrate data from different sources into a unified database or data warehouse. Ensure uniform data formats, consistent timestamps, and data integrity. Multi-dimensional data requires appropriate association and classification. For example, test case execution results and corresponding test environment status data need to be associated by time or test ID to ensure that the relationship between environment status and execution results can be compared during analysis. Deduplication and cleanup: Remove redundant or duplicate test records to ensure data uniqueness and accuracy. Handle missing data through interpolation, prediction, or other supplementary methods, and use anomaly detection algorithms to identify and handle outliers to ensure data reliability.

[0041] Extract dependency anomalies between code modules from test case execution results, and extract high-frequency network latency values from the test environment status, including:

[0042] Model code modules and their dependencies as a directed graph. In this graph, nodes represent code modules. Edges represent dependencies between modules. Edge weights represent the strength of the dependency or a metric (e.g., execution time, call frequency, resource consumption, coupling between modules, etc.). In the dependency graph, calculate the shortest path from one module (node) to another. The shortest path may indicate a stronger dependency or higher resource consumption.

[0043] Calculate the current shortest distance from the source node Vi to the node u, denoted as dist[u]. Let S represent the set of nodes that have been processed, indicating that the shortest paths from the source node Vi to these nodes have been found. Let Q represent the set of unprocessed nodes, which is the set of nodes closest to the source node. Set the weight of the edge eij as w(eij), representing the strength of the dependency from Vi to Vj. Set the shortest distance of each node dist[Vi]=0, indicating that the distance of the source node is 0. For other nodes Vj, initialize dist[Vj]=∞, indicating that the distance is unknown; initialize S and Q. Select a node u with the shortest distance in Q, move the node u to the processed set S, and remove u from Q. For all adjacent nodes v of the node u, check if there is a shorter path: If dist[u]+w(euv)<dist[v], then update dist[v]=dist[u]+w(euv), where w(euv) is the weight of the edge euv, and w(euv) represents the dependency strength between the code modules Vu and Vv. The dependency strength can be measured based on the number of function calls, code coupling degree, and data interaction frequency. Set the formula for calculating the dependency strength: ; where: represents the number of function calls between modules, (e.g., calculating dependencies using static analysis) represents the code coupling degree, reflects the data interaction frequency, and c, β, γ are weight coefficients that can be adjusted according to the actual situation. This means that if the shortest path from the source node Vi to u plus the dependency weight from u to v is less than the current shortest path of v, then update the shortest path of v until there are no nodes in Q and the shortest paths of all nodes have been calculated. After calculating the shortest paths of each module using the Dijkstra algorithm, calculate the dependency outlier value, with the expression: ; In the formula, AWD is the dependency outlier value, which is the shortest path from Vi to Vj, mean(dist) is the average of the shortest paths between all modules, and std(dist) is the standard deviation of the shortest paths between all modules. AWD is used to measure the degree of abnormality of the path length of a certain module pair compared to the overall distribution, similar to the standardized Z-score. If AWD is greater than 0, it indicates that the dependency between the modules is relatively far, and there may be an abnormal dependency. If AWD is less than 0, it indicates that the dependency between the modules is too tight, which may lead to a high coupling risk.

[0044] The core of the Dijkstra algorithm is based on the greedy selection of the shortest path, that is: if the length of the shortest path from the source node Vi to the current node Vu is dist[u], and now consider passing through the edge euv from Vu to reach the adjacent node Vv. If dist[u] + w(euv) < dist[v], it means that the path to Vv through Vu is shorter than the previously recorded path. Therefore, dist[v] is updated. [[ID=~1]] [[ID=~2]]

[0045] If the outlier value of a certain dependency is relatively high, it indicates that the strength or complexity of this dependency is too large, which may be a potential risk area. When the calculated outlier value exceeds a certain threshold (for example, more than 2 standard deviations), this dependency can be marked as "abnormal". This may indicate that the coupling between modules is too complex, or there are potential errors or bottlenecks. [[ID=~4]] [[ID=~5]]

[0046] Extract the high-frequency value of network latency from the test environment status. The method for obtaining the high-frequency value of network latency is as follows: [[ID=~7]] [[ID=~8]]

[0047] Collect network latency data over a period of time. Network latency data is usually continuous and can be obtained by periodically measuring the network request response time. [[ID=~10]] [[ID=~11]]

[0048] Convert the time-domain signal of network latency to the frequency domain through the Fast Fourier Transform (FFT). The calculation formula: [[ID=~13]] ; where: F(k) is the k-th frequency component in the frequency-domain data, is the n-th data point in the time-domain data, and N is the length of the data (i.e., the number of network latency data points). k is the frequency index, representing different frequency components. [[ID=~15]] is the kernel function of the Fast Fourier Transform; by calculating the complex amplitude of the Fourier transform, the amplitude spectrum is obtained: [[ID=~17]] ; where: A(k) is the amplitude of the k-th frequency component. Re(F(k)) and Im(F(k)) respectively represent the real part and the imaginary part of the Fourier transform result. The amplitude spectrum A(k) describes the strength of each frequency component. The larger the amplitude of the frequency component, the greater the proportion of this frequency component in the signal. [[ID=~19]] [[ID=~20]]

[0049] High-frequency components are usually related to the rapid fluctuations or instabilities of network latency. In the frequency-domain signal, high-frequency components correspond to higher frequency values. To extract high-frequency components, a frequency threshold needs to be set. [[ID=~22]] , and the components with frequencies greater than this threshold are regarded as high-frequency components. The calculation expression for extracting the amplitude of all high-frequency parts is: [[ID=~24]] ; is the sum of the amplitudes of all high-frequency components, representing the total intensity of high-frequency fluctuations in the network latency signal. The sum of the amplitudes of all calculated high-frequency components is used as the high-frequency value of network latency. [[ID=~26]] [[ID=~27]]

[0050] If the high-frequency components are large, it may indicate rapid network fluctuations or instability, which may indicate network congestion, packet loss, bandwidth fluctuations, and other issues. High-frequency fluctuations may be related to certain system loads or external factors. Analyzing these high-frequency components can help identify potential performance bottlenecks or issues.

[0051] Build a data prediction model, input dependency anomalies and high-frequency network delay values into the data prediction model for comprehensive calculation, and determine whether the prediction results of the machine learning model are biased based on the calculation results. Specifically:

[0052] The dependency outliers and network delay high-frequency values are normalized so that they are both between [0, 1]. The prediction result deviation index of the machine learning model is calculated based on the normalized dependency outliers and network delay high-frequency values.

[0053] For example, the present invention can use the following formula to calculate the prediction result deviation index of the machine learning model, and the calculation expression is: Where, is the prediction result deviation index of the machine learning model, AWD is the dependency outlier, is the high-frequency value of network delay, and is the weight coefficient of the dependency outlier and the high-frequency value of network delay (which can be optimized based on experimental experience or machine learning), and all are greater than 0.

[0054] The obtained prediction result deviation index of the machine learning model is compared with the pre-set standard threshold. If the prediction result deviation index of the machine learning model is greater than or equal to the pre-set standard threshold, it means that the prediction result of the machine learning model is deviated, and a warning signal is generated at this time; if the prediction result deviation index of the machine learning model is less than the pre-set standard threshold, it means that the prediction result of the machine learning model is not deviated, and no warning signal is generated at this time.

[0055] When predictions are biased, an adaptive learning rate and feedback mechanism can be introduced to adjust the weights of the machine learning model to reduce the bias toward successful cases and increase sensitivity to failed cases and high-risk test areas. This mechanism gradually adjusts the model's parameters, enabling it to better identify potential high-risk test cases.

[0056] Adaptive learning rate is a strategy that dynamically adjusts the learning rate based on the current prediction deviation. The learning rate determines the magnitude of the adjustment to the model parameters during each update. Excessively large learning rates can lead to model instability, while too small learning rates can result in slow convergence. Adaptive learning rate allows the model's update rate to be dynamically adjusted based on the strength of the feedback signal, thereby improving the model's responsiveness to deviations.

[0057] Adaptive learning rate update formula: Set the learning rate of the current model as η, the intensity of the feedback signal as F, and the prediction result deviation index as PDI. Update the learning rate, and the expression is: ; where: is the updated learning rate, is the current learning rate. γ is the adjustment coefficient of the feedback mechanism, which controls the amplitude of the learning rate change. Usually, 0 < γ < 1. F is the intensity of the feedback signal, which reflects the degree of prediction deviation. If the deviation is large, the F value is high, and the adjustment amplitude of the learning rate increases; if the deviation is small, the F value is low, and the adjustment amplitude of the learning rate decreases.

[0058] The bias of the machine learning model may lead to over-prediction of successful cases while ignoring failed cases or high-risk areas. When there is a prediction deviation, it is necessary to gradually reduce the bias of the model towards successful cases and make it pay more attention to failed cases and high-risk areas. To achieve this goal, the weights in the training data can be dynamically adjusted according to the feedback signal to reduce the weight of successful cases. Set the prediction weight of the current model for each case as, where represents the weight of case i, and the feedback signal of the deviation is F. Adjust the weight of each case: ; where: is the updated weight of case i, v is the adjustment coefficient, which determines the influence degree of the deviation feedback on the weight adjustment. Usually, 0 < v < 1. F is the feedback signal of the deviation (such as the deviation index or other calculation results), which represents the accuracy of the prediction. If the deviation is large and F is large, the weight of the model for successful cases will be reduced, thereby reducing the bias towards successful cases.

[0059] Through the adaptive learning rate and the feedback mechanism, in addition to adjusting the learning rate and case weights, other parameters of the model can also be adjusted (for example, the depth of the decision tree, the penalty parameter of the support vector machine, etc.). Set that certain parameters of the current model are obtained in a certain way, and these parameters will be affected by the deviation feedback. The adjustment expression is: ; where: is the updated model parameter, is the parameter of the current model, L is the loss function of the model, which represents the prediction error, is the gradient of the loss function with respect to the model parameter, which represents the contribution of the current model parameter to the prediction error.

[0060] Throughout the process, the feedback mechanism will determine the adjustment amplitude of the learning rate and case weights according to the size of the deviation index PDI. When the deviation of the prediction result is large (i.e., PDI is high), the model will more strongly adjust the learning rate and case weights to reduce the bias towards successful cases, so as to better identify failed cases and high-risk areas.

[0061] Ultimately, by continuously adjusting the model's parameters and weights, the model can gradually reduce bias and increase its sensitivity to high-risk areas during repeated learning.

[0062] Adjusted predictions are promptly communicated to the testing team through a feedback mechanism, allowing them to reassess their testing strategies based on the latest predictions. Specifically, after the machine learning model adjusts based on the adaptive learning rate and feedback mechanism, the generated predictions will indicate which test cases or test areas present higher risks or potential defects. Based on these feedback signals, the testing team can prioritize high-risk areas and optimize resource allocation, avoiding wasting time and effort on lower-risk areas. This process improves testing efficiency, ensures that critical defects are discovered and addressed promptly, and ultimately enhances the quality and accuracy of overall software testing.

[0063] Example 2, please refer to Figure 2 As shown, the artificial intelligence-based test risk identification system described in this embodiment includes a data acquisition module, a data extraction module, a data prediction module and a test adjustment module;

[0064] Data acquisition module: collects comprehensive test data, including test case execution results and test environment status;

[0065] Data extraction module: extracts abnormal values of dependencies between code modules from the test case execution results, and extracts high-frequency values of network delay from the test environment status;

[0066] Data prediction module: Builds a data prediction model, inputs dependency anomalies and high-frequency network delay values into the data prediction model for comprehensive calculation, and uses the calculation results to determine whether the prediction results of the machine learning model are biased;

[0067] Test Adjustment Module: When prediction deviation occurs, for failed cases and high-risk test areas, by introducing adaptive learning rate and feedback mechanism, the machine learning model gradually reduces the bias towards successful cases, increases sensitivity to failed cases, and feeds back the adjusted prediction results to the testing team.

[0068] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.

[0069] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.

[0070] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0071] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.

Claims

1. The test risk identification method based on artificial intelligence is characterized by: include: Collect comprehensive test data, including test case execution results and test environment status; Extract dependency anomalies between code modules from test case execution results, and extract high-frequency network latency values from test environment status; Specifically, it includes: using a directed graph to represent code modules and their dependencies, with nodes representing code modules and edges representing dependencies between modules; calculating the current shortest distance from the source node Vi to the node u and marking it as dist[u]; representing S as the set of processed nodes, indicating that the shortest path from the source node Vi to these nodes has been found; representing Q as the set of unprocessed nodes, indicating the set of nodes closest to the source node; setting the weight of the edge eij to w(eij), indicating the strength of the dependency from Vi to Vj; setting the shortest distance of each node dist[Vi] = 0, indicating that the distance to the source node is 0; for node Vj, initializing dist[Vj] = ∞; initializing S and Q, selecting a node u with the shortest distance in Q, moving node u to the processed set S, and removing u from Q; for all adjacent nodes v of node u, checking whether there is a shorter path: if dist[u] + w(euv) < dist[v], then updating dist[v] = dist[u] + w(euv), w(euv) is the weight of edge euv, which represents the dependency strength between code modules Vu and Vv. The dependency strength calculation formula is set as: ;in: Indicates the number of function calls between modules, Represents code coupling, Reflects the frequency of data interaction, c, β, and γ are weight coefficients, and the shortest path of v is updated until there are no nodes in Q. After calculating the shortest path of each module through the Dijkstra algorithm, the dependency anomaly value is calculated. The expression is: ; Where AWD is the dependency outlier, is the shortest path from Vi to Vj, mean(dist) is the average of the shortest paths between all modules, and std(dist) is the standard deviation of the shortest paths between all modules; Build a data prediction model, input dependency anomalies and high-frequency network delay values into the data prediction model for comprehensive calculation, and use the calculation results to determine whether the prediction results of the machine learning model are biased; When prediction deviations occur, for failed cases and high-risk test areas, we introduce adaptive learning rates and feedback mechanisms to gradually reduce the machine learning model's bias toward successful cases and increase its sensitivity to failed cases. The adjusted prediction results are then fed back to the testing team. Specifically, it includes: setting the learning rate of the current model to η, the strength of the feedback signal to F, and updating the learning rate. The expression is: ;in: is the updated learning rate, is the current learning rate, is the adjustment coefficient of the feedback mechanism, which controls the amplitude of the learning rate change, and F is the strength of the feedback signal; Dynamically adjust the weights in the training data based on feedback signals, reducing the weights of successful use cases, represents the weight of use case i, F is the strength of the feedback signal, and the weight of each use case is adjusted: ;in: is the updated weight of use case i, and v is the adjustment coefficient, which determines the impact of deviation feedback on weight adjustment.

2. The test risk identification method based on artificial intelligence according to claim 1, characterized in that: Extract high-frequency values of network delay from the test environment status. The method for obtaining high-frequency values of network delay is as follows: collect network delay data over a period of time, convert the time domain signal of network delay to the frequency domain F(k) through fast Fourier transform, where F(k) is the kth frequency component in the frequency domain data. By calculating the complex amplitude of the Fourier transform, the amplitude spectrum is obtained: ; Where: A(k) is the amplitude of the kth frequency component, Re(F(k)) and Im(F(k)) represent the real and imaginary parts of the Fourier transform result respectively, and a frequency threshold is set , the components with frequencies greater than the threshold are regarded as high-frequency components, and the calculation expression for extracting the amplitude of all high-frequency parts is: ; It is the sum of the amplitudes of all high-frequency components. The calculated sum of the amplitudes of all high-frequency components is used as the high-frequency value of the network delay.

3. The test risk identification method based on artificial intelligence according to claim 2, characterized in that: A data prediction model is constructed, and the dependency outliers and high-frequency network delay values are input into the data prediction model for comprehensive calculation. Specifically, the dependency outliers and high-frequency network delay values are normalized so that they are both between [0, 1]. The prediction result deviation index of the machine learning model is calculated based on the normalized dependency outliers and high-frequency network delay values.

4. The test risk identification method based on artificial intelligence according to claim 3, characterized in that: Compare the obtained prediction result deviation index of the machine learning model with the pre-set standard threshold. If the prediction result deviation index of the machine learning model is greater than or equal to the pre-set standard threshold, it means that the prediction result of the machine learning model is deviated, and a warning signal is generated at this time; If the prediction result deviation index of the machine learning model is less than the pre-set standard threshold, it means that the prediction result of the machine learning model has not deviated, and no warning signal is generated.

5. An artificial intelligence-based test risk identification system, configured to implement the artificial intelligence-based test risk identification method according to any one of claims 1 to 4, characterized in that: Including data acquisition module, data extraction module, data prediction module and test adjustment module; Data acquisition module: collects comprehensive test data, including test case execution results and test environment status; Data extraction module: extracts abnormal values of dependencies between code modules from the test case execution results, and extracts high-frequency values of network delay from the test environment status; Data prediction module: Builds a data prediction model, inputs dependency anomalies and high-frequency network delay values into the data prediction model for comprehensive calculation, and uses the calculation results to determine whether the prediction results of the machine learning model are biased; Test Adjustment Module: When prediction deviation occurs, for failed cases and high-risk test areas, by introducing adaptive learning rate and feedback mechanism, the machine learning model gradually reduces the bias towards successful cases, increases sensitivity to failed cases, and feeds back the adjusted prediction results to the testing team.

Citation Information

Patent Citations

  • Automatic test platform and method adaptive to operating system environment

    CN118170685A

  • Product testing method and system based on AI large model and machine learning

    CN119377085A

  • Multi-source software supply chain intelligent analysis method and system

    CN119720225A