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 method for generating automated source-code comments using retrieval-augmented generation (RAG) with a design document term dictionary. This method aligns terms and their meanings from design documents with lines of source code, producing comments that clearly reflect the source-code's intent and functionality. Our evaluations on the open-source software iDempiere show significant improvements: context precision increased by 22% and faithfulness by 17 % compared with conventional RAG methods These results confirm our method's validity. Therefore, we plan to explore its application to different software contexts in future work.
Authors
- Kazu Nishikawa
- Hideyuki Kanuka (ORCID: https://orcid.org/0000-0002-8560-8714)
- Genta Koreki
Institutions
- Hitachi (Japan) (JP)
Publication Details
- Published
- 2024-12-03
- DOI
- https://doi.org/10.1109/apsec65559.2024.00061
- Citations
- 1
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.78