mlsanityData to 14 Oct 2026

An Analysis of LLM Fine-Tuning and Few-Shot Learning for Flaky Test Detection and Classification

arXiv 2502.02715 ↗First posted 4 Feb 2025cs.SE cs.AIcited by 2

Not on the map. Why?

Abstract (arXiv)

Flaky tests exhibit non-deterministic behavior during execution and they may pass or fail without any changes to the program under test. Detecting and classifying these flaky tests is crucial for maintaining the robustness of automated test suites and ensuring the overall reliability and confidence in the testing. However, flaky test detection and classification is challenging due to the variability in test behavior, which can depend on environmental conditions and subtle code interactions. Large Language Models (LLMs) offer promising approaches to address this challenge, with fine-tuning and few-shot learning (FSL) emerging as viable techniques. With enough data fine-tuning a pre-trained LLM can achieve high accuracy, making it suitable for organizations with more resources. Alternatively, we introduce FlakyXbert, an FSL approach that employs a Siamese network architecture to train efficiently with limited data. To understand the performance and cost differences between these two methods, we compare fine-tuning on larger datasets with FSL in scenarios restricted by smaller datasets. Our evaluation involves two existing flaky test datasets, FlakyCat and IDoFT. Our results suggest that while fine-tuning can achieve high accuracy, FSL provides a cost-effective approach with competitive accuracy, which is especially beneficial for organizations or projects with limited historical data available for training. These findings underscore the viability of both fine-tuning and FSL in flaky test detection and classification with each suited to different organizational needs and resource availability.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 12 of its 27 references that are in the map. First posted on arXiv 4 Feb 2025.

Builds on

12 of 27 references.

References · 12

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  4. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
  5. 2022Estimating the Carbon Footprint of BLOOM, a 176B Parameter Language Modelcited by 265
  6. 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
  7. 2023Software Testing with Large Language Models: Survey, Landscape, and Visioncited by 166
  8. 2022Few-shot training LLMs for project-specific code-summarizationcited by 129
  9. 2023Using Large Language Models to Generate JUnit Tests: An Empirical Studycited by 53
  10. 2022Towards using Few-Shot Prompt Learning for Automating Model Completioncited by 13
  11. 2021Flakify: A Black-Box, Language Model-based Predictor for Flaky Testscited by 11
  12. 2025Assessing Data Augmentation-Induced Bias in Training and Testing of Machine Learning Modelscited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 1.

2 papers.