<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Test Driven Developer - Mocks</title>
    <link>http://testdrivendeveloper.com/</link>
    <description>You got a TEST for that?</description>
    <language>en-us</language>
    <copyright>John E. Boal</copyright>
    <lastBuildDate>Mon, 28 Jun 2010 05:26:54 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>web_master1@TestDrivenDeveloper.com</managingEditor>
    <webMaster>web_master1@TestDrivenDeveloper.com</webMaster>
    <item>
      <trackback:ping>http://testdrivendeveloper.com/Trackback.aspx?guid=34c7edfd-ba67-4eaa-9557-b58acb44dc5f</trackback:ping>
      <pingback:server>http://testdrivendeveloper.com/pingback.aspx</pingback:server>
      <pingback:target>http://testdrivendeveloper.com/PermaLink,guid,34c7edfd-ba67-4eaa-9557-b58acb44dc5f.aspx</pingback:target>
      <dc:creator>John E. Boal</dc:creator>
      <wfw:comment>http://testdrivendeveloper.com/CommentView,guid,34c7edfd-ba67-4eaa-9557-b58acb44dc5f.aspx</wfw:comment>
      <wfw:commentRss>http://testdrivendeveloper.com/SyndicationService.asmx/GetEntryCommentsRss?guid=34c7edfd-ba67-4eaa-9557-b58acb44dc5f</wfw:commentRss>
      <title>Balance Between Test-Driven Design and Test Maintenance Overhead</title>
      <guid isPermaLink="false">http://testdrivendeveloper.com/PermaLink,guid,34c7edfd-ba67-4eaa-9557-b58acb44dc5f.aspx</guid>
      <link>http://TestDrivenDeveloper.com/2010/06/28/BalanceBetweenTestDrivenDesignAndTestMaintenanceOverhead.aspx</link>
      <pubDate>Mon, 28 Jun 2010 05:26:54 GMT</pubDate>
      <description>&lt;div&gt;&lt;p&gt;Test-driven Development/Design when practiced properly, yields organic design growth as tests cause feature code to be written in response to failing tests. In *proper* practice, the entire code base is refactored as needed to ensure that all code and design smells are eliminated (while keeping tests passing). This essentially causes the design at any given time to integrate all the features written up to that point. Once this process is completed, the feature code should be relatively complete, if the tests were written well to dictate the behavior required by the customer. If Acceptance-Test Driven Development is used, the Acceptance Tests for the feature passing will indicate that it’s ready to ship. At any given point, the code base that is checked in should withstand the scrutiny of an outside code reviewer, and should embody all the best design principles. If it doesn’t, the “refactor” stage has not yet been completed.&lt;/p&gt;  &lt;h4&gt;Refactoring to Remove Code and Design Smells&lt;/h4&gt;  &lt;p&gt;I find many teams that either poorly implement or flat-out skip the step of refactoring the code base and overall code design as part of this cycle. This kind of organic development - sticking a new feature on a code base without integrating it into the design and making changes as required is like sticking a wad of gum on a bowling ball. It tends to be the entire code base lumpy, obtuse, and generally not pretty to look at. Teams can get away with this kind of development for a while more or less successfully (unfortunately). However this behavior causes LARGE problems for the team or those inheriting maintenance and new feature work on this code base. Often the team will have to stop to rewrite the whole code base at some point, because it’s too problematic to maintain the bowling ball and gum code. In practical business situations, it’s far far easier to maintain the overall design and integrate features into the design, course-correcting the design as needed to absorb all of the features into a coherent architecture.&lt;/p&gt;  &lt;p&gt;This concept of going through the code base and refactoring all of it to embody all the features in it, and removing design and code smells does imply that if the design changes, so must the tests that correspond to the design. If the tests are tightly coupled to the code base, some design changes can be painful in terms of test maintenance overhead. There are methodologies that assist in decoupling the test from the code, and have the test just confirm the behavior without much knowledge of how the implementation is done. The use of polymorphism, mock objects to decouple behaviors from implementation, and the principle of dependency injection in general can assist with decoupling, and make test maintenance less painful (although perhaps somewhat tougher to write at the outset). There is overhead still however with design changes, and that should be expected, embraced, and *estimated* in planning…&lt;/p&gt;  &lt;h4&gt;Plan for Change&lt;/h4&gt;  &lt;p&gt;In iteration planning, changes to the design and implementation, along with test maintenance should be factored in to the estimates for work being done. When breaking out tasks for a story, I like to at least mention if not record a specific task for the design refactoring, and another for the test maintenance for design changes. I personally think these should be more or less estimable by most teams with at least rudimentary skills. If the team is new, add a task with a ballpark guess for the time, but be sure to add the tasks so they have visibility… Scoping the effort for the design changes and test maintenance will be easier and easier going forward as the team gains understanding of what impact new features have. And it is likely that for a team with a good solid design, these changes will be minimal if they are done incrementally.&lt;/p&gt;  &lt;p&gt;Some teams prefer to finish the tasks for the features and their tests, and then have a single story for the design and test maintenance per iteration, and keep copying it from one iteration to the next. This works too, however I have seen issues where the iteration tasks don’t get completed, and the maintenance story gets bumped off or not completed in the sprint. This engineering debt is carried forward, and the code that is checked in for “completed” features for the sprint now carries debt with it as well.&lt;/p&gt;  &lt;p&gt;In my experience, I have seen more success with making the elimination of design and code smells part of the “Done” criteria for each story, and in fact pre-check-in criteria. This way we can’t call a story “Done” [meaning completed, and shippable] until it *really* is. Design and test maintenance changes on a per-story level should be small, and usually bite-size enough for a team to be able to handle operating this way even in a short iteration period.&lt;/p&gt;  &lt;p&gt;Don’t omit the design and test maintenance, plan for it specifically each iteration. This practice will help keep engineering debt from accruing from iteration to iteration. It is a key practice that will help keep a team, a project, and a code base (and a business) all on a successful course for the short, and the longer term.&lt;/p&gt;&lt;img width="0" height="0" src="http://testdrivendeveloper.com/aggbug.ashx?id=34c7edfd-ba67-4eaa-9557-b58acb44dc5f"/&gt;&lt;/div&gt;</description>
      <comments>http://testdrivendeveloper.com/CommentView,guid,34c7edfd-ba67-4eaa-9557-b58acb44dc5f.aspx</comments>
      <category>Mocks</category>
      <category>Refactoring</category>
      <category>TDD</category>
      <category>Unit Tests</category>
    </item>
    <item>
      <trackback:ping>http://testdrivendeveloper.com/Trackback.aspx?guid=51b0779e-f06c-418d-892d-9e1ba2a38300</trackback:ping>
      <pingback:server>http://testdrivendeveloper.com/pingback.aspx</pingback:server>
      <pingback:target>http://testdrivendeveloper.com/PermaLink,guid,51b0779e-f06c-418d-892d-9e1ba2a38300.aspx</pingback:target>
      <dc:creator>John E. Boal</dc:creator>
      <wfw:comment>http://testdrivendeveloper.com/CommentView,guid,51b0779e-f06c-418d-892d-9e1ba2a38300.aspx</wfw:comment>
      <wfw:commentRss>http://testdrivendeveloper.com/SyndicationService.asmx/GetEntryCommentsRss?guid=51b0779e-f06c-418d-892d-9e1ba2a38300</wfw:commentRss>
      <title>Inversion of Control with Dependency Injection</title>
      <guid isPermaLink="false">http://testdrivendeveloper.com/PermaLink,guid,51b0779e-f06c-418d-892d-9e1ba2a38300.aspx</guid>
      <link>http://TestDrivenDeveloper.com/2010/04/13/InversionOfControlWithDependencyInjection.aspx</link>
      <pubDate>Tue, 13 Apr 2010 15:41:03 GMT</pubDate>
      <description>&lt;div&gt;When we are unit testing a piece of code, sometimes there are modules or even systems that we need to rely on outside the scope of the test. It is usually very difficult or expensive to spin up these large pieces just to test one small piece. Even attempting to do this can really slow down the execution of the tests, and that becomes a problem of its own. When possible, we'd like to separate the implementation from the caller's execution so that the control is really in the called module doing the work. This is the "Inversion of Control" or IoC principle, as it's often referred.&lt;br&gt;&lt;br&gt;Dependency Injection is one mechanism where we can design our code in this way.

Dependency injection [DI] is like "injecting" a small bit of test-controlled code into the main-line execution space while the test is running. The test can control the specific execution of the "dependency" code, and cause it to behave in a specific way so as to elicit a specific behavior from the mainline code under test.&lt;br&gt;&lt;br&gt;My favorite mechanism to accomplish DI is to refactor code under test, extracting the logic of the dependency into a class that implements an interface. Then, we can create a test mechanism that implements the interface and behaves in the way that the test can control. We then replace the mainline "real" code with the test version at test time, bypassing the dependency and allowing us to remain focused on the code under test.&lt;br&gt;We can implement this with simple classes, or with Mock objects. The mock object frameworks out there today are quite robust and relatively easy to use, given an interface to implement for the dependency class. Rhino Mocks and Moq are some examples of frameworks that can be used for this type of test.

Here is a simple example of some code under test:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;using&lt;/span&gt; System;&lt;br&gt;&lt;br&gt;&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;namespace&lt;/span&gt; DIexample&lt;br&gt;{&lt;br&gt;    &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;class&lt;/span&gt; ClassUnderTest&lt;br&gt;    {&lt;br&gt;        &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;internal&lt;/span&gt; &lt;/span&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;IDependOnMe&lt;/span&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt; limit &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; Limiter();&lt;br&gt;&lt;br&gt;        &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; HasDependencyOnExternalClass(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; value)&lt;br&gt;        {&lt;br&gt;            &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;if&lt;/span&gt; (value &amp;lt; 0)&lt;br&gt;            {&lt;br&gt;                &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; limit.LogicFunction(value);&lt;br&gt;            }&lt;br&gt;            &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;else&lt;/span&gt;
            {
                &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; value;&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;interface&lt;/span&gt; IDependOnMe&lt;br&gt;    {&lt;br&gt;        &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; LogicFunction(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; value);&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;class&lt;/span&gt; Limiter : IDependOnMe&lt;br&gt;    {&lt;br&gt;        &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; LogicFunction(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; value)&lt;br&gt;        {&lt;br&gt;            &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;if&lt;/span&gt; (value &amp;lt; -10)&lt;br&gt;            {&lt;br&gt;                &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; value;&lt;br&gt;            }&lt;br&gt;            &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;else&lt;/span&gt;
            {
                &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; -10;&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;At test time, we can replace the internal variable "limit" with a test-created instance of an object that implements the "DependOnMe" interface, and behaves in a specific way (like just returning the value perhaps).

The variable "limit" is declared as "internal" scope, because we want the test code to be able to access it and replace its "real" object instance with a test-specific version. I keep the test assembly separate from the mainline code. However, I don't like the idea of making these mechanisms public unless they need to be, so instead in the mainline code, I use the internals visible to assembly attribute like this:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt; System.Runtime.CompilerServices;&lt;/pre&gt;&lt;pre&gt;[&lt;font color="#0000ff"&gt;assembly&lt;/font&gt;: InternalsVisibleTo("TestAssembly")]&lt;/pre&gt;&lt;br&gt;This allows all "internal" scoped methods to be accessed by the test assembly, and keeps all the test code out of the mainline code, and maintains at least a level of security that being public doesn't offer.&lt;br&gt;&lt;br&gt;Mock frameworks can be a big help in this type of DI testing. Rhino Mocks is here: &lt;a href="http://ayende.com/projects/rhino-mocks.aspx"&gt;http://ayende.com/projects/rhino-mocks.aspx&lt;/a&gt; it's a good free framework and fully featured. I've not used it but heard good things about MOQ: &lt;a href="http://code.google.com/p/moq/"&gt;http://code.google.com/p/moq/&lt;/a&gt;

&lt;br&gt;&lt;br&gt;Remember to keep the execution isolated from the implementation whenever possible, and it will make unit testing much easier.&lt;img width="0" height="0" src="http://testdrivendeveloper.com/aggbug.ashx?id=51b0779e-f06c-418d-892d-9e1ba2a38300"/&gt;&lt;/div&gt;</description>
      <comments>http://testdrivendeveloper.com/CommentView,guid,51b0779e-f06c-418d-892d-9e1ba2a38300.aspx</comments>
      <category>Mocks</category>
      <category>Unit Tests</category>
    </item>
    <item>
      <trackback:ping>http://testdrivendeveloper.com/Trackback.aspx?guid=e36a37f3-53c9-460d-8042-ee50090f0ad0</trackback:ping>
      <pingback:server>http://testdrivendeveloper.com/pingback.aspx</pingback:server>
      <pingback:target>http://testdrivendeveloper.com/PermaLink,guid,e36a37f3-53c9-460d-8042-ee50090f0ad0.aspx</pingback:target>
      <dc:creator>John E. Boal</dc:creator>
      <wfw:comment>http://testdrivendeveloper.com/CommentView,guid,e36a37f3-53c9-460d-8042-ee50090f0ad0.aspx</wfw:comment>
      <wfw:commentRss>http://testdrivendeveloper.com/SyndicationService.asmx/GetEntryCommentsRss?guid=e36a37f3-53c9-460d-8042-ee50090f0ad0</wfw:commentRss>
      <title>Unit Testing and Test Driven Development - a Practical Guide</title>
      <guid isPermaLink="false">http://testdrivendeveloper.com/PermaLink,guid,e36a37f3-53c9-460d-8042-ee50090f0ad0.aspx</guid>
      <link>http://TestDrivenDeveloper.com/2008/11/15/UnitTestingAndTestDrivenDevelopmentAPracticalGuide.aspx</link>
      <pubDate>Sat, 15 Nov 2008 21:08:59 GMT</pubDate>
      <description>&lt;div&gt;Here is a presentation I wrote on what Unit Testing is all about, and how TDD fits into the ATDD cycle.&lt;br&gt;&lt;br&gt;There are specific things here on testing the UI code with Selenium and JSUnit, and recommendations on how to do unit testing on your database code.&lt;br&gt;&lt;br&gt;This presentation is in PDF format, but I can post the PPTX format also if needed.&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;a href="http://testdrivendeveloper.com/content/binary/A%20Practical%20Guide%20to%20Unit%20Testing1.pdf"&gt;A Practical Guide to Unit Testing1.pdf (503.29 KB)&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;img width="0" height="0" src="http://testdrivendeveloper.com/aggbug.ashx?id=e36a37f3-53c9-460d-8042-ee50090f0ad0"/&gt;&lt;/div&gt;</description>
      <comments>http://testdrivendeveloper.com/CommentView,guid,e36a37f3-53c9-460d-8042-ee50090f0ad0.aspx</comments>
      <category>ATDD</category>
      <category>Mocks</category>
      <category>Refactoring</category>
      <category>Selenium</category>
      <category>TDD</category>
      <category>Testing</category>
      <category>Unit Tests</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://testdrivendeveloper.com/Trackback.aspx?guid=08d711e8-6e7b-4701-81b6-df843a72fa12</trackback:ping>
      <pingback:server>http://testdrivendeveloper.com/pingback.aspx</pingback:server>
      <pingback:target>http://testdrivendeveloper.com/PermaLink,guid,08d711e8-6e7b-4701-81b6-df843a72fa12.aspx</pingback:target>
      <dc:creator>John E. Boal</dc:creator>
      <wfw:comment>http://testdrivendeveloper.com/CommentView,guid,08d711e8-6e7b-4701-81b6-df843a72fa12.aspx</wfw:comment>
      <wfw:commentRss>http://testdrivendeveloper.com/SyndicationService.asmx/GetEntryCommentsRss?guid=08d711e8-6e7b-4701-81b6-df843a72fa12</wfw:commentRss>
      <slash:comments>6</slash:comments>
      <title>List of Tools for Developers</title>
      <guid isPermaLink="false">http://testdrivendeveloper.com/PermaLink,guid,08d711e8-6e7b-4701-81b6-df843a72fa12.aspx</guid>
      <link>http://TestDrivenDeveloper.com/2008/08/05/ListOfToolsForDevelopers.aspx</link>
      <pubDate>Tue, 05 Aug 2008 05:29:38 GMT</pubDate>
      <description>&lt;div&gt;I have been asked recently about tools I prefer to use in my every-day development. Here is a list of tools, and where to get them.&lt;br&gt;&lt;br&gt;Visual Studio 2008&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  Development IDE&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://msdn.microsoft.com/en-us/vstudio/products/aa700831.aspx"&gt;Microsoft&lt;/a&gt;&lt;br&gt;TestDriven.net&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; Test Runner&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;a href="http://TestDriven.net"&gt;TestDriven.net&lt;/a&gt;&lt;br&gt;WinMerge&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp; Diff / Merge tool&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;a href="http://winmerge.org/downloads/index.php"&gt;WinMerge.org&lt;/a&gt; integrates with VS and Tortoise too!&lt;br&gt;nUnit&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  Unit Testing Framework&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;a href="http://nunit.org/?p=download"&gt;nUnit.org&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Also see &lt;a href="http://www.mbunit.com/"&gt;mbUnit&lt;/a&gt; and &lt;a href="http://www.gallio.org"&gt;Gallio&lt;/a&gt;&lt;br&gt;Selenium&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp; UI test framework&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; &lt;a href="http://selenium.openqa.org/"&gt;OpenQA&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Also see &lt;a href="http://watin.sourceforge.net/"&gt;WatiN&lt;/a&gt;&lt;br&gt;ReSharper&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp; Integrated toolkit for VS&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; &lt;a href="http://www.jetbrains.com/resharper/download/"&gt;JetBrains&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  (OK I don't actually use it but it's good.)&lt;br&gt;Tortoise SVN&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; Shell Integration with SVN&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp; &lt;a href="http://tortoisesvn.net/downloads"&gt;Tigris&lt;/a&gt;&lt;br&gt;Ankh SVN&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  Visual Studio Plugin for SVN&amp;nbsp;&amp;nbsp;  &amp;nbsp; &lt;a href="http://ankhsvn.open.collab.net/servlets/ProjectProcess?pageID=3794"&gt;CollabNet&lt;/a&gt;&lt;br&gt;Subversion (Server)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version Control System&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;a href="http://www.visualsvn.com/server/"&gt;VisualSVN&lt;/a&gt;&lt;br&gt;Cruise Control.net&amp;nbsp; &amp;nbsp;&amp;nbsp;  &amp;nbsp; CI system&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;a href="http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET"&gt;ThoughtWorks&lt;/a&gt;&lt;br&gt;RhinoMocks&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  Mock Object System&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx"&gt;Ayende&lt;/a&gt;&lt;br&gt;nAnt&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp; .NET Build Tool&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &lt;a href="http://nant.sourceforge.net/"&gt;nAnt&lt;/a&gt;&lt;br&gt;Fitnesse&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; Acceptance Test Tool&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp; &lt;a href="http://fitnesse.org/"&gt;Fitnesse&lt;/a&gt;&lt;br&gt;STIQ&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp; Story Test Tool&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;a href="http://storytestiq.solutionsiq.com/wiki/Main_Page"&gt;Solutions IQ&lt;/a&gt;&lt;br&gt;GIMP&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  GNU Image Manipulation Prog. &lt;a href="http://gimp-win.sourceforge.net/"&gt;SourceForge&lt;/a&gt;&lt;br&gt;Notepad++&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; Smart Text Editor&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; &lt;a href="http://notepad-plus.sourceforge.net/uk/download.php"&gt;SourceForge UK&lt;/a&gt; when Visual Studio just won't do...&lt;br&gt;&lt;br&gt;Not development tools exactly, but extremely handy:&lt;br&gt;Process Explorer&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  Smarter Task Manager&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;SysInternals&lt;/a&gt;&lt;br&gt;FileZilla&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;  Upload/FTP client&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &lt;a href="http://filezilla-project.org/download.php"&gt;FileZilla&lt;/a&gt;&lt;br&gt;DivX&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp; Decoder&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &lt;a href="http://DivX.com"&gt;DivX&lt;/a&gt;&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp; Because sometimes we need to watch movies...&lt;br&gt;&lt;br&gt;That's all I can think of at the moment, but am probably missing some
things. I'm sure you'll all (please) chime in with what I forgot... :-)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;&lt;img width="0" height="0" src="http://testdrivendeveloper.com/aggbug.ashx?id=08d711e8-6e7b-4701-81b6-df843a72fa12"/&gt;&lt;/div&gt;</description>
      <comments>http://testdrivendeveloper.com/CommentView,guid,08d711e8-6e7b-4701-81b6-df843a72fa12.aspx</comments>
      <category>Automation</category>
      <category>Mocks</category>
      <category>Selenium</category>
      <category>Testing</category>
      <category>WatiN</category>
      <category>Tools</category>
    </item>
    <item>
      <trackback:ping>http://testdrivendeveloper.com/Trackback.aspx?guid=5b08a3b3-85a8-4c3b-b6d3-76cf1c796f8c</trackback:ping>
      <pingback:server>http://testdrivendeveloper.com/pingback.aspx</pingback:server>
      <pingback:target>http://testdrivendeveloper.com/PermaLink,guid,5b08a3b3-85a8-4c3b-b6d3-76cf1c796f8c.aspx</pingback:target>
      <dc:creator>John E. Boal</dc:creator>
      <wfw:comment>http://testdrivendeveloper.com/CommentView,guid,5b08a3b3-85a8-4c3b-b6d3-76cf1c796f8c.aspx</wfw:comment>
      <wfw:commentRss>http://testdrivendeveloper.com/SyndicationService.asmx/GetEntryCommentsRss?guid=5b08a3b3-85a8-4c3b-b6d3-76cf1c796f8c</wfw:commentRss>
      <title>Testing the Paint Truck</title>
      <guid isPermaLink="false">http://testdrivendeveloper.com/PermaLink,guid,5b08a3b3-85a8-4c3b-b6d3-76cf1c796f8c.aspx</guid>
      <link>http://TestDrivenDeveloper.com/2008/06/03/TestingThePaintTruck.aspx</link>
      <pubDate>Tue, 03 Jun 2008 18:55:32 GMT</pubDate>
      <description>&lt;div&gt;&lt;P&gt;I was explaining to someone about different types of testing I do with my code, and how mock objects can be used in unit tests. I used the example of the paint truck at the airport that spray-paints lines on the tarmac. Its job is to put down wide lines, narrow lines, in yellow, and white, and of a certain length, at specific places on the runways and taxiways. The truck is driven by a person, and the paint spray system is operated by&amp;nbsp;driver. It's not a perfect example, but it may get the point across.&lt;/P&gt;
&lt;P&gt;When we model this with truck software and try to test it,&amp;nbsp;most developers seem to tend to go right for testing the whole solution end to end.&amp;nbsp;That means&amp;nbsp;trying to figure out how to fire up the engine, position the truck at&amp;nbsp;certain coordinates, be at a certain speed, and then test the spray gun and see if it paints the correct stripes. It's a hard problem to solve, to try to set up with all these things&amp;nbsp;and get it just right - just to see if the painter works properly. It can be a daunting task to try to test software this way, yet most developers who do "unit testing" are trying to do just this kind of thing. My take is that this is not really "unit testing" but actually "functional" testing. While it is definitely good to have functional tests, I prefer my development team to focus on more narrow areas such as individual classes. If these are thoughtfully designed and&amp;nbsp;tested individually, they should work well when combined. This is also where integration and scenario testing come in. These types of tests are beyond the scope of unit tests.&lt;/P&gt;
&lt;P&gt;Let me give an example that explains how we might be able to go about testing this a bit more carefully. Let's take the truck as a single "system" and the paint sprayer as a separate "system." These systems are really not very coupled - the sprayer runs on the truck's electric system, but that's about it. It makes sense to decouple them in trying to test them.&lt;/P&gt;
&lt;P&gt;If we separate out the sprayer as a separate system, the only inputs it needs from the truck&amp;nbsp;are the electrical connection and the trigger input. We can "mock" out these connections by supplying a new power source and trigger input connector&amp;nbsp;that has the same "interface" (that is -&amp;nbsp;implements the same interface class in code). Now we can test the system without needing to have the actual truck around. This is the&amp;nbsp;concept of mock objects at its best in unit testing.&lt;/P&gt;
&lt;P&gt;We can separate even the power mock object from the trigger mock object. We can control how these mock objects behave precisely, and keep them in specific states so that the only variables under test are in the sprayer system. We can then test what happens to the sprayer if we make the power go away, what happens if we trigger both paint guns at the same time, and making sure we can turn on and off each gun. These make great unit tests and document how our code is supposed to work. They should run very fast, and not require any diesel fuel...&lt;/P&gt;
&lt;P&gt;All of the ability we have to be able to mock things like this, depends on programming to interfaces, which is a long-time engineering best practice to avoid decoupling. If we design our software to implement interfaces, we can then easily substitute dependency systems at test time with our own controlled version, and focus the testing on a more narrow area, while making the tests run faster at the same time.&lt;/P&gt;&lt;img width="0" height="0" src="http://testdrivendeveloper.com/aggbug.ashx?id=5b08a3b3-85a8-4c3b-b6d3-76cf1c796f8c"/&gt;&lt;/div&gt;</description>
      <comments>http://testdrivendeveloper.com/CommentView,guid,5b08a3b3-85a8-4c3b-b6d3-76cf1c796f8c.aspx</comments>
      <category>TDD</category>
      <category>Testing</category>
      <category>Mocks</category>
    </item>
  </channel>
</rss>