posted on Tuesday, August 31, 2004 3:07 PM
by
davidboschmans
Code Review with FxCop and DevPartner
If quality is a driver within your software organization you are probably familiar with formal and informal code reviews. Performing code reviews is one of those recommended practices – together with architecture review, design inspections and testing and ... - that can help you to build quality software.
In previous projects I’ve been using FxCop to perform automated code analysis on .NET managed code assemblies, outside and within an automated build process. However this is a great tool, we recently decided to switch to DevPartner’s Code Review solution. Why?
Well - indeed - both solutions are conceptually the same, but only since its most recent release (7.2) DevPartner Professional Studio supports the Visual Studio .NET naming guidelines for the .NET Framework.
Below you can find some of the usability differences I experienced using both tools.
It's all about rules
Both DevPartner Code Review and FxCop use a rules based approach to analyze your project code. Code Review comes with a rules database of 600+ rules, FxCop currently has 200+.
Creating custom rules in DevPartner Code Review is done through a wizard-driven utility, based on regular expressions, where FxCop-custom rules are programmed using the FxCop SDK. I prefer using regular expressions over SDK development because it allows you to extend the rules set without writing and compiling code.
Visual Studio .NET integration
When using DevPartner CodeReview before checking in your code, implementing CodeReview suggestions by DevPartner Code Review is easier because it’s fully integrated into Visual Studio .NET. FxCop is launched as a separate utility that launches VS.NET from a hyperlink embedded in each rule. DevPartner Code review analyzes the source code and the assemblies, looking for problems at each level. FxCop works by examining assemblies and it’s metatdata through the Reflection API.
Summary
Some practices are better at detecting code-errors than others but a proven practice to raise the quality of your software is doing code reviews. Both FxCop and DevPartner Code Review are very useful tools. For those of you not using FxCop: give it a try, it’s free and it will be part of Visual Studio 2005. For those interested in a more robust product and more detailed review information, like McCabe cyclomatic complexity metrics, give DevPartner's Code Review solution a try!