As mentioned in previous posts a huge effort of the TFS Migration tools initiative was to reverse engineer an existing code base, understand and document the environment. At this stage we are making huge strides with tools such as Sandcastle and Reflector, but the tool that excites me very much is the VSTS 2010 BETA-1 Architecture Edition. Those that know me know that I used to step around the VSTS 2005 and 2008 Architecture Edition, but with VSTS 2010 the path is changed from “step around” to “embrace”.
The list of features in the Architecture toolbox includes:
- Support for UML Diagrams, including:
- Use Case
- Architectural Validation
- Layer Diagram to model the layers, the key components and communication, as well as validation of the layer diagram, the rules and the code base.
- Support for MSBuild tasks, in other words validating the validation as part of the build. See references below for some great links to making it happen.
- Code discovery
- Architecture Explorer
- DGML Graphs
- Sequence diagrams from code
- Work Item integration
Stop the bus … acronyms
- MEF … stands for Managed Extensibility Framework, which enables plug-in extensions into the VSTS product. For more information on MEF, refer to http://www.codeplex.com/MEF, which outlines a general MEF framework, similar to a version that is built into Visual Studio 2010.
- DGML … well, if we ask the www.acronymfinder.com we get Duane G. Meyer Library (Springfield, MO), which is the wrong bus. In fact DGML, in this context, refers to Directed Graph Markup Language and Cameron has a great post on it here.
The Architecture Explorer is an amazing “reverse engineering” tool and its visualizations are phenomenal in terms of getting to grips with an existing code base. So many times in my past adventure I used to get a request “can you ‘quickly’ review the solution and give us a ‘happy’ feeling indicator” … when you peek into the DVD that is normally dropped on your desk you find code, code and more code … if lucky you find snippets of documentation which usually predates the code base and therefore it it a risk you take when ‘assuming’ that the documentation and the code base are part of the same movie. In the past I personally relied on tools such as the Reflector, as shown below, to dig into code base and get a feeling of dependencies.
With VSTS 2010 BETA-1 we were able to not only generate sequence diagrams, as shown below, from the code base, but using the Architecture Explorer we were able to dig into the code, get a mental picture and also a visualisation of dependencies.
… diagram cut intentionally at this point to minimise noise :)
If you take the Reflector screen shot shown earlier, you can create similar visualisations using the architecture explorer:
… the dependency matrix is really “cool” and useful:
… just an example, you can tune and fine-tune what you see and hide to your hearts content.
Obviously the 2008 class diagram visualisation still works as well:
The use case, activity, layer and component diagrams have not been used as yet in our reverse engineering exercise, but all are worth a second glance. Refer to http://msdn.microsoft.com/en-us/library/57b85fsc(VS.100).aspx for an introduction and walkthroughs on some of these models.
Obviously we are working with a BETA 1 product and therefore we have stumbled over a few rough edges and feature requests that we would like to raise. I am sure that the VSTS Architecture team will jump in and add relevant comments.
- Ability to drag classes from solution explorer onto logical class diagram.
- Ability to fine tune sequence diagrams, i.e. more control over exclusions and inclusions . For example when staring at a sequence diagram that potentially spans an A1 page, it would be great to rebuild saying, included only X, Y and Z, rather than just excluding stuff.
- Ability to export models as high-quality images. Copy+Paste works for all, however, quality suffers and working with “huge” diagrams is a challenge.
- Ability to segregate models into A4 pages, i.e. break up a large sequence diagram and save as individual files.
- Ability to reverse engineer activity, logical class and layer diagrams from code.
Some “rocking” references include:
As a sycophantic South-African, born in Switzerland, I should use a Potjie pot or Swiss Cheese ranking system.
To avoid confusion, I will resort to the standard out of 5 star system: /5 … I love it!
Reason? Features are not yet perfect, but add immense design and productivity value to our project. Reverse engineering has become a “fun” exercise and the resultant artefacts are both accurate and professional looking.