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 条
  • [41] Learning of association between a context and multiple possible target locations in a contextual cueing paradigm
    Chao Wang
    Xuejun Bai
    Yabo Hui
    Chen Song
    Guang Zhao
    Hanna Haponenko
    Bruce Milliken
    Hong-jin Sun
    Attention, Perception, & Psychophysics, 2020, 82 : 3374 - 3386
  • [42] Learning of association between a context and multiple possible target locations in a contextual cueing paradigm
    Wang, Chao
    Bai, Xuejun
    Hui, Yabo
    Song, Chen
    Zhao, Guang
    Haponenko, Hanna
    Milliken, Bruce
    Sun, Hong-jin
    ATTENTION PERCEPTION & PSYCHOPHYSICS, 2020, 82 (07) : 3374 - 3386
  • [43] Holistic Combination of Structural and Textual Code Information for Context Based API Recommendation
    Chen, Chi
    Peng, Xin
    Xing, Zhenchang
    Sun, Jun
    Wang, Xin
    Zhao, Yifan
    Zhao, Wenyun
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (08) : 2987 - 3009
  • [44] Learning Structure Models with Context Information for Visual Tracking
    Liu, Li-Wei
    Ai, Hai-Zhou
    JOURNAL OF COMPUTER SCIENCE AND TECHNOLOGY, 2013, 28 (05) : 818 - 826
  • [45] Epistemic metacognition in context: evaluating and learning online information
    Mason, Lucia
    Boldrin, Angela
    Ariasi, Nicola
    METACOGNITION AND LEARNING, 2010, 5 (01) : 67 - 90
  • [46] Learning Structure Models with Context Information for Visual Tracking
    刘力为
    艾海舟
    Journal of Computer Science & Technology, 2013, 28 (05) : 818 - 826
  • [47] Context Aware Information Model for Active Learning Object
    Slotkiene, Asta
    BALTIC JOURNAL OF MODERN COMPUTING, 2018, 6 (02): : 155 - 161
  • [48] Multi-Context Information for Word Representation Learning
    Dewalkar, Swapnil
    Desarkar, Maunendra Sankar
    DOCENG'19: PROCEEDINGS OF THE ACM SYMPOSIUM ON DOCUMENT ENGINEERING 2019, 2019,
  • [49] Learning Structure Models with Context Information for Visual Tracking
    Li-Wei Liu
    Hai-Zhou Ai
    Journal of Computer Science and Technology, 2013, 28 : 818 - 826
  • [50] A neural module to estimate context information for sequence learning
    Henriques, AS
    Araújo, AFR
    IJCNN'01: INTERNATIONAL JOINT CONFERENCE ON NEURAL NETWORKS, VOLS 1-4, PROCEEDINGS, 2001, : 1646 - 1651