<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.lostechies.com/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>James Gregory's Blog - All Comments</title><link>http://www.lostechies.com/blogs/jagregory/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Git Resources &amp;#8211; Blue Cog Blog</title><link>http://www.lostechies.com/blogs/jagregory/archive/2009/11/25/git-s-guts-branches-head-and-fast-forwards.aspx#73688</link><pubDate>Tue, 02 Mar 2010 17:27:32 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:73688</guid><dc:creator>Git Resources – Blue Cog Blog</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Git Resources &amp;#8211; Blue Cog Blog&lt;/p&gt;
&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=73688" width="1" height="1"&gt;</description></item><item><title>re: Git E-VAN recording</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/02/17/git-e-van-recording.aspx#72122</link><pubDate>Fri, 19 Feb 2010 23:13:22 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:72122</guid><dc:creator>Rusty</dc:creator><description>&lt;p&gt;Great git intro. Enjoyed the goats, too!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=72122" width="1" height="1"&gt;</description></item><item><title>.Net Pulse 2/15/2010</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/02/12/git-remotes-contributions-and-the-letter-n.aspx#69422</link><pubDate>Mon, 15 Feb 2010 17:41:29 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:69422</guid><dc:creator>Cadred (dotNET)</dc:creator><description>&lt;p&gt;.Net Pulse 2/15/2010&lt;/p&gt;
&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=69422" width="1" height="1"&gt;</description></item><item><title>re: Git: Remotes, contributions, and the letter N</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/02/12/git-remotes-contributions-and-the-letter-n.aspx#69345</link><pubDate>Mon, 15 Feb 2010 10:30:24 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:69345</guid><dc:creator>James Gregory</dc:creator><description>&lt;p&gt;Well spotted! Fixed, thanks.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=69345" width="1" height="1"&gt;</description></item><item><title>re: Git: Remotes, contributions, and the letter N</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/02/12/git-remotes-contributions-and-the-letter-n.aspx#69343</link><pubDate>Mon, 15 Feb 2010 10:21:31 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:69343</guid><dc:creator>Professor Rotwang</dc:creator><description>&lt;p&gt;Nice article - I like the V and N aide memoires. One minor point, you&amp;#39;ve tagged this as &amp;quot;git github&amp;quot; so it doesn&amp;#39;t appear under &amp;quot;git&amp;quot; alone. Since this isn&amp;#39;t really github specific - we use the same process for our own repos on a private central server - I wonder if this was a mistake.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=69343" width="1" height="1"&gt;</description></item><item><title>re: Behaviours in MSpec</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#52793</link><pubDate>Thu, 28 Jan 2010 09:06:51 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:52793</guid><dc:creator>James Gregory</dc:creator><description>&lt;p&gt;Sorry, jumped on you a bit there. :)&lt;/p&gt;
&lt;p&gt;Agree with everything you said. If you are using behaves_like, there&amp;#39;s a very good chance your class is doing too much; in most cases I wouldn&amp;#39;t encourage it&amp;#39;s use for this exact reason.&lt;/p&gt;
&lt;p&gt;In FNH&amp;#39;s case, ClassMap is doing too much, but as the public API that&amp;#39;s it&amp;#39;s job; no matter how I slice it up underneath, ClassMap is always going to have to expose all these methods and thus always need testing. I could compose the ClassMap from various smaller classes and test those individually, but in the end I&amp;#39;d still need to test everything on ClassMap, because that&amp;#39;s what the public uses. So it&amp;#39;s specs galore no matter how I slice it.&lt;/p&gt;
&lt;p&gt;Thanks again for MSpec, keep up the good work.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=52793" width="1" height="1"&gt;</description></item><item><title>re: Behaviours in MSpec</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#52723</link><pubDate>Thu, 28 Jan 2010 03:04:30 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:52723</guid><dc:creator>Aaron Jensen</dc:creator><description>&lt;p&gt;Hi James,&lt;/p&gt;
&lt;p&gt;It sounds like you&amp;#39;ve got a good use case for the feature. It also sounds like you understand the tradeoffs. That&amp;#39;s all I was really trying to point out. The feature is still there to be used, but people should understand the downsides. I did not say never, nor would I ever ;) &lt;/p&gt;
&lt;p&gt;Another thing to consider when being tempted to use this feature is that maybe this behavior should be broken into something separate that is testable once. It could be an indication that your class is doing too much and it&amp;#39;s time for composition rather than inheritance or some other refactoring. It doesn&amp;#39;t seem like this applies to your scenario, I just wanted to point that out as well--another thing to be aware of.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m glad you&amp;#39;re enjoying MSpec and the behaves like feature, thanks for sharing your experiences.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=52723" width="1" height="1"&gt;</description></item><item><title>re: Behaviours in MSpec</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#52694</link><pubDate>Wed, 27 Jan 2010 23:30:04 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:52694</guid><dc:creator>James Gregory</dc:creator><description>&lt;p&gt;I agree that you should use with care, definitely.&lt;/p&gt;
&lt;p&gt;As for DRY in tests, well, never is a strong word (although I don&amp;#39;t think you actually said never, but it was implied). It&amp;#39;s all about trade-offs. Readability over maintainability.&lt;/p&gt;
&lt;p&gt;Lets take an example that sparked this post. Fluent NHibernate exposes a Map method on ClassMap for mapping properties, this method is also available on the following: Components, DynamicComponents, CompositeElements, Subclasses, JoinedSubclasses, Joins, and probably others that I&amp;#39;m forgetting. I&amp;#39;ve got a few specs that cover the particular behaviour that method exposes, those specs are then repeated for each of those classes I just listed; technically they share the same implementation, but that&amp;#39;s an assumption that shouldn&amp;#39;t be made in my specs. &lt;/p&gt;
&lt;p&gt;Assuming I&amp;#39;ve got 5 specs for the Map method, that&amp;#39;s 35 specs for those classes listed. If I add a new piece of functionality that is spread across the many classes like Map is, I have to go through and create another 35+ specs; if I create another class similar to ClassMap, I have to recreate those 35 specs for the new implementation. Take that experience and multiply it by the 30+ methods and properties we expose on each of our classes, and you&amp;#39;ve got some serious spec explosion and a pending maintenance nightmare.&lt;/p&gt;
&lt;p&gt;In that scenario I&amp;#39;m much more willing to sacrifice a bit of readability in my specifications (and after all, it only affects the _code_, not the spec output) for the simplification of testing any additions/modifications that may be made to the interface. Without this functionality MSpec would be just as inadequate as any of the other testing frameworks, I&amp;#39;m happy it&amp;#39;s in there.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=52694" width="1" height="1"&gt;</description></item><item><title>re: Behaviours in MSpec</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#52693</link><pubDate>Wed, 27 Jan 2010 23:13:13 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:52693</guid><dc:creator>Aaron Jensen</dc:creator><description>&lt;p&gt;Behaviors are actually not documented or mentioned on my blog on purpose. I figured someone would find it eventually, but I didn’t want to promote it. I actually considered removing it.&lt;/p&gt;
&lt;p&gt;One of the biggest goals of mspec and context/spec in general is to make the tests easily scannable. Behaviors breaks this. It plays to our (being geeks) need to apply tools and methods we know without considering context.&lt;/p&gt;
&lt;p&gt;DRY does *not* apply to tests the same way it applies to code. DRYing up your tests is local optimization at its finest. By doing it, you reduce the lines of code but you also reduce the ease of understanding and ability to scan the test files. Don’t get me wrong, some cruft still should be abstracted/hidden, but the *core* of your specs is the specifications themselves. Behaviors hide those behind another class making full understanding from the code an extremely jarring experience.&lt;/p&gt;
&lt;p&gt;Use with care.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=52693" width="1" height="1"&gt;</description></item><item><title>re: Behaviours in MSpec</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#52496</link><pubDate>Wed, 27 Jan 2010 13:43:08 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:52496</guid><dc:creator>CraigCav</dc:creator><description>&lt;p&gt;James,&lt;/p&gt;
&lt;p&gt;I really like how behaviours can keep our code DRY, but I have a few reservations regarding the API - primarily that the Behaves_like field has/needs no value.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve written up my thoughts on my blog:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://craigcav.wordpress.com/2010/01/27/behaviours-in-mspec/"&gt;craigcav.wordpress.com/.../behaviours-in-mspec&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Craig&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=52496" width="1" height="1"&gt;</description></item><item><title>Behaviours in MSpec &amp;laquo; Cav&amp;#8217;s Weblog</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#52487</link><pubDate>Wed, 27 Jan 2010 13:31:47 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:52487</guid><dc:creator>Behaviours in MSpec « Cav’s Weblog</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Behaviours in MSpec &amp;laquo; Cav&amp;#8217;s Weblog&lt;/p&gt;
&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=52487" width="1" height="1"&gt;</description></item><item><title>re: Behaviours in MSpec</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#51005</link><pubDate>Fri, 22 Jan 2010 11:04:09 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:51005</guid><dc:creator>James Gregory</dc:creator><description>&lt;p&gt;@alex: That makes sense. I wouldn&amp;#39;t really want the behaviours to be exposed in the reports, as it&amp;#39;s just clouding the output; however, it is quite a nice touch in the R# runner. As you can (and I frequently do) use the R# runner to navigate around your specs, hiding away that certain ones are from a behaviour could easily lead to confusion.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a great feature, and I&amp;#39;m glad it&amp;#39;s there. It&amp;#39;s potentially open for abuse, but as are most great features.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=51005" width="1" height="1"&gt;</description></item><item><title>re: Behaviours in MSpec</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#50997</link><pubDate>Fri, 22 Jan 2010 10:44:40 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:50997</guid><dc:creator>Alexander Groß</dc:creator><description>&lt;p&gt;James,&lt;/p&gt;
&lt;p&gt;Referring to your tweet, that post totally makes sense! :)&lt;/p&gt;
&lt;p&gt;Let me explain one technical detail: As you stated above the behavior specifications (VehicleThatHasBeenStartedBehaviors&amp;#39; It fields) get injected into the respective context. From the console/TD.NET/HTML report you won&amp;#39;t be able to tell that &amp;quot;should have a running engine&amp;quot; came from a behavior, these are unaware of behaviors.&lt;/p&gt;
&lt;p&gt;The only place that is really aware of behavior specifications is the ReSharper runner that will show a sub-tree for each behavior that was injected into a context.&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=50997" width="1" height="1"&gt;</description></item><item><title>James Gregory - Behaviours in MSpec</title><link>http://www.lostechies.com/blogs/jagregory/archive/2010/01/18/behaviours-in-mspec.aspx#50988</link><pubDate>Fri, 22 Jan 2010 10:25:10 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:50988</guid><dc:creator>James Gregory - Behaviours in MSpec</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;James Gregory - Behaviours in MSpec&lt;/p&gt;
&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=50988" width="1" height="1"&gt;</description></item><item><title>James Gregory - Git&amp;#8217;s guts: Merging and rebasing</title><link>http://www.lostechies.com/blogs/jagregory/archive/2009/11/27/git-guts-merging-and-rebasing.aspx#50983</link><pubDate>Fri, 22 Jan 2010 10:15:20 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:50983</guid><dc:creator>James Gregory - Git’s guts: Merging and rebasing</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;James Gregory - Git&amp;#8217;s guts: Merging and rebasing&lt;/p&gt;
&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=50983" width="1" height="1"&gt;</description></item></channel></rss>