<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>DotNetSurfers Blog</title>
  <link rel="alternate" type="text/html" href="http://www.dotnetsurfers.com/Blog/" />
  <link rel="self" href="http://www.dotnetsurfers.com/Blog/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2010-02-10T06:50:58.2466939-07:00</updated>
  <author>
    <name>Latish Sehgal</name>
  </author>
  <subtitle>Thanks for stopping by. My name is Latish Sehgal and this is my blog on dot net and related technologies. </subtitle>
  <id>http://www.dotnetsurfers.com/Blog/</id>
  <generator uri="http://www.dasblog.net" version="2.0.7180.0">DasBlog</generator>
  <entry>
    <title>Getting Started with Mocking - Part 1 - The Basics</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2010/02/10/GettingStartedWithMockingPart1TheBasics.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,2e05aba3-322d-4042-a0ae-8b86869229a6.aspx</id>
    <published>2010-02-10T06:50:58.2466939-07:00</published>
    <updated>2010-02-10T06:50:58.2466939-07:00</updated>
    <category term="mocking" label="mocking" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,mocking.aspx" />
    <category term="MOQ" label="MOQ" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,MOQ.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.dotnetsurfers.com/utils/mocking1.zip" target="_blank">Download
Code</a>.
</p>
        <p>
This 2 part blog post series is based on a <a href="http://www.dotnetsurfers.com/Blog/2010/01/07/DallasCSharpSIGPresentationCodeAndSlides.aspx" target="_blank">talk</a> I
gave at the Dallas C# SIG last month. In this post, I describe general mocking concepts
that are independent of mocking frameworks. In the next post, I’ll describe how using
a mocking framework (like MOQ) can reduce development time and effort. 
</p>
        <p>
You are probably familiar with Unit Tests, but let’s spend a little time revisiting
them. As per <a href="http://weblogs.asp.net/rosherove/archive/2009/09/28/unit-test-definition-2-0.aspx" target="_blank">Roy
Osherove</a>  
<br />
              “A
unit test is a fast, in-memory, consistent, automated and repeatable test of a functional
unit-of-work in the system.” 
<br />
This is different from writing Integration Tests, which can talk to external resources
such as the filesystem, webservices, database and are inherently slow. A common mistake
is to create a Unit Test Suite but fill it with Integration tests. This increases
the test execution time and discourages developers from running the Unit Tests on
a regular basis (Ideally, each time before checking in code or more frequently).
</p>
        <p>
For the purpose of this series, lets assume that you are a senior developer at a firm
with plenty of work on your hands. Your pointy haired manager stops by to tell you
that he has a new project for you. Seeing that you are busy, he offers to assign you
an intern, Adam. You reluctantly agree and talk to Adam who seems like a sharp, reserved
guy with a good grasp over OOPs concepts. You go over the project requirements with
him, which consist of building a simple Shopping Cart. The Shopping Cart should 
</p>
        <ol>
          <li>
have the capability to add a product and update price accordingly, 
</li>
          <li>
have some sort of logging functionality. 
</li>
        </ol>
Adam seems confident that he can build this project, When asked about Unit Testing,
he admits not having any prior experience with it. You tell him to look it up, and
write Unit Tests for his code as well. So Adam goes into his cave, and starts working
on the Shopping Cart app.He informs you after 2 days that he has now completed the
application and his code is ready for review. The basic design looks like this 
<p></p><p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="MOQ_ClassDiagram[1]" border="0" alt="MOQ_ClassDiagram[1]" src="http://dotnetsurfers.com/blog/images/moq_classdiagram.jpg" width="398" height="484" /></p><p></p><p>
The code for the <strong>ShoppingCart</strong> class is pretty simple. It has a <strong>Total</strong> property
denoting the total price of the Shopping Cart, and an <strong>AddProduct()</strong> function,
which adds the price of the product to the total and logs a message. The logger object
is passed to the <strong>ShoppingCart</strong> via constructor injection. Also, the
ShoppingCart is coded against IProduct and ILogger interfaces rather than concrete
implementations, which makes testing easier.
</p><div class="csharpcode"><pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">public</span><span class="kwrd">class</span> ShoppingCart</pre><pre><span class="lnum"> 2: </span> {</pre><pre class="alt"><span class="lnum"> 3: </span><span class="kwrd">public</span> ShoppingCart(ILogger
logger)</pre><pre><span class="lnum"> 4: </span> {</pre><pre class="alt"><span class="lnum"> 5: </span><span class="kwrd">this</span>._logger
= logger;</pre><pre><span class="lnum"> 6: </span> }</pre><pre class="alt"><span class="lnum"> 7: </span> </pre><pre><span class="lnum"> 8: </span><span class="kwrd">private</span> ILogger _logger;</pre><pre class="alt"><span class="lnum"> 9: </span><span class="kwrd">public</span><span class="kwrd">decimal</span> Total
{ get; set; }</pre><pre><span class="lnum"> 10: </span> </pre><pre class="alt"><span class="lnum"> 11: </span><span class="kwrd">public</span><span class="kwrd">void</span> AddProduct(IProduct
product)</pre><pre><span class="lnum"> 12: </span> {</pre><pre class="alt"><span class="lnum"> 13: </span> Total = Total + product.Price;</pre><pre><span class="lnum"> 14: </span><span class="kwrd">if</span> (_logger != <span class="kwrd">null</span>)</pre><pre class="alt"><span class="lnum"> 15: </span> _logger.Log(String.Format(<span class="str">"Product
{0} has been added."</span>,product.Name));</pre><pre><span class="lnum"> 16: </span> }</pre><pre class="alt"><span class="lnum"> 17: </span> }</pre></div><style type="text/css">


























.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style><p>
We don’t really care about the Logger and Product implementation, but just know that
the Logger logs to a text file in “C:\temp”, and the Product class retrieves the product’s
price from the database. Adam has created 2 unit tests, one to check that the Shopping
Cart updates its price correctly, and the second one to ensure that logging is done.
</p><div class="csharpcode"><pre class="alt"><span class="lnum"> 1: </span> [TestMethod]</pre><pre><span class="lnum"> 2: </span><span class="kwrd">public</span><span class="kwrd">void</span> AddProduct_AddingProductWithPrice10_ShouldMakeTotal10()</pre><pre class="alt"><span class="lnum"> 3: </span> {</pre><pre><span class="lnum"> 4: </span> var target = <span class="kwrd">new</span> ShoppingCart(<span class="kwrd">null</span>);</pre><pre class="alt"><span class="lnum"> 5: </span><span class="rem">//make sure product
with ID =1 in database has Price = 10.00</span></pre><pre><span class="lnum"> 6: </span> var product = <span class="kwrd">new</span> Product
{ID = 1, Name = <span class="str">"Product1"</span>};</pre><pre class="alt"><span class="lnum"> 7: </span> target.AddProduct(product);</pre><pre><span class="lnum"> 8: </span> Assert.AreEqual(target.Total, 10.00M);</pre><pre class="alt"><span class="lnum"> 9: </span> }</pre><pre><span class="lnum"> 10: </span> </pre><pre class="alt"><span class="lnum"> 11: </span> [TestMethod]</pre><pre><span class="lnum"> 12: </span><span class="kwrd">public</span><span class="kwrd">void</span> AddProduct_AddingProduct_ShouldCallLogger()</pre><pre class="alt"><span class="lnum"> 13: </span> {</pre><pre><span class="lnum"> 14: </span> var logger = <span class="kwrd">new</span> Logger();</pre><pre class="alt"><span class="lnum"> 15: </span> var target = <span class="kwrd">new</span> ShoppingCart(logger);</pre><pre><span class="lnum"> 16: </span> var product = <span class="kwrd">new</span> Product
{ID = 2, Name = <span class="str">"Product2"</span>};</pre><pre class="alt"><span class="lnum"> 17: </span> target.AddProduct(product);</pre><pre><span class="lnum"> 18: </span><span class="rem">//Open log file and make sure
corresponding log was added.</span></pre><pre class="alt"><span class="lnum"> 19: </span> }</pre></div><style type="text/css">
























.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style><p>
Clearly, his Unit Tests leave a lot to be desired. They depend on the state of the
database and the filesystem and therefore are not fast or in-memory. For the same
reasons, they are also not repeatable or automated. These are in fact, more close
to Integration Tests than Unit Tests. This is a very common mistake. You advise him
to mock his dependencies, and since the ShoppingCart class interacts with interfaces
rather than concrete implementations, this should be easy to accomplish. 
</p><table border="1" cellspacing="0" cellpadding="2" bgcolor="#c68158" align="center"><tbody><tr><td valign="top" width="967"><h3 align="center">Stubs VS Mocks
</h3><p align="left">
The definition of stubs and mocks and their differences has been debated many times
before. The <a href="http://www.martinfowler.com/articles/mocksArentStubs.html" target="_blank">Mocks
Aren’t Stubs</a> article by Martin Fowler is a good resource to get started (The concepts
really hit home for me after reading Roy Osherove’s <a href="http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274" target="_blank">The
Art of Unit Testing</a>. I highly recommend the book if you are getting started with
Unit Testing). A few guidelines to remember about Mocks and Stubs are:
</p><ul><li><div align="left">You can have many stubs in a unit test, but you should have only
one mock object.
</div></li><li><div align="left">Stubs help in getting the unit test set up, but you’ll never assert
against the stub object. You’ll assert against the class under test.  
</div></li></ul><p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="stub[1]" border="0" alt="stub[1]" src="http://dotnetsurfers.com/blog/images/stub.jpg" width="543" height="312" /></p><blockquote><p>
If you are using mocks, you will assert against the mock object. Stubs lend themselves
more naturally to state based unit testing and mocks to interaction based unit testing.
</p><p></p></blockquote><p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="mock[1]" border="0" alt="mock[1]" src="http://dotnetsurfers.com/blog/images/mock.jpg" width="543" height="312" /></p></td></tr></tbody></table><p>
Adam now understands what he is doing wrong, and works on isolating his unit tests
to test only the ShoppingCart class. He creates new implementations for IProduct and
ILogger that he can use for Unit Testing. Note that in the new implementations, he
only has to put in logic needed to get his unit tests to work.
</p><div class="csharpcode"><pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">public</span><span class="kwrd">class</span> ProductStub:IProduct</pre><pre><span class="lnum"> 2: </span> {</pre><pre class="alt"><span class="lnum"> 3: </span><span class="kwrd">public</span><span class="kwrd">string</span> Name
{ get; set; }</pre><pre><span class="lnum"> 4: </span><span class="kwrd">public</span><span class="kwrd">decimal</span> Price
{ get; set; }</pre><pre class="alt"><span class="lnum"> 5: </span><span class="kwrd">public</span><span class="kwrd">string</span> GetProductCategory()</pre><pre><span class="lnum"> 6: </span> {</pre><pre class="alt"><span class="lnum"> 7: </span><span class="kwrd">throw</span><span class="kwrd">new</span> NotImplementedException();</pre><pre><span class="lnum"> 8: </span> }</pre><pre class="alt"><span class="lnum"> 9: </span> }</pre><pre><span class="lnum"> 10: </span><span class="kwrd">public</span><span class="kwrd">class</span> LoggerMock:ILogger</pre><pre class="alt"><span class="lnum"> 11: </span> {</pre><pre><span class="lnum"> 12: </span><span class="kwrd">public</span><span class="kwrd">int</span> NumberOfTimesLoggerCalled
{ get; set; }</pre><pre class="alt"><span class="lnum"> 13: </span><span class="kwrd">public</span><span class="kwrd">void</span> Log(<span class="kwrd">string</span> text)</pre><pre><span class="lnum"> 14: </span> {</pre><pre class="alt"><span class="lnum"> 15: </span> NumberOfTimesLoggerCalled++;</pre><pre><span class="lnum"> 16: </span> }</pre><pre class="alt"><span class="lnum"> 17: </span> }</pre></div><style type="text/css">




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style><p></p><p>
And he revises his Unit Tests accordingly
</p><div class="csharpcode"><pre class="alt"><span class="lnum"> 1: </span> [TestMethod]</pre><pre><span class="lnum"> 2: </span><span class="kwrd">public</span><span class="kwrd">void</span> AddProduct_AddingProductWithPrice10_ShouldMakeTotal10()</pre><pre class="alt"><span class="lnum"> 3: </span> {</pre><pre><span class="lnum"> 4: </span> var cart = <span class="kwrd">new</span> ShoppingCart(<span class="kwrd">null</span>);</pre><pre class="alt"><span class="lnum"> 5: </span> var stubProduct = <span class="kwrd">new</span> ProductStub(){Price=10.00M};</pre><pre><span class="lnum"> 6: </span> cart.AddProduct(stubProduct);</pre><pre class="alt"><span class="lnum"> 7: </span> Assert.AreEqual(cart.Total, 10.00M);</pre><pre><span class="lnum"> 8: </span> }</pre><pre class="alt"><span class="lnum"> 9: </span> </pre><pre><span class="lnum"> 10: </span> [TestMethod]</pre><pre class="alt"><span class="lnum"> 11: </span><span class="kwrd">public</span><span class="kwrd">void</span> AddProduct_AddingProduct_ShouldCallLogger()</pre><pre><span class="lnum"> 12: </span> {</pre><pre class="alt"><span class="lnum"> 13: </span> var loggerMock = <span class="kwrd">new</span> LoggerMock();</pre><pre><span class="lnum"> 14: </span> var cart = <span class="kwrd">new</span> ShoppingCart(loggerMock);</pre><pre class="alt"><span class="lnum"> 15: </span><span class="kwrd">int</span> oldNumberOfTimes
= loggerMock.NumberOfTimesLoggerCalled;</pre><pre><span class="lnum"> 16: </span> cart.AddProduct(<span class="kwrd">new</span> ProductStub());</pre><pre class="alt"><span class="lnum"> 17: </span> Assert.AreEqual(oldNumberOfTimes
+ 1, loggerMock.NumberOfTimesLoggerCalled);</pre><pre><span class="lnum"> 18: </span> }</pre></div><style type="text/css">



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style><p>
Adam’s Unit Tests now pass and he has done a good job of keeping them free from external
resources such as the filesystem or database by manually mocking his classes. Note
how the first Unit Test uses the new IProduct implementation (a Stub) to support the
Unit Test but asserts against the Shopping Cart object, whereas the second one asserts
against the new ILogger implementation (a Mock).
</p><p>
In the next post, we’ll see how Adam can achieve the same granularity in his Unit
Tests by using a mocking framework rather than creating manual mocks.
</p><p><a href="http://www.dotnetsurfers.com/utils/mocking1.zip" target="_blank">Download
Code</a>.
</p><img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=2e05aba3-322d-4042-a0ae-8b86869229a6" /></div>
    </content>
  </entry>
  <entry>
    <title>CodeMash 2010: Review</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2010/01/16/CodeMash2010Review.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,01d6a56c-3a22-48b6-a74f-a2098374a383.aspx</id>
    <published>2010-01-16T03:20:00-07:00</published>
    <updated>2010-01-21T08:22:47.205333-07:00</updated>
    <category term="community" label="community" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,community.aspx" />
    <category term="conference" label="conference" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,conference.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I am sitting at the Cleveland airport right now, waiting for my flight back to Dallas.
I spent the last 3 days at the <a href="http://www.codemash.org/" target="_blank">CodeMash</a> conference
held at the Kalahari resorts in Sandusky, Ohio. This was the biggest (and longest)
conference that I have been to. It was exhilarating to be surrounded by and talk to
such passionate developers. You could feel the high energy levels throughout the conference.
Some of the highlights for me were:
</p>
        <ul>
          <li>
Bootstrapping your business session with <a href="http://kohari.org/" target="_blank">Nate
Kohari</a> and <a href="http://averyblog.com/" target="_blank">James Avery</a>: I
have great respect for entrepreneurs, and more so for those with a coding background.
Nate and James shared things that worked for them in their ventures, and a lot of
things that didn’t. The session was very interactive, and a great start to the conference
for me. 
</li>
          <li>
Ruby/IronRuby: One of my goals for going to CodeMash was to decide if I am going to
spend any significant amount of time trying to learn Ruby/IronRuby this year. The
passion that a lot of the developers (especially the EdgeCase folks)  had for
Ruby was definitely contagious and hard to ignore. I ended up attending a couple of
Ruby sessions and I hope to spend more time with it in the next couple of months.
The best Ruby session for me was “Ruby and Rails for the .Net developer” by <a href="http://blog.mattyoho.com/" target="_blank">Matt
Yoho</a>. 
</li>
          <li>
Meeting more geeks: I got to meet a bunch of great people I knew from twitter, and
some more. 
</li>
          <li>
Amazon Ninja puzzles: Amazon had the best vendor booth IMO. They had programming related
puzzles for you to solve, and I found myself in front of the question board every
few hours (even missed some sessions because of this :). This is me hacking away in
the halls with the Amazon Ninjas next to my laptop.<a href="http://www.dotnetsurfers.com/Blog/content/binary/WindowsLiveWriter/CodeMash2010_6FA2/ninja_%5B1%5D_2.jpg"><img style="display: block; float: none; margin-left: auto; margin-right: auto" title="ninja_[1]" alt="ninja_[1]" src="http://www.dotnetsurfers.com/blog/images/ninja_.jpg" /></a></li>
          <li>
Enter the Haggis concert: There was a live concert by <a href="http://www.enterthehaggis.com/" target="_blank">Enter
the Haggis</a> on Thursday night, and they played some great fusion music. This was
an awesome way to unwind. <a href="http://www.dotnetsurfers.com/Blog/content/binary/WindowsLiveWriter/CodeMash2010_6FA2/ninja_%5B1%5D_2.jpg"><img style="display: block; float: none; margin-left: auto; margin-right: auto" title="enter the haggis" alt="enter the haggis" src="http://www.dotnetsurfers.com/blog/images/haggis_.jpg" /></a></li>
        </ul>
        <p>
There was plenty of food and caffeine at the conference, though the Wifi could have
been better. Thanks to all the organizers for doing such a great job. I hope to be
there again next year.
</p>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=01d6a56c-3a22-48b6-a74f-a2098374a383" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Dallas CSharp SIG Presentation Code And Slides</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2010/01/07/DallasCSharpSIGPresentationCodeAndSlides.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,9cad4749-4e64-49a5-8dc9-af8e97eb88ea.aspx</id>
    <published>2010-01-07T12:42:34.2720737-07:00</published>
    <updated>2010-01-07T12:43:29.5145065-07:00</updated>
    <category term="MOQ" label="MOQ" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,MOQ.aspx" />
    <category term="presentation" label="presentation" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,presentation.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ll be presenting at the Dallas C# SIG later today, and am uploading a draft of the
code and slides, in case somebody wants to work on the code during the presentation.
I’ll update the attachment after the presentation if there are any changes.
</p>
        <p>
Download <a href="http://www.dotnetsurfers.com/utils/MOQ_Presentation.zip">here</a>.
</p>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=9cad4749-4e64-49a5-8dc9-af8e97eb88ea" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Using Test Impact Analysis in Visual Studio 2010</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2009/11/08/UsingTestImpactAnalysisInVisualStudio2010.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,4cf200c7-d0d8-4ea6-a248-7b745cf8cce0.aspx</id>
    <published>2009-11-07T21:35:24.93-07:00</published>
    <updated>2009-11-07T21:55:34.772463-07:00</updated>
    <category term="Visual Studio 2010" label="Visual Studio 2010" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,Visual%2BStudio%2B2010.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
A tweet this morning from <a href="http://blog.davidohara.net/">David O'Hara</a> about
wanting something on the lines of <a href="http://www.nateclark.com/articles/2008/09/17/_autotest_-is-now-_autospec_-how-to-set-up-autospec-for-rspec-and-rails-with-zentest">Autospec</a> for
Visual Studio motivated me to look into the Test Impact Analysis feature in Visual
Studio 2010. Test Impact Analysis allows you to see what unit tests have been impacted
by your latest code changes. This means that you need to run only the affected tests
rather than the whole test suite to ensure that you have not made any breaking changes.
This is clearly a big productivity win, especially if you have a big test suite.
</p>
        <p>
I created a small Calculator Class and corresponding unit tests to work with. Here's
what you need to do to get started with Test Impact Analysis.
</p>
        <ol>
          <li>
Open your project in Visual Studio 2010 and open "Test Impact View" window
(Test-&gt;Windows-&gt;Test Impact View). You should see something like this.<br /><img style="margin: 5px" alt="" src="http://dotnetsurfers.com/blog/images/TestImpactView.jpg" /><br /></li>
          <li>
Enable test impact data collection by clicking on the link in the "Test Impact
View" window. You can also do the same by going into Test-&gt;Edit Test Settings-&gt;Test
Settings-&gt;Data And Diagnostics-&gt;Test Impact.<br /><img height="509" border="" width="700" style="margin: 5px" class="" alt="" src="http://dotnetsurfers.com/blog/images/EnableTestImpactAnalysis.jpg" title="" /><br /></li>
          <li>
To generate baseline data, you need to rebuild your solution and run all tests in
your test projects. You can do this using the "Test View Window". Your "Test
Impact Window" should now look like this.<br /><img height="320" border="" width="700" style="margin: 5px" class="" alt="" src="http://dotnetsurfers.com/blog/images/TIV1.jpg" title="" /></li>
          <li>
Make code changes that you are working on. Since I am just testing here, I modify
my Add() method to do multiplication instead of additon. Now when I <strong>Save</strong> the
code and <strong>Rebuild</strong> the project, the "Test Impact Window"
automatically updates to show what tests need to be re-run. In this case, I need to
re-run my "AddTest". I do so using "Run Tests" link in the "Test
Impact View" or the keyboard shortcut Ctrl +R,Y.<br /><img height="237" border="" width="700" style="margin: 5px" class="" alt="" src="http://dotnetsurfers.com/blog/images/TIV2.jpg" title="" /></li>
          <li>
Running "AddTest" causes it to fail since I introduced a bug in the last
step.<br /><img height="292" border="" width="700" style="margin: 5px" class="" alt="" src="http://dotnetsurfers.com/blog/images/TIV3.jpg" title="" /></li>
          <li>
Since my test failed, it still shows up under "Impacted Tests". I now fix
my Add() method, rebuild my project and rerun the unit test. My unit test passes and
the "Test Impact View" becomes empty again, indicating that my code is in
good shape and safe to check in.<br /><img height="293" border="" width="700" style="margin: 5px" class="" alt="" src="http://dotnetsurfers.com/blog/images/TIV4.jpg" title="" /></li>
        </ol>
        <p>
While this is not as powerful as running affected unit tests automatically in the
background like AutoSpec does for Ruby, it's defintely a step in the right direction.
I can totally see this becoming a part of my workflow.
</p>
        <p>
A couple of other things
</p>
        <ul>
          <li>
Since Visual Studio only recognizes MSTest unit tests, I am not sure if this would
work with other frameworks like NUnit. If you know of a way to do so, please leave
a comment.</li>
          <li>
The Test Impact Analysis feature is available in Premium and Ultimate versions but
not in the Professional version. See <a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx">this</a> for
feature comparison between different versions.</li>
          <li>
I tested this with Beta 2 of Visual Studio 2010.</li>
        </ul>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=4cf200c7-d0d8-4ea6-a248-7b745cf8cce0" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Working with Visual Studio on a Mac</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2009/08/15/WorkingWithVisualStudioOnAMac.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,474741e1-9521-42a5-9870-4094c08d5261.aspx</id>
    <published>2009-08-15T15:50:57.201-07:00</published>
    <updated>2009-08-15T15:52:39.152183-07:00</updated>
    <category term=".net" label=".net" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,.net.aspx" />
    <category term="Mac" label="Mac" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,Mac.aspx" />
    <category term="Visual Studio" label="Visual Studio" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,Visual%2BStudio.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
When I <a href="http://www.DotNetSurfers.com/Blog/2009/07/31/MyNewMacBookPro.aspx">recently
purchased a Macbook Pro</a>, I had a couple of options to set up my .Net development
environment on there. I could use a Virtual Machine based solution such as <a href="http://www.parallels.com/products/desktop/">Parallels</a> or <a href="http://www.vmware.com/products/fusion/">VMware
Fusion</a>, or run Windows natively using <a href="http://www.apple.com/macosx/what-is-macosx/compatibility.html">BootCamp</a>.
My first preference was to stay inside the Mac OS if possible. I spent some time researching
which product other developers are having more success with and Fusion seemed to be
more stable and responsive for the majority of them. I downloaded the trial version
from their website and took it for a spin, and have been really happy with it. 
</p>
        <p>
I have used both XP and Windows 7 in a VM with Fusion, and the performance has been
pretty flawless. I allocate both processors, 40 GB of hard disk space and 2 GB of
RAM to a VM. Some of my peers have long been advocating the advantages of developing
using VMs, and now I totally get how cool this way of working is. I can create and
restore snapshots at any point of time, create a new VM to try out any beta software,
and keep my development environment isolated from softwares/utilities that it does
not need (avoiding software bloat). I am using a Windows 7 VM right now for the most
part and playing around with Visual Studio 2010 on it. I intially found the Unity
feature in Fusion (it gives the illusion of running Windows apps natively on the Mac
OS) to be really cool, but I don't really use it much. I have dedicated a Space to
my VMs, and tend to work in full screen mode.
</p>
        <p>
If you end up going the same way as me, I would recommend looking at multiple vendors
before purchasing Fusion. I bought if off <a href="http://www.amazon.com/gp/product/B001F5VBRU/">Amazon</a>,
and it cost me $23.49 (including a $10 mail-in rebate). Other sites,including VMware,
offer it for upto $80.
</p>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=474741e1-9521-42a5-9870-4094c08d5261" />
      </div>
    </content>
  </entry>
  <entry>
    <title>My New MacBook Pro</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2009/07/31/MyNewMacBookPro.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,f38b8094-6068-415a-beea-30f58dc14c05.aspx</id>
    <published>2009-07-31T11:26:05.841-07:00</published>
    <updated>2009-08-02T11:29:49.4554736-07:00</updated>
    <category term="Mac" label="Mac" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,Mac.aspx" />
    <category term="gadgets" label="gadgets" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,gadgets.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
It all started when I got my new IPhone (3gs) about a month ago. I had been using
a Nokia E71 since the start of this year, and have owned a couple of Windows mobile
based phone before that. To describe my experience with the new IPhone briefly, its
usability and slick interface just blew me away. I could not believe I had missed
out on owning this marvellous device for so long. My previous cell phones offered
most of the features that my IPhone does, but there's a big difference in the user
experience. It would not be a stretch to say that the IPhone serves most of the functions
that I had recently bought a netbook for. After playing with some really well designed
IPhone apps (facebook, tweetdeck etc), I really wanted to check out the development
environment and get familiar with the basics at least. Unfortunately, you can develop
an IPhone app only on an Intel based Mac. When I dug for more information on the interwebs,
I discovered that a bunch of other .Net developers have been using a Mac as their
primary workstation for quite some time using either <a href="http://www.apple.com/macosx/what-is-macosx/compatibility.html">Bootcamp</a> or
a VM based solution such as <a href="http://www.vmware.com/products/fusion/">VMware
Fusion</a> or <a href="http://www.parallels.com/products/desktop/">Parallels</a>.
I decided to take the plunge and ordered a <a href="http://www.apple.com/macbookpro/">15
inch Macbook Pro</a> with a 2.53GHz Intel Core 2 Duo processor, 4 gigs of memory and
a 320GB 7200 rpm hard disk. Here's my experience so far with the new Macbook Pro.
</p>
        <p>
To put things in context, my primary workstation at home right now is a Dell desktop
with 2.5 GHz Core 2 Duo processor, 6 gigs of Ram and running the latest 64 bit Windows
7 RC. I am very happy with the that machine and use it with a dual monitor setup (see
image below, the one on the right is a an Asus netbook).
</p>
        <p>
          <img height="366" style="margin: 5px" width="488" alt="" src="http://www.dotnetsurfers.com/Blog/images/DSCF0629_488x366.shkl.JPG" />
        </p>
        <p>
To get upto speed with my new Macbook Pro, I shut down the Windows based desktop completely
and have been using the Macbook as my primary computer for more than a week now. The
device itself is a pleasure to use and looks very slick. I like the spacious keyboard
and am really digging the trackpad. It has excellent battery life (&gt;5 hours) in my
usage so far. This is the most responsive machine I have ever owned. It takes around
2 seconds to revive the system from sleep mode, and unlike my Windows experience,
I do not have to keep an eye on memory and processor usage all the time. I do prefer
desktops over laptops for working for longer time periods because a laptop forces
me into a slouching posture and puts more strain on the wrists. I tried to find a
good docking station for the Macbook but was mostly unsuccessful. The <a href="http://www.BookEndzDocks.com/New_Products-Docking_Station_for_the_15_Unibody_MacBook_Pro.html">only
docking station</a> I found was from BookEndz which had mixed reviews and a very high
price tag (~$300). I ended up buying a <a href="http://www.amazon.com/mStand-Laptop-Stand-Rain-Design/dp/B000OOYECC/ref=pd_rhf_p_t_2">lapstop
stand</a> instead and currently attach my 20" monitor, ergonomic keyboard and trackball
when working at home. On weekends, I usually work from a coffee shop and carry the
laptop around with me. I tried pairing the Macbook with my 24" monitor, but it did
not feel comfortable to use due to the big difference in screen size. Here's a picture
of my updated setup.
</p>
        <p>
          <img height="375" style="margin: 5px" width="500" alt="" src="http://www.dotnetsurfers.com/Blog/images/IMG_0183_500x375.shkl.JPG" />
        </p>
        <p>
The Leopard OS is pretty easy to get used to. I did have some trouble initially understanding
how applications are installed and kept on launching them from the Downloads folder
rather than copying them to my Applications. I like the Spaces feature and it gives
the experience of a larger screen area. I use different spaces for the Windows VM,
web browser, chat/twitter clients right now. The biggest issue I am facing right now
is constant switching between the keyboard and mouse/trackball. On windows, I use <a href="http://bayden.com/SlickRun/">slickrun</a> and
any available shortcuts to keep my hands on the keyboard as much as possible. I found
a great free app called <a href="http://blacktree.com/?quicksilver">Quicksilver</a> for
the Mac which is an application lancher (and more). Other useful applications are <a href="http://www.appzapper.com/">AppZapper</a> (application
uninstaller), <a href="http://adium.im/">Adium</a> (chat client) and <a href="http://macromates.com/">Textmate</a>(text
editor). For editing blogs, I am using a free editor called <a href="http://www.qumana.com/">Qumana</a> right
now. I have always used the Firefox plugin <a href="https://addons.mozilla.org/en-US/firefox/addon/684">FireFtp</a> for
FTP purposes, and the same suffices for my needs right now.
</p>
        <p>
I have installed the IPhone SDK and am checking out Objective C and the XCode IDE
right now. I plan to write another post soon describing how I set up my Windows development
environment on the Mac soon. Stay tuned.
</p>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=f38b8094-6068-415a-beea-30f58dc14c05" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Using a productivity tool like ReSharper or CodeRush</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2009/06/06/UsingAProductivityToolLikeReSharperOrCodeRush.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,55965066-2325-4d52-837d-b7e46c0b1b50.aspx</id>
    <published>2009-06-06T14:07:17.7854638-07:00</published>
    <updated>2009-06-06T14:07:17.7854638-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
At the C# SIG meeting in Dallas last week, <a href="http://blog.davidohara.net/" target="_blank">David</a> mentioned
something really interesting about using a productivity add-on such as <a href="www.jetbrains.com/resharper/" target="_blank">ReSharper</a> or <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/" target="_blank">CodeRush</a>.
I think his exact quote was: 
</p>
        <blockquote>
          <p>
“If your not using a productivity tool, you’re ripping off your customers and wasting
your time”
</p>
        </blockquote>
        <p>
While I have met and worked with many ReSharper/CodeRush users in the past and talked
about the value that such tools add, the sentiment has never been so strongly expressed.
I have been playing around with both the tools over the last several months and am
a happy ReSharper user now. I found CodeRush to have a lighter memory footprint, but
the graphics and effects just got in the way of my work. ReSharper, on the other hand,
was very usable and intuitive and had a minimal learning curve. Your experience might
vary, but I would encourage you to take both the tools for a spin and try using one,
if you are not already doing so.
</p>
        <p>
Coming back to David’s statement, I think I agree with him more or less. Not only
can you save some serious time by using such a tool, these add-ons generally encourage
you to write cleaner code. You also deliver more value to the client in less time,
and that could possibly lead to better feedback, more projects or recommendations
to other  clients.
</p>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=55965066-2325-4d52-837d-b7e46c0b1b50" />
      </div>
    </content>
  </entry>
  <entry>
    <title>The Big Design Conference in Dallas</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2009/05/31/TheBigDesignConferenceInDallas.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,14f75062-b17d-48b8-b56f-0faf054080db.aspx</id>
    <published>2009-05-30T18:32:09.3832611-07:00</published>
    <updated>2009-05-30T18:51:50.1935995-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just came back from the <a href="http://bigdesignconference.com/" target="_blank">Big
Design Conference</a> held today in Dallas, and my brain is just flooded right now
with all the information I picked up on different design and development topics. It
was one of the most well organized conferences I have been to, with 4 parallel tracks
(Social Media, Code Development, User Experience and Strategy) going on throughout
the day. The hardest part was to pick a session out of the different choices to go
to. I ended up attending <a href="http://blogs.msdn.com/chkoenig/" target="_blank">Chris
Koenig’s</a> session on touch based apps, <a href="http://www.poetpainter.com/" target="_blank">Stephen
Anderson’s</a> talk on seductive interactions, <a href="http://developingux.com/" target="_blank">Caleb
Jenkins</a>’ Silverlight 3 talk and <a href="https://adaptivepath.com/aboutus/toddw.php" target="_blank">Todd
Wilken’s</a> session on saying No and learning. All sessions had great content and
I even got to play with a Microsoft Surface Unit, which was again very impressive
but is still very expensive (~$12K-15K) to own a personal unit. 
</p>
        <p>
There were lots of Macbooks (designer conference, duh) and netbooks being used in
the audience, and the <a href="http://search.twitter.com/search?q=%23bigd09" target="_blank">conference
twitter stream</a> was buzzing throughout the day with reviews and feedback from the
attendees. The conference organizers even had the twitter stream displayed to the
public in the hallway.
</p>
        <p>
          <a href="http://dotnetsurfers.com/blog/images/bigd.jpg">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="bigd[1]" border="0" alt="bigd[1]" src="http://dotnetsurfers.com/blog/images/bigd.jpg" width="401" height="302" />
          </a>
        </p>
        <p>
This just goes on to show the increasing importance of social media like twitter at
such events. Overall, it was a great experience and I got to meet some really interesting
people in the Dallas area as well as attend great presentations. A big thanks to the
organizers for arranging this.
</p>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=14f75062-b17d-48b8-b56f-0faf054080db" />
      </div>
    </content>
  </entry>
  <entry>
    <title>My Dot Net Developer&amp;rsquo;s tools list, and more&amp;hellip;</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2009/05/23/MyDotNetDeveloperrsquosToolsListAndMorehellip.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,2f58a9a4-c4db-4c53-a115-3200f66ebe6c.aspx</id>
    <published>2009-05-23T16:42:33.2065524-07:00</published>
    <updated>2009-05-23T16:51:54.0493426-07:00</updated>
    <category term="asp.net" label="asp.net" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,asp.net.aspx" />
    <category term="Better Developer" label="Better Developer" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,Better%2BDeveloper.aspx" />
    <category term="utilities" label="utilities" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,utilities.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I gave a brownbag presentation at my current client recently about the common tools
(in addition to Visual Studio), that I use on a regular basis for working with .NET
or web development in general. I also threw in some non-development tools that are
a part of my day to day life and make things easier. Here’s the complete list:
</p>
        <p>
Note: For a completely awesome and Ultimate Developer’s tool list, be sure to check
out <a href="http://www.hanselman.com/tools" target="_blank">Scott’s blog post</a>.
</p>
        <table border="1" cellspacing="0" cellpadding="0" width="649">
          <tbody>
            <tr>
              <td width="91" align="center">
 </td>
              <td width="327">
                <p align="center">
                  <strong>
                    <u>.NET</u>
                  </strong>
                </p>
              </td>
              <td width="229">
 </td>
            </tr>
            <tr>
              <td width="93" align="center">
                <p align="center">
                  <strong>Name</strong>
                </p>
              </td>
              <td width="326">
                <p align="center">
                  <strong>Description</strong>
                </p>
              </td>
              <td width="228">
                <p align="center">
                  <strong>Comments</strong>
                </p>
              </td>
            </tr>
            <tr>
              <td width="94" align="center">
                <p>
                  <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A362781C-3870-43BE-8926-862B40AA0CD0&amp;displaylang=en">ClrProfiler</a>
                </p>
              </td>
              <td width="325">
                <p>
The CLR Profiler includes a number of very useful views of the allocation profile,
including a histogram of allocated types, allocation and call graphs, a time line
showing GCs of various generations and the resulting state of the managed heap after
those collections, and a call tree showing per-method allocations and assembly loads.
</p>
              </td>
              <td width="228">
                <p>
                  <a href="http://odetocode.com/Blogs/scott/archive/2005/12/11/2611.aspx">Working with
Cassini</a>
                </p>
              </td>
            </tr>
            <tr>
              <td width="95" align="center">
                <p>
                  <a href="http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&amp;displaylang=en">DebugDiag</a>
                </p>
              </td>
              <td width="324">
                <p>
The Debug Diagnostic Tool (DebugDiag) is designed to assist in troubleshooting issues
such as hangs, slow performance, memory leaks or fragmentation, and crashes in any
Win32 user-mode process. The tool includes additional debugging scripts focused on
Internet Information Services (IIS) applications, web data access components, COM+
and related Microsoft technologies.
</p>
              </td>
              <td width="227">
                <p>
                  <a href="http://blogs.msdn.com/tess/archive/2009/05/12/debug-diag-script-for-troubleshooting-net-2-0-memory-leaks.aspx">Troubleshooting
.Net 2.0 memory leaks.</a>
                </p>
              </td>
            </tr>
            <tr>
              <td width="96" align="center">
                <p>
                  <a href="http://code.msdn.microsoft.com/codeanalysis/Release/ProjectReleases.aspx?ReleaseId=553">FxCop</a>
                </p>
              </td>
              <td width="324">
                <p>
FxCop is a code analysis tool that checks .NET managed code assemblies for conformance
to the Microsoft .NET Framework Design Guidelines.
</p>
              </td>
              <td width="227">
 </td>
            </tr>
            <tr>
              <td width="97" align="center">
                <p>
                  <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=4B5B7F29-1939-4E5B-A780-70E887964165&amp;displaylang=en">LibCheck</a>
                </p>
              </td>
              <td width="323">
                <p>
This tool allows you to compare two versions of an assembly, and determine the differences.
The tool reports the differences as a combination of 'removed' and 'added' APIs.
</p>
              </td>
              <td width="227">
 </td>
            </tr>
            <tr>
              <td width="98" align="center">
                <p>
                  <a href="http://www.ndepend.com/">NDepend</a>
                </p>
              </td>
              <td width="322">
                <p>
NDepend is a tool that simplifies managing a complex .NET code base. Architects and
developers can analyze code structure, specify design rules, plan massive refactoring,
do effective code reviews and master evolution by comparing different versions of
the code.
</p>
              </td>
              <td width="227">
                <p>
Has Academic, commercial versions.
</p>
              </td>
            </tr>
            <tr>
              <td width="99" align="center">
                <p>
                  <a href="http://research.microsoft.com/en-us/projects/pex/default.aspx">PEX</a>
                </p>
              </td>
              <td width="322">
                <p>
Right from the Visual Studio code editor, <strong>Pex</strong> finds interesting input-output
values of your methods, which you can save as a small test suite with high code coverage.
Pex performs a systematic analysis, hunting for boundary conditions, exceptions and
assertion failures, which you can debug right away. Pex enables Parameterized Unit
Testing, an extension of Unit Testing that reduces test maintenance costs.
</p>
              </td>
              <td width="226">
                <ul>
                  <li>
Has Academic, commercial versions. 
</li>
                  <li>
                    <a href="http://blog.maartenballiauw.be/post/2009/01/07/Verifying-code-and-testing-with-Pex.aspx">Getting
Started</a>. 
</li>
                </ul>
              </td>
            </tr>
            <tr>
              <td width="100" align="center">
                <p>
                  <a href="http://www.red-gate.com/products/reflector/">Reflector</a>
                </p>
              </td>
              <td width="321">
                <p>
.NET Reflector enables you to easily view, navigate, and search through, the class
hierarchies of .NET assemblies, even if you don't have the code for them. With it,
you can decompile and analyze .NET assemblies in C#, Visual Basic, and IL.
</p>
              </td>
              <td width="226">
                <p>
Be sure to check out the <a href="http://www.codeplex.com/reflectoraddins">Addins</a></p>
              </td>
            </tr>
            <tr>
              <td width="101" align="center">
                <p>
                  <a href="http://sourceforge.net/projects/regulator/">Regulator</a>
                </p>
              </td>
              <td width="321">
                <p>
The Regulator is an advanced Regular expressions testing tool, featuring syntax highlighting
and web-service integration with Regexlib.com's database of online regular expressions.
</p>
              </td>
              <td width="226">
 </td>
            </tr>
            <tr>
              <td width="102" align="center">
                <p>
                  <a href="http://www.jetbrains.com/resharper/">Resharper</a>
                </p>
              </td>
              <td width="320">
                <p>
ReSharper provides solution-wide error highlighting on the fly, instant solutions
for found errors, over 30 advanced code refactorings, superior unit testing tools,
handy navigation and search features, single-click code formatting and cleanup, automatic
code generation and templates.
</p>
              </td>
              <td width="225">
                <ul>
                  <li>
Free 30 day trial, Full Edition: $199, C# Edition: $149. 
</li>
                  <li>
                    <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/">CodeRush
Express</a> is a similar free alternative, but I prefer Resharper. 
</li>
                </ul>
              </td>
            </tr>
            <tr>
              <td width="103" align="center">
                <p>
                  <a href="http://www.microsoft.com/Downloads/details.aspx?FamilyID=e82ea71d-da89-42ee-a715-696e3a4873b2&amp;displaylang=en">SandCastle</a>
                </p>
              </td>
              <td width="319">
                <p>
Enables managed class library developers to easily create accurate, informative documentation
with a common look and feel.
</p>
              </td>
              <td width="225">
                <p>
                  <a href="http://www.dotnetsurfers.com/Blog/2009/04/17/CreatingMSDNLikeHelpUsingSandcastle.aspx">Simple
how-to</a>.
</p>
              </td>
            </tr>
            <tr>
              <td width="103" align="center">
                <p>
                  <a href="http://www.binaryfortress.com/aspnet-viewstate-helper/">ViewState Helper</a>
                </p>
              </td>
              <td width="319">
                <p>
Lets you debug ViewState issues by displaying Page and viewstate details for an asp.net
page.
</p>
              </td>
              <td width="225">
                <p>
                  <a href="http://www.pluralsight.com/toolcontent/ViewStateDecoder11.zip">Alternative</a>
                </p>
              </td>
            </tr>
            <tr>
              <td width="103" align="center">
                <p>
                  <a href="http://projects.nikhilk.net/WebDevHelper/">Web Development Helper</a>
                </p>
              </td>
              <td width="319">
                <p>
Web Development Helper is a free browser extension for Internet Explorer that provides
a set of tools and utilities for the Web developer, esp. Ajax and ASP.NET developers.
The tool provides features such as a DOM inspector, an HTTP tracing tool, and script
diagnostics and immediate window.
</p>
              </td>
              <td width="225">
 </td>
            </tr>
            <tr>
              <td width="103" align="center">
                <p>
                  <a href="http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx" target="_blank">WinDbg</a>
                </p>
              </td>
              <td width="319">
                <p>
Microsoft Windows Debugger (WinDbg) is a powerful Windows-based debugging tool. It
is capable of both user-mode and kernel-mode debugging.
</p>
              </td>
              <td width="226">
                <p>
                  <a href="http://blogs.msdn.com/tess/default.aspx">Excellent blog to learn more</a>.
</p>
              </td>
            </tr>
          </tbody>
        </table>
        <p>
 
</p>
        <table border="1" cellspacing="0" cellpadding="0" width="648">
          <tbody>
            <tr>
              <td width="92" align="center">
 </td>
              <td width="329">
                <p align="center">
                  <strong>
                    <u>Web Development</u>
                  </strong>
                </p>
              </td>
              <td width="225">
                <strong> </strong>
              </td>
            </tr>
            <tr>
              <td width="94" align="center">
                <p>
                  <strong>Name</strong>
                </p>
              </td>
              <td width="327">
                <p>
                  <strong>Description</strong>
                </p>
              </td>
              <td width="225">
                <p>
                  <strong>Comments</strong>
                </p>
              </td>
            </tr>
            <tr>
              <td width="96" align="center">
                <p>
                  <a href="http://www.dotnetsurfers.com/Blog/2008/10/02/RemovingUnusedCSSClassesFromYourWebApplication.aspx">CssCleaner</a>
                </p>
              </td>
              <td width="326">
                <p>
Detect unused css classes in your website (static analysis).
</p>
              </td>
              <td width="224">
Written by yours truly :). Need to add more features to this and maybe change the
UI to WPF.</td>
            </tr>
            <tr>
              <td width="98" align="center">
                <p>
                  <a href="http://www.sprymedia.co.uk/article/Design">Design</a>
                </p>
              </td>
              <td width="325">
                <p>
Design is a suite of web-design and development assistive tools which can be utilised
on any web-page. Encompassing utilities for grid layout, measurement and alignment,
Design is a uniquely powerful JavaScript bookmarklet.
</p>
              </td>
              <td width="224">
 </td>
            </tr>
            <tr>
              <td width="99" align="center">
                <p>
                  <a href="http://www.fiddler2.com/fiddler2/">Fiddler</a>
                </p>
              </td>
              <td width="324">
                <p>
Fiddler logs all HTTP(S) traffic between your computer and the Internet and Fiddler
allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle"
with incoming or outgoing data. Fiddler includes a powerful event-based scripting
subsystem, and can be extended using any .NET language.
</p>
              </td>
              <td width="223">
                <ul>
                  <li>
Make sure you check out the <a href="http://www.fiddler2.com/Fiddler2/extensions.asp">Addons</a>. 
</li>
                  <li>
                    <a href="http://www.wireshark.org/">Wireshark</a> is another alternative. 
</li>
                </ul>
              </td>
            </tr>
            <tr>
              <td width="100" align="center">
                <p>
                  <a href="http://getfirebug.com/">Firebug</a>
                </p>
              </td>
              <td width="324">
                <p>
Firebug integrates with Firefox to put a wealth of web development tools at your fingertips
while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live
in any web page.
</p>
              </td>
              <td width="223">
                <ul>
                  <li>
Use <a href="http://www.microsoft.com/DownLoads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&amp;displaylang=en">IE
toolbar</a> or <a href="http://getfirebug.com/lite.html">Firebug Lite</a> for IE. 
</li>
                  <li>
Make sure you check out the <a href="http://getfirebug.com/extensions/index.html">extensions</a>. 
</li>
                </ul>
              </td>
            </tr>
            <tr>
              <td width="101" align="center">
                <p>
                  <a href="http://www.jslint.com/">JSLint</a>
                </p>
              </td>
              <td width="323">
                <p>
With JavaScript Lint, you can check all your JavaScript source code for common mistakes
without actually running the script or opening the web page.
</p>
              </td>
              <td width="223">
 </td>
            </tr>
            <tr>
              <td width="102" align="center">
                <p>
                  <a href="http://westciv.com/xray/index.html">XRAY</a>
                </p>
              </td>
              <td width="323">
                <p>
XRAY is a bookmarklet for Internet Explorer 6+, and Webkit and Mozilla based browsers
(including Safari, Firefox, Camino or Mozilla). Use it to see the box model for any
element on any web page.
</p>
              </td>
              <td width="222">
 </td>
            </tr>
            <tr>
              <td width="103" align="center">
                <p>
                  <a href="http://www.xenocode.com/browsers/">Xenocode.com</a>
                </p>
              </td>
              <td width="322">
                <p>
Run any browser (IE 6-8, FF 2,3, Opera, Chrome, Safari) directly from the web.
</p>
              </td>
              <td width="223">
                <ul>
                  <li>
This is the best and easiest way I have seen to run multiple versions of IE on your
box, but their service seems to be down lately. 
</li>
                  <li>
Other options are to use a virtual machine or a program like <a href="http://tredosoft.com/Multiple_IE">Multiple
IE</a>. 
</li>
                </ul>
              </td>
            </tr>
          </tbody>
        </table>
        <p>
 
</p>
        <table border="1" cellspacing="0" cellpadding="0" width="649">
          <tbody>
            <tr>
              <td width="89" align="center">
 </td>
              <td width="328">
                <p align="center">
                  <strong>
                    <u>SQL Development</u>
                  </strong>
                </p>
              </td>
              <td width="230">
 </td>
            </tr>
            <tr>
              <td width="90" align="center">
                <p>
                  <strong>Name</strong>
                </p>
              </td>
              <td width="327">
                <p>
                  <strong>Description</strong>
                </p>
              </td>
              <td width="229">
                <p>
                  <strong>Comments</strong>
                </p>
              </td>
            </tr>
            <tr>
              <td width="91" align="center">
                <p>
                  <a href="http://anjlab.com/en/projects/opensource/sqlprofiler">AnjLab SqlProfiler</a>
                </p>
              </td>
              <td width="327">
                <p>
SQL Server Express Edition Profiler provides the most of functionality standard profiler
does, such as choosing events to profile, setting filters, etc.
</p>
              </td>
              <td width="229">
                <p>
This is good while working with Sql Server Express, which does not come with a profiler.
</p>
              </td>
            </tr>
            <tr>
              <td width="92" align="center">
                <p>
                  <a href="http://roundpolygons.com/SqlAssist/tabid/91/Default.aspx">SqlAssist</a>
                </p>
              </td>
              <td width="326">
                <p>
Adds Sql Intellisense to Sql Server Management Studio and Visual Studio.
</p>
              </td>
              <td width="230">
                <ul>
                  <li>
Free 30 day trial, pricing <a href="http://roundpolygons.com/Purchase/tabid/414/Default.aspx">here</a>. 
</li>
                  <li>
Sql Server 2008 has inbuilt intellisense. 
</li>
                  <li>
                    <a href="http://www.softtreetech.com/isql.htm">SqlAssistant</a> is a good alternative
for working with multiple database environments. 
</li>
                </ul>
              </td>
            </tr>
          </tbody>
        </table>
        <p>
 
</p>
        <table border="1" cellspacing="0" cellpadding="0" width="648">
          <tbody>
            <tr>
              <td width="94" align="center">
 </td>
              <td width="342">
                <p align="center">
                  <strong>
                    <u>Generic Useful Tools</u>
                  </strong>
                </p>
              </td>
              <td width="210">
 </td>
            </tr>
            <tr>
              <td width="96" align="center">
                <p>
                  <strong>Name</strong>
                </p>
              </td>
              <td width="341">
                <p>
                  <strong>Description</strong>
                </p>
              </td>
              <td width="210">
                <p>
                  <strong>Comments</strong>
                </p>
              </td>
            </tr>
            <tr>
              <td width="98" align="center">
                <p>
                  <a href="http://www.autohotkey.com/">AutoHotKey</a>
                </p>
              </td>
              <td width="339">
                <p>
Automate sending keystrokes and mouse clicks by creating/recording macros.
</p>
              </td>
              <td width="209">
 </td>
            </tr>
            <tr>
              <td width="100" align="center">
                <p>
                  <a href="http://www.nu2.nu/pebuilder/">Bart's Preinstalled Environment (BartPE) bootable
windows CD/DVD</a>
                </p>
              </td>
              <td width="338">
                <p>
Bart's PE Builder helps you build a "BartPE" (Bart Preinstalled Environment)
bootable Windows CD-Rom or DVD from the original Windows XP or Windows Server 2003
installation/setup CD, very suitable for PC maintenance tasks.
</p>
              </td>
              <td width="208">
 </td>
            </tr>
            <tr>
              <td width="102" align="center">
                <p>
                  <a href="http://www.daemon-tools.cc/eng/home">Daemon Tools</a>
                </p>
              </td>
              <td width="337">
                <p>
To use virtual drives.
</p>
              </td>
              <td width="207">
 </td>
            </tr>
            <tr>
              <td width="104" align="center">
                <p>
                  <a href="http://www.instapaper.com/">Instapaper bookmarklet</a>
                </p>
              </td>
              <td width="336">
                <p>
Instapaper allows you to easily save urls for later, when you have time, so you don’t
just forget about them or skim through them.
</p>
              </td>
              <td width="207">
 </td>
            </tr>
            <tr>
              <td width="105" align="center">
                <p>
                  <a href="http://www.irfanview.com/">IrfanView</a>
                </p>
              </td>
              <td width="335">
                <p>
IrfanView is a very fast, small, compact graphic viewer.
</p>
              </td>
              <td width="206">
 </td>
            </tr>
            <tr>
              <td width="106" align="center">
                <p>
                  <a href="http://kdiff3.sourceforge.net/">KDiff</a>
                </p>
              </td>
              <td width="335">
                <p>
Compare, Merge files and directories.
</p>
              </td>
              <td width="206">
 </td>
            </tr>
            <tr>
              <td width="107" align="center">
                <p>
                  <a href="http://notepad-plus.sourceforge.net/uk/site.htm">Notepad++</a>
                </p>
              </td>
              <td width="334">
                <p>
                  <strong>Notepad++</strong> is a free source code editor and Notepad replacement that
supports several languages.
</p>
              </td>
              <td width="206">
 </td>
            </tr>
            <tr>
              <td width="108" align="center">
                <p>
                  <a href="http://www.getpaint.net/index.html">Paint.Net</a>
                </p>
              </td>
              <td width="334">
                <p>
Paint.NET is free image and photo editing software for computers that run Windows.
</p>
              </td>
              <td width="205">
                <p>
I use this instead of MS Paint for simple tasks.
</p>
              </td>
            </tr>
            <tr>
              <td width="109" align="center">
                <p>
                  <a href="http://portableapps.com/">Portable Apps</a>
                </p>
              </td>
              <td width="333">
                <p>
Carry your favorite computer programs along with all of your bookmarks, settings,
email and more with you. Use them on any Windows computer. All without leaving any
personal data behind.
</p>
              </td>
              <td width="205">
 </td>
            </tr>
            <tr>
              <td width="110" align="center">
                <p>
                  <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx">ProcessExplorer</a>
                </p>
              </td>
              <td width="333">
                <p>
                  <em>Process Explorer</em> shows you information about which handles and DLLs processes
have opened or loaded.
</p>
              </td>
              <td width="205">
                <p>
This has replaced my task manager for the last couple of years.
</p>
              </td>
            </tr>
            <tr>
              <td width="111" align="center">
                <p>
                  <a href="http://bayden.com/SlickRun/">SlickRun</a>
                </p>
              </td>
              <td width="332">
                <p>
SlickRun is a free floating command line utility for Windows. SlickRun gives you almost
instant access to any program or website.
</p>
              </td>
              <td width="204">
 </td>
            </tr>
            <tr>
              <td width="112" align="center">
                <p>
                  <a href="http://synergy2.sourceforge.net/">Synergy</a>
                </p>
              </td>
              <td width="331">
                <p>
Synergy lets you easily share a single mouse and keyboard between multiple computers
with different operating systems, each with its own display, without special hardware.
It's intended for users with multiple computers on their desk since each system uses
its own monitor(s).
</p>
              </td>
              <td width="204">
 </td>
            </tr>
            <tr>
              <td width="113" align="center">
                <p>
                  <a href="http://www.videora.com/en-us/Converter/">Videora Converter</a>
                </p>
              </td>
              <td width="331">
                <p>
Videora Converter is a free video converter that converts video files, YouTube videos,
movies and DVD's so you can play them on your video playing device.
</p>
              </td>
              <td width="204">
 </td>
            </tr>
            <tr>
              <td width="114" align="center">
                <p>
                  <a href="http://www.videolan.org/vlc/">VLC media player</a>
                </p>
              </td>
              <td width="330">
                <p>
Multimedia player.
</p>
              </td>
              <td width="203">
                <p>
Plays most video formats out of the box.
</p>
              </td>
            </tr>
            <tr>
              <td width="114" align="center">
                <p>
                  <a href="http://www.winamp.com/player">Winamp music player</a>
                </p>
              </td>
              <td width="330">
                <p>
Mp3 music player.
</p>
              </td>
              <td width="203">
                <p>
This supports global hotkey bindings, so I can use use my keyboard to change track,
volume without bringing it in focus.
</p>
              </td>
            </tr>
            <tr>
              <td width="114" align="center">
                <p>
                  <a href="http://www.mesh.com/">Windows Live Mesh</a>
                </p>
              </td>
              <td width="330">
                <p>
Keep files and folders in sync on multiple devices.
</p>
              </td>
              <td width="205">
 </td>
            </tr>
          </tbody>
        </table>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=2f58a9a4-c4db-4c53-a115-3200f66ebe6c" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Creating MSDN like help using Sandcastle</title>
    <link rel="alternate" type="text/html" href="http://www.DotNetSurfers.com/Blog/2009/04/17/CreatingMSDNLikeHelpUsingSandcastle.aspx" />
    <id>http://www.dotnetsurfers.com/Blog/PermaLink,guid,fad7be3c-a5d2-4970-969a-97e93b9d5240.aspx</id>
    <published>2009-04-17T06:19:14.722-07:00</published>
    <updated>2009-04-17T06:53:22.0224239-07:00</updated>
    <category term=".net" label=".net" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,.net.aspx" />
    <category term="sandcastle" label="sandcastle" scheme="http://www.dotnetsurfers.com/Blog/CategoryView,category,sandcastle.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <h3>Just follow these simple steps ( I am using the Ajaxcontroltoolkit library as
an example here)
</h3>
        <h3> 
</h3>
        <p>
1. Download Sandcastle (<a href="http://www.codeplex.com/Sandcastle">http://www.codeplex.com/Sandcastle</a>).
</p>
        <p>
2. Download and install Sandcastle Help File Builder (<a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=SHFB">http://www.codeplex.com/Wiki/View.aspx?ProjectName=SHFB</a>).
</p>
        <p>
3. Check <a href="http://www.ewoodruff.us/shfbdocs/Index.aspx?topic=html/8c0c97d0-c968-4c15-9fe9-e8f3a443c50a.htm">http://www.ewoodruff.us/shfbdocs/Index.aspx?topic=html/8c0c97d0-c968-4c15-9fe9-e8f3a443c50a.htm</a> for
other requirements. If you have Visual Studio installed, you should probably be good.
</p>
        <p>
4. Run SandcastleBuilderGUI.exe, Create a new project and save it in the same location
as your solution file. You can add it to the solution for easier version control maintenance.
</p>
        <p>
5. Add your main assemblies to be documented using the Add button. Make sure your
Visual studio project for that assembly is set up to generate xml documentation file
(Project-&gt;Properties-&gt;Build-&gt;XML Documentation file should be checked).
</p>
        <p>
          <img src="http://www.dotnetsurfers.com/blog/images/sandcastle.jpg" width="752" height="109" />
        </p>
        <p>
6. In Project Properties within Sandcastle Help File Builder
</p>
        <blockquote>
          <p>
a. Under Build -&gt; Dependencies, Add the folder containing all the referenced assemblies,
or add them individually.
</p>
          <p>
b. Select the correct version under Build -&gt;FrameworkVersion.
</p>
          <p>
c. Under Build -&gt; HelpFileFormat, choose the output type (chm and/or website).
</p>
          <p>
d. Under Help File, you can add things like copyright, header, footer, feedback email
address etc.
</p>
          <p>
e. Set visibility for different type of members under Visibility.
</p>
        </blockquote>
        <p>
7. At this point you can build project within Sandcastle Help File Builder to create
help file manually. You can see an example of sample output <a href="http://www.dotnetsurfers.com/sandcastlehelp/index.aspx" target="_blank">here</a>.
</p>
        <p>
8. To create the help file from the command prompt, use SandcastleBuilderConsole.exe
and pass the path to the help project file as a parameter. E.g. 
</p>
        <blockquote>
          <p>
"C:\Program Files\EWSoftware\Sandcastle Help File Builder\sandcastlebuilderconsole.exe"
"C:\utils\libs\ajaxcontroltoolkit_help.shfb". 
</p>
        </blockquote>
        <p>
This can be used in a post-build event to automate the generation of help files.
</p>
        <img width="0" height="0" src="http://www.dotnetsurfers.com/Blog/aggbug.ashx?id=fad7be3c-a5d2-4970-969a-97e93b9d5240" />
      </div>
    </content>
  </entry>
</feed>