Static analysis and code reviews

May 19th, 2009 by Alen Zukich

Jason certainly hits the nail on the head.  Automation, specifically using static analysis, is key and it should be tightly integrated with your code review. Although we need to be careful where we label source code analysis.  Static source code analysis certainly can find those low level issues such as labeling your local variables correctly, but it goes beyond simple code style issues.

Where static source code analysis can really help is with the deep inter-procedural context that it can provide.  For example, during a code review you go through some code with a number of function calls.  Hopefully you know what each and every function is doing…but do you really?  This is where the deep analysis of static source code tools can help.  It can help you identify that there may be an issue in the code review and that issue happens to show that a function is returning NULL.  Uh oh, potential null pointer dereference on our hands.

Now add code reviews with other static source code technology, such as full source cross reference information, flowcharting, impact analysis for any function/methods and architectural representation to show you the full context of the system.  Now you’re talking powerful.

  • email
  • Twitter
  • LinkedIn
  • Reddit
  • DZone
  • Digg
  • Slashdot
  • del.icio.us
  • Technorati

Related posts:

  1. Findbugs not recognizing exceptions? Java static analysis
  2. Java source code vs bytecode analysis
  3. False positives in modern static analyzers

Tags: , , , ,

One Response to “Static analysis and code reviews”

  1. Jason Cohen

    Nice point! You’re right — together the processes are stronger than apart, and indeed each helps the other to be more effective and to fill in the gaps where the other is weak.

Leave a Reply