Skip to content

UCLA-SEAL/SWIRL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWIRL — Sensemaking Warnings with Interactive Review and Learning

License: MIT Platform: Meteor UCLA SEAL Lab

Bug-finding tools like Infer and SpotBugs generate large volumes of warnings — SWIRL helps developers make sense of them through interactive feedback and inductive summary rules that reveal commonalities across related warnings.

SWIRL main interface


What is SWIRL?

Static analysis tools surface hundreds of warnings at once. Developers struggle to determine which are actionable, and which share the same root cause. SWIRL solves this by letting users:

  • Label individual warnings as interesting or uninteresting
  • Highlight code expressions directly in the UI to drive rule induction
  • Group related warnings automatically using ILP-derived summary rules
  • Iterate — the rules refine themselves with each round of feedback

Our user study (14 participants, real warnings from Infer and SpotBugs) showed that SWIRL users reported lower mental demand and greater confidence compared to inspecting warnings one-by-one.


How it Works

SWIRL workflow

SWIRL uses Inductive Logic Programming (ILP) via clingo to derive rules over:

  • Code containment (package / class / method)
  • Type hierarchies
  • API signatures and recurring code expressions

Installation

Prerequisite: Install Meteor and clingo.

python3 -m pip install --user --upgrade clingo

Running SWIRL

Navigate to code/meteor_app and launch with environment variables that select a dataset:

SpotBugs — Apache Lucene/Solr (Null Dereference)

WARNING_TYPE=apache_lucene-solr__NULL_ \
WARNING_JSON_NAME=spotbugs_warnings_apache_lucene-solr__NULL_ \
meteor

Infer — Alibaba Nacos (Null Dereference)

WARNING_JSON_NAME=infer_warnings_alibaba_nacos_NULL_DEREFERENCE meteor

Infer — Presto (Resource Leak)

WARNING_TYPE=RESOURCE_LEAK__presto \
WARNING_JSON_NAME=infer_warnings_prestodb_presto_RESOURCE_LEAK \
meteor

CodeQL — Apache Dubbo

WARNING_TYPE=dubbo_external \
WARNING_JSON_NAME=codeql_warnings_apache_dubbo_dubbo_external \
~/.meteor/meteor

Toy Analysis (Infer)

# Null Dereference
WARNING_TYPE=NULL_DEREFERENCE__toy_analysis \
WARNING_JSON_NAME=infer_warnings_xxx_toy_analysis_NULL_DEREFERENCE \
meteor

# Resource Leak
WARNING_TYPE=RESOURCE_LEAK__toy_analysis \
WARNING_JSON_NAME=infer_warnings_xxx_toy_analysis_RESOURCE_LEAK \
meteor

URL Parameters

After launching, open http://localhost:3000 with any combination of these query parameters:

Parameter Values Description
dataset spotbugs, infer, dubbo_external Selects the warning dataset
baseline true Enables baseline mode (no grouping — one warning at a time)

Examples:

Mode URL
SWIRL + SpotBugs http://localhost:3000/?dataset=spotbugs
SWIRL + Infer http://localhost:3000/?dataset=infer
Baseline + SpotBugs http://localhost:3000/?dataset=spotbugs&baseline=true
Baseline + Infer http://localhost:3000/?dataset=infer&baseline=true

Simulation

Reproduce the simulation experiments from the paper:

# Resource Leak warnings (Presto)
python3 simulate.py RESOURCE_LEAK__presto \
  meteor_app/_ground-truth_infer_resource_leaks.txt

# Null Dereference warnings (Lucene/Solr)
python3 simulate.py apache_lucene-solr__NULL_ \
  meteor_app/_ground-truth_spotbugs_labels.txt

Never-Fixed Analysis

The neverfixed_analysis/ directory contains our analysis showing that 43% of Null Pointer Dereference warnings generated by Infer on Alibaba Nacos are never fixed — motivating the need for better warning sensemaking tools.

neverfixed_analysis/
├── dataset/          # Java source file variants
├── reports/          # fixed/neverfixed bug reports (CSV, JSON, XLSX)
├── neverfixed.ipynb  # analysis notebook
└── README.md

Repository Structure

swirl/
├── code/
│   ├── meteor_app/         # Main Meteor web application
│   ├── simulate.py         # Simulation experiment
│   ├── stat_tests.py       # Statistical tests
│   └── *.json / *.ipynb    # Warning datasets and analysis notebooks
├── neverfixed_analysis/    # Never-fixed warning analysis
└── images/                 # Figures used in this README

License

MIT — see LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors