EUVIMEDScopri EUVIMED
Open access · CC BY 4.0

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

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

Computers · 2026-07-30 · 15 (8) · 486

DOI: 10.3390/computers15080486 ↗

At a glance

Journal article in Computers, published online on 2026-07-30. Written by Kanwal Naz and 4 co-authors. 39 references. The full text is freely available (open access, CC BY 4.0). Funded by: Open Access Publication Fund of Magdeburg University.

AbstractDati bibliograficiCiteRelated studies

Abstract (original language)

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.

Funding

  • Open Access Publication Fund of Magdeburg University

Cite

APA

Naz, K., Shafi, I., Mehmood, M. Z., Khan, A. S., & Ahmad, J. (2026). From Bug Reports to Code Quality: A Transformer-Based Classification Approach Using CodeBERT. Computers, 15(8), 486. https://doi.org/10.3390/computers15080486

Vancouver

Naz K, Shafi I, Mehmood MZ, Khan AS, Ahmad J. From Bug Reports to Code Quality: A Transformer-Based Classification Approach Using CodeBERT. Computers. 2026;15(8):486. doi:10.3390/computers15080486

BibTeX
@article{Naz2026,
  author = {Naz, Kanwal and Shafi, Imran and Mehmood, M. Zakria and Khan, Abdul Saboor and Ahmad, Jamil},
  title = {From Bug Reports to Code Quality: A Transformer-Based Classification Approach Using CodeBERT},
  journal = {Computers},
  year = {2026},
  volume = {15},
  number = {8},
  pages = {486},
  doi = {10.3390/computers15080486}
}
Start for free →