views:

124

answers:

4

I have done with my web application. Now I am into code review phase. I have looked for some tools for code review in StackOverflow. But my question is:

Why should I depend on a tool for my code review?

+3  A: 

It helps much to investigate possible issues during review phase.

Artic
+5  A: 

You shouldn't rely on a tool for your complete code review - but you can use a tool to help you check for consistency in style, naming etc. Some tools can go further, spotting potential concurrency issues, null pointer dereferencing and so on.

It's a good idea to fix as many of these problems as possible before getting another person on board for the rest of the code review, so that you can make their time as useful as possible.

I'm slightly surprised that you're "done" with your application before getting any code reviewed, however - I think it's a much better idea to do a code review at the point of each check-in to source control; that way you can discover potential weaknesses in your design much earlier.

Jon Skeet
@jon what c# code review tool you use?
Pandiya Chendur
@jon i want to know too...
Meysam Javadi
@Pandiya: To be honest, I haven't used very many myself... don't forget that I haven't been writing production code in C# for quite a while (I'm a Java developer during the day). However, you should investigate FxCop, StyleCop, and the Code Contracts in .NET 4. I'd also add that I use ReSharper, which gives me a constant code review of sorts - it has a coloured bar alongside the code which shows potential problems and suggestions.
Jon Skeet
A: 

If you are working in a team, how do you ensure that everyone has followed certain standards like variable naming convention, comments, moderately sized functions, using stored procs instead of direct queries and so on? This is the place where a tool can help you. If it comes to pure logic and core functionality of the business logic, the tool will not be able to help you to that extent.

.NET CLR Profiler tool, for example, can tell you lots about the performance of your code and it is one tool that you can't even think about running in production since it makes everything painfully slow.

FxCop - http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx

<snip> 

FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies, such as possible design, localization, performance, and security improvements. Many of the issues concern violations of the programming and design rules set forth in the Design Guidelines for Class Library Developers, which are the Microsoft guidelines for writing robust and easily maintainable code by using the .NET Framework. FxCop is intended for class library developers. However, anyone creating applications that should comply with the .NET Framework best practices will benefit. FxCop is also useful as an educational tool for people who are new to the .NET Framework or who are unfamiliar with the .NET Framework Design Guidelines. FxCop is designed to be fully integrated into the software development cycle and is distributed as both a fully featured application that has a graphical user interface (FxCop.exe) for interactive work, and a command-line tool (FxCopCmd.exe) suited for use as part of automated build processes or integrated with Microsoft Visual Studio® .NET as an external tool.

</snip>

References : http://www.codeplex.com/TFSCodeReviewFlow http://msdn.microsoft.com/en-us/library/ms998364.aspx http://articles.techrepublic.com.com/5100-10878_11-5034931.html

Rahul Soni
+1  A: 

By tool, do you mean a tool that will do the "dumb" part of the job automatically by doing some kind of static analysis and leave the interesting parts (because they can't be automated) for a human or do you mean a tool that will ease the collaboration between people, the tracking of reviews and corrections, etc like reviewboard, Google Code's code review tool, codebeamer, etc? In both cases, I think I gave some hints.

Pascal Thivent