Source code representation for comment generation and program comprehension
department or school: Science, Irving K. Barber Faculty of (Okanagan)
department or school: Computer Science, Mathematics, Physics and Statistics, Department of (Okanagan)
data provider: DSpace
degree campus: UBCO
creator: Sharma, Rishab
issued: 2021-12-14T21:25:43Z
issued: 2021
related degree: Master of Science - MSc
degree grantor: University of British Columbia
description: Code comment generation is the task of generating a high-level natural language description for a given code snippet. Comments help software developers maintain programs; however, comments are mostly missing or are outdated. Many studies develop models to generate comments automatically, mainly using deep neural networks. A missing point in the current research is capturing each character's information and the syntactic differences of tokens. Moreover, the contextual meaning of code tokens is generally overlooked. In this thesis, we present LAnguage Model and Named Entity Recognition Code comment generator (LAMNER-Code). A character-level language model is used to learn the semantic representation and a Named Entity Recognition model is trained for learning the code entities. These representations are used in a Neural Machine Translation architecture to produce comments. We evaluate the generated comments using our model and other baselines against ground truth on a Java dataset with four standard metrics, BLEU, ROGUE-L, METEOR, and CIDEr, which are improved by 3.26, 5.27, 1.25, and 0.1 points, respectively. The existing techniques and our proposed work are complementary to each other. Experiments on abstracted code further demonstrate the value of the LAMNER-Code embeddings. The human evaluation confirms the quality of LAMNER-Code comments compared to baselines and the reference comments. Also, the new decoder sampling strategy presented in this works can better recall identifiers during comments generation. Despite the improvement in the performance, we see performance from Transformer based models is comparable to this work. Therefore, we conduct an additional exploratory study to understand source code comprehension by the Transformer based models. The findings from this study reveal some similarities with the natural languages and also present differences in the attention of the Transformer-based language model for source code. Finally, we use the findings from…
aggregated CHO: https://circle.library.ubc.ca/rest/handle/2429/80449
note: Source Code Representation forComment Generation and ProgramComprehensionbyRishab SharmaB.Tech., Guru Nanak Dev University, 2018A THESIS SUBMITTED IN PARTIAL FULFILLMENT OFTHE REQUIREMENTS FOR THE DEGREE OFMASTER OF SCIENCEinTHE COLLEGE OF GRADUATE STUDIES(Computer Science)THE UNIVERSITY OF BRITISH COLUMBIA(Okanagan)December 2021© Rishab Sharma, 2021The following individuals certify that they have read, and recommendto the College of Graduate Studies for acceptance, a thesis/dissertation en-titled:Source Code Representation for Comment Generation andProgram Comprehensionsubmitted by Rishab Sharma in partial fulfilment of the requirements ofthe degree of Master of ScienceDr. Fatemeh Hendijani Fard, Irving K. Barber Faculty of ScienceSupervisorDr. Mohamed Shehata, Irving K. Barber Faculty of ScienceSupervisory Committee MemberDr. Chen Feng, School of EngineeringSupervisory Committee MemberDr. Anas Chaaban, School of EngineeringUniversity ExamineriiAbstractCode comment generation is the task of generating a high-level naturallanguage description for a given code snippet. Comments help software de-velopers maintain programs; however, comments are mostly missing or areoutdated. Many studies develop models to generate comments automati-cally, mainly using deep neural networks. A missing point in the current re-search is capturing each character’s information and the syntactic differencesof tokens. Moreover, the contextual meaning of code tokens is generallyoverlooked. In this thesis, we present LAnguage Model and Named EntityRecognition Code comment generator (LAMNER-Code). A character-levellanguage model is used to learn the semantic representation and a NamedEntity Recognition model is trained for learning the code entities. These rep-resentations are used in a Neural Machine Translation architecture to pro-duce comments. We evaluate the generated comments using our model andother baselines against ground truth on a Java dataset with four standardmetrics, BLEU, ROGUE-L,…
has type: Thesis/Dissertation
date issued: 2022-02
is shown at: 10.14288/1.0406070
language: eng
degree discipline: Computer Science
provider: Vancouver : University of British Columbia Library
publisher: University of British Columbia
rights: Attribution-NonCommercial-ShareAlike 4.0 International
rights URI: http://creativecommons.org/licenses/by-nc-sa/4.0/
scholar level: Graduate
contributor: Fard, Fatemeh Hendijani
type: Text
identifier URI: http://hdl.handle.net/2429/80449