Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have recently moved to a new company where I am tasked (in part) with evaluating the existing code base and coming up with patterns and best practices.

Our development team consists of around 20 programmers and we have nearly as many projects. The bulk of the code is done in C# and SQL (Stored Procedures).

Naturally, I speak to the guys writing the code. However, I need to read through the code to get a proper idea of what is going on. Given the number of projects, it is extremely time consuming; especially if you're simply trying to get a high-level view of what is going on.

At the moment I am using Enterprise Architect to import the classes into class diagrams. This helps to an extent, but I guess something like a flow diagram would be more useful.

I suspect team leads deal with this same problem often when it comes to code reviews. How do you manage to speed-up code analysis?

share|improve this question

migrated from stackoverflow.com Dec 3 '11 at 5:38

This question came from our site for professional and enthusiast programmers.

1  
Work with the developers. Do reviews (at least part of them, if not all) with them. It'll take your and their time, but you'll have a better understanding of what's going on quicker and you'll be able to note and communicate defects right away and even discuss them. If you repeat this with them multiple times (20+), they'll start seeing their own defects better and not be detached from your work. And yes, code reviews are time consuming and tedious and for best results shouldn't be done in a rush or total isolation. –  Alex Nov 30 '11 at 9:10
    
@Alex Good advice. Thanks! –  Andre Nov 30 '11 at 10:03
add comment

1 Answer

Disclose: I am part of the NDepend team.

Did you try the tool NDepend ? The tool provides many features to do fast code analysis on a .NET code base, like default and custom code rules or dependency graph and dependency matrix. This should help you to quickly pinpoint the bulk of code quality and code architecture flaws.

Concerning code reviews, NDepend proposes the code diff feature. Basically you can compare 2 different snapshots of your code base and explore diff easily. This way you can focus your code reviews on code that has been added or changed since your last stable version.

For example below I am listing NUnit methods added or changed between v2.5.3 and v2.5.8. By right-clicking a changed method you can see the source code diff, or decompile both older and newer versions of the method with Reflector and see the decompiled results diff.

enter image description here

share|improve this answer
    
I must've been living under a rock. This is awesome! Thanks. –  Andre Dec 1 '11 at 11:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.