arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2409.10781cs.SE
收藏

代码注释不一致对引入缺陷的影响研究

Investigating the Impact of Code Comment Inconsistency on Bug Introducing

Shiva Radmanesh, Aaron Imani, Iftekhar Ahmed, Mohammad Moshirpour

AI总结:

本研究利用GPT-3.5探究代码注释不一致对缺陷引入的影响,验证了GPT-3.5在不一致检测上的优越性,发现不一致变更引发缺陷提交的概率约为一致变更的1.5倍,且影响随时间推移减弱。

摘要:

代码注释对于阐明代码功能、提升可读性以及促进开发者间协作至关重要。尽管注释十分重要,但它们往往会过时,进而与对应代码产生不一致,这可能会误导开发者并潜在引入缺陷。本研究使用大语言模型(具体为GPT-3.5)探究代码-注释不一致对缺陷引入的影响。我们首先对比了GPT-3.5模型与其他现有最优方法在检测此类不一致问题上的性能,证明了GPT-3.5在该领域的优越性。此外,我们借助GPT-3.5和比值比分析,在不同时间范围内分析了代码-注释不一致的时间演化及其对缺陷倾向性的影响。研究结果显示,不一致的变更引发引入缺陷的提交的概率约为一致变更的1.5倍,凸显了在软件开发中维护一致且最新的注释的必要性。本研究为代码-注释不一致与软件质量之间的关系提供了新见解,对其随时间变化的影响展开了全面分析,表明代码-注释不一致对缺陷引入的影响在不一致刚出现时最高,且会随时间推移逐渐减弱。

英文摘要:

Code comments are essential for clarifying code functionality, improving readability, and facilitating collaboration among developers. Despite their importance, comments often become outdated, leading to inconsistencies with the corresponding code. This can mislead developers and potentially introduce bugs. Our research investigates the impact of code-comment inconsistency on bug introduction using large language models, specifically GPT-3.5. We first compare the performance of the GPT-3.5 model with other state-of-the-art methods in detecting these inconsistencies, demonstrating the superiority of GPT-3.5 in this domain. Additionally, we analyze the temporal evolution of code-comment inconsistencies and their effect on bug proneness over various timeframes using GPT-3.5 and Odds ratio analysis. Our findings reveal that inconsistent changes are around 1.5 times more likely to lead to a bug-introducing commit than consistent changes, highlighting the necessity of maintaining consistent and up-to-date comments in software development. This study provides new insights into the relationship between code-comment inconsistency and software quality, offering a comprehensive analysis of its impact over time, demonstrating that the impact of code-comment inconsistency on bug introduction is highest immediately after the inconsistency is introduced and diminishes over time.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑