Taxonomy of inline code comment smells

Author:

Jabrayilzade ElgunORCID,Yurtoğlu Ayda,Tüzün ErayORCID

Abstract

AbstractCode comments play a vital role in source code comprehension and software maintainability. It is common for developers to write comments to explain a code snippet, and commenting code is generally considered a good practice in software engineering. However, low-quality comments can have a detrimental effect on software quality or be ineffective for code understanding. This study aims to create a taxonomy of inline code comment smells and determine how frequently each smell type occurs in software projects. We conducted a multivocal literature review to define the initial taxonomy of inline comment smells. Afterward, we manually labeled 2447 inline comments from eight open-source projects where half of them were Java, and another half were Python projects. We created a taxonomy of 11 inline code comment smell types and found out that the smells exist in both Java and Python projects with varying degrees. Moreover, we conducted an online survey with 41 software practitioners to learn their opinions on these smells and their impact on code comprehension and software maintainability. The survey respondents generally agreed with the taxonomy; however, they reported that some smell types might have a positive effect on code comprehension in certain scenarios. We also opened pull requests and issues fixing the comment smells in the sampled projects, where we got a 27% acceptance rate. We share our manually labeled dataset online and provide implications for software engineering practitioners, researchers, and educators.

Funder

Bilkent University

Publisher

Springer Science and Business Media LLC

Reference125 articles.

1. Commenting (2023) https://www.cs.utah.edu/~germain/PPS/Topics/commenting.html. Accessed 10-04-2022

2. Writing code comments (2023) https://web.archive.org/web/20210327171829/https://developers.google.com/tech-writing/two/code-comments. Accessed 28-04-2022

3. Are code comments a code smell? (2018). https://steemit.com/programming/@beggars/are-code-comments-a-code-smell. Accessed 28-04-2022

4. Adams T (2020) How to write a good code comment. https://www.pullrequest.com/blog/how-to-write-a-good-code-comment/. Accessed 28-04-2022

5. Aguilar JM (2008) 13 tips to comment your code. https://www.devtopics.com/13-tips-to-comment-your-code/. Accessed 28-04-2022

Cited by 1 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. When simplicity meets effectiveness: Detecting code comments coherence with word embeddings and LSTM;Proceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering;2024-06-18

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3