Learning Code Context Information to Predict Comment Locations

被引:18
|
作者
Huang, Yuan [1 ,2 ]
Hu, Xinyu [1 ,2 ]
Jia, Nan [3 ]
Chen, Xiangping [4 ,5 ]
Xiong, Yingfei [6 ,7 ]
Zheng, Zibin [1 ,2 ]
机构
[1] Sun Yat Sen Univ, Natl Engn Res Ctr Digital Life, Guangzhou 510006, Peoples R China
[2] Sun Yat Sen Univ, Sch Data & Comp Sci, Guangzhou 510006, Peoples R China
[3] Hebei GEO Univ, Sch Management Sci & Engn, Shijiazhuang 050031, Hebei, Peoples R China
[4] Sun Yat Sen Univ, Guangdong Key Lab Big Data Anal & Simulat Publ Op, Guangzhou 510006, Peoples R China
[5] Sun Yat Sen Univ, Sch Commun & Design, Guangzhou 510006, Peoples R China
[6] Peking Univ, Sch Elect Engn & Comp Sci, Beijing 100871, Peoples R China
[7] Peking Univ, Minist Educ, Key Lab High Confidence Software Technol, Beijing 100871, Peoples R China
基金
中国博士后科学基金; 中国国家自然科学基金; 国家重点研发计划;
关键词
Feature extraction; Software; Semantics; Programming; Predictive models; Syntactics; Buildings; Code context information; code features extraction; comment location; comment quality; commenting decision;
D O I
10.1109/TR.2019.2931725
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Code commenting is a common programming practice of practical importance to help developers review and comprehend source code. In our developer survey, commenting has become an important, yet often-neglected activity when programming. Moreover, there is a lack of formal and automatic way in current practice to remind developers where to comment in the source code. To provide informative guidance on commenting during development, we propose a novel method CommentSuggester to recommend developers regarding appropriate commenting locations in the source code. Because commenting is closely related to the context information of source code, we identify this important factor to determine comment positions and extract it as structural context features, syntactic context features, and semantic context features. Subsequently, machine learning techniques are applied to identify possible commenting locations in the source code. We evaluated CommentSuggester using large datasets from dozens of open-source software systems in GitHub. The encouraging experimental results and user study demonstrated the feasibility and effectiveness of our commenting suggestion method.
引用
收藏
页码:88 / 105
页数:18
相关论文
共 50 条
  • [21] DeepTLE: Learning Code-Level Features to Predict Code Performance Before It Runs
    Zhou, Meiling
    Chen, Jie
    Hu, Haiyang
    Yu, Jiacheng
    Li, Zhongjin
    Hu, Hua
    2019 26TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC), 2019, : 252 - 259
  • [22] Bash Code Comment Generation Method Based on Dual Information Retrieval
    Chen X.
    Yu C.
    Yang G.
    Pu X.-L.
    Cui Z.-Q.
    Ruan Jian Xue Bao/Journal of Software, 2023, 34 (03): : 1310 - 1329
  • [23] Project-specific code summarization with in-context learning
    Yun, Shangbo
    Lin, Shuhuai
    Gu, Xiaodong
    Shen, Beijun
    JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 216
  • [24] Code -Style In -Context Learning for Knowledge -Based Question Answering
    Nie, Zhijie
    Zhang, Richong
    Wang, Zhongyuan
    Liu, Xudong
    THIRTY-EIGHTH AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE, VOL 38 NO 17, 2024, : 18833 - 18841
  • [25] COMMENT ON CODE
    RIEMER, GA
    AMERICAN BAR ASSOCIATION JOURNAL, 1980, 66 (DEC): : 1495 - 1496
  • [26] Learning Sequential and Structural Information for Source Code Summarization
    Choi, YunSeok
    Bak, JinYeong
    Na, CheolWon
    Lee, Jee-Hyong
    FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, ACL-IJCNLP 2021, 2021, : 2842 - 2851
  • [27] Augmented sentiment representation by learning context information
    Hu Han
    Xuxu Bai
    Ping Li
    Neural Computing and Applications, 2019, 31 : 8475 - 8482
  • [28] Guideline Learning for In-Context Information Extraction
    Pang, Chaoxu
    Cao, Yixuan
    Ding, Qiang
    Luo, Ping
    2023 CONFERENCE ON EMPIRICAL METHODS IN NATURAL LANGUAGE PROCESSING (EMNLP 2023), 2023, : 15372 - 15389
  • [29] Augmented sentiment representation by learning context information
    Han, Hu
    Bai, Xuxu
    Li, Ping
    NEURAL COMPUTING & APPLICATIONS, 2019, 31 (12): : 8475 - 8482
  • [30] From Context to Code: Information Transfer Constrains the Emergence of Graphic Codes
    Winters, James
    Morin, Olivier
    COGNITIVE SCIENCE, 2019, 43 (03)