<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	>
<channel>
	<title>Comments on: Testing Your Setup Code</title>
	<atom:link href="http://www.symphonious.net/2006/05/08/testing-your-setup-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.symphonious.net/2006/05/08/testing-your-setup-code/</link>
	<description>Living in a state of accord.</description>
	<pubDate>Wed, 07 Jan 2009 21:06:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Symphonious &#187; End To End Testing And The 10 Minute Build</title>
		<link>http://www.symphonious.net/2006/05/08/testing-your-setup-code/comment-page-1/#comment-31436</link>
		<dc:creator>Symphonious &#187; End To End Testing And The 10 Minute Build</dc:creator>
		<pubDate>Thu, 07 Sep 2006 11:45:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.symphonious.net/2006/05/08/testing-your-setup-code/#comment-31436</guid>
		<description>[...] At least in my mind, there seems to be a clash of aims in XP. You want to make sure that you have complete confidence in your tests so that you can go faster and reduce the cost of change. To achieve this you write lots and lots of tests - until your fear of something breaking turns to boredom from writing tests you know will pass. Most of those tests are atomic and test a particular component, but fear lies in the gaps between components too so you regularly get recommendations like Ola Ellnestam&#39;s on my previous post, Testing Your Setup Code: [...]</description>
		<content:encoded><![CDATA[<p>[...] At least in my mind, there seems to be a clash of aims in XP. You want to make sure that you have complete confidence in your tests so that you can go faster and reduce the cost of change. To achieve this you write lots and lots of tests - until your fear of something breaking turns to boredom from writing tests you know will pass. Most of those tests are atomic and test a particular component, but fear lies in the gaps between components too so you regularly get recommendations like Ola Ellnestam&#39;s on my previous post, Testing Your Setup Code: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Sutton</title>
		<link>http://www.symphonious.net/2006/05/08/testing-your-setup-code/comment-page-1/#comment-31403</link>
		<dc:creator>Adrian Sutton</dc:creator>
		<pubDate>Wed, 06 Sep 2006 20:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.symphonious.net/2006/05/08/testing-your-setup-code/#comment-31403</guid>
		<description>Olla,
Thanks for that. I can see that an inversion of control library would avoid the problem in your code, but the problem is really just hidden in some third party library which is still a critical part of your app. At least you're not going to go changing that code so you don't need the tests as a saftey harness as much but it would still be nice to have a way to effectively test this stuff.

Regarding integration and acceptance tests, I tend to agree - I really like having a very high level of coverage from tests that exercise the whole segment of code, if not end-to-end. The trouble is, these tests are slow and cause your build time to sky rocket. There's seems to be a lot of people recommending you avoid integration and acceptance tests because of this. I'm not sure what the right answer is, but I'm hoping to think about it some more in a new post in the next couple of days.</description>
		<content:encoded><![CDATA[<p>Olla,<br />
Thanks for that. I can see that an inversion of control library would avoid the problem in your code, but the problem is really just hidden in some third party library which is still a critical part of your app. At least you&#8217;re not going to go changing that code so you don&#8217;t need the tests as a saftey harness as much but it would still be nice to have a way to effectively test this stuff.</p>
<p>Regarding integration and acceptance tests, I tend to agree - I really like having a very high level of coverage from tests that exercise the whole segment of code, if not end-to-end. The trouble is, these tests are slow and cause your build time to sky rocket. There&#8217;s seems to be a lot of people recommending you avoid integration and acceptance tests because of this. I&#8217;m not sure what the right answer is, but I&#8217;m hoping to think about it some more in a new post in the next couple of days.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ola Ellnestam</title>
		<link>http://www.symphonious.net/2006/05/08/testing-your-setup-code/comment-page-1/#comment-31347</link>
		<dc:creator>Ola Ellnestam</dc:creator>
		<pubDate>Wed, 06 Sep 2006 08:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.symphonious.net/2006/05/08/testing-your-setup-code/#comment-31347</guid>
		<description>Hey Adrian,

First I´d just like to say I really enjoyed reading your posts. It seems to me you've run into
every single problem I have lately. Issues with TDD, continous integration etc.

I´ve run into this particular problem not too long ago.  Hope I can help.

When doing TDD you're forced to do a lot of injection. 

In one place or another. Usually at 'the top' of an application, the main-class or whatever,
there is bound to be a lot of factories etc. 

However you could avoid this by using an 'inversion of control'-framework. Like Pico or Spring.
I've only used Spring and it's ApplicationContext to achieve this. But I've seem other use Pico.

This allows you to configure your way out of the problem. Or rather externalize your configuration.
As a side effect it is easier to get that 100% test coverage. That alone isn't telling you a lot about your application thou. But it was one of your concerns right?

Note: When you're TDDing and getting the very loose coupling every one is longing for ;-) you must be aware that integration tests and acceptance tests are an absolute necessity. Since this is the only way to really test your
configuration. But as far as I could tell from earlier posts. You already knew this.

Hope this helps.

Cheers,
Ola Ellnestam

P.S Feel free to contact me if you'd like. D.S</description>
		<content:encoded><![CDATA[<p>Hey Adrian,</p>
<p>First I´d just like to say I really enjoyed reading your posts. It seems to me you&#8217;ve run into<br />
every single problem I have lately. Issues with TDD, continous integration etc.</p>
<p>I´ve run into this particular problem not too long ago.  Hope I can help.</p>
<p>When doing TDD you&#8217;re forced to do a lot of injection. </p>
<p>In one place or another. Usually at &#8216;the top&#8217; of an application, the main-class or whatever,<br />
there is bound to be a lot of factories etc. </p>
<p>However you could avoid this by using an &#8216;inversion of control&#8217;-framework. Like Pico or Spring.<br />
I&#8217;ve only used Spring and it&#8217;s ApplicationContext to achieve this. But I&#8217;ve seem other use Pico.</p>
<p>This allows you to configure your way out of the problem. Or rather externalize your configuration.<br />
As a side effect it is easier to get that 100% test coverage. That alone isn&#8217;t telling you a lot about your application thou. But it was one of your concerns right?</p>
<p>Note: When you&#8217;re TDDing and getting the very loose coupling every one is longing for ;-) you must be aware that integration tests and acceptance tests are an absolute necessity. Since this is the only way to really test your<br />
configuration. But as far as I could tell from earlier posts. You already knew this.</p>
<p>Hope this helps.</p>
<p>Cheers,<br />
Ola Ellnestam</p>
<p>P.S Feel free to contact me if you&#8217;d like. D.S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Sutton</title>
		<link>http://www.symphonious.net/2006/05/08/testing-your-setup-code/comment-page-1/#comment-16352</link>
		<dc:creator>Adrian Sutton</dc:creator>
		<pubDate>Mon, 08 May 2006 02:58:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.symphonious.net/2006/05/08/testing-your-setup-code/#comment-16352</guid>
		<description>The advantage of 100% code coverage is that you can quickly glance at a report and know that you haven't slacked off. TDD requires an awful lot of discipline and if you slack off it really comes back to bite you hard. Having even a semi-effective smoke test like 100% code coverage is really beneficial so that you have reasonable confidence that you missed something. Testing until you're not afraid anymore is a reasonable rule as well, but it is a compromise and not one you should be willing to take unless you've investigated the alternatives.

We're currently in the process of investigating alternatives and looking at how we can test things that we usually just say - oh that can't be tested. It wasn't long ago that we were saying we couldn't test GUI code, but now we have atomic tests for GUI classes that have already caught bugs that would have been hard to track down. Before that we used to think it will excessively difficult to test HTML, now we have libraries that make that job much easier and we've caught a lot of bugs because of that.

If you just accept the things that you can't test, you never make progress on solving them - if you keep looking for better ways to do things and new approaches to testing you start to find solutions to these problems and your codebase improves. I'm pretty sure I don't want to have a custom classloader involved when running my tests, but if someone has developed one that's simple to use and they've had good results, I'd certainly investigate it further. Mostly though I posted this in the hope that someone would have already encountered these areas and come up with ways to test them.</description>
		<content:encoded><![CDATA[<p>The advantage of 100% code coverage is that you can quickly glance at a report and know that you haven&#8217;t slacked off. TDD requires an awful lot of discipline and if you slack off it really comes back to bite you hard. Having even a semi-effective smoke test like 100% code coverage is really beneficial so that you have reasonable confidence that you missed something. Testing until you&#8217;re not afraid anymore is a reasonable rule as well, but it is a compromise and not one you should be willing to take unless you&#8217;ve investigated the alternatives.</p>
<p>We&#8217;re currently in the process of investigating alternatives and looking at how we can test things that we usually just say - oh that can&#8217;t be tested. It wasn&#8217;t long ago that we were saying we couldn&#8217;t test GUI code, but now we have atomic tests for GUI classes that have already caught bugs that would have been hard to track down. Before that we used to think it will excessively difficult to test HTML, now we have libraries that make that job much easier and we&#8217;ve caught a lot of bugs because of that.</p>
<p>If you just accept the things that you can&#8217;t test, you never make progress on solving them - if you keep looking for better ways to do things and new approaches to testing you start to find solutions to these problems and your codebase improves. I&#8217;m pretty sure I don&#8217;t want to have a custom classloader involved when running my tests, but if someone has developed one that&#8217;s simple to use and they&#8217;ve had good results, I&#8217;d certainly investigate it further. Mostly though I posted this in the hope that someone would have already encountered these areas and come up with ways to test them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charlie Groves</title>
		<link>http://www.symphonious.net/2006/05/08/testing-your-setup-code/comment-page-1/#comment-16351</link>
		<dc:creator>Charlie Groves</dc:creator>
		<pubDate>Mon, 08 May 2006 01:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.symphonious.net/2006/05/08/testing-your-setup-code/#comment-16351</guid>
		<description>If I swapped out my classloader, I feel like it'd enter into the state of things I have to consider when trying to fix something.  The point of atomic testing for me is to get the level of complexity down to a point where I can understand all of it one chunk.  A possibly broken(at least definitely different from the one in the actual execution environ) classloader adds another variable to consider and pushes me past the level of complexity I can comofortably understand.

I'm not sure why you're worried about a 'slipppery slope' of less than 100% coverage.  Test until you're no longer afraid and then test no longer.  Adding tests just to hit a line coverage number just increases noise in the system.  Substantially reworking the test environment adds noise to the 'why is this test broken' process.  You have to have some trust in your teammates and yourself that you'll test the sticky bits so you don't have to be slavishly devoted to code coverage.</description>
		<content:encoded><![CDATA[<p>If I swapped out my classloader, I feel like it&#8217;d enter into the state of things I have to consider when trying to fix something.  The point of atomic testing for me is to get the level of complexity down to a point where I can understand all of it one chunk.  A possibly broken(at least definitely different from the one in the actual execution environ) classloader adds another variable to consider and pushes me past the level of complexity I can comofortably understand.</p>
<p>I&#8217;m not sure why you&#8217;re worried about a &#8217;slipppery slope&#8217; of less than 100% coverage.  Test until you&#8217;re no longer afraid and then test no longer.  Adding tests just to hit a line coverage number just increases noise in the system.  Substantially reworking the test environment adds noise to the &#8216;why is this test broken&#8217; process.  You have to have some trust in your teammates and yourself that you&#8217;ll test the sticky bits so you don&#8217;t have to be slavishly devoted to code coverage.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
