﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Philip Beadle</title>
    <description>My personal blog on DotNetNuke.</description>
    <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/BlogId/20/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>philip.beadle@readify.net</managingEditor>
    <webMaster>admin1@dotnetnuke.com</webMaster>
    <pubDate>Tue, 13 May 2008 11:28:48 GMT</pubDate>
    <lastBuildDate>Tue, 13 May 2008 11:28:48 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.4.0.39853</generator>
    <item>
      <title>Check out my video on DGTV :)</title>
      <description>&lt;p&gt;Michael Kordahi aka the Delicate Genius is a Microsoft Developer Evangelist in Sydney, he inteviewed me about my &lt;a href="http://www.microsoft.com/australia/remix08/index.aspx"&gt;ReMIX&lt;/a&gt; session last week check it out here &lt;a href="http://delicategeniusblog.com/?p=682"&gt;http://delicategeniusblog.com/?p=682&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1827/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1827/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1827</guid>
      <pubDate>Tue, 06 May 2008 14:00:00 GMT</pubDate>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1827</trackback:ping>
    </item>
    <item>
      <title>Open Force 08 Connect - Check out the free DNN training you can get</title>
      <description>&lt;p&gt;There is some free top quality training going on down Orlando way on the weekend between the two US Tech Ed sessions.  Check out &lt;a href="http://www.openforce08.com/Home/OpenForceConnect/Orlando/Overview/tabid/115/Default.aspx"&gt;http://www.openforce08.com/Home/OpenForceConnect/Orlando/Overview/tabid/115/Default.aspx&lt;/a&gt; for more details.  Looks like a great weekend of DNN, shame I cant make the trip for the 4th time this year :).&lt;/p&gt;
&lt;p&gt;Let me know if youre going.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1828/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1828/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1828</guid>
      <pubDate>Tue, 06 May 2008 14:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1828</trackback:ping>
    </item>
    <item>
      <title>ReMIX bling for my Blog.</title>
      <description>&lt;p&gt;&lt;a href="http://www.microsoft.com/australia/remix08/index.aspx"&gt;&lt;img border="0" alt="I'm speaking at REMIX. Are you?" align="left" src="http://www.microsoft.com/australia/remix08/images/bling/iamspeaking_08.jpg" /&gt;&lt;/a&gt; Just got this new bling for my Blog about ReMIX '08. &lt;strong&gt;Building Rich Internet Applications using Microsoft Silverlight 2&lt;/strong&gt;&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1822/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1822/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1822</guid>
      <pubDate>Thu, 01 May 2008 14:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1822</trackback:ping>
    </item>
    <item>
      <title>ReMIX Australia '08</title>
      <description>&lt;p&gt;I will be presenting at ReMIX Australia '08 in Sydney and Melbourne in May.  Check out the details here&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.microsoft.com/australia/remix08/index.aspx"&gt;http://www.microsoft.com/australia/remix08/index.aspx&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1821/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1821/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1821</guid>
      <pubDate>Tue, 29 Apr 2008 14:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1821</trackback:ping>
    </item>
    <item>
      <title>MVP Reawarded</title>
      <description>&lt;p&gt;Got my email this morning reawarding me MVP for another year.  Now enough of that time to get back to finishing the TDD DNN Module template.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1787/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1787/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1787</guid>
      <pubDate>Tue, 01 Apr 2008 14:00:00 GMT</pubDate>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1787</trackback:ping>
    </item>
    <item>
      <title>Test Driven Module Update</title>
      <description>&lt;p&gt;I have now nearly completed the module.  Tests are now in place for all layers and cover&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;100% of the testable code in the Edit part of the module&lt;/li&gt;
    &lt;li&gt;100% of the Controller&lt;/li&gt;
    &lt;li&gt;100% of the testable parts of SqlDataProvider&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can check out the code solution at &lt;a href="http://www.codeplex.com/TestDrivenDNNModule"&gt;http://www.codeplex.com/TestDrivenDNNModule&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I'll write the rest of the tests ASAP.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1788/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1788/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1788</guid>
      <pubDate>Tue, 01 Apr 2008 14:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1788</trackback:ping>
    </item>
    <item>
      <title>TDD DNN Modules - Some changes to the core </title>
      <description>&lt;div&gt;When you are developing a DNN module you have access to a bunch of properties in the core framework such as UserID, ModuleID and LocalResourceFile.  When you start developing modules using Test Driven Development (TDD) you still need access to these properties which means we need to be able to access them from  the presenter class.&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;The presenter class has a construct like this&lt;/p&gt;
&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;Public&lt;/span&gt; &lt;span style="color: blue"&gt;Sub&lt;/span&gt; &lt;span style="color: blue"&gt;New&lt;/span&gt;(&lt;span style="color: blue"&gt;ByVal&lt;/span&gt; _View &lt;span style="color: blue"&gt;As&lt;/span&gt; IViewTestDrivenDNNModule)&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;            View = _View&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;            Controller = &lt;span style="color: blue"&gt;New&lt;/span&gt; TestDrivenDNNModuleController&lt;br /&gt;
        &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;which means that the View we access in the presenter class only has the properties specified in the interface for the View.  We can access the LocalResourceFile if the DotNetNuke.UI.Modules.IModuleControl is inherited but since the PortalModuleBase class does not have an interface we cannot access the other properties we need. &lt;/div&gt;
&lt;div&gt;
&lt;p&gt;So I made a few changes to the core to experiment with an Interface for the PortalModuleBase. Firstly I created a new interface called IPortalModuleBase&lt;/p&gt;
&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;Public&lt;/span&gt; &lt;span style="color: blue"&gt;Interface&lt;/span&gt; IPortalModuleBase&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;ReadOnly&lt;/span&gt; &lt;span style="color: blue"&gt;Property&lt;/span&gt; ModuleID() &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Integer&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;ReadOnly&lt;/span&gt; &lt;span style="color: blue"&gt;Property&lt;/span&gt; UserID() &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Integer&lt;br /&gt;
&lt;/span&gt;    &lt;span style="color: blue"&gt;End&lt;/span&gt; &lt;span style="color: blue"&gt;Interface&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt; &lt;/div&gt;
&lt;div style="line-height: normal"&gt;Then the PortalModuleBase class implements the new interface&lt;/div&gt;
&lt;div style="line-height: normal"&gt; &lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;Public&lt;/span&gt; &lt;span style="color: blue"&gt;Class&lt;/span&gt; PortalModuleBase&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;Inherits&lt;/span&gt; UserControlBase&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;Implements&lt;/span&gt; IModuleControl&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;Implements&lt;/span&gt; IPortalModuleBase&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt; &lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;Public&lt;/span&gt; &lt;span style="color: blue"&gt;ReadOnly&lt;/span&gt; &lt;span style="color: blue"&gt;Property&lt;/span&gt; ModuleId() &lt;span style="color: blue"&gt;As&lt;/span&gt; &lt;span style="color: blue"&gt;Integer&lt;/span&gt; &lt;span style="color: blue"&gt;Implements&lt;/span&gt; IPortalModuleBase.ModuleID&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt; &lt;/div&gt;
&lt;div style="line-height: normal"&gt;And lastly the interface for our module inherits both of the IPortalModuleBase and IModuleControl interfaces like this&lt;/div&gt;
&lt;div style="line-height: normal"&gt; &lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;Public&lt;/span&gt; &lt;span style="color: blue"&gt;Interface&lt;/span&gt; IViewTestDrivenDNNModule&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;Inherits&lt;/span&gt; DotNetNuke.UI.Modules.IPortalModuleBase&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;Inherits&lt;/span&gt; DotNetNuke.UI.Modules.IModuleControl&lt;/span&gt;&lt;/div&gt;
&lt;div style="line-height: normal"&gt; &lt;/div&gt;
&lt;div&gt;This allows easy access to the properties we need in the presenter class like this&lt;/div&gt;
&lt;div style="line-height: normal"&gt;&lt;span style="font-size: 10pt"&gt;colTestDrivenDNNModules = objTestDrivenDNNModules.GetTestDrivenDNNModules(View.ModuleID)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;Previously I had just added new properties to the IViewTestDrivenDNNModule interface and pulled the values through from the ViewTestDrivenDNNModule partial class. This however was inelegant and led to having properties such as ModuleId1!! This new solution is far more useable and very easy to implement.&lt;/p&gt;
&lt;p&gt;Doing this will allow much easier development of TDD DNN modules.&lt;/p&gt;
&lt;/div&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1739/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1739/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1739</guid>
      <pubDate>Sun, 24 Feb 2008 14:00:00 GMT</pubDate>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1739</trackback:ping>
    </item>
    <item>
      <title>TDDDNN - Diagram of how it all fits together so far.</title>
      <description>&lt;p&gt;I drew this up to help give an understanding of how the testing of DNN Modules is going to work for my &lt;a href="http://www.codeplex.com/TestDrivenDNNModule"&gt;TDD DNN Module template&lt;/a&gt; at CodePlex.&lt;/p&gt;
&lt;p&gt;&lt;img height="663" width="797" alt="" src="/Portals/25/CoreTeam/BlogFiles/PhilipB/TDDDNNDiagram.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;This diagram shows how each level of a DNN module can be unit tested using RhinoMocks to generate the mock objects.  It also shows where I will be driving the integration testing and also the automation testing using Watin.&lt;/p&gt;
&lt;p&gt;Mock objects and mock controllers allow you to create known return values for the methods you are testing.  Doing this allows you directly test a piece of code knowing that if the code is corect it will return the value you assigned to the mock object/controller.  the unit test is then just that, a test of a unit of work.  Once you have the unit tests written you can then do a code coverage analysis and make sure that you code is fully covered (where useful).  This allows you to test for each of the code paths in your code.  Good code coverage gives you confidence that the code you have written doesnt have black holes. &lt;/p&gt;
&lt;p&gt;My favourite part of having a well covered code is that when a bug is reported you can write a test to prove that it is a bug and then modify your code, rerun your tests and know that you didnt intrduce another bug with the fix implemented. &lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1733/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1733/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1733</guid>
      <pubDate>Sun, 17 Feb 2008 14:00:00 GMT</pubDate>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1733</trackback:ping>
    </item>
    <item>
      <title>Test Driven DNN Modules</title>
      <description>&lt;p&gt;In my day job I and my teams write unit tests for all of our code and we write our projects to be testable, this gives great benefits and actaully makes your projects go faster.  My current porject has a code coverage of 80%+ and we have nearly 800 tests written already.  The really cool thing about having Unit tests for all of your code is that when you or someone else needs to cahnge some part of the solution you simply run the tests afterwards to make sure you didnt break anything elsewhere.&lt;/p&gt;
&lt;p&gt;The other thing we do is when a bug is reported by the Test Team, who write our automation tests with Watin, we firstly write a test to prove there is a bug and then mod the code to fix the bug.  This gives us an extra set of tests that test the edge case we missed before and thus makes the code even stronger.&lt;/p&gt;
&lt;p&gt;And yet another benefit of unti testing is that you can include the tests in your load tests to measure performance. &lt;/p&gt;
&lt;p&gt;So with all these great reasons to write unit tests I have started building a template DNN module that can be fully unit tested.  I have created a new Forge project here &lt;a href="http://www.codeplex.com/TestDrivenDNNModule"&gt;http://www.codeplex.com/TestDrivenDNNModule&lt;/a&gt; .  You can download the template and see how Im doing it.  One of the things you will find is that to write unit tests for ASP.Net apps you need to be able to separate out the functional code from the normal code behind file to conduct a proper uint test.  To do this I have used the &lt;a href="http://martinfowler.com/eaaDev/PassiveScreen.html"&gt;Passive View Pattern&lt;/a&gt; from Martin Fowler.  I was put onto this by &lt;a href="http://www.dotnetnuke.com/Community/Blogs/tabid/825/BlogID/217/Default.aspx"&gt;Dan Bartholomew&lt;/a&gt; who discovered it is very similar to the pattern in the &lt;a href="http://www.codeplex.com/websf"&gt;WCSF&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you look in the code behind file you'll see that the only code is to set properties and to call the methods in the Presenter class which ahs all the functioanl code.  The code in teh code behind does not need to be unit tested as it only sets and gets properties or triggers an event.  The code in the presenter class is what gets tested.&lt;/p&gt;
&lt;p&gt;My next task is to add in the mocking of each layer using RhinoMocks so that i can unit test each part of the Presenter code without worrying about hitting code further down the stack such as the Controller class and data providers.  Dan is helping me out on that so we should have some more of the template done next week.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1732/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1732/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1732</guid>
      <pubDate>Thu, 14 Feb 2008 14:00:00 GMT</pubDate>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1732</trackback:ping>
    </item>
    <item>
      <title>End of my web farm experiment</title>
      <description>&lt;p&gt;Well sorry to say I ran out of time trying to get the servers setup and run a few tests on DNN before I had to give them back.  Ill try again with a virtual setup soon.&lt;/p&gt;</description>
      <link>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1729/Default.aspx</link>
      <author>philip.beadle@readify.net</author>
      <comments>http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1729/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1729</guid>
      <pubDate>Mon, 11 Feb 2008 14:00:00 GMT</pubDate>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://www.dotnetnuke.com/DesktopModules/Blog/Trackback.aspx?id=1729</trackback:ping>
    </item>
  </channel>
</rss>