@inproceedings{e4036c0979ae457283b0a87653ef3daa,
title = "Do bugs lead to unnaturalness of source code?",
abstract = "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).",
keywords = "Bug Fixing, Bugs, Code Entropy, Naturalness, Source Code",
author = "Yanjie Jiang and Hui Liu and Yuxia Zhang and Weixing Ji and Hao Zhong and Lu Zhang",
note = "Publisher Copyright: {\textcopyright} 2022 ACM.; 30th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2022 ; Conference date: 14-11-2022 Through 18-11-2022",
year = "2022",
month = nov,
day = "7",
doi = "10.1145/3540250.3549149",
language = "English",
series = "ESEC/FSE 2022 - Proceedings of the 30th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering",
publisher = "Association for Computing Machinery, Inc",
pages = "1085--1096",
editor = "Abhik Roychoudhury and Cristian Cadar and Miryung Kim",
booktitle = "ESEC/FSE 2022 - Proceedings of the 30th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering",
}