Quantizing Large-Language Models for Predicting Flaky Tests

Shanto Rahman, Abdelrahman Baz, Sasa Misailovic, August Shi

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

A major challenge in regression testing practice is the presence of flaky tests, which non-deterministically pass or fail when run on the same code. Previous research identified multiple categories of flaky tests. Prior research has also de-veloped techniques for automatically detecting which tests are flaky or categorizing flaky tests, but these techniques generally involve repeatedly rerunning tests in various ways, making them costly to use. Although several recent approaches have utilized large-language models (LLMs) to predict which tests are flaky or predict flaky-test categories without needing to rerun tests, they are costly to use due to relying on a large neural network to perform feature extraction and prediction. We propose FlakyQ to improve the effectiveness of LLM-based flaky-test prediction by quantizing LLM's weights. The quantized LLM can extract features from test code more efficiently. To make up for loss in prediction performance due to quantization, we further train a traditional ML classifier (e.g., a random forest) to learn from the quantized LLM-extracted features and do the same prediction. The final model has similar prediction performance while running faster than the non-quantized LLM. Our evaluation finds that FlakyQ classifiers consistently improves prediction time over the non-quantized LLM classifier, saving 25.4% in prediction time over all tests, along with a 48.4 % reduction in memory usage. Furthermore, prediction performance is equal or better than the non-quantized LLM classifier.

Original languageEnglish (US)
Title of host publicationProceedings - 2024 IEEE Conference on Software Testing, Verification and Validation, ICST 2024
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages93-104
Number of pages12
ISBN (Electronic)9798350308181
DOIs
StatePublished - 2024
Event17th IEEE Conference on Software Testing, Verification and Validation, ICST 2024 - Toronto, Canada
Duration: May 27 2024May 31 2024

Publication series

NameProceedings - 2024 IEEE Conference on Software Testing, Verification and Validation, ICST 2024

Conference

Conference17th IEEE Conference on Software Testing, Verification and Validation, ICST 2024
Country/TerritoryCanada
CityToronto
Period5/27/245/31/24

Keywords

  • Flaky Test Categorization
  • Large-Language Models
  • Quantization

ASJC Scopus subject areas

  • Artificial Intelligence
  • Software
  • Safety, Risk, Reliability and Quality
  • Modeling and Simulation

Fingerprint

Dive into the research topics of 'Quantizing Large-Language Models for Predicting Flaky Tests'. Together they form a unique fingerprint.

Cite this