2020 · 23 citations · 17 references
ComputingComputer ScienceComputer SystemsProgramming LanguagesSoftware EngineeringSystems ProgrammingApplication Programming InterfacesType CheckingType SystemsAutomated Bug FindingBug Pattern DetectionDynamic Program AnalysisDynamic Type CheckingEfficiencyRuntime Type SystemsStatic Bug DetectionStatic Type Checking
The dynamic typing discipline of Python allows developers to program at a high level of abstraction. However, type related bugs are commonly encountered in Python systems due to the lack of type declaration and static type checking. Especially, the misuse of dynamic typing discipline produces underlying bugs and increases maintenance efforts. In this paper, we introduce six types of dynamic typing related practices in Python programs, which are the common but potentially risky usage of dynamic typing discipline by developers. We also implement a tool named PYDYPE to detect them. Based on this tool, we conduct an empirical study on nine real-world Python systems (with the size of more than 460KLOC) to understand dynamic typing related practices. We investigate how widespread the dynamic typing related practices are, why they are introduced into the systems, whether their usage correlates with increased likelihood of bug occurring, and how developers fix dynamic typing related bugs. The results show that: (1) dynamic typing related practices exist inconsistently in different systems and Inconsistent Variable Types is most prevalent; (2) they are introduced into systems mainly during early development phase to promote development efficiency; (3) they have a significant positive correlation with bug occurring; (4) developers tend to add type checks or exception handling to fix dynamic typing related bugs. These results benefit future research in coding convention, language design, bug detection and fixing.
17
A large scale study of programming languages and code quality in github
Baishakhi Ray, Daryl Posnett, Vladimir Filkov et al. · 2014 · 385 citations
An analysis of the dynamic behavior of JavaScript programs
Gregor Richards, Sylvain Lebresne, Brian R. Burg et al. · 2010 · 356 citations
Empirical analysis of programming language adoption
Leo A. Meyerovich, Ariel Rabkin · 2013 · 157 citations
Python probabilistic type inference with natural language support
Zhaogui Xu, Xiangyu Zhang, Lin Chen et al. · 2016 · 92 citations · Full text