 | H. Sankaja, R. Sandeeptha, R. Ranasingha, S. Wickramanayake, and N. de Silva
International Conference of Sabaragamuwa University of Sri Lanka, 2025, pp. 61,
Automated Program Repair (APR) has emerged as a transformative technology in software engineering, promising to reduce debugging time and improve software reliability through automatic bug fixing. However, developers remain hesitant to adopt APR tools due to a lack of transparency in generated patches, creating a critical gap between technical capability and practical adoption. This study aimed to develop FIXPLAIN, an explainable APR framework that simultaneously generates code patches and human-readable natural language explanations using intermediate decoder embeddings. A dataset of 34,640 Java bug-fix pairs was curated from the MegaDiff corpus, and explanations were generated using GPT-4o and Claude with consensus-based filtering for quality assurance. FIXPLAIN employs a lightweight adapter mechanism with cross-attention and gating to integrate APR model embeddings into explanation generation, using LoRA-based fine-tuning while preserving repair model quality. Three evaluation approaches were used for validation: automated metrics (BLEU, ROUGE, METEOR), comparison with baseline models (CodeT5, LLaMA-Instruct), and human evaluation with professional Java developers. The framework significantly outperformed baseline models across all automated metrics, achieving BLEU scores of 17.98 compared to 3.33 for LLaMA-Instruct and METEOR scores of 0.36. Human evaluation with ten professional Java developers confirmed that FIXPLAIN explanations substantially improve developer trust, perceived patch correctness, and understanding of automated fixes. The explanations effectively clarify bug root causes and repair logic, with particular effectiveness for complex logic errors where traditional code comparison provides insufficient insight. FIXPLAIN successfully bridges the gap between automated program repair capabilities and developer acceptance through transparent, trustworthy explanations. The parameter-efficient design enables practical deployment while maintaining repair quality, opening new avenues for multi-task APR systems and developer-centric tooling that could transform automated program repair integration in software development workflows. |