Machine Learning for Actionable Warning Identification: A Comprehensive Survey

Xiuting Ge, Chunrong Fang, Xuanye Li, Weisong Sun, Daoyuan Wu, Juan Zhai, Shang-Wei Lin, Zhihong Zhao, Yang Liu, Zhenyu Chen · DOI · OpenReview

TL;DR

This paper presents a comprehensive survey of Machine Learning (ML) approaches for Actionable Warning Identification (AWI), a crucial step in making static code analysis tools more useful. By systematically reviewing 51 studies, the authors provide a structured overview of the AWI workflow, categorize existing ML-based methods, and highlight key techniques, their strengths, and weaknesses, ultimately offering practical research directions.

What Problem Does This Paper Address?

Static Code Analyzers (SCAs) are invaluable for finding software defects, but they often generate a massive number of warnings, a significant portion of which are "unactionable" (e.g., false positives). This deluge of warnings overwhelms developers, hindering the practical adoption of SCAs. While manual inspection can help, it's time-consuming and error-prone. Actionable Warning Identification (AWI) aims to tackle this by filtering or prioritizing these warnings. With the rise of Machine Learning (ML), many approaches have emerged to automate AWI, leveraging ML's ability to learn complex patterns. However, a consolidated understanding of these ML-based AWI techniques, their workflows, and their limitations has been missing, making it difficult for researchers and practitioners to advance the field.

Methods

The authors conducted a systematic literature review, gathering 51 primary studies from five digital libraries between 2000 and 2023. They employed a meticulous methodology, including defining search keywords, selection criteria, and a two-pass review process. The core of their analysis involves outlining a typical ML-based AWI workflow, which they break down into four stages:

  1. Warning Dataset Preparation: Acquiring and labeling warning data.
  2. Warning Dataset Preprocessing: Feature extraction, selection, and rebalancing.
  3. AWI Model Construction: Building the ML model.
  4. AWI Model Evaluation: Assessing the model's performance.

They then categorize ML-based AWI approaches based on their warning output format (classification, ranking, combination) and analyze the techniques used in each stage of the workflow, detailing their strengths, weaknesses, and distribution across these categories.

Datasets

The paper discusses warning datasets collected from various sources:

  • Real-world projects: The majority of studies (82%) use datasets from real-world projects. A widely used dataset is from 12 open-source Java projects, adopted by nine studies.
  • Synthetic projects: Datasets are also generated from artificially designed projects, such as Juliet and OWASP, which offer more control and balance but may not reflect realistic distributions.
  • Combined sources: Some studies use a mix of real-world and synthetic data.

The paper also notes that the specific SCAs used (e.g., FindBugs, CppCheck, Sparrow) and the development languages of the projects (primarily Java and C/C++) significantly influence the warning datasets.

Key Insights and Ideas

  • ML is a Game Changer for AWI: ML-based AWI approaches have demonstrated superior performance in enhancing SCA usability by learning subtle patterns that traditional methods miss.
  • The AWI Workflow is Key: Understanding the distinct stages of the AWI workflow (preparation, preprocessing, construction, evaluation) is crucial for analyzing and improving ML-based AWI techniques.
  • Output Format Matters: Categorizing AWI approaches by their output (classification, ranking, combination) provides a clear lens to understand their goals and trade-offs. Classification is the most common approach.
  • Data is Paramount: The quality and characteristics of the warning dataset (source, labeling strategy, features) are critical determinants of AWI performance. Manual labeling is reliable but slow; automatic methods are faster but can be noisy.
  • Feature Engineering is Complex: Warning features can be derived from various sources (external reports, internal source code, hybrid) and categories (characteristic-based, statistical, content-based, sequential, structural). Combining these can be powerful but risks redundancy.
  • Model Choice is Diverse: A wide range of ML models, from traditional ones like Random Forests to deep learning architectures and pre-trained models (LLMs), are employed.
  • Evaluation Strategies Need Care: While K-fold cross-validation is prevalent, its suitability for imbalanced datasets and real-world scenarios (where time is a factor) is questioned, suggesting rolling cross-validation might be more appropriate.

Key Results

  • Prevalence of Classification: The classification approach, which labels warnings as actionable or unactionable, is the most common, used in 61% of studies.
  • Dominant ML Models: Random Forest (RF) is the most frequently used traditional ML model, while Convolutional Neural Networks (CNNs) are prominent among deep learning models.
  • Data Sources: Real-world projects constitute the vast majority (82%) of warning dataset sources. Java and C/C++ are the dominant development languages.
  • Labeling Strategies: Manual and automatic labeling strategies are most common, covering 43% and 41% of studies, respectively.
  • Feature Extraction: Internal and hybrid sources are prevalent for feature extraction, with manual methods being the most common way to extract features. Characteristic-based and statistical categories are the most used warning features.
  • Model Structures: Multiple models-based structures are the most common for AWI.
  • Construction Scenarios: "Within project" is the most prevalent AWI construction scenario.
  • Validation Strategies: K-fold cross-validation is the most common validation strategy, followed by HoldOut.
  • Performance Measures: Recall, Precision, and Accuracy are the most frequently used performance metrics.

Limitations and Future Work

Limitations:

  • Data Diversity: While the survey covers a broad range of studies, the reliance on specific SCAs (like FindBugs) and languages (Java, C/C++) might limit the generalizability of findings.
  • Traceability: Many warning datasets are not traceable, making it hard to verify their quality.
  • Labeling Noise: Automatic labeling strategies, while efficient, can introduce noise and mislabeled warnings.
  • Feature Redundancy: Combining features from different sources can lead to redundancy, hindering performance.
  • Evaluation Bias: Traditional validation strategies like K-fold cross-validation might not accurately reflect real-world performance due to imbalanced datasets and temporal aspects.

Future Work Directions:

  • Data Improvement:
    • Collect warning datasets from a wider variety of SCAs and programming languages (e.g., Python).
  • Develop more robust labeling strategies, potentially through human-machine collaboration.
  • Characterize warnings with more fine-grained features, exploring combinations and leveraging structural information more effectively.
  • Investigate feature selection techniques more thoroughly.
  • Select class rebalancing techniques more carefully to address imbalance.
  • Model Exploration:
    • Explore semi-supervised and unsupervised learning for AWI to reduce reliance on massive labeled datasets.
  • Investigate the potential of Large Language Models (LLMs) for AWI, including domain-specific LLMs and fine-tuning strategies.
  • Design customized AWI approaches tailored to different warning categories.
  • Conduct practical AWI model evaluation using rolling cross-validation to better reflect real-world scenarios.

Summary updated

BibTeX
@article{ge2025machine,
  author = {Xiuting Ge and Chunrong Fang and Xuanye Li and Weisong Sun and Daoyuan Wu and Juan Zhai and Shang-Wei Lin and Zhihong Zhao and Yang Liu and Zhenyu Chen},
  title = {{Machine Learning for Actionable Warning Identification: A Comprehensive Survey}},
  journal = {ACM Computing Surveys},
  year = {2025},
  doi = {10.1145/3696352},
}
Figure