Archive for March, 2006

Test-Driven.NET: a great little tool

I’ve just started to work on a project where we want to apply Test-Driven Development (TDD) methodology. Since not all the developers are going to have Team System, we can’t rely on the built in features for unit testing. Because of that, we’re using NUnit (www.nunit.org) for the unit tests.
 
A few months ago I’ve learned about this little free tool called Test-Driven.NET (www.testdriven.net). This tool integrates unit testing within Visual Studio, regardless of whether we’re using NUnit or Team System’s test framework. In a few words, say you’re working on a test class and you want to run an individual test method, all you have to do is right click within the method’s body and select "Run Test". The test results are shown right on the interface. One can also set a breakpoint and "Run Test with Debugger".
 
One can also right click anywhere on the class and select "Run Tests" to run every test on the class, or do the same on the project, to run all tests within the specific project.
 
Here’s another useful little thing I just found out yesterday: I have a test class with a private helper method that returns a custom object needed by a test method. By accident, I’ve right-clicked on this helper method and selected Run Test. Test-Driven actually ran the code within that method, and dumped the object on the output window (listing all properties and their values on the output window). That little feature alone just helped me troubleshooting an issue I was having, right on.
 

Leave a comment

Migration FxCop custom rules to work with .NET 2.0

I’ve had a bunch of libraries of custom rules that we’ve been using with FxCop against .NET 1.x code. I’ve just gone through the process of recompiling those rules to work against .NET 2.0 assemblies, both using VS 2005 integration with code analysis and the external FxCop 1.35 GUI. Here are my findings on the process:
 
  1. I didn’t have to anything on the code for the rules (seems like the introspection engine hasn’t changed).
  2. In order to use the custom rules within the VS 2005 IDE, the rule assemblies must be copied under the following directory: C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\Rules.
  3. Note that if you’re using the rules within VS 2005, the rule assembly must be compiled against the FxCopSdk.dll and Microsoft.Cci.dll that come with VS 2005 (they’re under C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\). If you’re using the rules from FxCop external GUI instead, the rule assemblies must be compiled against FxCopSdk.dll and Microsoft.Cci.dll that come with FxCop (under some folder like this: C:\Program Files\Microsoft FxCop 1.35).

At this point, I might say I like the integration of code analysis into the VS IDE. However, I still like the way FxCop GUI displays the violations better (better way to see information about the violations, as well as notes typed in by the developers).

See more on the differences between FxCop and VS 2005 on the following posts:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=300185&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299899&SiteID=1

Leave a comment

Speaking at the Houstong .NET User Group

Hey there,
 
yeah, I know, it’s been a while since my last post. Got busy, what can I say.  🙂
 
This coming Thursday (March 9) I’ll be speaking at the Houston .NET User Group (HDNUG). It’s always fun to present at this user group, so I’m looking forward to it. I’m gonna be giving an intro to LINQ.
 
More info at: http://www.hdnug.org/

Leave a comment