Question

recently I was given the task to discover a C# solution I have never seen before, and give suggestions on refactoring it. I think I will use NDepend (for the first time ever) to see the overall picture, and also to check a lot of code metrics to figure out what could be refactored. NDepend is pretty good at showing the structure of a project, I think.

My question is a more general one: what do you think is the best way to discover code that you are seeing the first time, and need to understand it's structure? (Unfortunately there is no logical design documentation and the code is poorly commented.)

Was it helpful?

Solution

Code Discovery is much more easy with NDepend. This tool provides a top-down approach on dependencies and layering between assemblies, namespaces and classes. This is done with some graph and depednencies matrix generated from the code.

You'll also get dependencies on tier code assemblies, which is really useful to know which part of the code does what.

Also, some graphical representation of volume metrics such as # lines of code helps a lot to get a clear idea of where the effort where done on the code.

OTHER TIPS

I frequently use Reflector to study third-party assemblies as well as .NET assemblies. Not so much for a bird's-eye view of the relations between classes, but a more for close-up detail of exactly what is going on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top