Scaling Static Analyses at Facebook
11–20 of 27 posts
Re: Scaling Static Analyses at Facebook
#12We should start to run Infer on all open source C and C++ code in existence.
Hopefully Software Heritage (https://www.softwareheritage.org) will help with that.
Re: Scaling Static Analyses at Facebook
#13Edit: It worked again right after I posted this comment.
Re: Scaling Static Analyses at Facebook
#14Earlier quoted context omitted.
Also, the main issue with static analysis tools tends to be not false negatives, but false positives. That is, they churn out tons and tons of alerts that aren't actually bugs. Some such systems alert so much that they aren't worth using.
Yes, that's the main culprit with traditional static analysis. No one wants to review the results, because the amount of signal to noise is far too low. And also since it's an optional thing and not enforced by the compiler. I think this is where languages with stronger inbuilt analysis (e.g. Rust) win: The results are better, and since the analysis is always running as part of a compiler pass there are no huge jumps…
> diff time [ie in the standard code-review workflow] deployment saw a 70% fix rate, where a more traditional "offline" or "batch" deployment (where bug lists are presented to engineers, outside their workflow) saw a 0% fix rate
That's the difference between "static analysis presented as part of the workflow a developer goes through anyway" and "static analysis presented after the fact". If you're in a position to enforce a code-review workflow that tools can hook into then "at code review time" works, but "at compile time" is better still since it shortens the feedback loop and ensures that everybody sees the issues while they're thinking about the code, even for smaller situations with more ad-hoc or nonexistent code review setups.
Re: Scaling Static Analyses at Facebook
#15Earlier quoted context omitted.
It sounds (from the article) like they have some sort of heuristic for determining potential severity, and they're ok with more false-positives in areas where the potential damage from a false-negative is very high.
I might be biased, but I've never seen these systems work well in practice. Some 15-17 years ago Microsoft depoloyed a system called PreFix which would find genuine, hard to find bugs, but then bury them under a mountain of false positives, so few teams ran it, and even fewer looked at the results. I like what LLVM did in this area. Its SCA is not very comprehensive (so it can't be relied upon for deep analysis), but…
Re: Scaling Static Analyses at Facebook
#16Earlier quoted context omitted.
I might be biased, but I've never seen these systems work well in practice. Some 15-17 years ago Microsoft depoloyed a system called PreFix which would find genuine, hard to find bugs, but then bury them under a mountain of false positives, so few teams ran it, and even fewer looked at the results. I like what LLVM did in this area. Its SCA is not very comprehensive (so it can't be relied upon for deep analysis), but…
The mountain of false positives isn't an issue if you run the static analysis tools from the start of the project's development.
Re: Scaling Static Analyses at Facebook
#17Re: Scaling Static Analyses at Facebook
#18Earlier quoted context omitted.
I might be biased, but I've never seen these systems work well in practice. Some 15-17 years ago Microsoft depoloyed a system called PreFix which would find genuine, hard to find bugs, but then bury them under a mountain of false positives, so few teams ran it, and even fewer looked at the results. I like what LLVM did in this area. Its SCA is not very comprehensive (so it can't be relied upon for deep analysis), but…
In python, Pylint and mypy find real bugs all the time, plenty of false positives but still very usable.
Re: Scaling Static Analyses at Facebook
#19We should start to run Infer on all open source C and C++ code in existence.
Not only Infer, but other static analyzers would also be useful. Hopefully Software Heritage ( https://www.softwareheritage.org ) will help with that.
Re: Scaling Static Analyses at Facebook
#20Earlier quoted context omitted.
Also, the main issue with static analysis tools tends to be not false negatives, but false positives. That is, they churn out tons and tons of alerts that aren't actually bugs. Some such systems alert so much that they aren't worth using.
Yes, that's the main culprit with traditional static analysis. No one wants to review the results, because the amount of signal to noise is far too low. And also since it's an optional thing and not enforced by the compiler. I think this is where languages with stronger inbuilt analysis (e.g. Rust) win: The results are better, and since the analysis is always running as part of a compiler pass there are no huge jumps…