Do bugs lead to unnaturalness of source code?

Yanjie Jiang, Hui Liu*, Yuxia Zhang*, Weixing Ji, Hao Zhong, Lu Zhang

*此作品的通讯作者

科研成果: 书/报告/会议事项章节会议稿件同行评审

2 引用 (Scopus)

摘要

Texts in natural languages are highly repetitive and predictable because of the naturalness of natural languages. Recent research validated that source code in programming languages is also repetitive and predictable, and naturalness is an inherent property of source code. It was also reported that buggy code is significantly less natural than bug-free one, and bug fixing substantially improves the naturalness of the involved source code. In this paper, we revisit the naturalness of buggy code and investigate the effect of bug-fixing on the naturalness of source code. Different from the existing investigation, we leverage two large-scale and high-quality bug repositories where bug-irrelevant changes in bug-fixing commits have been explicitly excluded. Our evaluation results confirm that buggy lines are often less natural than bug-free ones. However, fixing bugs could not significantly improve the naturalness of involved code lines. Fixed lines on average are as unnatural as buggy ones. Consequently, bugs are not the root cause of the unnaturalness of source code, and it could be inaccurate to identify buggy code lines solely by the naturalness of source code. Our evaluation results suggest that the naturalness-based buggy line detection results in extremely low precision (less than one percentage).

源语言英语
主期刊名ESEC/FSE 2022 - Proceedings of the 30th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering
编辑Abhik Roychoudhury, Cristian Cadar, Miryung Kim
出版商Association for Computing Machinery, Inc
1085-1096
页数12
ISBN(电子版)9781450394130
DOI
出版状态已出版 - 7 11月 2022
活动30th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2022 - Singapore, 新加坡
期限: 14 11月 202218 11月 2022

出版系列

姓名ESEC/FSE 2022 - Proceedings of the 30th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering

会议

会议30th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2022
国家/地区新加坡
Singapore
时期14/11/2218/11/22

指纹

探究 'Do bugs lead to unnaturalness of source code?' 的科研主题。它们共同构成独一无二的指纹。

引用此