Home ➤ Publications ➤ sankaja2025generating

Generating Natural Language Explanations for Automated Program Repair Generated Patches

H L S Sankaja, R P G Sandeeptha, R M R U Ranasingha, S Wickramanayake, Nisansa de Silva
International Conference of Sabaragamuwa University of Sri Lanka

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.

Keywords: Machine Learning / Deep Learning | Automated Program Repair | Explainable Artificial Intelligence | Code Generation | Text Generation |

@inproceedings{sankaja2025generating,
  title={{Generating Natural Language Explanations for Automated Program Repair Generated Patches}},
  author={Sankaja, H L S and Sandeeptha, R P G and Ranasingha, R M R U and Wickramanayake, S and de Silva, Nisansa},
  booktitle={International Conference of Sabaragamuwa University of Sri Lanka},
  year={2025},
  pages={61},
  abstract={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.},
  misc={http://repo.lib.sab.ac.lk:8080/xmlui/bitstream/handle/susl/5189/Abstracts_page_109.pdf?sequence=1&isAllowed=y,ML,https://goo.gl/iY6aTr}
}



Related Projects

AI for Software Maintenance

Active

PI: Sandareka Wickramanayake

We propose to advance automated program repair by leveraging natural language processing techniques, iterative repair strategies, and explainable AI frameworks to enhance accuracy, robustness, and interpretability of repair systems.