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?

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

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

  • I must've been living under a rock. This is awesome! Thanks. – André Hauptfleisch Dec 1 '11 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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