Predicting Code Coverage in DevOps Pipelines Using Machine Learning Regression Models
Abstract
The increasing adoption of DevOps practices has accelerated software delivery cycles, creating a growing demand for intelligent testing strategies that maintain software quality without delaying continuous integration and continuous deployment (CI/CD) pipelines. Code coverage remains one of the most widely used indicators for evaluating software testing effectiveness; however, conventional coverage analysis is typically performed after test execution, limiting its usefulness for proactive decision-making during software development. Predicting code coverage before extensive testing can enable development teams to optimize testing resources, prioritize critical software components, and improve overall pipeline efficiency. This study proposes a machine learning-based regression framework for predicting code coverage using commonly available software testing metrics, including the number of test cases, execution time, and code complexity. Two ensemble learning algorithms, Hist Gradient Boosting Regression (HGBR) and Extreme Gradient Boosting Regression (XGBR), are developed and evaluated using a dataset consisting of 200 software testing instances. The predictive models are assessed using multiple evaluation metrics, including the coefficient of determination (R²), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Explained Variance Score (EVS), Maximum Error, Mean Squared Logarithmic Error (MSLE), and Median Absolute Error (MedAE). Experimental results demonstrate that both models achieve high predictive accuracy, while HGBR exhibits superior generalization performance on unseen test data with an R² value of 0.955, outperforming XGBR in terms of prediction stability and lower error metrics. The findings further indicate that execution time, code complexity, and test case count collectively provide meaningful predictive information for estimating software code coverage. The proposed framework offers a practical decisionsupport mechanism that can be integrated into modern DevOps environments to assist software engineers in optimizing testing strategies, improving resource allocation, and enhancing continuous software quality assurance. The study also discusses the practical implications, current limitations, and future research opportunities for integrating machine learning-driven predictive analytics into intelligent DevOps pipelines. Keywords: code coverage prediction; DevOps; CI/CD pipelines; machine learning regression; ensemble learning; Hist Gradient Boosting; XGBoost; software testing analytics; software quality assurance