Ariful1904129/codebert-flakytest-fold2
CodeBERT for Flaky Test Categorisation (FlakeBench)
Classifies a Java/Kotlin test method into one of six categories: five kinds of flaky test plus non-flaky.
What this is
A fine-tune of microsoft/codebert-base on the FlakeBench dataset from *Understanding and Improving Flaky Test Classification* (OOPSLA 2025), trained as a reproduction exercise on a single 8 GB consumer GPU. The uploaded weights are the "Balanced" configuration below.
Training configurations
Hardware: 1× RTX 4060 Laptop (8 GB). Class rebalancing is the one deviation from the paper's method, which trains on the raw distribution (97% non-flaky).
Results (per-category F1)
The Balanced configuration (uploaded weights) achieves the best macro-F1 of 69.89% .
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
name = "Ariful1904129/codebert-flakytest-fold2"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForSequenceClassification.from_pretrained(name, trust_remote_code=True).eval()
code = """@Test
public void testConnect() throws Exception {
Thread.sleep(1000);
assertTrue(client.isConnected());
}"""
x = tok(code, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
pred = model(**x).logits.argmax(-1).item()
print(model.config.id2label[pred])Scope: Java/Kotlin test methods; inputs longer than 512 tokens are truncated.
Citation
Please cite the original paper. This model is a third-party reproduction and is not endorsed by its authors.
@inproceedings{flakylens2025,
title = {Understanding and Improving Flaky Test Classification},
booktitle = {OOPSLA},
year = {2025}
}Dataset and method: UT-SE-Research/FlakyLens.
