Study of a Code Comment Decision Method Based on Structural Features

Renmin Wang,Tao Wang,Huaimin Wang
DOI: https://doi.org/10.1109/icicas48597.2019.00125
2019-01-01
Abstract:Code comment is one of the most effective ways to help programmers to understand the source code. High-quality comment decisions can not only cover the core code snippets in the software system but also avoid generating redundant code comments. However, in actual development, there is no uniform comment specification, and most of the comment decisions depend on personal experience and domain knowledge. This paper has learned a common comment decision specification from a large number of code comment examples to assist programmers in making appropriate comment decisions during code development. This paper proposes a method to extract the code structure from the context code of the current code line, and use the machine learning algorithm to determine the possibility that the current code needs to add comments. The proposed method was evaluated on 8 well-known open-source Python projects in GitHub and the experimental results show the feasibility and effectiveness of the method in some code types.
What problem does this paper attempt to address?