From Bug Reports to Code Quality: A Transformer-Based Classification Approach Using CodeBERT

Maintaining code quality during software maintenance is a persistent challenge because bug-fix activities frequently introduce new code smells, accelerating long-term technical debt. Although bug-report classification has been applied to severity prediction and developer triaging, its use for proactively distinguishing Code-Quality-Impacting Bugs (CQIBs) from Non-Code-Quality-Impacting Bugs (NQIBs) remains underexplored. This paper proposes a transformer-based classification framework that fine-tunes CodeBERT on a balanced dataset of 25,000+ bug-report segments drawn from four Apache projects (Camel, CloudStack, Geode, and HBase). We evaluate two training strategies sequential transfer learning and individual fine-tuning and compare both against the published CNN-based baselines and against BERT, RoBERTa, and DeBERTa. Under 5-fold cross-validation, individual CodeBERT fine-tuning achieves weighted-F1 scores of 0.924, 0.866, 0.858, and 0.845 on Camel, CloudStack, Geode, and HBase, respectively, for an average of 0.873. Sequential transfer learning reaches a mean accuracy of 89.8% and a peak accuracy of 92.4% on Camel. CodeBERT is the best-performing transformer in this comparison, exceeding the average weighted-F1 of BERT (0.790), RoBERTa (0.753), and DeBERTa (0.742). Rigorous preprocessing, class balancing within the training folds, and stratified evaluation contribute substantially to these results.

Authors

Institutions

Publication Details

Journal
Computers
Published
2026-07-30
DOI
https://doi.org/10.3390/computers15080486
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

From Bug Reports to Code Quality: A Transformer-Based Classification Approach Using CodeBERT

Abdul Saboor Khan, Imran Shafi, Kanwal Naz, Jamil Ahmad et al.
Computers
Software Engineering Research
article

From Bug Reports to Code Quality: A Transformer-Based Classification Approach Using CodeBERT

Abdul Saboor Khan, Imran Shafi, Kanwal Naz, Jamil Ahmad, M. Zakria Mehmood
article en

Abstract

Maintaining code quality during software maintenance is a persistent challenge because bug-fix activities frequently introduce new code smells, accelerating long-term technical debt. Although bug-report classification has been applied to severity prediction and developer triaging, its use for proactively distinguishing Code-Quality-Impacting Bugs (CQIBs) from Non-Code-Quality-Impacting Bugs (NQIBs) remains underexplored. This paper proposes a transformer-based classification framework that fine-tunes CodeBERT on a balanced dataset of 25,000+ bug-report segments drawn from four Apache projects (Camel, CloudStack, Geode, and HBase). We evaluate two training strategies sequential transfer learning and individual fine-tuning and compare both against the published CNN-based baselines and against BERT, RoBERTa, and DeBERTa. Under 5-fold cross-validation, individual CodeBERT fine-tuning achieves weighted-F1 scores of 0.924, 0.866, 0.858, and 0.845 on Camel, CloudStack, Geode, and HBase, respectively, for an average of 0.873. Sequential transfer learning reaches a mean accuracy of 89.8% and a peak accuracy of 92.4% on Camel. CodeBERT is the best-performing transformer in this comparison, exceeding the average weighted-F1 of BERT (0.790), RoBERTa (0.753), and DeBERTa (0.742). Rigorous preprocessing, class balancing within the training folds, and stratified evaluation contribute substantially to these results.

ComputersVol. 15(8)
Abdul Wali Khan University Mardan (PK), Abasyn University (PK), National University of Sciences and Technology (PK), Otto-von-Guericke-Universität Magdeburg (DE)
Partnerships for the goals
Openalex Percentile: Top 3%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.