<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vi-kan.net &#187; TDD</title>
	<atom:link href="http://blog.vi-kan.net/tag/tdd/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.vi-kan.net</link>
	<description>{ TODO -oVegar : insert clever text here}</description>
	<lastBuildDate>Thu, 06 May 2010 13:27:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DUnit: Loading tests from dll’s</title>
		<link>http://blog.vi-kan.net/2009/dunit-loading-tests-from-dlls/</link>
		<comments>http://blog.vi-kan.net/2009/dunit-loading-tests-from-dlls/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 14:21:33 +0000</pubDate>
		<dc:creator>Vegar</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DUnit]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://blog.vi-kan.net/?p=71</guid>
		<description><![CDATA[I wanted to split all my unittests for a project into separate packages to keep tings nice and clean. DUnit comes with a unit called TestModules.pas which helps you do that.
The unit contains three public methods:
function LoadModuleTests(LibName: string) :ITest;
procedure RegisterModuleTests(LibName: string);
procedure UnloadTestModules;
The LoadModuleTests( )-function, dynamically loads the given library (dll or dtl files), and returns [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to split all my unittests for a project into separate packages to keep tings nice and clean. <a title="DUnit: An Xtreme testframework for Delphi programs" href="http://dunit.sourceforge.net/">DUnit</a> comes with a unit called <a title="View testmodules.pas from sourceforge.net" href="http://dunit.svn.sourceforge.net/viewvc/dunit/trunk/src/TestModules.pas?revision=15&amp;view=markup">TestModules.pas</a> which helps you do that.<span id="more-71"></span></p>
<p>The unit contains three public methods:</p>
<pre class="brush: delphi; gutter: false;">function LoadModuleTests(LibName: string) :ITest;
procedure RegisterModuleTests(LibName: string);
procedure UnloadTestModules;</pre>
<p>The LoadModuleTests( )-function, dynamically loads the given library (dll or dtl files), and returns an interface to the tests defined within. RegisterModuleTests( ) does the same, but also calls RegisterTest( ) with the interface from the library.</p>
<p>There is one requirement that the library has to satisfy. It must export a function named ‘Test’ that returns a ITest-interface. Following is a basic project file showing how this can be done:</p>
<pre class="brush: delphi; gutter: false;">library OurUnitTests;

uses
  TestFramework;

function Test: ITest;
begin
  result := RegisteredTests;
end;

exports
  Test name 'Test';

end;</pre>
<p>The Test( )-function simply returns the result from the RegisteredTests( ) method from the TestFramework-unit. RegisteredTests( ) returns a ITestSuite containing all the test classes registered.</p>
<p>Here&#8217;s a samle project file that loads all dll-files from the executables folder, and runs all test through the GUITestRunner:</p>
<pre class="brush: delphi; gutter: false;">program RunTests;
uses
  Forms,
  TestFramework,
  GUITestRunner,
  TestModules,
  SysUtils,
  Windows,
  JclFileUtils,
  classes,
  Dialogs
  ;

  {$R *.RES}

procedure LoadTests;
var
  filelist: TStringList;
  str: string;
begin
  filelist := TStringList.Create;
  try
    BuildFileList('*.dll', faAnyFile, filelist);

    for str in filelist do
    begin
      try
        RegisterModuleTests(str)
      except
        on E: Exception do
          ShowMessage(e.Message);
      end;
    end;
  finally
    filelist.free;
  end;
end;

begin
  Application.Initialize;

  LoadTests;
  GUITestRunner.RunRegisteredTests;
  UnloadTestModules;
end.</pre>
<p>The BuildFileList( ) method comes from JCL, and simply fills a TStringList with filenames from the given mask. As I said, this is a very basic project, but it shows how to use the TestModules-unit to dynamically load tests. This can easily be expanded to a more flexible solution. You could use command parameters to control what folder should be searched for libraries, or what testrunner should be used, GUI or XML or custom runner.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.vi-kan.net/2009/dunit-loading-tests-from-dlls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TDD, Unittesting and Delphi</title>
		<link>http://blog.vi-kan.net/2009/tdd-unittesting-and-delphi/</link>
		<comments>http://blog.vi-kan.net/2009/tdd-unittesting-and-delphi/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 11:04:50 +0000</pubDate>
		<dc:creator>Vegar</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[UnitTesting]]></category>

		<guid isPermaLink="false">http://blog.vi-kan.net/?p=60</guid>
		<description><![CDATA[Lately, I’ve been trying to learn TDD. In this post, I will collect the resources that I find.]]></description>
			<content:encoded><![CDATA[<p>Lately, I’ve been trying to learn TDD. In this post, I will collect some resources that I find helpfull. </p>
<p> <span id="more-60"></span>
</p>
<h2>Test Frameworks</h2>
<h3 style="padding-left: 30px">DUnit</h3>
<p style="padding-left: 30px"><a title="http://dunit.sourceforge.net/" href="http://dunit.sourceforge.net/">http://dunit.sourceforge.net/</a></p>
<h3 style="padding-left: 30px">DUnitLite</h3>
<p style="padding-left: 30px"><a title="http://code.google.com/p/dunitlite/" href="http://code.google.com/p/dunitlite/">http://code.google.com/p/dunitlite/</a></p>
<h3 style="padding-left: 30px">DSpec</h3>
<p style="padding-left: 30px"><a title="http://sourceforge.net/projects/dspec/" href="http://sourceforge.net/projects/dspec/">http://sourceforge.net/projects/dspec/</a></p>
<h2>Mocking/Faking</h2>
<h3 style="padding-left: 30px">Pascal Mock</h3>
<p style="padding-left: 30px"><a title="http://sourceforge.net/projects/pascalmock/" href="http://sourceforge.net/projects/pascalmock/">http://sourceforge.net/projects/pascalmock/</a></p>
<h3 style="padding-left: 30px">Delphi Mock Wizard</h3>
<p style="padding-left: 30px"><a title="http://code.google.com/p/delphi-mock-wizard/" href="http://code.google.com/p/delphi-mock-wizard/">http://code.google.com/p/delphi-mock-wizard/</a></p>
<h3 style="padding-left: 30px">Simple Mock</h3>
<p style="padding-left: 30px"><a title="http://delphixtreme.com/wordpress/?p=14" href="http://delphixtreme.com/wordpress/?p=14">http://delphixtreme.com/wordpress/?p=14</a></p>
<h3 style="padding-left: 30px">Ultra Basic MockObjects</h3>
<p style="padding-left: 30px"><a title="http://sourceforge.net/projects/ubmock/" href="http://sourceforge.net/projects/ubmock/">http://sourceforge.net/projects/ubmock/</a></p>
<h2>Code coverage</h2>
<h3 style="padding-left: 30px">Discover for Delphi</h3>
<p style="padding-left: 30px"><a title="http://www.cyamon.com/discover1.htm" href="http://www.cyamon.com/discover1.htm">http://www.cyamon.com/discover1.htm</a></p>
<h3 style="padding-left: 30px">AQ Time</h3>
<p style="padding-left: 30px"><a title="http://www.automatedqa.com/products/aqtime/" href="http://www.automatedqa.com/products/aqtime/">http://www.automatedqa.com/products/aqtime/</a></p>
<h2>Supporting tools</h2>
<h3 style="padding-left: 30px">DUnit IDE integration</h3>
<p style="padding-left: 30px"><a title="http://delphixtreme.com/wordpress/?page_id=8" href="http://delphixtreme.com/wordpress/?page_id=8">http://delphixtreme.com/wordpress/?page_id=8</a></p>
<h2>Websites</h2>
<h3 style="padding-left: 30px">Delphi-Extreme</h3>
<p style="padding-left: 30px"><a title="http://www.delphixtreme.com/" href="http://www.delphixtreme.com/">http://www.delphixtreme.com/</a></p>
<p style="padding-left: 30px"><a title="http://www.delphixtreme.com/forums/" href="http://www.delphixtreme.com/forums/">http://www.delphixtreme.com/forums/</a></p>
<h2>FitNesse</h2>
<h3 style="padding-left: 30px">FitNesse</h3>
<p style="padding-left: 30px"><a title="http://fitnesse.org/" href="http://fitnesse.org/">http://fitnesse.org/</a></p>
<h3 style="padding-left: 30px">Fit4Delphi</h3>
<p style="padding-left: 30px"><a title="http://code.google.com/p/fit4delphi/" href="http://code.google.com/p/fit4delphi/">http://code.google.com/p/fit4delphi/</a></p>
<h3 style="padding-left: 30px">FitNesse.Tutorials</h3>
<p style="padding-left: 30px"><a title="http://schuchert.wikispaces.com/FitNesse.Tutorials" href="http://schuchert.wikispaces.com/FitNesse.Tutorials">http://schuchert.wikispaces.com/FitNesse.Tutorials</a></p>
<h2>Books</h2>
<p><span style="font-size: xx-small"></span></p>
<table border="0" cellspacing="0" cellpadding="2" width="609">
<tbody>
<tr>
<td valign="top"><a href="http://my.safaribooksonline.com/0321269349"><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.vi-kan.net/wp-content/uploads/2009/08/image.png" width="76" height="100" /></a></td>
<td valign="top" width="506"><strong><a href="http://my.safaribooksonline.com/0321269349">Fit for Developing Software: Framework for Integrated Tests</a></strong>           <br /><span style="font-size: xx-small">by Rick Mugridge; Ward Cunningham </span>
<p><span style="font-size: xx-small">Publisher: Prentice Hall              <br />Pub Date: June 29, 2005               <br />Print ISBN-10: 0-321-26934-9               <br />Print ISBN-13: 978-0-321-26934-8 </span></p>
<p><span style="font-size: xx-small">Pages: 384</span></p>
</td>
</tr>
<tr>
<td valign="top" width="96"><a href="http://my.safaribooksonline.com/9781933988276"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" src="http://blog.vi-kan.net/wp-content/uploads/2009/08/image1.png" width="76" height="95" /></a></td>
<td valign="top" width="506"><strong><a href="http://my.safaribooksonline.com/9781933988276">The Art of Unit Testing: with Examples in .NET</a></strong>           <br /><span style="font-size: xx-small">by Roy Osherove </span>
<p><span style="font-size: xx-small">Publisher: Manning Publications              <br />Pub Date: June 28, 2009               <br />Print ISBN-10: 1-933988-27-4               <br />Print ISBN-13: 978-1-933988-27-6 </span></p>
<p><span style="font-size: xx-small">Pages: 320</span></p>
</td>
</tr>
<tr>
<td valign="top" width="96"><a href="http://my.safaribooksonline.com/0321146530"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" src="http://blog.vi-kan.net/wp-content/uploads/2009/08/image2.png" width="76" height="95" /></a></td>
<td valign="top" width="506"><a href="http://my.safaribooksonline.com/0321146530">Test Driven Development: By Example</a>           <br /><span style="font-size: xx-small">by Kent Beck </span>
<p><span style="font-size: xx-small">Publisher: Addison-Wesley Professional              <br />Pub Date: November 08, 2002               <br />Print ISBN-10: 0-321-14653-0               <br />Print ISBN-13: 978-0-321-14653-3 </span></p>
<p><span style="font-size: xx-small">Pages: 240</span></p>
</td>
</tr>
<tr>
<td valign="top" width="96"><a href="http://my.safaribooksonline.com/9780131495050"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" src="http://blog.vi-kan.net/wp-content/uploads/2009/08/image3.png" width="76" height="102" /></a></td>
<td valign="top" width="506"><a href="http://my.safaribooksonline.com/9780131495050">xUnit Test Patterns: Refactoring Test Code</a>           <br /><span style="font-size: xx-small">by Gerard Meszaros </span>
<p><span style="font-size: xx-small">Publisher: Addison-Wesley Professional              <br />Pub Date: May 21, 2007               <br />Print ISBN-10: 0-13-149505-4               <br />Print ISBN-13: 978-0-13-149505-0 </span></p>
<p><span style="font-size: xx-small">Pages: 944</span></p>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.vi-kan.net/2009/tdd-unittesting-and-delphi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->