一句话:通过实证研究提炼四项关键静态分析特性并实现工具 Pyinder,在 68 个真实类型错误中检出 34 个,远超现有工具合计的 16 个。
Python 的动态类型特性使静态类型错误检测在实践中效果不佳。本文是一篇经验论文,作者首先从 20 个开源项目中收集并分析了 68 个真实类型错误,通过实证研究归纳出对有效检测 Python 类型错误至关重要的四项静态分析特性。基于这些洞见,作者设计并实现了静态类型错误检测工具 Pyinder。评估结果显示,Pyinder 成功检测出 68 个错误中的 34 个,而现有类型分析工具合计仅能检测出 16 个。论文还讨论了 Pyinder 未能检测出的其余 34 个错误,为 Python 类型分析工具的未来方向提供了见解,并展示了 Pyinder 能够在近期 Python 项目中发掘此前未知的错误。
In this experience paper, we design, implement, and evaluate a new static type-error detection tool for Python. To build a practical tool, we first collected and analyzed 68 real-world type errors gathered from 20 open-source projects. This empirical investigation revealed four key static-analysis features that are crucial for the effective detection of Python type errors in practice. Utilizing these insights, we present a tool called Pyinder, which can successfully detect 34 out of the 68 bugs, compared to existing type analysis tools that collectively detect only 16 bugs. We also discuss the remaining 34 bugs that Pyinder failed to detect, offering insights into future directions for Python type analysis tools. Lastly, we show that Pyinder can uncover previously unknown bugs in recent Python projects.