已入深夜,您辛苦了!由于当前在线用户较少,发布求助请尽量完整的填写文献信息,科研通机器人24小时在线,伴您度过漫漫科研夜!祝你早点完成任务,早点休息,好梦!

An Empirical Study on the Relationship Between Defects and Source Code’s Unnaturalness

计算机科学 源代码 实证研究 程序设计语言 数学 统计
作者
Yanjie Jiang,Hui Liu,J. Liu,Yuxia Zhang,Weixing Ji,Hao Zhong,Lu Zhang
出处
期刊:ACM Transactions on Software Engineering and Methodology [Association for Computing Machinery]
标识
DOI:10.1145/3718083
摘要

Natural languages are “natural” in that texts in natural languages are repetitive and predictable. Recent research indicates that programming languages share similar characteristics (naturalness), with source code displaying patterns of repetition and predictability. Notably, studies have shown that buggy code deviates from these natural patterns in that buggy code is significantly less natural than bug-free one. In this paper, we conduct a large-scale and extensive empirical study to investigate whether code defects lead to unnaturalness of source code. Different from existing studies, we leverage multiple large-scale and high-quality bug repositories where bug-irrelevant changes in bug-fixing commits have been explicitly excluded. The leveraged software applications cover different programming languages, and the empirical study involves real-world software defects as well as defects injected automatically with well-known mutation operators. On one side, our evaluation results confirm existing studies in that buggy source code lines are often less natural than bug-free ones. On the other side, our evaluation reveals some interesting new findings. First, fixing bugs does not significantly improve the naturalness of code lines and the fixed lines on average are as unnatural as buggy ones. This finding may suggest that software defects are not the root causes of source code’s unnaturalness although there does existing statistically significant correlation between software defects and source code’s naturalness. Second, defects in different programming languages have similar effect on source code’s naturalness. The conclusions (i.e., buggy code is less natural but fixing the bugs cannot improve source code’s naturalness) hold regardless of the programming languages. Third, injecting defects automatically by well-known mutation operators does not significantly reduce the naturalness of involved source code lines. This suggests that automatically injected defects may have a similar impact on the naturalness of source code as real-world defects inadvertently introduced by developers. Fourth, the detects’ impact on source code’s naturalness varies slightly among different categories of software defects. Although fixing bugs on average does not significantly improve the naturalness of involved source code, fixing ”checking” related bugs does significantly improve the naturalness of source code. Finally, locating buggy code lines according to naturalness alone is inaccurate, resulting in extremely low precision (less than one percent).
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
1秒前
yiyi完成签到 ,获得积分10
2秒前
端庄洪纲发布了新的文献求助10
7秒前
8秒前
孙绪鹏发布了新的文献求助10
8秒前
9秒前
9秒前
领导范儿应助科研通管家采纳,获得10
11秒前
Lucas应助科研通管家采纳,获得10
11秒前
11秒前
传奇3应助科研通管家采纳,获得10
11秒前
Orange应助科研通管家采纳,获得10
11秒前
11秒前
15秒前
陈腿毛发布了新的文献求助10
16秒前
科目三应助xxx采纳,获得10
16秒前
玉灵子发布了新的文献求助10
18秒前
玉灵子完成签到,获得积分10
23秒前
24秒前
王博士发布了新的文献求助10
27秒前
28秒前
zzz发布了新的文献求助10
29秒前
安静的飞珍完成签到,获得积分10
31秒前
31秒前
怕孤单的幼荷完成签到 ,获得积分10
32秒前
朴素的安双应助虎虎虎采纳,获得10
36秒前
goblue完成签到,获得积分10
37秒前
40秒前
战神林北完成签到,获得积分10
42秒前
飞走了完成签到 ,获得积分10
43秒前
睡到自然醒完成签到 ,获得积分10
45秒前
义气的元柏完成签到 ,获得积分10
46秒前
汉堡包应助熬夜的小王采纳,获得10
46秒前
48秒前
小脸红扑扑完成签到 ,获得积分10
51秒前
52秒前
53秒前
54秒前
鱼yu发布了新的文献求助10
55秒前
JDM完成签到 ,获得积分10
56秒前
高分求助中
Applied Survey Data Analysis (第三版, 2025) 800
Assessing and Diagnosing Young Children with Neurodevelopmental Disorders (2nd Edition) 700
The Elgar Companion to Consumer Behaviour and the Sustainable Development Goals 540
Images that translate 500
Handbook of Innovations in Political Psychology 400
Mapping the Stars: Celebrity, Metonymy, and the Networked Politics of Identity 400
Towards a spatial history of contemporary art in China 300
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 物理 生物化学 纳米技术 计算机科学 化学工程 内科学 复合材料 物理化学 电极 遗传学 量子力学 基因 冶金 催化作用
热门帖子
关注 科研通微信公众号,转发送积分 3843144
求助须知:如何正确求助?哪些是违规求助? 3385420
关于积分的说明 10540341
捐赠科研通 3105987
什么是DOI,文献DOI怎么找? 1710810
邀请新用户注册赠送积分活动 823771
科研通“疑难数据库(出版商)”最低求助积分说明 774264