Source Code Summarization & Comment Generation with NLP : A New Index Proposal

M. Alp Eren Kilic, M. Fatih Adak · 2024

Understanding and maintaining source code is a critical aspect of software development. Source code comments play a crucial role to increase understandability and sustainability. However, creating and maintaining comprehensive comments alongside the source code can be labour intensive and lead to inconsistencies. This study investigates the effectiveness of Natural Language Processing (NLP) techniques in automating the source code summarization and comment generation processes to alleviate these challenges. We propose a novel evaluation framework that assesses the sufficiency and quality of generated comments in aiding source code comprehension. Leveraging state-of-the-art NLP models, our approach aims to summarize source code functionalities and generate descriptive comments automatically. Furthermore, we introduce a new index proposal tailored to evaluate the adequacy of generated comments in capturing the essence of source code. Software projects with a high Cyclomatic Complexity value need to be explained and well documented as they are projects with high complexity. In this study, different popular repositories were analysed and comments were generated for uncommented functions using natural language processing approaches. With the proposed index, both Cyclomatic Complexity value and productivity were evaluated. The successful results obtained from this study shows that automatic comment generation approaches can be used much more successfully in the near future.

Read the paper · More papers on PaperTik