Test Case Prioritization: Towards High-Reliability Continuous Integration

Nov 4, 2021 | Blog, Israel

In August 2021, a team of graduate students from Reichman University, a leading research university in Israel, started working on the TCP project under the guidance of senior engineers from Red Hat. In a nutshell, the goal of the TCP project is to create a novel ML-based tool that solves the TCP (Test Case Prioritization) problem in software regression testing. 

As the size of software increases, testing requires more time and resources

Automatic regression testing is a crucial step of any CI/CD pipeline. Its primary goal is to detect bugs and defects introduced by recent changes as early as possible while keeping verification costs at a very low level. An ability to perform regression testing efficiently and effectively (i.e., within a small timeframe yet catching the majority of the bugs) would allow developers to rapidly deliver reliable software updates to the users.

Unfortunately, the regression testing process in modern large-scale software products tends to be much more complex and cumbersome than desired. As the size of the software increases, the test suite also grows bigger and requires more time and resources to be fully executed. In many cases, the time to run the entire test suite can reach 3-4 days or even a week. Consequently, executing all available tests during the CI/CD regression testing procedure is highly impractical and, in many cases, completely infeasible.

A new approach to software testing

To address this issue, test case prioritization (TCP) methods have emerged. Test case prioritization aims to order a given set of test cases such that, the earlier a test appears in the resulting order, the higher is the probability for this test to detect a bug or a fault introduced by the given code change. Provided such an ordering on the entire test suite, the regression testing procedure can iterate over it starting from the beginning and advancing until a predefined limit on the maximal testing time (say, 1 minute) is reached. As the most significant test cases are executed first, the chances of early fault detection rise while still only executing a negligible part (say, 1%) of the entire test suite.

In recent years, TCP solutions have been adopted by major industry players and have spawned a wave of academic research projects. However, the full potential of TCP in regression testing is yet to be explored. As of now, the most widely used approaches are mainly based on heuristic search strategies and/or code coverage methods. In contrast, methods based on machine learning in general and deep learning in particular are barely explored. Closing this gap and devising a ML-based TCP tool is the primary goal of our project.

Preliminary results

As of October 2021, the project team has reached its first major milestone: implementing an open-source proof-of-concept prototype that replicates the state-of-the-art academic results in this area. A large dataset of OpenShift test case execution statistics (successes and failures of tests on a variety of project versions) has been collected, an array of useful high-level features has been extracted, and a learning model based on XGBoost has been trained. The uncalibrated model has reached highly promising results, namely an accuracy of up to 0.95 and a recall of up to 0.98.

As an immediate next step, the team will be looking to improve the state-of-the-art. To that end, a variety of machine learning and data mining methods will be considered.

Those interested in finding out more about the TCP project and/or looking for collaboration opportunities are kindly invited to contact Dr. Ilya Kolchinsky (ikolchin@redhat.com) or Gil Klein (gklein@redhat.com).

Related Stories

Encouraging mentees to thrive: How to be a good mentor

Encouraging mentees to thrive: How to be a good mentor

An internship is a great opportunity for a company to evaluate candidates in a time-limited job role, but it is also a chance for interns to learn, gain work experience, and evaluate that company as a potential future employer; this is an equally important part of the position.

Beyond – The 3rd round for the Open Source academy course

Beyond – The 3rd round for the Open Source academy course

During the summer semester of 2020, Red Hat’s Beyond platform offered a class on open source development in conjunction with Efi Arazi School of Computer Science at the Interdisciplinary Center (IDC) of Herzliya, Israel’s only private university.

Bringing technical concepts to life through digital illustration

Bringing technical concepts to life through digital illustration

Red Hat Research Days 2020 was an experiment in recreating face to face interaction between researchers, Red Hat engineers, customers and partners in the virtual space. The goal; moving research into open source communities. And the event was immensely successful --...

Open Source at the Turing

Open Source at the Turing

In July last year, Red Hat visited the Turing Institute to deliver a two-day workshop on Open Source and why it's a great choice for academic software. The majority of the schedule was available to members of Turing Institute, however the first day was closed with a...

Jonathan Cameron: Getting Started on Linux Kernel

Jonathan Cameron: Getting Started on Linux Kernel

Jonathan Cameron is a rising senior at Boston University studying Computer Engineering. He spoke with the Red Hat Research (RHR) team about his internship project and why this project is important for future interns working on the Linux kernel.  RHR: Jonathan,...

Where there’s a will there’s a way: Honors graduate and blind programmer Vojtěch Polásek joins the Red Hat Security Compliance team.

Where there’s a will there’s a way: Honors graduate and blind programmer Vojtěch Polásek joins the Red Hat Security Compliance team.

Vojta Polásek graduated with honors at Masaryk University Brno, receiving the Dean’s award for his Bachelor and Diploma theses. His diploma thesis was nominated by his faculty to prestigious Czech and Slovak IT SPY competition evaluating IT diploma theses and was among the 8 best finalists. Recently, Vojta joined Red Hat and kick-started his career in the Security Compliance team. While Vojta’s record is impressive for any young engineer, it’s made all the more remarkable by the fact that he was born visually impaired and lost his sight entirely during his teenage years.