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 条
  • [1] Snippet Comment Generation Based on Code Context Expansion
    Guo, Hanyang
    Chen, Xiangping
    Huang, Yuan
    Wang, Yanlin
    Ding, Xi
    Zheng, Zibin
    Zhou, Xiaocong
    Dai, Hong-Ning
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2024, 33 (01)
  • [2] Towards Context-Aware Code Comment Generation
    Yu, Xiaohan
    Huang, Quzhe
    Wang, Zheng
    Feng, Yansong
    Zhao, Dongyan
    FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, EMNLP 2020, 2020, : 3938 - 3947
  • [3] Statistical learning of distractor locations is dependent on task context
    de Waard, Jasper
    van Moorselaar, Dirk
    Bogaerts, Louisa
    Theeuwes, Jan
    SCIENTIFIC REPORTS, 2023, 13 (01)
  • [4] Statistical learning of distractor locations is dependent on task context
    Jasper de Waard
    Dirk van Moorselaar
    Louisa Bogaerts
    Jan Theeuwes
    Scientific Reports, 13
  • [5] Learning to Predict Code Review Completion Time In Modern Code Review
    Chouchen, Moataz
    Ouni, Ali
    Olongo, Jefferson
    Mkaouer, Mohamed Wiem
    EMPIRICAL SOFTWARE ENGINEERING, 2023, 28 (04)
  • [6] Learning to Predict Code Review Completion Time In Modern Code Review
    Moataz Chouchen
    Ali Ouni
    Jefferson Olongo
    Mohamed Wiem Mkaouer
    Empirical Software Engineering, 2023, 28
  • [7] Learning to Predict Information Needs: Context-Aware Display as a Cognitive Aid and an Assessment Tool
    Love, Bradley C.
    Jones, Matt
    Tomlinson, Marc T.
    Howe, Michael
    CHI2009: PROCEEDINGS OF THE 27TH ANNUAL CHI CONFERENCE ON HUMAN FACTORS IN COMPUTING SYSTEMS, VOLS 1-4, 2009, : 1351 - 1360
  • [8] Learning to predict future locations with internally generated theta sequences
    Parra-Barrero, Eloy J.
    Cheng, Sen
    PLOS COMPUTATIONAL BIOLOGY, 2023, 19 (05)
  • [9] Learning to Generate Structured Code Summaries From Hybrid Code Context
    Zhou, Ziyi
    Li, Mingchen
    Yu, Huiqun
    Fan, Guisheng
    Yang, Penghui
    Huang, Zijie
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2024, 50 (10) : 2512 - 2528
  • [10] Automatic Code Review by Learning the Structure Information of Code Graph
    Yin, Ying
    Zhao, Yuhai
    Sun, Yiming
    Chen, Chen
    SENSORS, 2023, 23 (05)