代码审计可以被认为是静态分析吗?

Can code audits be considered static analysis?

当人们谈论静态分析时,他们通常谈论质量指标和编程约定。代码审计似乎是不同的东西,因为它发现的是错误和安全漏洞。理论上,两者都是静态分析(代码审计是在不执行程序的情况下进行的,不是吗? 使用 Findbugs、Coverity 等工具)。

那么,代码审计静态分析也是吗?

Code audits is done by humans mostly (with some little help from tools), like any other kind of audits (e.g. financial audits). Code review一般在开发团队内部完成,但代码审计通常由外部人员完成。

静态 source code analysis is done by software code analysis tools, and using them is very complex in practice (so in fact the analyzing software tool needs help or expertise from its user and/or will give false positives).

halting problem 是源代码分析的基本限制:没有工具可以静态检测每个 无限循环程序(并且只有它们)。

为了分析 C 或 C++ 代码,您可能会考虑在源代码中使用 MELT. Or using Frama-C, probably by adding ACSL 注释自定义 GCC 编译器(具有足够的注释,并且在某些 有限的 类 的 C 程序,主要用于嵌入式应用程序,该工具将能够 证明 您的代码运行良好 w.r.t。规范)。

但是有no silver bullet。编程很难(即使使用工具)。