Risky Dynamic Typing-related Practices in Python: An Empirical Study

Python(编程语言) 计算机科学 程序设计语言 打字 软件工程 语音识别
作者
Zhifei Chen,Lin Chen,Yibiao Yang,Qiong Feng,Xuansong Li,Wei Song
出处
期刊:ACM Transactions on Software Engineering and Methodology [Association for Computing Machinery]
卷期号:33 (6): 1-35 被引量:1
标识
DOI:10.1145/3649593
摘要

Python’s dynamic typing nature provides developers with powerful programming abstractions. However, many type-related bugs are accumulated in code bases of Python due to the misuse of dynamic typing. The goal of this article is to aid in the understanding of developers’ high-risk practices toward dynamic typing and the early detection of type-related bugs. We first formulate the rules of six types of risky dynamic typing-related practices (type smells for short) in Python. We then develop a rule-based tool named RUPOR, which builds an accurate type base to detect type smells. Our evaluation shows that RUPOR outperforms the existing type smell detection techniques (including the Large Language Models–based approaches, Mypy, and PYDYPE) on a benchmark of 900 Python methods. Based on RUPOR, we conduct an empirical study on 25 real-world projects. We find that type smells are significantly related to the occurrence of post-release faults. The fault-proneness prediction model built with type smell features slightly outperforms the model built without them. We also summarize the common patterns, including inserting type check to fix type smell bugs. These findings provide valuable insights for preventing and fixing type-related bugs in the programs written in dynamic-typed languages.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
有热心愿意完成签到,获得积分10
1秒前
wushengdeyu完成签到 ,获得积分10
1秒前
神一样的鸟完成签到 ,获得积分10
2秒前
长安的荔枝完成签到 ,获得积分10
11秒前
fyy完成签到 ,获得积分10
13秒前
22秒前
马大帅完成签到,获得积分10
23秒前
25秒前
CY完成签到,获得积分10
38秒前
淳于安筠完成签到 ,获得积分10
38秒前
45秒前
黑猫老师完成签到 ,获得积分10
45秒前
dada完成签到,获得积分10
59秒前
木又完成签到 ,获得积分10
1分钟前
明理雨莲发布了新的文献求助20
1分钟前
1分钟前
王波完成签到 ,获得积分10
1分钟前
zhenzhangfynu发布了新的文献求助20
1分钟前
1分钟前
1分钟前
小青蛙叫呱呱完成签到,获得积分10
1分钟前
蓝色花生豆完成签到,获得积分0
1分钟前
骑着萝卜飞完成签到 ,获得积分10
1分钟前
zhenzhangfynu完成签到,获得积分10
1分钟前
isedu完成签到,获得积分0
1分钟前
cdercder应助科研通管家采纳,获得10
1分钟前
1分钟前
li发布了新的文献求助10
1分钟前
林家小弟完成签到 ,获得积分10
1分钟前
赖氨酸完成签到,获得积分10
1分钟前
CodeCraft应助li采纳,获得10
1分钟前
1分钟前
寻梦发布了新的文献求助10
1分钟前
花生油炒花生米完成签到 ,获得积分10
2分钟前
传统的孤丝完成签到 ,获得积分10
2分钟前
张琴完成签到 ,获得积分10
2分钟前
bosco完成签到,获得积分10
2分钟前
东北二踢脚完成签到 ,获得积分10
2分钟前
情怀应助明理雨莲采纳,获得10
2分钟前
2分钟前
高分求助中
Principles of Economics, 11th Edition 10000
University Physics with Modern Physics, 16th edition 10000
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Gründe der Seele:Die Wiener Psychatrie im 20.Jahrhundert 1000
Development of a Bridge Weigh-In-Motion System: A technology to convert the bridge response to the passage of traffic into data on vehicle configurations, speeds, times of travel and weights 1000
Organic Reactions, Volume 116 1000
Current concepts in cutaneous toxicity : proceedings of the Fourth Conference on Cutaneous Toxicity, Washington, D.C., May 9-11, 1979 1000
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7270073
求助须知:如何正确求助?哪些是违规求助? 8890570
关于积分的说明 18793349
捐赠科研通 6945455
什么是DOI,文献DOI怎么找? 3203699
关于科研通互助平台的介绍 2376553
邀请新用户注册赠送积分活动 2179581