API2Com: On the Improvement of Automatically Generated Code Comments Using API Documentations
Ramin Shahbazi, Rishab Sharma, Fatemeh H. Fard

TL;DR
This paper investigates using API documentation as an external knowledge source to improve automatic code comment generation, finding benefits for methods with a single API but challenges with multiple APIs due to lengthy documentation inputs.
Contribution
Proposes API2Com, a novel model leveraging API documentation for comment generation, and analyzes its effectiveness across different API usage scenarios.
Findings
API documentation improves comment quality for methods with a single API.
Performance decreases with multiple APIs due to long documentation inputs.
New techniques are needed to select the most informative API documentation.
Abstract
Code comments can help in program comprehension and are considered as important artifacts to help developers in software maintenance. However, the comments are mostly missing or are outdated, specially in complex software projects. As a result, several automatic comment generation models are developed as a solution. The recent models explore the integration of external knowledge resources such as Unified Modeling Language class diagrams to improve the generated comments. In this paper, we propose API2Com, a model that leverages the Application Programming Interface Documentations (API Docs) as a knowledge resource for comment generation. The API Docs include the description of the methods in more details and therefore, can provide better context in the generated comments. The API Docs are used along with the code snippets and Abstract Syntax Trees in our model. We apply the model on a…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
MethodsLinear Layer · Absolute Position Encodings · Position-Wise Feed-Forward Layer · Attention Is All You Need · Byte Pair Encoding · Residual Connection · Layer Normalization · Adam · Label Smoothing · Dropout
