Refactoring with NDepend (1 of N)
 

by Sameera on September 08, 2009 16:37

Almost for the last 2 years, I’ve been working on a substantially large and complex project. And like in any long haul project, some areas of the project’s code has been developing their own distinct smell. Much of the project is in good condition however, thanks mostly to my OCD. But, there’s this one library of code that’s been haunting me in my dreams, begging me to refactor it out of it’s misery. Then again, this is working code…

Refactoring a 2 year old code base is never going to be easy or pleasant. Without the right tools to help you, the task could be pretty daunting. NDepend is one such awesome tool. One glance at the many testimonials the tool has received is enough to realize that this no ordinary app. Check out what the Scott Hanselman’s got to say:

“NDepend is giving me insight into my applications that I haven't had before (...) Once I realized the depth and breadth of the information I was looking at it, I was like a kid in a candy shop.”

Personally however, I was a little intimidated by the complexity of NDepend at first. It’s definitely not the kind of app with which you can jump first and figure out on the way down. You might want to invest a couple of hours going through the documentation first. This post from Andre Loker is probably a good place to start.

Step 1: Figuring out where to start

When you have a large code base to refactor, the hardest thing to do is to figure out where to start. Generally, you’d want to start with the simplest steps. The built in CQL queries in NDepend are probably the best guides for this.BuiltIn_CQL

With just one click (“Run Analysis”), NDepends have come back with a report of how crappy the project’s code is. Not only that, it has made a quick list of 10 methods that I should look in to refactoring. So, there it is… my starting point.

Add comment


(Will show your Gravatar icon)  

biuquote
  • Comment
  • Preview
Loading



About Me

Sameera Perera

Sameera Perera

Log in

RecentComments

Comment RSS

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

Archive

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

All forms of source code published on Codoxide.com are distributed under the Apache License, Version 2.0 unless otherwise stated.
The rest of the content are published under a Creative Commons Attribution 3.0 License.
Creative Commons License

CodoxideTM

Copyright © 2010  codoxide.com. All rights reserved. Designed by Sameera Perera