Andrew Stopford's Weblog

poobah

News

Articles

Family

MbUnit Folks

Old Blogs

Wanted: a code discovery tool

Picture this, large scale enterprise app, small scale legacy application, third party code...in other words a code base you are not fully familar with and need to understand. Sure enough can apply the feathers rules but if your in a hurrry to understand to understand a code base to start making changes (and a green field option is not an option) then what do you do? I'm on the look out for a tool that can allow you to explore a code base, explore object dependencies and pathways. Ideas welcome.

Comments

Ben Hall said:

NDepend ? I found it quite useful last time I had to do something like this.

# July 24, 2008 6:34 AM

FransBouma said:

- use a profiler to check which code is run often when you perform actions in the application

- use a code coverage tool to check which code is executed when you perform a given action X

- use code metrics to see which routine is referenced a lot etc.

- and AFTER you gathered those info, you can place debugger breakpoints and can step through code which needs further investigation.

But profiler and code coverage tool are a good start.

# July 24, 2008 7:28 AM

Mads Laumann said:

I created this tool sometime ago. Guess it doesn't solve all your problems, but it should be able to give you a good idea of dependencies between asseblies and projects.

www.codeplex.com/DependencyFinder

# July 24, 2008 10:12 AM

tobsen said:

Get your hands on a CASE tool (e.g. enterprise architect) which is able to reverseengineer the code you have the sources for. Sometimes UML is the best way to tell you what/where/why.

# July 24, 2008 11:11 AM

Fabrice Marguerie said:

In reply to a similar request I received last year, here is a collection of tools I suggested: weblogs.asp.net/.../net-reverse-engineering-tool-for-understanding-projects.aspx

# July 24, 2008 11:43 AM

Pálesz said:

NDepend is quite useful.

By the way, we are working on a tool like you imagined. Quite interactive, massive visualizing, ability to load .NET and Java assemblies/jar files, but at the moment we are only at the beginning of the implementation, so please wait. :)

Once we have finished, i will tell you more about the software, i promise.

# July 24, 2008 12:23 PM

Granville Barnett said:

Profiler + NDepend should help you out.

Good thing about NDepend is that you can drill down and ask more atomic questions.

# July 24, 2008 4:55 PM

Patrick said:

I have to work in this fashion (often with other people's legacy app's) all the time. I tend to find I can do everything I need to do with Resharper and a whiteboard.

I find that the navigation features of this tool the best thing at letting be traverse lots of code very quickly. I use the whiteboad (piece of paper, or set of index cards if I have to) to model out the interactions and dependencies.

The parts of resharper I tend to use:

- FindUsages (let's me find what parts of code depends on this method/variable, etc)

- HighlightUsages in file (gives me an indication about how a member variable might be a key/peripheral concept)

- GoToInheritor (gives me an indication of how many sub-classes/etc I need to understand if I change the superclass)

- GoToBase (so I understand if I make a change in a subclass, what else do I need to understand) or alternatively  (or alternatively ViewTypeHierarchy)

- GoToSymbol or GoToTypeDeclaration using pattern matching and camel case lets me find duplicates or similarly named methods

Good luck!

# August 4, 2008 7:13 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)