Type Visualiser



Type Visualiser is a .NET application to visualise a compiled .NET type from an assembly.  It shows dependencies to other types and the strength of those dependencies.  It also shows statistics on each individual class (ie number of methods, properties and Intermediate Language (MSIL) Lines of Code (LOC). Types are visualised using colour coded boxes and lines (light blue = .NET Framework type, dark blue = custom class, green = interface, gold = enumeration).  Line thickness indicates how must the target subject type consumes or uses a dependency. Straight lines indicate an association (such as field or property) and dashed lines indicate a consumption or static relationship (ie the subject type creates a type uses it and does not store its value in a field or property). All objects have tool tips to explain what they are representing.

Download

Minimum Requirements: Windows 7 (2Gb+ RAM recommended)
Type Visualiser 32bit | 64bit 16/October/2012 Version 1.0.20
You are free to use it, distribute it, but may not disassemble or modify it in any way and you may not remove references to the author.

Feel free to report issues here. Although I'll try to address any issues enhancements, I do have a day job ;-) There will be issues with it, this is not a commercial product, just a simple after hours project.

Help and Documentation


Why?

I wrote it for two reasons.
  1. I found myself spending time drawing sketches of code that is new to me to.  Understanding how a type is linked to other types and visualising that helps me get a better understanding of the whole solution.
  2. Working with legacy code is challenging and the architecture is seldom as clean and organised as what it was originally intended to be.  Trying to write automated tests across legacy code is hard and can be time consuming.  Visually understanding how many dependencies a type has and how tight or strong those dependencies are helps me strategize and estimate writing tests for legacy code.
One of the reasons why I spent time on "trying" to make it look pretty (and keep in mind I'm a developer not a designer ;-))  is to use these diagrams to show legacy-code project stakeholders the need for some code clean-up or training.  

Screenshots

A visulisation of the Microsoft Unity Container's dependencies.

Diagrams can be rearranged and tidied up and saved.

Can optionally show secondary associations

Features

  • Load any .NET Assembly browse the types (public and internal) and visualise any of its types.
  • Visualise the relationships that are difficult to see completely from code.
  • Dependencies are shown as lines, the thicker the line the more dependent the subject is on the other type.
  • Colour coded lines.  See direct usage of types as opposed to access via an interface. (Red is direct access, black is access via an interface).
  • See the difference between fields and local method variable consumption with dotted and solid lines.
  • Hide System (.NET Framework) types, Trivial Types (you define the trivial list using regular expressions), or just right click and hide any type.
  • Rearrange the diagram how you like it, and save it for later retrieval.
  • Recently viewed type files and reload from this list.
  • Save as a bitmap by that wonderful Screenshot feature of Windows (ALT+PrintScreen).

Known issues:

  • Analyzing the IL code to count lines of code and to discover consumption relationships is slow at the moment.  A better technique is needed to parse the IL.
  • Duplicate types may appear on the diagram if a parent also exists as an association.
  • Clicking a secondary association line may not show just the secondary usage descriptions, it will also show how the subject uses that association as well.
Feel free to contact me with other issues.

History:

  • 1.018 -> 1.0.20
    New line connector mode "Direct" previous was connecting to one of a small number of snap to points.
    Lines will turn from red to black when a type is added to the trivial list.
    Fixed a problem with duplicate types appearing on some diagrams.
    Fixed a problem with secondary lines being drawn incorrectly.
    Fixed a performance issue with unrelated types being loaded.
    Fixed an issue with the trivial list being emptied if a hide command is not used.
  • 1.0.16 -> 1.0.18
    Newer faster diagram engine.
    Now shows all inherited types back to System.Object.
    Can show secondary associations between associations of the main subject.
  • 1.012 -> 1.0.16
    Multi-document interface added so many type diagrams can be open at once.
    New and improved visual style.
    Added some performance adjustments.
  • 1.09 -> 1.0.12
    Fixed connector problem not touching their type boxes after loading a new type.
    New Hide Background feature for clearer screen-shots.
    Grouped like associations together into the same space in the diagram.
    New "click association line" feature to show more detail about where and how the associated type is used in the subject type.
    Added cache for time consuming statistics line LOC calculation.
    Added loading screen when analysing and loading a type.
  • 1.0.8 -> 1.0.9
    Bug fix release. 


Previous Versions:
1.0.18 32bit | 64bit 19/August/2012
1.0.16 32bit | 64bit 6/May/2012
1.0.12 32bit | 64bit 31/Mar/2012
1.0.9 32bit | 64bit 26/Feb/2012
1.0.8 32bit | 64bit 14/Jan/2012
 

1 comment:

  1. It is similar to Sacha Barber's Class diagram generation tool on Code Project.

    http://www​.codeproje​ct.com/Art​icles/1782​3/100-Refl​ective-Cla​ss-Diagram​-Creation-​Tool

    My point of difference is showing the strength of the dependencies and showing usage (consumption) of classes as local variables or static calls (ie that are not fields or properties).

    ReplyDelete