Static analysis tools typically address the problem of excessive false positives by requiring programmers to explicitly annotate their code. However, when faced with incomplete annotations, many analysis tools are either too conservative, yielding false positives, or too optimistic, resulting in unsound analysis results. In order to flexibly and soundly deal with partially-annotated programs, we propose to build upon and adapt the gradual typing approach to abstract-interpretation-based program analyses. Specifically, we focus on null-pointer analysis and demonstrate that a gradual null-pointer analysis hits a sweet spot, by gracefully applying static analysis where possible and relying on dynamic checks where necessary for soundness. In addition to formalizing a gradual null-pointer analysis for a core imperative language, we build a prototype using the Infer static analysis framework, and present preliminary evidence that the gradual null-pointer analysis reduces false positives compared to two existing null-pointer checkers for Infer. Further, we discuss ways in which the gradualization approach used to derive the gradual analysis from its static counterpart can be extended to support more domains. This work thus provides a basis for future analysis tools that can smoothly navigate the tradeoff between human effort and run-time overhead to reduce the number of reported false positives.
翻译:平板分析工具通常处理过度假正数的问题,要求程序员明确说明其代码。然而,在遇到不完整的说明时,许多分析工具要么过于保守,产生虚假正数,要么过于乐观,导致分析结果不健全。为了灵活和妥善地处理部分附加说明的方案,我们提议以逐步打字方法为基础,将逐步打字方法调整为抽象口译方案分析。具体地说,我们侧重于无指点分析,并表明逐步进行无指针分析会达到一个甜点,尽可能优雅地进行静态分析,并在必要时依靠动态检查,以保持稳健。除了将逐步的无指数分析正规化,我们还利用“Infer”静态分析框架建立一个原型,并提出初步证据,证明逐步的无指数分析会减少假正数,而现有两个“Infer”对准程序分析是无效的。此外,我们讨论了如何将渐进式分析方法扩大用于从其静态对称对称中进行逐步分析,从而支持更多的领域。这项工作为未来分析工具提供了基础,从而减少了能够平稳地将人类努力与运行中转式平时平时平时平式平路的数字进行。