Test method applied to continuous integration self-test system and continuous integration self-test system

By analyzing the runtime data of abnormal test cases and dynamically adjusting the retry interval and resource allocation, the problem of invalid retries in the continuous integration self-test system was solved, improving testing efficiency and stability.

CN123138136APending Publication Date: 2026-11-20CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510645934.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing continuous integration self-testing systems, the retry mechanism for failed test cases is prone to network fluctuations, leading to invalid retries, which affects testing efficiency and wastes resources.

Method used

By analyzing the runtime data of abnormal test cases, we can determine whether the problem is due to environmental issues, dynamically adjust the retry interval, optimize resource allocation, and generate test reports to improve testing efficiency.

Benefits of technology

This effectively avoids misjudgments, saves troubleshooting time, improves retry success rate, reduces resource waste, and optimizes test stability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138136A_ABST
    Figure CN123138136A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a test method applied to a continuous integration self-test system and the continuous integration self-test system. The method comprises: a trigger module sending a trigger signal to a task scheduling module; the task scheduling module acquiring code of a software to be tested from a preconfigured code repository in response to the trigger signal, calling a build tool to perform compilation and packaging based on the code and deployment of a test environment, and sending a packaged executable software package to a test execution module; the test execution module starting software testing of each test case based on the test environment and the executable software package; an intelligent analysis module acquiring abnormal test results in the software testing of the test execution module, enabling a retry mechanism based on an abnormal test case corresponding to the abnormal test results, and providing resource allocation by a resource management module in a retry operation; and the intelligent analysis module generating a test report according to test results of each test case. The method is used to improve test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a testing method and a continuous integration self-testing system. Background Technology

[0002] Continuous integration, as a core practice in software development, significantly improves the efficiency and quality of software development by automating the build, test, and integration processes, and has become an indispensable part of ensuring the smooth progress of software projects.

[0003] In existing technologies, technicians pre-set environmental elements such as hardware resources, network environment, and software dependencies according to requirements. During the test execution process, the system completes the test task according to the set parameters and determines whether the test results pass or fail.

[0004] However, retrying failed test cases can lead to network fluctuations and further unnecessary failures, impacting testing efficiency. Summary of the Invention

[0005] This application provides a testing method and a continuous integration self-testing system for use in order to improve testing efficiency.

[0006] In a first aspect, embodiments of this application provide a testing method applied to a continuous integration self-testing system. The continuous integration self-testing system includes: a trigger module, a task scheduling module, a test execution module, an intelligent analysis module, and a resource management module. The method includes: a trigger module receiving a trigger signal generated in response to a preset operation on the software under test, and sending the trigger signal to the task scheduling module; a task scheduling module, in response to the trigger signal, retrieving the code of the software under test from a pre-configured code repository, calling a build tool to compile and package the code and deploy the test environment, and sending the compiled and packaged executable software package to the test execution module; and a test execution module, based on the test environment and the executable software package, performing tests on each test application. For example, the software testing is initiated; the intelligent analysis module obtains the abnormal test results from the software testing in the test execution module, and enables the retry mechanism based on the abnormal test cases corresponding to the abnormal test results. After a preset number of retries, if all abnormal test cases obtain abnormal test results, the runtime data of the abnormal test cases is obtained, and the runtime data is used to determine whether it is an environmental issue; if it is not an environmental issue, an error type label for the abnormal test case is generated based on the runtime data; if the intelligent analysis module determines that it is an environmental issue, the abnormal test case is placed in the retry queue, and the retry operation continues based on the retry mechanism. During the retry operation, the resource management module provides resource allocation; the intelligent analysis module generates a test report based on the test results of each test case.

[0007] In one possible implementation, obtaining runtime data of abnormal test cases and determining whether it is an environmental issue based on the runtime data includes: obtaining runtime data of abnormal test cases, wherein the runtime data includes logs and runtime parameters, and the runtime parameters include memory usage and network byte input fields; querying the logs for connection timeout fields, if a connection timeout field is found, it is determined to be a network error; if the memory usage is greater than a first threshold and the duration is greater than a second threshold, it is determined to be a resource contention error; if the network byte input field is in the first range, it is determined to be a network byte input too low error; if the network byte input field is in the second range, it is determined to be a network byte input too high error; defining network errors and resource contention errors as environmental issues.

[0008] In one possible implementation, the retry operation is continued based on the retry mechanism, including: obtaining the load of the abnormal test case on the current node and determining the load factor based on the load; obtaining the number of times the abnormal test case has been retried; calculating the retry interval based on the load factor, the number of times it has been retried and the basic transmission time; and performing a retry operation on the abnormal test case based on the retry interval.

[0009] In one possible implementation, the formula for calculating the retry interval based on the load factor, the number of retries, and the basic transmission time is as follows:

[0010]

[0011]

[0012] In the formula, Retry Interval The retry interval is indicated by ; n represents the number of retries; base_delay represents the basic transmission time; load_factor represents the load factor; and current_load represents the current node load.

[0013] In one possible implementation, after the software test is completed, the method further includes: extracting multiple-dimensional features from the code repository and runtime data; and inputting the multiple-dimensional features into a pre-trained test performance prediction model to output the probability of test failure under a preset scenario.

[0014] In one possible implementation, after the software testing is completed, the process further includes: calculating the risk value of each test case based on the test report; determining the alarm level of each test case based on the risk value of each test case; determining the notification method based on the alarm level; and sending a notification to the maintenance personnel according to the notification method.

[0015] In one possible implementation, the risk value of each test case is calculated based on the test report, including: obtaining the lifecycle stage of the software under test from the test report; obtaining the overall test failure rate, execution time variance, historical correlation, and business impact of each test case from the test report; determining a first factor for the overall test failure rate, a second factor for the execution time variance, a third factor for the historical correlation, and a fourth factor for the business impact based on the lifecycle stage; and determining the risk value of each test case based on the first factor for the overall test failure rate, the second factor for the execution time variance, the third factor for the historical correlation, and the fourth factor for the business impact.

[0016] Secondly, embodiments of this application provide a continuous integration self-testing system, including: a trigger module, a task scheduling module, a test execution module, an intelligent analysis module, and a resource management module.

[0017] The trigger module is used to receive trigger signals generated in response to preset operations on the software under test, and send the trigger signals to the task scheduling module.

[0018] The task scheduling module is used to respond to trigger signals, retrieve the code of the software under test from the pre-configured code repository, call the build tools to compile, package, and deploy the test environment based on the code, and send the compiled and packaged runnable software package to the test execution module.

[0019] The test execution module is used to start software tests for each test case based on the test environment and the executable software package.

[0020] The intelligent analysis module is used to obtain abnormal test results in the software testing of the test execution module. Based on the abnormal test results, a retry mechanism is activated for the abnormal test cases. After a preset number of retries, if all abnormal test cases obtain abnormal test results, the execution data of the abnormal test cases is obtained. The execution data is used to determine whether it is an environmental issue. If it is not an environmental issue, an error type label is generated for the abnormal test cases based on the execution data. If it is determined to be an environmental issue, the abnormal test cases are placed in the retry queue, and the retry operation continues based on the retry mechanism. A test report is generated based on the test results of each test case.

[0021] The resource management module is used to provide resource allocation for the intelligent analysis module during retry operations.

[0022] In one possible implementation, it also includes a data storage module and a notification module.

[0023] The data storage module is used to provide reference data for the intelligent analysis module and to store the output data of the intelligent analysis module.

[0024] The intelligent analysis module is used to calculate the risk value of each test case based on the test report, and determine the alarm level of each test case based on the risk value of each test case.

[0025] The notification module is used to determine the notification method based on the alarm level and send notifications to the operations and maintenance personnel according to the notification method.

[0026] In one possible implementation, the intelligent analysis module includes a retry unit, an early warning classification unit, and a test performance unit.

[0027] The retry unit includes an error classifier and a policy executor.

[0028] An error classifier is used to obtain runtime data of abnormal test cases and determine whether the problem is due to environmental issues.

[0029] The strategy executor is used to add abnormal test cases to the retry queue if the problem is caused by the environment, and continue to perform retry operations based on the retry mechanism.

[0030] The early warning classification unit includes a risk calculator and a notification route.

[0031] The risk calculator is used to calculate the risk value of each test case based on the test report.

[0032] The notification routing determines the alarm level for each test case based on its risk value.

[0033] The performance testing unit includes a feature extractor and a model service.

[0034] Feature extractors are used to extract multi-dimensional features from code repositories and runtime data.

[0035] The model service is used to input multi-dimensional features into a pre-trained test performance prediction model to output the probability of test failure in a preset scenario.

[0036] Thirdly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0037] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0038] The testing method and system provided in this application for continuous integration self-testing systems locate environmental problems such as network errors and resource contention by analyzing abnormal test case execution data, avoiding misjudgments and saving troubleshooting time. For test cases with abnormal test results caused by environmental problems, the retry interval is dynamically adjusted based on load factor, number of retries, and basic transmission time to rationally arrange retry operations, improve retry success rate, and reduce resource waste. Combined with a resource management module, resources are dynamically allocated to ensure stable test operation. Finally, a report is generated based on the test results, effectively improving the testing efficiency and reliability of the continuous integration self-testing system, optimizing resource utilization, and accelerating the software development testing cycle. Attached Figure Description

[0039] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0040] Figure 1 A flowchart illustrating a testing method applied to a continuous integration self-testing system, provided as an embodiment of this application;

[0041] Figure 2 This is a schematic diagram of the structure of the continuous integration self-testing system provided in the embodiments of this application.

[0042] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0043] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0044] To clearly understand the technical solution of this application, we will first provide a detailed introduction to the solutions of existing technologies. In today's rapidly iterating software development field, continuous integration has become a core practice paradigm. By deeply integrating automated build, testing, and integration processes into the entire software development lifecycle, continuous integration effectively shortens the development cycle, reduces integration risks, and significantly improves the overall efficiency and quality of software development. It is a key technical means to ensure the smooth delivery of software projects and maintain the stability of software systems. In the existing software development testing technology system, technical personnel usually need to pre-define a series of environmental factors such as hardware resource configuration, network environment parameters, and software dependencies according to testing requirements. During the test execution phase, the system automatically completes the test tasks based on these pre-set parameters and judges the test results as pass or fail according to preset judgment rules. This testing mode has achieved standardization and automation of the testing process to a certain extent and can meet the needs of most common testing scenarios. However, current technologies have obvious defects in handling failed test cases. Existing systems generally adopt a retry mechanism for failed test cases, that is, when a test case fails to execute for the first time, the system automatically triggers a re-execution operation. However, this retry mechanism is highly susceptible to network fluctuations during actual operation. This can cause test cases that might have initially failed due to a brief anomaly to encounter more severe network problems during retries, leading to further failures and even a vicious cycle of multiple ineffective retries. This not only wastes significant computing resources and time but also severely impacts testing efficiency, prolongs software development cycles, and increases overall project costs, making it difficult to meet the urgent needs of modern software development for efficient and stable testing processes.

[0045] To address the aforementioned technical issues, the inventors devised a retry mechanism for abnormal test results. First, a retry mechanism is enabled for abnormal test cases. After a preset number of retries is reached, the runtime data of the abnormal test cases is used to determine if it's an environmental issue. If not, an error type label is generated, allowing developers to quickly locate the problem. If it is determined to be an environmental issue, the abnormal test cases are placed in a retry queue. The retry interval is determined based on the current node load and the number of retries already performed. The retry strategy continues to be executed based on retry detection. Simultaneously, the resource management module provides resource allocation for the retry process, effectively solving the drawbacks of existing technologies where retry mechanisms cause network fluctuations and multiple invalid retries.

[0046] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0047] Figure 1This application provides a flowchart illustrating a testing method applied to a continuous integration self-testing system. The continuous integration self-testing system includes a trigger module, a task scheduling module, a test execution module, an intelligent analysis module, and a resource management module. Figure 1 As shown, the method includes:

[0048] S201: Trigger module, which receives trigger signals generated in response to preset operations on the software under test, and sends the trigger signals to the task scheduling module.

[0049] The trigger signal sources include Cron tasks, Git semaphores, API (Application Programming Interface) triggers, scripts, and other custom triggering methods.

[0050] Specifically, Cron tasks are tools used in Unix and Unix-like systems to execute tasks on a schedule. Cron tasks generate trigger signals at preset time intervals. Trigger signals are generated when developers upload code for the software under test to a Git repository or perform merge requests. Other systems or programs can send trigger signals to the trigger module by calling specific APIs. Developers can write custom scripts, setting trigger conditions and execution logic within them. When the script is executed, it sends trigger signals to the trigger module. When the trigger module captures these signals, it sends them to the task scheduling module, activating the automated testing process.

[0051] For example, other custom triggering methods include generating trigger signals based on specific environment variables.

[0052] S202: Task scheduling module. In response to a trigger signal, it retrieves the code of the software under test from a pre-configured code repository, calls the build tool to compile, package, and deploy the test environment based on the code, and sends the compiled and packaged runnable software package to the test execution module.

[0053] Specifically, after receiving the trigger signal from the trigger module, the task scheduling module establishes a stable connection with the code repository based on pre-defined configuration information. It accurately retrieves the latest code version of the software under test from the repository and then calls the appropriate build tool to compile the code according to the project's build script and dependency configuration. Next, it performs a packaging operation, integrating the compiled code and related resources into a deployable software package. Simultaneously, the task scheduling module deploys the test environment according to its requirements, including installing necessary operating systems, middleware, databases, etc., providing a stable runtime environment for subsequent testing. Finally, it sends the compiled and packaged executable software package to the test execution module.

[0054] S203: Test execution module, which starts software testing for each test case based on the test environment and executable software package.

[0055] Specifically, after receiving the runnable software package and the ready-to-use test environment from the task scheduling module, the test execution module first initiates unit testing. It uses a unit testing framework to verify the logical correctness and functional completeness of the code for the smallest testable units of the software, such as functions, classes, and modules. After completing unit testing, the test execution module enters the interface testing phase, using professional testing tools to inspect the interfaces between components, verifying the accuracy of data transmission, the compliance of parameter calls, and the correctness of interaction logic between interfaces. After completing unit and interface testing, the test execution module further executes other types of tests, including but not limited to performance testing, security testing, and compatibility testing. Simultaneously, it records key data and runtime logs during the test execution process.

[0056] S204: Intelligent analysis module, obtains abnormal test results in the software testing of the test execution module, enables the retry mechanism based on the abnormal test cases corresponding to the abnormal test results, and after a preset number of retries, if all abnormal test cases obtain abnormal test results, then obtains the running data of the abnormal test cases, and determines whether it is an environmental problem based on the running data; if it is not an environmental problem, then generates error type labels for the abnormal test cases based on the running data.

[0057] Specifically, when an abnormal test result is received from the test execution module, the intelligent analysis module activates a retry mechanism for the corresponding abnormal test case, retrying the abnormal test case multiple times. After the preset number of retries, if the abnormal test case still yields abnormal test results, the module analyzes the runtime data of the abnormal test case. This runtime data includes system logs, performance metrics, input / output data, etc., during the test case execution process. By analyzing this data, the module determines whether the abnormality is caused by environmental issues. If the analysis determines that it is not an environmental issue, the intelligent analysis module uses machine learning algorithms and a rule engine to extract features and recognize patterns in the runtime data. Based on the analysis results, it generates error type labels for the abnormal test case, such as "logic error," "data anomaly," and "interface call failure," so that developers can quickly locate and resolve the problem.

[0058] Specifically, the steps for obtaining runtime data from abnormal test cases and determining whether the issue is an environmental problem based on the runtime data include:

[0059] Sa1: Obtain the runtime data of abnormal test cases, including logs and runtime parameters, including memory usage and network byte input fields.

[0060] Specifically, the intelligent analysis module acquires runtime data from abnormal test cases, including logs and runtime parameters. Logs record information about the test execution process, and runtime parameters include memory usage and network byte input fields, providing a data foundation for subsequent determination of whether the anomaly stems from environmental issues.

[0061] Sa2: Check the logs for a connection timeout field. If a connection timeout field is found, it is considered a network error.

[0062] Specifically, after obtaining the runtime data of the abnormal test cases, the intelligent analysis module queries the logs, focusing on the presence of a "connection timeout" field. A "connection timeout" indicates that the software under test failed to successfully complete a connection operation within a specified time when attempting to establish a connection with other devices, services, or resources. This phenomenon is often closely related to the stability of the network environment and may be caused by high network latency, network interruption, or unresponsive target server. Once a "connection timeout" field is found in the logs, the intelligent analysis module determines that the current anomaly is caused by a network error.

[0063] Sa3: If memory usage exceeds the first threshold and the duration exceeds the second threshold, it is determined to be a resource contention error.

[0064] For example, the intelligent analysis module monitors the memory usage during the execution of abnormal test cases. When the memory usage exceeds 80% and lasts for more than 60 seconds, it indicates that multiple memory resources are competing for each other within the software under test, resulting in uneven allocation, and is judged as a resource contention error.

[0065] Sa4: If the network byte input field is in the first interval, it is determined to be a network byte input too low error.

[0066] For example, the intelligent analysis module divides the value range of the network byte input field according to preset rules. When the byte of this field is in the range of 0-5, it indicates that the amount of network data received by the system is lower than the normal level, which may be due to insufficient network bandwidth, congestion, or data source failure, and is judged as an error of too low network byte input.

[0067] Sa5: If the network byte input field is in the second interval, it is judged as a network byte input too high error.

[0068] For example, when the number of bytes in the network byte input field is between 95 and 100, it indicates that the system has received a large amount of network data in a short period of time, exceeding normal expectations, which may lead to a decrease in system performance. This situation may be caused by a network attack or abnormal data transmission from the data source, and is judged as a network byte input too high error.

[0069] Sa6: Defines network errors and resource contention errors as environmental problems.

[0070] Specifically, based on the analysis of the abnormal test case execution data, network errors were caused by external factors such as unstable network environment, while resource contention errors were related to system resource allocation and usage. Both were defined as environmental issues.

[0071] S205: Intelligent analysis module. If the problem is determined to be an environmental issue, the abnormal test cases are placed in the retry queue and the retry operation continues based on the retry mechanism. During the retry operation, the resource management module provides resource allocation.

[0072] Specifically, when the intelligent analysis module determines that an abnormal test case is caused by an environmental issue, it places the abnormal test case in a retry queue so that it can be tested again after the environmental conditions are optimized. Based on a pre-set retry mechanism, the intelligent analysis module will schedule the abnormal test case to be executed again at certain time intervals and a certain number of retries. During the retry operation, the resource management module will dynamically allocate system resources according to the characteristics and requirements of the abnormal test case. For example, if the test case requires a large amount of computing resources, the resource management module will prioritize the allocation of CPU and memory resources; if network communication is involved, it will optimize network bandwidth and connection configuration.

[0073] Specifically, the process of continuing to perform retry operations based on the retry mechanism includes:

[0074] Sb1: Obtain the load of the abnormal test case on the current node and determine the load factor based on the load.

[0075] Specifically, when retrying abnormal test cases based on the retry mechanism, the load of the current node where the abnormal test case is located is obtained. The load of the current node can be indicators such as CPU utilization, memory usage, and network bandwidth usage. By quantifying and analyzing these load indicators, the load factor is determined according to a preset algorithm.

[0076] Specifically, the preset algorithm formula is as follows:

[0077]

[0078] In the formula, load_factor represents the load factor; current_load represents the load of the current node.

[0079] Sb2: Get the number of retries for the abnormal test case.

[0080] Sb3: Calculate the retry interval based on the load factor, the number of retries, and the basic transmission time.

[0081] Specifically, the formula for calculating the retry interval based on the load factor, the number of retries, and the basic transmission time is as follows:

[0082]

[0083] In the formula, Retry Interval This indicates the retry interval; n represents the number of retries; and base_delay represents the base transmission time. The base transmission time represents the time required to complete one test case execution.

[0084] Sb4: Performs retry operations on abnormal test cases based on the retry interval.

[0085] After calculating the retry interval, the system will retry abnormal test cases according to this interval. After each retry, the system will reassess the load, update the number of retries, and recalculate the retry interval.

[0086] S206: Intelligent analysis module, which generates test reports based on the test results of each test case.

[0087] Specifically, after analyzing and processing the test results, the intelligent analysis module generates a test report by synthesizing the detailed test results of each test case. The module performs statistical analysis on the execution of test cases, including the total number of executed test cases, the number of passed test cases, the number of failed test cases, and the number of unexecuted test cases, and calculates corresponding key indicators such as pass rate and failure rate. For failed test cases, it records detailed information such as error type, error message, frequency of occurrence, corresponding test case number, and execution environment, providing developers with clear problem localization and analysis clues.

[0088] Through the above embodiments, the average time for executing continuous integration tasks in this application is 30 minutes, which is 37.5% higher than the traditional method of about 48 minutes. The average detection time for critical issues is about 7 minutes, which is 91.1% higher than the traditional method of 79 minutes. The false alarm rate for environmental issues is 12%, which is 68% higher than the traditional method of 38%.

[0089] In summary, analyzing abnormal test case execution data helps pinpoint environmental issues such as network errors and resource contention, avoiding misjudgments and saving troubleshooting time. For test cases where environmental issues lead to abnormal test results, the retry interval is dynamically adjusted based on load factor, number of retries, and basic transmission time, rationally scheduling retry operations to improve retry success rate and reduce resource waste. Combined with the resource management module, resources are dynamically allocated to ensure stable test operation. Finally, reports are generated based on test results, effectively improving the testing efficiency and reliability of the continuous integration self-testing system, optimizing resource utilization, and accelerating the software development testing cycle.

[0090] In another embodiment provided in this application, a pre-trained test performance prediction model is used to predict the probability of test failure over a period of time after the software test is completed. The method includes:

[0091] S301: Extract multiple dimensional features from code repositories and runtime data.

[0092] Specifically, features of code changes are extracted from the code repository, including complexity increments and the number of new method calls. Historical test feature data is extracted from runtime data, including the variance of execution time and failure modes of the past 10 executions, as well as environmental state feature data, such as average processor / memory values ​​and network inflow / outflow rates.

[0093] S302: Input multiple dimensional features into a pre-trained test performance prediction model to output the probability of test failure under a preset scenario.

[0094] Specifically, these features are input into a pre-trained test performance prediction model, which then analyzes and calculates based on previously learned knowledge to output the probability of test failure in a preset scenario.

[0095] By backtesting multiple historical continuous integration tests, test failures caused by increased parameters due to code increment changes can be predicted 30 minutes in advance with an accuracy of over 80%. Test failures caused by a surge in network latency parameters in the environmental health index can also be predicted with an accuracy of over 90%.

[0096] In summary, by extracting multi-dimensional features from code repositories and runtime data, and inputting them into a pre-trained test performance prediction model, the model can output the probability of test failure under preset scenarios, enabling early risk warnings and helping testers and developers to identify potential risks and optimize them in a timely manner before release.

[0097] In another embodiment provided in this application, after the software test is completed, an alarm notification is also included, the method comprising:

[0098] S401: Calculate the risk value of each test case based on the test report.

[0099] Specifically, the methods for calculating the risk value include:

[0100] Sc1: Obtain the lifecycle stage of the software under test from the test report.

[0101] The lifecycle stage of the software under test reflects the different processes the software is currently in, such as development, testing, deployment, or maintenance. The characteristics, stability, and risks faced by the software differ at different lifecycle stages.

[0102] Sc2: Obtain the overall test failure rate, execution time variance, historical correlation, and business impact of each test case from the test report.

[0103] Among them, the overall test failure rate represents the proportion of test cases that fail in multiple tests; the execution time variance represents the fluctuation of the execution time of test cases; the historical correlation represents the degree of correlation between the test case and test cases that have had problems in the past; and the business impact represents the degree of impact of test case failure on the software's business functions.

[0104] Sc3: Based on the lifecycle stage, determine the first factor of the overall test failure rate, the second factor of the execution time variance, the third factor of historical correlation, and the fourth factor of business impact.

[0105] Specifically, Table 1 shows the influencing factors corresponding to different life cycle stages provided in the embodiments of this application, where α represents the first factor, β represents the second factor, γ represents the third factor, and δ represents the fourth factor.

[0106] Table 1: Influencing factors corresponding to different life cycle stages

[0107]

[0108] Sc4: Determine the risk value of each test case based on the first factor of the overall test failure rate, the second factor of the execution time variance, the third factor of the historical correlation, and the fourth factor of the business impact.

[0109] Specifically, after determining the factors for each indicator, the overall test failure rate, execution time variance, historical correlation, and business impact are multiplied by the corresponding factors, and then the risk value of each test case is obtained by weighted summation.

[0110] S402: Determine the alarm level for each test case based on its risk value.

[0111] Specifically, after obtaining the risk value of each test case, in order to facilitate the differentiation and processing of test cases with different risk levels, it is necessary to classify different alarm levels according to the magnitude of the risk value.

[0112] S403: Determine the notification method based on the alarm level, and send a notification to the operations and maintenance personnel according to the notification method.

[0113] Specifically, for test cases with high alarm levels, real-time notification methods such as SMS and telephone may be necessary to ensure that operations and maintenance personnel are informed and can handle the situation promptly. For test cases with medium to low alarm levels, relatively mild notification methods such as email can be used. By selecting an appropriate notification method based on the alarm level, sending notifications to operations and maintenance personnel, and setting response time limits, it is ensured that operations and maintenance personnel are promptly informed of any risks that arise during software testing.

[0114] For example, Table 2 shows the triggering conditions, notification methods, and response time limits corresponding to the alarm levels provided in the embodiments of this application.

[0115] Table 2: Triggering conditions, notification methods, and response time limits for alarm levels

[0116]

[0117] In summary, by calculating the risk value of each test case based on the test report, firstly, the software lifecycle stage is obtained; then, indicators such as overall test failure rate, execution time variance, historical correlation, and business impact are collected; and finally, the risk value is accurately calculated by determining the factors of each indicator based on the lifecycle stage. Next, the alarm level is determined based on the risk value, and finally, an appropriate notification method is selected to inform the operations and maintenance personnel according to the alarm level. This achieves hierarchical management of test case risks, enabling rapid identification of high-risk test cases, timely implementation of countermeasures, and effective reduction of software operational risks.

[0118] Figure 2 This is a schematic diagram of the structure of the continuous integration self-testing system provided in an embodiment of this application. Figure 2 As shown, the system includes: a trigger module, a task scheduling module, a test execution module, an intelligent analysis module, and a resource management module.

[0119] The trigger module is used to receive trigger signals generated in response to preset operations on the software under test, and send the trigger signals to the task scheduling module.

[0120] The task scheduling module is used to respond to trigger signals, retrieve the code of the software under test from the pre-configured code repository, call the build tools to compile, package, and deploy the test environment based on the code, and send the compiled and packaged runnable software package to the test execution module.

[0121] The test execution module is used to start software tests for each test case based on the test environment and the executable software package.

[0122] The intelligent analysis module is used to obtain abnormal test results in the software testing of the test execution module. Based on the abnormal test results, a retry mechanism is activated for the abnormal test cases. After a preset number of retries, if all abnormal test cases obtain abnormal test results, the execution data of the abnormal test cases is obtained. The execution data is used to determine whether it is an environmental issue. If it is not an environmental issue, an error type label is generated for the abnormal test cases based on the execution data. If it is determined to be an environmental issue, the abnormal test cases are placed in the retry queue, and the retry operation continues based on the retry mechanism. A test report is generated based on the test results of each test case.

[0123] The resource management module is used to provide resource allocation for the intelligent analysis module during retry operations.

[0124] Continue to refer to Figure 2 The system also includes a data storage module and a notification module.

[0125] The data storage module is used to provide reference data for the intelligent analysis module and to store the output data of the intelligent analysis module.

[0126] The intelligent analysis module is used to calculate the risk value of each test case based on the test report, and determine the alarm level of each test case based on the risk value of each test case.

[0127] The notification module is used to determine the notification method based on the alarm level and send notifications to the operations and maintenance personnel according to the notification method.

[0128] Continue to refer to Figure 2 The intelligent analysis module includes a retry unit, an early warning classification unit, and a test performance unit.

[0129] The retry unit includes an error classifier and a policy executor.

[0130] An error classifier is used to obtain runtime data of abnormal test cases and determine whether the problem is due to environmental issues.

[0131] The strategy executor is used to add abnormal test cases to the retry queue if the problem is caused by the environment, and continue to perform retry operations based on the retry mechanism.

[0132] The early warning classification unit includes a risk calculator and a notification route.

[0133] The risk calculator is used to calculate the risk value of each test case based on the test report.

[0134] The notification routing determines the alarm level for each test case based on its risk value.

[0135] The performance testing unit includes a feature extractor and a model service.

[0136] Feature extractors are used to extract multi-dimensional features from code repositories and runtime data.

[0137] The model service is used to input multi-dimensional features into a pre-trained test performance prediction model to output the probability of test failure in a preset scenario.

[0138] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0139] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0140] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0141] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0142] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0144] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0145] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0146] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0147] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A testing method applied to a continuous integration self-test system, characterized in that, The continuous integration self-testing system includes: a trigger module, a task scheduling module, a test execution module, an intelligent analysis module, and a resource management module; The method includes: The trigger module receives a trigger signal generated in response to a preset operation on the software under test, and sends the trigger signal to the task scheduling module. The task scheduling module, in response to the trigger signal, retrieves the code of the software under test from the pre-configured code repository, calls the build tool to perform compilation, packaging, and deployment of the test environment based on the code, and sends the compiled and packaged runnable software package to the test execution module; The test execution module initiates software testing for each test case based on the test environment and the runnable software package. The intelligent analysis module obtains abnormal test results in the software testing of the test execution module, enables a retry mechanism based on the abnormal test cases corresponding to the abnormal test results, and after a preset number of retries, if all abnormal test cases obtain abnormal test results, then the running data of the abnormal test cases is obtained, and it is determined whether the problem is an environmental issue based on the running data; if it is not an environmental issue, then an error type label for the abnormal test cases is generated based on the running data. If the intelligent analysis module determines that the problem is an environmental issue, it will place the abnormal test case into a retry queue and continue to perform the retry operation based on the retry mechanism. In the retry operation, the resource management module provides resource allocation. The intelligent analysis module generates a test report based on the test results of each test case.

2. The method according to claim 1, characterized in that, The step of obtaining the runtime data of the abnormal test cases and determining whether it is an environmental issue based on the runtime data includes: Obtain the runtime data of the abnormal test case, wherein the runtime data includes logs and runtime parameters, and the runtime parameters include memory usage and network byte input fields; The log is checked to see if it contains a connection timeout field. If a connection timeout field is found, it is determined to be a network error. If the memory usage rate is greater than the first threshold and the duration is greater than the second threshold, it is determined to be a resource contention error. If the network byte input field is in the first interval, it is determined to be a network byte input too low error; If the network byte input field is in the second interval, it is determined to be a network byte input too high error; The network error and the resource contention error are defined as the environmental problem.

3. The method according to claim 1, characterized in that, The retry operation based on the retry mechanism includes: Obtain the load of the abnormal test case on the current node, and determine the load factor based on the load; Obtain the number of retries for the abnormal test case; Calculate the retry interval based on the load factor, the number of retries, and the basic transmission time; Retry operations are performed on the abnormal test cases based on the retry interval.

4. The method according to claim 3, characterized in that, The formula for calculating the retry interval based on the load factor, the number of retries, and the basic transmission time is as follows: In the formula, Retry Interval The retry interval is represented by ; n represents the number of retries; base_delay represents the basic transmission time; load_factor represents the load factor; and current_load represents the current node load.

5. The method according to claim 1, characterized in that, After the software testing is completed, the following also includes: Extract multiple dimensional features from the code repository and the runtime data; The multiple dimensional features are input into a pre-trained test performance prediction model to output the probability of test failure under a preset scenario.

6. The method according to claim 1, characterized in that, After the software testing is completed, the following also includes: Calculate the risk value of each test case based on the test report; Based on the risk value of each test case, determine the alarm level of each test case; Based on the alarm level, determine the notification method and send a notification to the operations and maintenance personnel according to the notification method.

7. The method according to claim 6, characterized in that, The calculation of the risk value of each test case based on the test report includes: Obtain the lifecycle stage of the software under test from the test report; The overall test failure rate, execution time variance, historical correlation, and business impact of each test case are obtained from the test report. Based on the lifecycle stage, determine the first factor of the comprehensive test failure rate, the second factor of the execution time variance, the third factor of the historical correlation, and the fourth factor of the business impact. The risk value of each test case is determined based on the first factor of the overall test failure rate, the second factor of the execution time variance, the third factor of the historical correlation, and the fourth factor of the business impact.

8. A continuous integration self-testing system, characterized in that, include: Trigger module, task scheduling module, test execution module, intelligent analysis module, and resource management module; The trigger module is used to receive a trigger signal generated in response to a preset operation on the software under test, and to send the trigger signal to the task scheduling module. The task scheduling module is used to respond to the trigger signal, obtain the code of the software under test from the pre-configured code repository, call the build tool to perform compilation, packaging and deployment of the test environment based on the code, and send the compiled and packaged runnable software package to the test execution module; The test execution module is used to start software testing for each test case based on the test environment and the runnable software package; The intelligent analysis module is used to obtain abnormal test results in the software testing of the test execution module, enable a retry mechanism based on the abnormal test cases corresponding to the abnormal test results, and after a preset number of retries, if all abnormal test cases obtain abnormal test results, then obtain the running data of the abnormal test cases, and determine whether it is an environmental problem based on the running data. If it is not an environmental issue, then generate error type labels for the abnormal test cases based on the runtime data; If the problem is determined to be an environmental issue, the abnormal test case is placed in the retry queue, and the retry operation continues to be performed based on the retry mechanism. A test report is then generated based on the test results of each test case. The resource management module is used to provide resource allocation for the intelligent analysis module during the retry operation.

9. The system according to claim 8, characterized in that, Also includes: Data storage module and notification module; The data storage module is used to provide reference data for the intelligent analysis module and to store the output data of the intelligent analysis module. The intelligent analysis module is used to calculate the risk value of each test case based on the test report, and determine the alarm level of each test case based on the risk value of each test case. The notification module is used to determine the notification method based on the alarm level, and send a notification to the operation and maintenance personnel according to the notification method.

10. The system according to claim 8, characterized in that, The intelligent analysis module includes a retry unit, an early warning classification unit, and a test performance unit; The retry unit includes an error classifier and a policy executor; The error classifier is used to obtain the runtime data of the abnormal test cases and determine whether it is an environmental problem based on the runtime data. The policy executor is configured to, if the problem is environmental, place the abnormal test case into a retry queue and continue to perform retry operations based on the retry mechanism. The early warning classification unit includes a risk calculator and a notification route; The risk calculator is used to calculate the risk value of each test case based on the test report; The notification routing determines the alarm level of each test case based on the risk value of each test case; The test performance unit includes a feature extractor and a model service; The feature extractor is used to extract multi-dimensional features from the code repository and the runtime data; The model service is used to input the multiple dimensional features into a pre-trained test performance prediction model to output the probability of test failure under a preset scenario.