arrow
返回

Detecting and Explaining Python Name Errors

delete2025-02-01
delete0
PRE
AI
J
Jiawei Wang *
L
Li Li
刘
刘奎 (Kui Liu)
DOI:10.1016/j.infsof.2024.107592delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Python has become one of the most popular programming languages nowadays but has not received enough attention from the software engineering community. Many errors, either fixed or not yet, have been scattered in the lifetime of Python projects, including popular Python libraries that have already been reused. NameError is among one of those errors that are widespread in the Python community, as confirmed in our empirical study. Yet, our community has not put effort into helping developers mitigate its introductions. To fill this gap, we propose in this work a static analysis-based approach called DENE (short for D etecting and E xplaining N ame E rrors) to automatically detect and explain name errors in Python projects. To this end, DENE builds control-flow graphs for Python projects and leverages a scope-aware reaching definition analysis to locate identifiers that may cause name errors at runtime and report their locations. Experimental results on carefully crafted ground truth demonstrate that DENE is effective in detecting name errors in real-world Python projects. The results also confirm that unknown name errors are still widely presented in popular Python projects and libraries, and the outputs of DENE can indeed help developers understand why the name errors are flagged as such.
Keyword:
Static analysis
Python code
Tools
Empirical studies

期刊

Information and Software Technology 封面图
Information and Software Technology
IF:
4.3
论文数:
3.8K
被引数:
7.7K

机构

M
Monash University
学者数:
5.4W
论文数: 5.4W
被引数: 79
H
huawei technologies
学者数:
3.3K
论文数: 2.9K
被引数: 1
B
Beihang University
学者数:
5.2W
论文数: 4.1W
被引数: 37
学者 查看更多机构
引用论文

引用论文

Analysis of the collagen content and tensile strength of the aponeurotic scar - an experimental study in pigs
err1999-02-01
err0
PREAI
errE. Brenda; A. Marques; P. H. N. Saldiva; M. C. Davini; M. D. Pereira; E. Minami; M. C. Ferreira
err分享
err收藏
Bacillus Calmette-Guérin Treatment and Vesicorenal Reflux
err2017-08-11
err0
PREAI
errA. Böhle; J. Schüller; A. Knipper; A. Hofstetter
err分享
err收藏
Enhanced loading of a magneto-optic trap from an atomic beam
err1994-11-01
err0
PREAI
errBrian P. Anderson; Mark A. Kasevich
err分享
err收藏
Effect of early dietary amino acid restrictions on serum metabolites in pigs selected for lean growth efficiency
err2006-12-01
err0
errOAAI
errH. R. Mule; L. I. Chiba; J. Fabian; D. L. Kuhlers; S. B. Jungst; L. T. Frobish; K. Nadarajah; W. G. Bergen; E. G. Welles
err分享
err收藏
The advantages of normocalcemic continuous warm cardioplegia over low calcemic cardioplegia in myocardial protection
err1999-09-01
err0
PREAI
errYoshinobu Nakamura; Naoaki Takemoto; Hiroaki Kuroda; Shigetsugu Ohgi
err分享
err收藏
Anatomy of pudendal nerve at urogenital diaphragm—new critical site for nerve entrapment
err2005-11-01
err0
PREAI
errStephan Hruby; Johannes Ebmer; A. Lee Dellon; Oskar C. Aszmann
err分享
err收藏
学者 查看更多内容