First of all, if you are like me, you certainly don’t want another
Visual Studio extension that will slow down your work environment. So
let’s be clear: tremendous efforts have been put on performance and
memory consumption. Even on large code base, made of hundreds of
thousands of lines of code and dozens of VS projects, Visual Studio is
not noticeably slow down by the NDepend v3 addin. Check by yourself and try NDepend v3.0.0 Beta3 here (v3 Beta3 pro works with v2 pro licenses and a v3 trial version is also available). VisualStudio 2010, 2008 and 2005
are supported. VS 2010 Beta2 is not supported, NDepend v3 Beta3 works
on the limited VS 2010 SLCTP3 and hopefully it will work with VS 2010
RC1 (to be released in a few weeks in February).
So what does NDepend v3 brings to the table? Simply
put, what NDepend v2 does in the Continuous Integration/Build process,
NDepend v3 does it live at development-time inside Visual Studio
(of course CI/Build integration facilities are still supported). A
progress circle, in the status bar of Visual Studio, constantly informs
the developer if the code currently violates some CQL rules. An
informative window appear when the circle is hovered by the mouse.

If
you are serious about conventions in your code base, you can easily
define your own CQL rules and make sure that they are checked
automatically and often, even before developers commit their changes.
CQL rules cover a wide range of concerns, including: structuring ; layering ; components boundaries ; code changes ; dozens of quality metrics ; code element naming ; NET Fx usage ; API usage ; API evolution and ascendant compatibility ; coverage ratio by tests ; dead-code detection ; un-optimal encapsulation, ; side-effects and mutability etc …(all this is detailed here).
It
takes 2 to 5 seconds to check hundreds of CQL rules asynchronously on a
low-priority thread in VS, at each compilation, or if your prefer every
N hours (this is easily configurable). The magic behind this
performance achievement comes from what we call incremental analysis: NDepend v3 only focuses on code that has been changed since the last analysis.
There are many other innovative capabilities brought by this new version of NDepend, let’s briefly mention some of them:
- Multi VS solutions wide-analysis and collaboration: A NDepend project can
spawn dozens of VS projects partitioned in several VS solutions. A same
NDepend project can be attached to several VS solutions that represent
your entire code base (eventually including tests projects). Once there
are several solutions opened in several instance of VS (one for tests,
one for UI code, etc.), NDepend menus lets you jump naturally from one
solution to another; Concretely you can go to the source code
definition of code element B defined in VS solution B from anywhere it
is referenced in VS solution A opened in another instance of VS. A
unique possibility and a huge time saver!
- Rich Code Search in VS: All search capabilities of NDepend
are now integrated in VS. VS itself and many other Addins comes with
their own Search facilities. What makes NDepend search different is
- NDepend search updates result instantly while refining search
criteria, no matter how big is the code base nor the number of matches
found,
- NDepend search can be done according to plenty of different
criteria (by text(s) in name, by regex(s) , by code metrics, by
changes, by visibility, by purity…),
- NDepend search by name comes with many unique facilities to make code search more efficient (more on this here Efficiently Searching Code Elements by Name),
- Searching in diff between 2 versions of the code base is a unique way to code review changes (more on this here Drastically leverage your Code Reviews).
- Search scope can spawn several VS solutions, includes tier code
matched by search as well, and constitutes a point of jump across multi
VS solutions opened in several VS instances..

- Multi CQL Query Edition in VS: CQL is to a code base what
SQL is to a relational database. Interestingly enough, the "Search in
code" feature described above is just a CQL Query generator. You can
edit several CQL Queries at a time in VS to query the code at whim or
readily define new CQL rules, pretty much the same way you would write
SQL code to query a relational database.


- Continuous comparison with a base line in VS: For a long
time, NDepend v2.x lets users explore changes between 2 snapshots of a
code base. With NDepend v3, we harness this feature to continuously
provide in VS the information of what has been refactored or added
since a particular base line. We expect that the base line will often
be the most recently released in production version of the code. If you
cared to save on your HardDrive a copy of the source code base line,
NDepend will let you compare in a click from VS changes made in source
files themselves.

- Reflector disassembly’s comparison: NDepend can command
Reflector from VS to disassemble in source file (in C#, VB.NET, IL
etc.) any class or any method. With this facility, one click is enough
to disassemble 2 versions of the same code element from 2 versions of
the container assembly. Then, NDepend automatically opens the 2
disassembled code text files built with your favorite text comparison
tool. This is ideal if you want to quickly check from production
assemblies which recent changes might have caused a particular bug.

- Deep VS Integration: Whether it is from Solution Explorer or
Code Editor, all NDepend features are available on right-click as soon
as the context can be recognized as a code element (including
application or referenced assembly, namespace, type, method or field).
All NDepend features (CQL query generation, interaction with code
visualization panels, interaction with Reflector...) are grouped under
a single NDepend menu. If you become addict, any NDepend menu can
optionally be shown at the right-click menu first level.
- NDepend Session state preserved: Now NDepend's panels states
(and their undo/redo states as well) are persisted across VisualNDepend
or VisualStudio sessions. When you open VS the day after, everything is
in the same state as it was before you shut down your computer.
There are dozens of others cool features in the product including
Rich informational contextual tooltip, Global summary of the code base,
supports for .NET v4, Silverlight 3 and Reflector 6, dozens of UI
usability enhancements (including some new facilities in the
visualization with the Dependency Graph) etc … The vast majority of
these evolutions has been driven from users feedback.
NDepend v3
is now in beta phase and we will have a final version in February. It
is a Go Live beta, we are confident that the current NDepend v3 beta3
is stable and won’t disturb you in your work. All NDepend licenses sold
from now are v3 compatible and questions concerning v2 licenses
upgrading will be answered on-time on the web-site. Now download NDepend v3 and harness your VisualStudio work environment!
Posted
Thu, Jan 28 2010 10:21 AM
by
Patrick Smacchia
Filed under: Dependency Matrix, code base snapshot comparison, NDepend, Metric View, VS, CQL, Code visualization, VS Integration, Dependency Graph, Rich Code Search, VStudio, Reflector, Treemap, incremental analysis, Silverlight, Visual Studio