APSEC 2024 (series) / ERA - Early Research Achievements /
Enhancing Source Code Comment Generation via Retrieval-Augmented Generation with Design Document Term Dictionary
Effective software development depends on clear code comments for better understanding. We introduce a new method for generating automated source code comments using Retrieval-Augmented Generation (RAG) with a Design Document Term Dictionary (DDTD). This method aligns terms and their meanings from design documents with lines of source code, producing comments that clearly reflect the code’s intent and functionality. Our evaluations on the open-source ERP software iDempiere show significant improvements: Context Precision increased by 22% and Faithfulness by 17% compared to conventional RAG methods These results confirm our method’s validity. Therefore, we plan to explore its application to different software contexts in future work.