Does your code need comment?

Gespeichert in:
Bibliographische Detailangaben
Titel: Does your code need comment?
Autoren: Huang, Yuan, Jia, Nan, Shu, Junhuai, Hu, Xinyu, Chen, Xiangping, Zhou, Qiang
Quelle: Software: Practice & Experience; Mar2020, Vol. 50 Issue 3, p227-245, 19p
Schlagwörter: SYSTEMS software, MACHINE learning, SOURCE code, COMPREHENSION
Abstract: Summary: Code comments convey information about the programmers' intention in a more explicit but less rigorous manner than source code. This information can assist programmers in various tasks, such as code comprehension, reuse, and maintenance. To better understand the properties of the comments existing in the source code, we analyzed more than 450 000 comments across 136 popular open‐source software systems coming different domains. We found that the methods involving header comments and internal comments were shown low percentages in software systems, ie, 4.4% and 10.27%, respectively. As an application of our findings, we propose an automatic approach to determine whether a method needs a header comment, known as commenting necessity identification. Specifically, we identify the important factors for determining the commenting necessity of a method and extract them as structural features, syntactic features, and textual features. Then, by applying machine learning techniques and noise‐handling techniques, we achieve a precision of 88.5% on eight open‐source software from GitHub. The encouraging experimental results demonstrate the feasibility and effectiveness of our approach. [ABSTRACT FROM AUTHOR]
Copyright of Software: Practice & Experience is the property of Wiley-Blackwell and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)
Datenbank: Complementary Index
Beschreibung
Abstract:Summary: Code comments convey information about the programmers' intention in a more explicit but less rigorous manner than source code. This information can assist programmers in various tasks, such as code comprehension, reuse, and maintenance. To better understand the properties of the comments existing in the source code, we analyzed more than 450 000 comments across 136 popular open‐source software systems coming different domains. We found that the methods involving header comments and internal comments were shown low percentages in software systems, ie, 4.4% and 10.27%, respectively. As an application of our findings, we propose an automatic approach to determine whether a method needs a header comment, known as commenting necessity identification. Specifically, we identify the important factors for determining the commenting necessity of a method and extract them as structural features, syntactic features, and textual features. Then, by applying machine learning techniques and noise‐handling techniques, we achieve a precision of 88.5% on eight open‐source software from GitHub. The encouraging experimental results demonstrate the feasibility and effectiveness of our approach. [ABSTRACT FROM AUTHOR]
ISSN:00380644
DOI:10.1002/spe.2772