<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Andrew Stopford&amp;#39;s Weblog</title><link>http://weblogs.asp.net/astopford/default.aspx</link><description>poobah</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Wanted: a code discovery tool</title><link>http://weblogs.asp.net/astopford/archive/2008/07/24/wanted-a-code-discovery-tool.aspx</link><pubDate>Thu, 24 Jul 2008 09:34:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6438379</guid><dc:creator>andrewstopford</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6438379</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/07/24/wanted-a-code-discovery-tool.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Picture this, large scale enterprise app,&amp;nbsp;small scale legacy application, third party code...in other words a code base you are not fully&amp;nbsp;familar with and need to understand. Sure enough can apply the &lt;A class="" href="http://www.informit.com/store/product.aspx?isbn=0131177052&amp;amp;aid=15d186bd-1678-45e9-8ad3-fe53713e811b" mce_href="http://www.informit.com/store/product.aspx?isbn=0131177052&amp;amp;aid=15d186bd-1678-45e9-8ad3-fe53713e811b"&gt;feathers rules&lt;/A&gt; but if your in a hurrry to understand to understand a code base to start making changes (and a green field option is not an option) then what do you do? I'm&amp;nbsp;on&amp;nbsp;the look out for a tool that can allow you to explore a code base, explore object dependencies&amp;nbsp;and pathways.&amp;nbsp;Ideas welcome.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6438379" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/astopford/archive/tags/General+Software+Development/default.aspx">General Software Development</category></item><item><title>I never saw this coming...</title><link>http://weblogs.asp.net/astopford/archive/2008/07/17/i-never-saw-this-coming.aspx</link><pubDate>Thu, 17 Jul 2008 11:25:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6410671</guid><dc:creator>andrewstopford</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6410671</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/07/17/i-never-saw-this-coming.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;While eating my lunch I was running through google reader and started reading a post from &lt;A class="" href="http://feeds.feedburner.com/~r/CodeBetter/~3/337276731/me-mef-a-new-beginning.aspx" mce_href="http://feeds.feedburner.com/~r/CodeBetter/~3/337276731/me-mef-a-new-beginning.aspx"&gt;Glen&lt;/A&gt;, this lead me in turn to Hammett (the guy that founded the Castle project) and &lt;A class="" href="http://hammett.castleproject.org/?p=312" mce_href="http://hammett.castleproject.org/?p=312"&gt;this post literally blew me away.&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Microsoft have been snapping some of the coolest, smartest dudes in the commnity lately, first Haack, then Rob, then Hansleman,&amp;nbsp;now....Hammet.&amp;nbsp;It is&amp;nbsp;a very long time coming, Hammett is&amp;nbsp;a seriously smart dude and&amp;nbsp;fully deserves it.&amp;nbsp; He will be joining them on the &lt;A class="" href="http://blogs.msdn.com/kcwalina/archive/2008/04/25/MEF.aspx" mce_href="http://blogs.msdn.com/kcwalina/archive/2008/04/25/MEF.aspx"&gt;MEF&lt;/A&gt; team, as that is not directly related to Castle (although I am sure the IoC stuff make use of the MEF) he gets to keep working on the project, very cool.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I do wonder when Oren, &lt;FONT face=Calibri&gt;Jeremy&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;and Jeff&amp;nbsp;(also super smart dudes) will be joining the mother ship, still waiting on my call Scott :D&amp;nbsp;;-)&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6410671" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Give credit where it is due</title><link>http://weblogs.asp.net/astopford/archive/2008/07/11/give-credit-where-it-is-due.aspx</link><pubDate>Fri, 11 Jul 2008 06:48:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6387792</guid><dc:creator>andrewstopford</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6387792</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/07/11/give-credit-where-it-is-due.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;&lt;A class="" href="http://blog.bits-in-motion.com/2008/07/attribution-and-golden-rule.html" mce_href="http://blog.bits-in-motion.com/2008/07/attribution-and-golden-rule.html"&gt;Jeff's recent&amp;nbsp;post I cannot repeat enough&lt;/A&gt;, with both MbUnit and Gallio we have made sure&amp;nbsp;that we have&amp;nbsp;credited folks where we have reimplemented their&amp;nbsp;ideas and concepts. If they took the time to come&amp;nbsp;up with the concept\idea then we feel it was only right to credit them for that concep\idea,&amp;nbsp;while there may be little legal standing it is a polite and professional thing to do.&amp;nbsp;During my time as V2 lead, Roy contacted me about a failure on our part to credit him for the Rollback attribute&amp;nbsp;in the MbUnit code and we quickly corrected it. It was Roys concept and it was only fair to give notice of that. Me and Jeff have recently noticed several other OSS projects who have copied some of the concepts\ideas from MbUnit\Gallio and we ask that those concerned give us the same consideration.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6387792" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/MbUnit/default.aspx">MbUnit</category><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Alan Turing</title><link>http://weblogs.asp.net/astopford/archive/2008/07/05/alan-turing.aspx</link><pubDate>Fri, 04 Jul 2008 23:56:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6360483</guid><dc:creator>andrewstopford</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6360483</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/07/05/alan-turing.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 180px; HEIGHT: 240px" height=240 src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Alan_Turing_Memorial_Closer.jpg/180px-Alan_Turing_Memorial_Closer.jpg" width=180 mce_src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Alan_Turing_Memorial_Closer.jpg/180px-Alan_Turing_Memorial_Closer.jpg"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A class="" href="http://www.codinghorror.com/blog/archives/001143.html" mce_href="http://www.codinghorror.com/blog/archives/001143.html"&gt;Jeff Attwood has a post on possibily the greatest man in the computing age, Alan Turing.&lt;/A&gt; As Jeff states during WW2 Alan helped break the enigma code and went on to become&amp;nbsp;one of&amp;nbsp;the fore-fathers of AI.&amp;nbsp; There are several books&amp;nbsp;on Alans life that are well worth reading with the &lt;A class="" href="http://www.amazon.com/Alan-Turing-Enigma-Andrew-Hodges/dp/0099116413" mce_href="http://www.amazon.com/Alan-Turing-Enigma-Andrew-Hodges/dp/0099116413"&gt;Andrew Hodges book&lt;/A&gt; one of the best.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Alan is one of my personal heros,&amp;nbsp;some of Alans greatest work in computing occured&amp;nbsp;here in Manchester,&amp;nbsp;the place I was born and grew up in. After the war Alan conducted research into computing and maths&amp;nbsp;at the University of Manchester. He worked on one of the first computers ever built the &lt;A class="" href="http://en.wikipedia.org/wiki/Manchester_Mark_I" mce_href="http://en.wikipedia.org/wiki/Manchester_Mark_I"&gt;Manchester Mark 1&lt;/A&gt; as well as conducting a great deal of his AI and machine learning&amp;nbsp;research there.&amp;nbsp; &lt;A class="" href="http://en.wikipedia.org/wiki/Alan_Turing_Memorial" mce_href="http://en.wikipedia.org/wiki/Alan_Turing_Memorial"&gt;The&amp;nbsp;memorial you see above was built in his honor&lt;/A&gt; and rightly&amp;nbsp;so, with out him I cannot imagine what the world&amp;nbsp;may have become.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6360483" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/General+Software+Development/default.aspx">General Software Development</category></item><item><title>MbUnit v3 in Visual Studio Team System 2008</title><link>http://weblogs.asp.net/astopford/archive/2008/07/03/mbunit-v3-in-visual-studio-team-system-2008.aspx</link><pubDate>Thu, 03 Jul 2008 16:46:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6353921</guid><dc:creator>andrewstopford</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6353921</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/07/03/mbunit-v3-in-visual-studio-team-system-2008.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;One of the changes made in MbUnit v3 alpha 3 was support for the Visual Studio Team System test runner. As Jeff points out, we are the first to offer this kind of support. At the moment the support is experimental but&amp;nbsp;we will be driving foward more in the coming weeks and months.&lt;/P&gt;
&lt;P mce_keep="true"&gt;You will need to &lt;A class="" href="http://mb-unit.googlecode.com/files/GallioBundle-3.0.0.285-Setup.exe" mce_href="http://mb-unit.googlecode.com/files/GallioBundle-3.0.0.285-Setup.exe"&gt;install MbUnit v3 alpha 3,&lt;/A&gt; if your upgrading from v2 to v3 there will be some compatability issues (I'll cover these in a later post).&lt;/P&gt;
&lt;P mce_keep="true"&gt;Take this simple test&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/astopford/a2.png" mce_src="http://weblogs.asp.net/blogs/astopford/a2.png"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;Make sure you have MbUnit and Gallio referanced&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/astopford/a3.png" mce_src="http://weblogs.asp.net/blogs/astopford/a3.png"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Recompile and the test should now show in the Test View window&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://weblogs.asp.net/blogs/astopford/a1.png" mce_src="http://weblogs.asp.net/blogs/astopford/a1.png"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Just like a MSTest test&amp;nbsp;you can now run through the test window.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 378px; HEIGHT: 201px" height=201 src="http://weblogs.asp.net/blogs/astopford/a4.png" width=378 mce_src="http://weblogs.asp.net/blogs/astopford/a4.png"&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6353921" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/MbUnit/default.aspx">MbUnit</category><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category></item><item><title>MbUnit v3 beta 3 updates</title><link>http://weblogs.asp.net/astopford/archive/2008/07/03/mbunit-v3-beta-3-updates.aspx</link><pubDate>Thu, 03 Jul 2008 11:56:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6353728</guid><dc:creator>andrewstopford</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6353728</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/07/03/mbunit-v3-beta-3-updates.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Jeff has news on&amp;nbsp;a couple of &lt;A class="" href="http://blog.bits-in-motion.com/2008/06/announcing-gallio-alpha-3-update-3.html" mce_href="http://blog.bits-in-motion.com/2008/06/announcing-gallio-alpha-3-update-3.html"&gt;updates to the MbUnit v3 beta 3 release&lt;/A&gt; including.&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;R# 4.0 final&amp;nbsp;support&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Factory attribute support&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Repeat and ThreadedRepeat attributes support&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;CSV data source metadata&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;A class="" href="http://research.microsoft.com/pex/" mce_href="http://research.microsoft.com/pex/"&gt;Pex support&lt;/A&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Contract verifiers&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;The R# 4.0 support does mean that you can run MbUnit 3.0 and 2.0 in R# but if you prefer&amp;nbsp;you can &lt;A class="" href="http://der-albert.de/archive/2008/06/13/mbunit-2.4-plugin-for-resharper-4.0-final.aspx" mce_href="http://der-albert.de/archive/2008/06/13/mbunit-2.4-plugin-for-resharper-4.0-final.aspx"&gt;work directly with MbUnit v2.0 (rather than through Gallio) via Alberts plugin.&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;My thanks to Jeff and the whole team, who have worked hard to help make this happen (Jeff in particular works all hours to bring this to you).&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6353728" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/MbUnit/default.aspx">MbUnit</category><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category></item><item><title>32</title><link>http://weblogs.asp.net/astopford/archive/2008/06/29/6336789.aspx</link><pubDate>Sun, 29 Jun 2008 21:23:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6336789</guid><dc:creator>andrewstopford</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6336789</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/06/29/6336789.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;I post this every year, but I was a day late this year. I turned 32 yesterday, your only as old as you feel they say, I feel about 50 :) &lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6336789" width="1" height="1"&gt;</description></item><item><title>MbUnit @ DDD7</title><link>http://weblogs.asp.net/astopford/archive/2008/06/07/mbunit-ddd7.aspx</link><pubDate>Sat, 07 Jun 2008 21:46:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6256269</guid><dc:creator>andrewstopford</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6256269</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/06/07/mbunit-ddd7.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;I've proposed a session for MbUnit&amp;nbsp;at one of the UK's best free 1 day conferences, DDD7. DDD7 will be held later this year at&amp;nbsp;Microsoft UK's hq down in Reading but is organised&amp;nbsp;and talks given by&amp;nbsp;non&amp;nbsp;Microsoft staff.&amp;nbsp;The session is based on the one I gave at AgileNorth last year however I'll also be covering Gallio and the changes to MbUnit in v3. The sessions are voted by attendees and &lt;A class="" href="http://www.developerday.co.uk/ddd/agendaddd7.asp" mce_href="http://www.developerday.co.uk/ddd/agendaddd7.asp"&gt;the quality of speakers and speakers is very high&lt;/A&gt;, I'd love to take the talk down to Reading so when voting opens do spare me a thought :)&lt;/P&gt;
&lt;P mce_keep="true"&gt;I'm also hoping to speak at AgileNorth again later this year.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6256269" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/MbUnit/default.aspx">MbUnit</category><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category></item><item><title>ContextSwitchDeadLock erorr while debugging</title><link>http://weblogs.asp.net/astopford/archive/2008/05/19/contextswitchdeadlock-erorr-while-debugging.aspx</link><pubDate>Mon, 19 May 2008 16:14:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6201540</guid><dc:creator>andrewstopford</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6201540</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/05/19/contextswitchdeadlock-erorr-while-debugging.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;While debugging a managed code batch process today I ran into VS throwing a 'ContextSwitchDeadlock MDA' error. The debugger was attached to several long running process's and towards the end of the cycle VS was reporting this issue. As &lt;A class="" href="http://blogs.msdn.com/jmstall/archive/2005/11/11/ContextSwitchDeadLock.aspx" mce_href="http://blogs.msdn.com/jmstall/archive/2005/11/11/ContextSwitchDeadLock.aspx"&gt;Mike Stall reports&lt;/A&gt; it seems to be caused by the thread running the managed code I am debugging timing out but the unmanaged thread seeing not seeing it as dead. Why the managed code I am running times out in the debugger thread I am not clear about. It seems like that the debugger has a fixed response to all break points that starts at execution time, as each step I am debugging goes off to the database, waits a while and then comes back, it eats into this time. Eventually the debugger thread times out and the ContextSwitchDeadlock error occurs. You can't stop this kind of error (although I do wonder if the time out value on the debugger thread could be adjusted) but you can disable the warning. &lt;/P&gt;
&lt;P mce_keep="true"&gt;Two tips I &lt;A class="" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=280491&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=280491&amp;amp;SiteID=1"&gt;extracted from this thread&lt;/A&gt; is &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;First you don't already have it (Debug - Exceptions) obtain the debug exceptions window (right click tool bar - customize - debug and drag exceptions into the debug menu).&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Select from Debug - Exceptions - Managed Debugging Assistants and disable ContextSwitchDeadlock.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;I had no luck with trying to disable this via reg keys and config files but that is suggested in the MDA help files.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6201540" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Using Where and Group in Linq</title><link>http://weblogs.asp.net/astopford/archive/2008/05/16/using-where-and-group-in-linq.aspx</link><pubDate>Fri, 16 May 2008 11:53:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6195474</guid><dc:creator>andrewstopford</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6195474</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/05/16/using-where-and-group-in-linq.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;I tried lots of Google time to find the answer to this and failed (my google searching may also suck :) so in trying to tie a Where and GroupBy together&amp;nbsp;in a Linq query I used the following.&lt;/P&gt;
&lt;P mce_keep="true"&gt;var values = from p in tbl_data&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;BR&gt;&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;where&lt;BR&gt;&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;p.some_other_value == 'hello world'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select p;&lt;/P&gt;
&lt;P mce_keep="true"&gt;var group_values = values.GroupBy(p =&amp;gt; p.a_value).ToList();&lt;/P&gt;
&lt;P mce_keep="true"&gt;I've seen lots of queries that place the&amp;nbsp;groupby in the from and but&amp;nbsp;never&amp;nbsp;with a Where, there may be a nicer way of doing it but the above works for me :)&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6195474" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/astopford/archive/tags/Linq/default.aspx">Linq</category></item><item><title>MbUnit v3 and optional TestFixture</title><link>http://weblogs.asp.net/astopford/archive/2008/05/16/mbunit-v3-and-optional-testfixture.aspx</link><pubDate>Fri, 16 May 2008 11:49:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6195453</guid><dc:creator>andrewstopford</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6195453</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/05/16/mbunit-v3-and-optional-testfixture.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;If you have not already done so, &lt;A class="" href="http://blog.bits-in-motion.com/2008/05/mbunit-testfixture-attribute-is-now.html" mce_href="http://blog.bits-in-motion.com/2008/05/mbunit-testfixture-attribute-is-now.html"&gt;check out Jeff's post on changes to make TestFixture optional&lt;/A&gt;. As Jeff notes, Jim and Brad took this line in XUnit and after consultation it was decided for MbUnit to support this. Note, it's optional so your existing tests won't break but if refactoring it out makes sense then it is available for you to do so. If you do have any thought's and feelings on this do let us know.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6195453" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/MbUnit/default.aspx">MbUnit</category><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category></item><item><title>MbUnit v3 alpha 3</title><link>http://weblogs.asp.net/astopford/archive/2008/05/14/mbunit-v3-alpha-3.aspx</link><pubDate>Wed, 14 May 2008 22:11:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6190014</guid><dc:creator>andrewstopford</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6190014</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/05/14/mbunit-v3-alpha-3.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;&lt;A class="" href="http://blog.bits-in-motion.com/2008/05/announcing-gallio-v30-alpha-3.html" mce_href="http://blog.bits-in-motion.com/2008/05/announcing-gallio-v30-alpha-3.html"&gt;Jeff announced the release of Gallio alpha 3 yesterday&lt;/A&gt;, my time constriants at the moment meant I missed blogging Alpha 2 back in March but that release was a massive release in terms of features and the work that Jeff, Julian, Graham, Mark, Ben&amp;nbsp;and the rest of the team have put in.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I have talked about &lt;A class="" href="http://www.gallio.org/" mce_href="http://www.gallio.org"&gt;Gallio&lt;/A&gt; before but as a re-cap, Gallio is described best on the website &lt;EM&gt;"The Gallio Automation Platform is an open, extensible, and neutral system for .NET that provides a common object model, runtime services and tools (such as test runners) that may be leveraged by any number of test frameworks",&lt;/EM&gt; What does that mean, well unit test frameworks such as xUnit.net, NUnit, Pex&amp;nbsp;and MSTest&amp;nbsp;can plugin into the framework (and Gallio supports them all) or frameworks like MbUnit v3 use it directly. It's runners then use that framework and Gallio has the largest set of runners of any unit test framework to date.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;GUI (Icarus)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Console (Echo)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;TD.NET&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;R#&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;VSTS&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;CCNet&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Powershell&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;MSBuild&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;NAnt&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The runners them selfs are very rich, those who remember the ZaneBug framework will remember how rich it's GUI was and that is something we have aimed for in Icarus with great use of layouts and display information. So now you can take your framework of choice and reuse them across the Gallio platform.&lt;/P&gt;
&lt;P&gt;Related directly to MbUnit is the change to the parameterized testing, this has had some heavy work&amp;nbsp;done in make things a little simpler and far more flexible.&amp;nbsp;With this kind of testing&amp;nbsp;now added to Xunit.net, NUnit and csUnit&amp;nbsp;there are lots of different ways you can go about it, the following is a&amp;nbsp;reprint from Jeff's announcement.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;A test can now be parameterized in any of the following ways:&lt;/EM&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;Adding a method parameter to a test method. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Adding a generic method parameter to a test method. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Adding a constructor parameter to a test fixture. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Adding a field to a test fixture. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Adding a writable property to a test fixture. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Adding a generic type parameter to a test fixture. &lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;Correspondingly data-source attributes can be specified on any of the following code elements:&lt;/EM&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;Test methods. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Test method parameters. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Test method generic parameters. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Test fixture types. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Test fixture constructors. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Test fixture constructor parameters. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Test fixture fields. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Test fixture properties. &lt;/EM&gt;
&lt;LI&gt;&lt;EM&gt;Test fixture generic parameters. &lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;So there are many choices, but each choice is quite simple.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Here are a few interesting combinations.&lt;/EM&gt;&lt;/P&gt;
&lt;H5&gt;&lt;EM&gt;A basic "Row"-test. &lt;/EM&gt;&lt;/H5&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;CHANGE !! &lt;/STRONG&gt;- : The [RowTest] attribute is not needed anymore and has been eliminated.&lt;/EM&gt;&lt;/P&gt;
&lt;H5&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/H5&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;[TestFixture] &lt;BR&gt;public class Fixture &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Test] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Row(3, 4, 5, true)] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Row(1, 2, 3, false)] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Test(int a, int b, int c, bool expectedResult) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Assert.AreEqual(expectedResult, Math.IsPythagoreanTriple(a, b, c)); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;H5&gt;&lt;EM&gt;CHANGE !! - A generic "Type"-test.&lt;/EM&gt;&lt;/H5&gt;
&lt;P&gt;&lt;EM&gt;Note: The [TypeFixture] attribute is not needed anymore and has been eliminated.&lt;/EM&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;[TestFixture] &lt;BR&gt;[Row(typeof(List&amp;lt;int&amp;gt;))] &lt;BR&gt;[Row(typeof(LinkedList&amp;lt;int&amp;gt;))] &lt;BR&gt;public class Fixture&amp;lt;T&amp;gt; where T : IList&amp;lt;int&amp;gt;, new() &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Test] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Test() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; T list = new T(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Add(123); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Assert.AreEqual(1, list.Count); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;H5&gt;&lt;EM&gt;CHANGE !! - A combinatorial test.&lt;/EM&gt;&lt;/H5&gt;
&lt;P&gt;&lt;EM&gt;Note: The [CombinatorialTest] attribute is not needed anymore and has been eliminated.&lt;/EM&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;[Test] &lt;BR&gt;public void Test([Column(0, 1)] int a, [Column("a", "b")] string b, [Column(false, true)] bool c) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Test something with the specified combination. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Will be executed 8 times total. &lt;BR&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;H5&gt;&lt;EM&gt;CHANGE!! - A pairwise test.&lt;/EM&gt;&lt;/H5&gt;
&lt;P&gt;&lt;EM&gt;Only tests all combinations of pairs of values.&amp;nbsp; Can yield a significant reduction in test cases compared to ordinary combinatorial tests while still obtaining great coverage.&amp;nbsp; See also: &lt;/EM&gt;&lt;A href="http://www.pairwise.org/"&gt;&lt;FONT color=#5588aa&gt;&lt;EM&gt;www.pairwise.org&lt;/EM&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;[Test, PairwiseJoin] &lt;BR&gt;public void Test([Column(0, 1)] int a, [Column("a", "b")] string b, [Column(false, true)] bool c) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Test something with the specified combination. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Will be executed only 4 times instead of 8. &lt;BR&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;H5&gt;&lt;EM&gt;NEW !&amp;nbsp; - &lt;/EM&gt;&lt;EM&gt;A CSV data source.&lt;/EM&gt;&lt;/H5&gt;
&lt;P&gt;&lt;EM&gt;Just one of many external data sources to be implemented.&lt;/EM&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;[Test] &lt;BR&gt;[CsvData(ResourcePath="CsvDataTest.csv", HasHeader=true)] &lt;BR&gt;public void ImplicitlyScopedResourceWithHeader(decimal price, string item) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.WriteLine("{0}: {1}", item, price); &lt;BR&gt;} &lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;The data itself should be stored in an embedded resource called "CsvDataTest.csv".&amp;nbsp; We just create a file with that name in the same folder as the test class and then set its Build Action property to Embedded Resource in Visual Studio.&lt;/EM&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Item, Price &lt;BR&gt;Apples, 1.00 &lt;BR&gt;Bananas, 1.50 &lt;BR&gt;Cookies, 2.00&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note the changes to TypeFixture and CombinatorialTest, also note Factory is not included, if you use this with combinatorial tests I'd like to hear from you. The Pairwise testing is something new to v3 and I'll cover in more detail in a future post.&amp;nbsp;If you have further questions, things you want to see them also let me know.&lt;/P&gt;
&lt;P&gt;Please also note that &lt;A class="" href="http://www.hanselminutes.com/default.aspx?showID=130" mce_href="http://www.hanselminutes.com/default.aspx?showID=130"&gt;Jeff sat down with Scott Hansleman, Brad&amp;nbsp;Wilson (XUnit.net), Charlie Poole&amp;nbsp;(NUnit) and Roy Osherove&lt;/A&gt; to talk about the past and future of unit test frameworks in .NET at the recent ALT.NET event, Jeff does talk about Gallio and it is well worth a listen. I do hope that in the future the discussion thrown open wider to other folks that&amp;nbsp;are central to the topic,&amp;nbsp;such as Jim Newkirk, Peli de Halleux, Manfred Lange and others.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6190014" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/MbUnit/default.aspx">MbUnit</category><category domain="http://weblogs.asp.net/astopford/archive/tags/.NET/default.aspx">.NET</category></item><item><title>MVP &amp; MVC simply put</title><link>http://weblogs.asp.net/astopford/archive/2008/05/13/mvp-amp-mvc-simply-put.aspx</link><pubDate>Tue, 13 May 2008 12:08:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6186293</guid><dc:creator>andrewstopford</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6186293</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/05/13/mvp-amp-mvc-simply-put.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;This question seems to get asked a lot, &lt;A class="" href="http://www.codeproject.com/KB/architecture/DotNetMVPFramework_Part1.aspx" mce_href="http://www.codeproject.com/KB/architecture/DotNetMVPFramework_Part1.aspx"&gt;this recent article on codeproject&lt;/A&gt; does a decent job of explanation as well as this article from &lt;A class="" href="http://blogs.infragistics.com/blogs/tsnyder/archive/2007/10/17/mvc-or-mvp-pattern-whats-the-difference.aspx" mce_href="http://blogs.infragistics.com/blogs/tsnyder/archive/2007/10/17/mvc-or-mvp-pattern-whats-the-difference.aspx"&gt;Infragistics Guidisan Todd Snyder&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;If I was sum it up very simply, the different is entry point into the pattern. &lt;/P&gt;
&lt;P mce_keep="true"&gt;In MVC the entry point is the controller, if you look at the Microsoft MVC framework for example the controller class is where you bind your view and everything else (model) together.&lt;/P&gt;
&lt;P mce_keep="true"&gt;In MVP mean while the entry point is the view, webforms lends it's self very well to this pattern as you can bind the aspx and your view and use the normal aspx entry point to get at the rest of your patttern (in fact winforms works well on this pattern as well).&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Going a bit further&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;You can break down your view into two, a view and View-extender. The temptation in webforms land in a passive sense of the pattern is hold all sorts of view centric items on the presenter. If you have lots going on in your presenter for your view and you want to keep your view ultra light and passive then use a view extender as a layer between the presenter and view, remember keep your concerns focused and light.&lt;/P&gt;
&lt;P mce_keep="true"&gt;In Presenter-First (a variant of MVP) you can take your first MVP pattern and extend it's presenter to multiple views that also follow the MVP pattern. If there is a degree of data transform needed between the language of the view and the model then this pattern can be useful.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;BR&gt;&lt;STRONG&gt;Crazy thought of the day&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I wonder if the Microsoft MVC view engine (or MonoRails for that matter) could be readapted to act as entry point. More likely you could redefine aspx files as your own http handler, writing a class to act as the aspx which then appends the view and obtains actions from it.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6186293" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/Patterns/default.aspx">Patterns</category><category domain="http://weblogs.asp.net/astopford/archive/tags/General+Software+Development/default.aspx">General Software Development</category></item><item><title>The work\life balance and my absence of late.</title><link>http://weblogs.asp.net/astopford/archive/2008/04/24/the-work-life-balance-and-my-absence-of-late.aspx</link><pubDate>Thu, 24 Apr 2008 11:36:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6126658</guid><dc:creator>andrewstopford</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=6126658</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/04/24/the-work-life-balance-and-my-absence-of-late.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;For the first time in 7 years of blogging I almost managed no blog posts in a month. I (for fun) graphed the last 12 months of blog posts and sure enough the amount of posts has seen a steady drop. I then graphed all the posts I have made on weblogs.asp.net and since peaking in 2004 I have been on a decline ever since. There are several reasons why, but my now near total flat line needs explanation.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;With the work/life balance and my new family growing the balance tips in favour of more time with my family and less time at the computer. As such blogging\writing\opensource and generally all things out side of the day job has gone the way of the pear (i.e I have stopped). I've had a good run, of the 11 years I have been working in this industry all of them have seen me doing things out side of the day job, from blogging, article writing, book authoring and reviewing, to 4 years of user forum support (as a Macromedia Evangelist) and 3 years of open source\MbUnit. I've had time for all these things but things have changed and as much as I love geeking out I won't have Darcey growing up with her dad a stranger. More so, Emma has been for years a 'computer widow' while I was geeking it up, that has to stop.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I came close to closing this blog, I just don't have that much to say anymore. However, Emma convinced me other wise and I'll aim for a couple of posts a month however I may manage none at all.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6126658" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/General+Software+Development/default.aspx">General Software Development</category></item><item><title>The design in TDD</title><link>http://weblogs.asp.net/astopford/archive/2008/03/10/the-design-in-tdd.aspx</link><pubDate>Mon, 10 Mar 2008 22:13:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5946657</guid><dc:creator>andrewstopford</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/astopford/rsscomments.aspx?PostID=5946657</wfw:commentRss><comments>http://weblogs.asp.net/astopford/archive/2008/03/10/the-design-in-tdd.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;Lately&amp;nbsp;I've been drafting posts&amp;nbsp;on my daily commute and post them up in batches (just in case you were wondering :). &amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I recall an article (not sure where I read it) about Ron Jeffries and his ability as an 'alpha architect'. Such people are rare, the design they have mostly in their mind with TDD providing a way of slightly reshaping the design and proving the model (in a pair session that can mean validating each other’s ideas). Another kind of folks is the folks that have a general system picture but design a piece at a time with model shaping and validation occurring as they go. Both are no less a way of designing and developing a system but while the 'alpha architect' has considered overall, system considerations and won't introduce design faults, the other folks need to go carefully to avoid those faults.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The point that TDD is a design process seems to get missed, writing tests before your code is only part of the process and not the sum total. The trouble I have found is that the design process tends to be an organic one, a rhythm that you adopt and you’re not aware of what process you’re following. So in this post I am going to attempt to lay out some of those considerations, not sure I will capture them all and you may have your own, leave us a comment with yours.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;SOC&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;A car is not made from one part but many, with each part such as the engine or wheels made up from other parts. Does the engine depend on the door handle or the windscreen wiper blades? No. Each part, object or concern is separated from the rest but is associated in such a way that you can still achieve your aim without any dependencies on each concern. Relating that back to code, if a car class had an internal Ferrari engine object could we create a Porsche car from that car class? If the car class held a reference to an engine object that the Ferrari object was sub class off could we instead create a Porsche sub class and our Porsche car have the right engine? The practice of SOC is really a good OO practice in that you ensure your classes are so tightly bound to other concerns that you losing all the polymorphic benefits.&lt;/P&gt;
&lt;P mce_keep="true"&gt;TDD helps us here in that we look at all of the concerns of the class and how that class behaves in isolation and with associated concerns integrating with the class. If in writing and then developing the test it fails randomly, your setup and surround is heavy or you are forcing the test into a deep integration test then chances are the class and its concerns are bound up too tight and it's a candidate for further refactoring.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Integration and Isolation&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Take your class in isolation, can you isolate it? If you can what are its dependencies, if you’re testing it what kind of dependencies do you need and how deep are they. The more complex it is to take a class in isolation then your likely looking at a smell and some further refactoring is required. TDD forces you into putting a class into isolation and not being 5 levels deep in a system. You’re focused on that class alone and once taken out of context you can really learn if it will hold up.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A class="" href="http://codebetter.com/blogs/jeremy.miller/archive/2008/03/03/unit-testing-playing-tennis-and-the-lack-of-absolutes-in-tdd.aspx" mce_href="http://codebetter.com/blogs/jeremy.miller/archive/2008/03/03/unit-testing-playing-tennis-and-the-lack-of-absolutes-in-tdd.aspx"&gt;Jeremy’s most recent post talked about using static and integration styles in your tests&lt;/A&gt;, it's a great post and well worth taking your time over. One thing that is worth mentioning about integration is that integration means as light as you can make it. If your using a lot of other actual concrete concerns to achieve isolation then it's a smell, the cohesion between your class and its concerns is too tightly bound. If you can use mocks or doubles in place of the concerns and your class knows no difference, working as it would normally then you’re in a happy place. Sometimes you can't avoid using an actual and sometimes it makes sense but too many and too often would be a smell, finding a balance is half the skill.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Things around&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Consider the concerns around the class, what does the class need as inputs, what does it need for its processing and for its outputs. Those considerations would help you decide what you want to mock, double or actual. For example a class adds an entry to a database as a net product, a test (or for that matter another concern making use of the class) does not care how this product occurs; only that it has occurred. It would be a good mock candidate as we are not reusing the db entry further down the test process and as such we only care the method has occurred. If you wanted to emulate some kind of processing or validation, for example loading a collection of data, then a double could be useful. Following the same contract as the actual, the double would be a light weight emulation that the test could use.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Cross Cuts&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Cross cutting concerns are (but not limited to) things like logging, security and validation etc. Things that may not be central to the core parts of the class like processing or logic but needed in the general scheme of the operation of the class. If you find your concerns reusing other concerns more and more often than these could be a cross cuts. To aid re-use and isolation you will want to ensure the cross cuts don't affect the SUT when under test. There are several tools are you disposal (such as DI, IoC and AOP) to service the cross cuts.&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5946657" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/astopford/archive/tags/Patterns/default.aspx">Patterns</category><category domain="http://weblogs.asp.net/astopford/archive/tags/General+Software+Development/default.aspx">General Software Development</category></item></channel></rss>