Playing with NDepend

Few days ago I used NDepend tool to analyze the code of one of our bigger projects in Sogeti. Here are my thoughts on the tool.

NDepend is a static dependency analyzer tool. It scans your compiled code, the PDBs and the source code and produces a “map” of your code dependencies, metrics and structures. It has been around for several years now, and it has kept beeing better in every new edition.

The default view of NDepend is the so-called “Report” that highlights all the potential issues with your code. It gives you a trove of information to optimize your code, in a HTML format that’s easy to share. The report contains the summary of all the main features of the tool: rule violations, dependency cycles, complex code and so on.

NDepend Report

The next feature that I used is the dependency visualization. There are two “flavours” to it: the dependency graph and the dependency matrix.

The dependency graph is easy to grasp but it can only be meaningfully used with a handful of classes and namespaces. It quickly becomes a mess with more than a couple of dozen objects.

NDepend Dependency Graph

The dependency matrix is a much more powerful tool. It can be used to spot dependency cycles, infrastructure classes, “god” classes, cohesion and coupling and so on. However, it’s not as intuitive to analyze as the graph, it takes some time playing with it to grasp the information without consulting the help windows.

NDepend Dependency Matrix

NDepend has a full set of code complexity and maintainibility rules. It can quickly highlight the most important issues so that you can concentrate on fixing the most critical parts of your code.

NDepend Code Rules

But it’s just the surface of it. NDepend has a full-blown language called CQLinq, akin to SQL, that allows you to query your code. You can find classes that have high coupling, methods that are too complex, nested structures in the code and a myriad of other code patterns.

NDepend CQLinq

In my opinion, NDepend is an invaluable tool if you’re concerned about your code quality (and you should be). It takes some time to grasp and master all the power of it, as it can be an overwhelming experience for a first-time user, but it’s a time well invested.

Thanks to Patrick Smacchia (the main force behind NDepend) for the NDepend license for MVPs, that allowed me to fully evaluate the tool.


Helpful SharePoint Tool for Solution Deployment Automation

I decided to give a try to a new tool that has been published at CodePlex, called SharePoint Solution Deployer (SPSD). It is built to automate solution deployment in different environments.

SPSD SharePoint Solution Deployer

The tool is built with PowerShell by Mattias Einig (Swedish SharePoint guys) and it’s made of a close-knit scripts that do the deployment in the following fashion:

  • The environment data is set as a XML config file, one per each environment
  • The solution WSP is dropped in a specific folder
  • Deploy script is run. It retracts the solution from all the servers, resets or recycles IIS and/or SharePoint services, uploads and deploys the solution, all with nice progress information.
  • You can also run pre and post deployment PowerShell scripts, if you need to ensure some non-SharePoint settings.

It’s very simple to configure: it’s just the XML environment file and your WSP file(s) and it runs smoothly.


Give the tool a try and make your own opinion.

Balsamiq Mockups: A Review

As you can probably remember, my frequency of blog posts here has been reduced in the last months. The reason is simple: I’ve been engaged in a enterpreneur startup course, organized by Tetuan Valley in Barcelona. I had an idea for some time already to make a browser business management game, but with a funny touch. The result of all this activity is White Collar Game, still in development. You can check the project blog for more details.

I had to look for a suitable application for making mock-up screens quickly (and I mean really quickly!). Microsoft Visio was too “polished” to be really useful for quick mocking up and drawing by hand had the inconvenience of scanning and the costly retouching and modification.

I stumbled upon balsamiq studio’s Mockups, an Adobe AIR application available as both web and desktop application. The mockups are extremely easy to make: just drag a widget from the toolbar, double-click, write the text and that’s it. The application is updated really fast (almost every week) and there’s a huge repository of pre-made elements available at MockupsToGo. The look-and-feel of the mockups is just right: they aren’t hand-drawn but they look like that. It gives you this funny feeling of freedom to criticise and rearrange things, which is not easy to do with a more “polished” mockup that looks like it’s the real thing.

The fact I like the most, besides being almost perfect tool for doing mockups, is the fact that the company is also a startup, created by Peldi Guilizzoni as a side project when he was working at Adobe. Now he has established the company in Italy and keeps a really interesting blog about the company, including yearly figures and publicly disclosing the company insights in it.

For more information about the balsamiq Mockups tool, check this short video on YouTube.

Thumbs up for Balsamiq!

Visual Studio 2010 Tools for SharePoint


At TechEd EMEA in Barcelona, the Visual Studio 2010 tools for SharePoint were announced and demonstrated. What was showed was the following:

  • Server Explorer for SharePoint to view lists and other SharePoint artifacts directly inside of Visual Studio

  • Existing WSP file import into a new solution

  • Visual Web Part Designer (finally!!!) which loads a user control as a web part for SharePoint (this was an idea I had in mind for some time lately, but it seems that I wasn’t alone in that)

  • Event Receiver Wizard that creates source code with only the event receiver

  • ASPX workflow initiation form designer (and probably other workflow forms, too)

  • Packaging Explorer and the Packaging Editor to fine-tune the WSP layout and contents

You can learn more about these tools on Channel9 and the Visual Studio 2010 homepage or read the original announcement at SharePoint Team blog.

A Marvelous Little Utility for Zooming

Tired of changing the font size when teaching Visual Studio? Try this new miracle tool from Mark Russinovich and SysInternals Team (now on Microsoft payroll).

ZoomIt 2.0 sits in the system tray, waiting for you to press CTRL + 1, and then zooms the entire screen, seamlessly and extremely fast. You can pan around the zoomed area by moving the mouse. To zoom in and zoom out, use the mouse wheel.


And it just weighs 142 KB! Get it here.