Machine Learning Models for Intelligent Test Case Selection
摘要
Regression testing is running test cases after every code change, ensuring that there are no intended breaks in the changes. This study explores the application of machine learning for intelligent test case selection, aiming to reduce testing effort while maintaining test effectiveness. Using a dataset of test case features extracted from commits within the Apache Commons Collections project, we investigated the performance of four classification models: Logistic Regression, Random Forest, Support Vector Classifier (SVC), and Gradient Boosting. Test case selection labels were generated using Ekstazi, a regression test selection technique, to indicate whether a test case would be selected or not. The models were trained and evaluated using a group-based split strategy based on commit hashes to ensure realistic performance estimates that match what is expected in production. Evaluation metrics included accuracy, precision, recall, F1 score, AUC-ROC, and Regression Test Selection (RTS) metrics like safety violation, precision violation, and test suite reduction. The results indicate that Gradient Boosting achieved a favorable balance between test suite reduction and risk mitigation, offering a promising approach for automated test case selection within the context of regression testing. This work highlights the potential of machine learning to replicate and potentially outperform established techniques such as Ekstazi to optimize software testing processes and improve overall development efficiency.