I have a question: how difficult is it to implement the ast? It seems like that the bulk of the work for this static code analysis.
A hands-on introduction to static code analysis
11–20 of 32 posts
Re: A hands-on introduction to static code analysis
#12It's good to see discussions of static analysis, but I often feel that these blog posts do a disservice to the techniques. The post leads by mentioning applications like bugfinding and security vuln detection but the examples here are barely above local syntactic checks. This is the common scenario in the majority of blog posts I see about static analysis, probably because it is just much easier to put together a qui…
Article author here. Agree that the post merely touches the surface for static analysis -- because it was aimed towards an audience looking for an introduction to static analysis. The scope for the examples in this post had to be limited for this reason. Inter-procedural pointer analysis -- Yes, a lot more trickier than these, but definitely more juicier. Will try to write a post on it in the coming weeks.
Re: A hands-on introduction to static code analysis
#13The kinds of analyses mentioned here are typically grouped under "linting"–more advanced static analysis tools will typically do things like dataflow analysis.
Any beginner friendly articles on more advanced analysis that you'd recommend?
Re: A hands-on introduction to static code analysis
#14The kinds of analyses mentioned here are typically grouped under "linting"–more advanced static analysis tools will typically do things like dataflow analysis.
Re: A hands-on introduction to static code analysis
#15It's good to see discussions of static analysis, but I often feel that these blog posts do a disservice to the techniques. The post leads by mentioning applications like bugfinding and security vuln detection but the examples here are barely above local syntactic checks. This is the common scenario in the majority of blog posts I see about static analysis, probably because it is just much easier to put together a qui…
Re: A hands-on introduction to static code analysis
#16Slightly tangential to what the article is about, but at least in the C/C++ world, the most important change to make static analysis popular for "the rest of us" was probably Xcode's decision to integrate clang analyzer right into the Xcode UI under a menu item (Xcode doesn't do many things right, but this is definitely one of the very good features). This way, analyzing the code is a simple "button press" and works…
Somewhat annoyingly, the static analyzer that ships with Xcode doesn't seem to be packaged separately as in the command line tools…
Re: A hands-on introduction to static code analysis
#17It's good to see discussions of static analysis, but I often feel that these blog posts do a disservice to the techniques. The post leads by mentioning applications like bugfinding and security vuln detection but the examples here are barely above local syntactic checks. This is the common scenario in the majority of blog posts I see about static analysis, probably because it is just much easier to put together a qui…
I want to read more on this topic. Have you written about this anywhere, or do you have a pointer/suggestion?
If you want to go deeper, Principles of Program Analysis is a popular reference: Principles of Program Analysis https://www.amazon.com/dp/3540654100/
Re: A hands-on introduction to static code analysis
#18Re: A hands-on introduction to static code analysis
#19Earlier quoted context omitted.
Any beginner friendly articles on more advanced analysis that you'd recommend?
https://en.wikipedia.org/wiki/Static_single_assignment_form
SSA is also not even universal among IRs for static analysis at this point. Heap-SSA is growing in popularity for complex dataflow problems involving fields.
Re: A hands-on introduction to static code analysis
#20The kinds of analyses mentioned here are typically grouped under "linting"–more advanced static analysis tools will typically do things like dataflow analysis.
Any beginner friendly articles on more advanced analysis that you'd recommend?