ReDef: Do Code Language Models Truly Understand Code Changes for Just-in-Time Software Defect Prediction?
Not on the map. Why?
Abstract (arXiv)
Just-in-Time software defect prediction (JIT-SDP) plays a critical role in prioritizing risky code changes during code review and continuous integration. However, existing datasets often suffer from noisy labels and low precision in identifying bug-inducing commits. To address this, we present ReDef (Revert-based Defect dataset), a high-confidence benchmark of function-level modifications curated from 22 large-scale C/C++ projects. Defective cases are anchored by revert commits, while clean cases are validated through post-hoc history checks. Ambiguous instances are conservatively filtered out via a GPT-assisted triage process involving multiple votes and audits. This pipeline yields 3,164 defective and 10,268 clean modifications, offering substantially more reliable labels than prior resources. Beyond dataset construction, we provide a systematic evaluation of how Code Language Models (CLMs)-specifically CodeBERT, CodeT5+, UniXcoder, and Qwen2.5-reason about code modifications. We first investigate which input encodings most effectively expose change information under five different strategies. We then design four counterfactual perturbation strategies (e.g., swapping added/deleted blocks, inverting diff polarity) to serve as diagnostic probes. We posit that if models genuinely capture change semantics, such distortions should lead to a clear decline in predictive performance. Our results show that compact diff-style encodings consistently outperform whole-function formats across all CLMs, supported by rigorous statistical confirmation. However, under counterfactual tests, performance remains effectively stable, revealing that what appears to be robustness in fact reflects a reliance on superficial cues rather than true semantic understanding.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 25 of its 74 references that are in the map. First posted on arXiv 11 Sep 2025.
Builds on
25 of 74 references.
References · 25
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2025Qwen3 Technical Reportcited by 8,195
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2017Adversarial Examples for Evaluating Reading Comprehension Systemscited by 568
- 2017A systematic study of the class imbalance problem in convolutional neural networkscited by 510
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
- 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 98
- 2020CC2Vec: Distributed Representations of Code Changescited by 38
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2023An Empirical Comparison of Pre-Trained Models of Source Codecited by 25
13 more
- 2023CCT5: A Code-Change-Oriented Pre-Trained Modelcited by 17
- 2023Revisiting Sentiment Analysis for Software Engineering in the Era of Large Language Modelscited by 13
- 2024Learning in the Wild: Towards Leveraging Unlabeled Data for Effectively Tuning Pre-trained Code Modelscited by 9
- 2023Evaluating SZZ Implementations: An Empirical Study on the Linux Kernelcited by 7
- 2019Problems with SZZ and Features: An empirical study of the state of practice of defect prediction data collectioncited by 6
- 2023Tram: A Token-level Retrieval-augmented Mechanism for Source Code Summarizationcited by 6
- 2023The EarlyBIRD Catches the Bug: On Exploiting Early Layers of Encoder Models for More Efficient Code Classificationcited by 5
- 2025Benchmarking Large Language Models for Multi-Language Software Vulnerability Detectioncited by 5
- 2024Line-level Semantic Structure Learning for Code Vulnerability Detectioncited by 4
- 2023A study on the impact of pre-trained model on Just-In-Time defect predictioncited by 3
- 2023Empirical Study on Transformer-based Techniques for Software Engineeringcited by 2
- 2025Refactoring neq Bug-Inducing: Improving Defect Prediction with Code Change Tactics Analysiscited by 2
- 2024Just-In-Time Software Defect Prediction via Bi-modal Change Representation Learningcited by 1
Built on by
Not cited yet.