Investigating the Impact of Code Comment Inconsistency on Bug Introducing Using an LLM Model

Date
2024-09-18
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
Code comments are essential for clarifying code functionality, improving readability, and facilitating collaboration among developers. They serve as a guide to help both current and future developers understand the logic and purpose behind specific code segments. However, as software evolves, code changes frequently, and comments may not always be updated to reflect these changes. Despite their importance, comments often become outdated, leading to inconsistencies with the corresponding code. This can mislead developers and potentially introduce bugs. This thesis investigates the impact of code-comment inconsistency on bug introduction using large language models, specifically GPT-3.5. I first compare the performance of the GPT-3.5 model with other state-of-the-art models in detecting these inconsistencies, demonstrating the superiority of GPT-3.5 in this domain. Additionally, I analyze the temporal evolution of code-comment inconsistencies and their effect on bug proneness over various timeframes using the GPT-3.5 model 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 thesis provides new insights into the relationship between code-comment inconsistency and software quality, offering a comprehensive analysis of its impact over time.
Description
Keywords
Citation
Radmanesh, S. (2024). Investigating the impact of code comment inconsistency on bug introducing using an LLM model (Master's thesis, University of Calgary, Calgary, Canada). Retrieved from https://prism.ucalgary.ca.