Software visualization for C#

2019-04-07 08:29发布

问题:

Does any of you know a tool for software visualization, or visual code navigation in c#?

I found a bunch of tools but they're all for Java for some reason.

There's a list of them in wikipedia but none is for the .Net platform.

http://en.wikipedia.org/wiki/Software_visualization#Tools

I'm very much interested in visual code navigation because I get very disoriented around big projects.

回答1:

I think NDepend is what you are looking for, but unfortunately it's not for free.


Edit: I just saw that there is a limited open source version, too.



回答2:

Reflector itself may not offer reasonable visualization of code. But there are addins that can enhance it with such functionality.

Try the following addins on this page:

  • Graph
  • AutoDiagrammer
  • SequenceViz


回答3:

Red Gate's reflector (formerly Lutz Roeder's) allows you to browse assemblies and view their dependencies. Using the analyze function you can see where a class is used and what it uses.

There are also some plugins that make the browsing easier.

Apart from that you can use Visual Studios Object Browser to browse all classes in all referenced assemblies and view their dependencies or you could use the Class View function of Visual Studio to get an overview of the classes and their properties.



回答4:

You can also use VS's own class diagram to give a graphical view for some items. Although I think its limited to just one project at a time. Add a new 'Class Diagram' to the project, and then drag classes or assemblies etc from the Class view onto it to add them; or go to the class view and right click, view diagram. I find these very useful for looking around, but not so great for editing.



回答5:

Frederick, those Reflector add-ins are absolutely great. I will certainly try them out.

I am also interested in "Spacial Representations of Code". It's about using spacial memory to navigate through code (and not get lost).

There's a Microsoft Research group on the subject: http://research.microsoft.com/en-us/projects/SpatialCode/

On that page are a few very cool ideas but no software to download and use (that's research for ya! ).

Does anyone know of anything practical in that direction?



回答6:

It will only be a drop in the ocean, but while you're at it, give Stephan Brenner's .NET Reference Explorer a go. It's very simple, but I find it useful at exactly what it does - graph referenced assemblies.



回答7:

Reflector is certainly an option.

I was more aiming for a visual solution. Perhaps a graph which shows you which class is using which class, or a graph that shows you which method is calling which method.

Examples (although not in C#) are CodeCity, EvoSpaces, CodeCrawler and also some in the link to wikipedia I posted in the original post.

So I was wondering if there's any existing software \ open source project that deals with this stuff.



回答8:

Softagram provides software visualization and visual code navigations for multiple languages. In addition to .NET C#, it also supports C, C++, Java, JavaScript, TypeScript, Python, PHP, Scala and Go.

Softagram has special abstraction capabilities to enable visual code navigation in the biggest projects also, such as Chromium.

It is the only visualization tool that has capability to offer software change visualization integrated to pull requests of Github, Bitbucket and VSTS, and their hosted counterparts (Github Enterprise, Bitbucket Server and TFS).