<?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 anti-patterns for developers</title>
	<atom:link href="http://watchitlater.com/blog/2010/03/testing-anti-patterns-for-developers/feed/" rel="self" type="application/rss+xml" />
	<link>http://watchitlater.com/blog/2010/03/testing-anti-patterns-for-developers/</link>
	<description>A reluctant foray into the world of blogging.</description>
	<lastBuildDate>Tue, 13 Dec 2011 12:46:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Tom</title>
		<link>http://watchitlater.com/blog/2010/03/testing-anti-patterns-for-developers/comment-page-1/#comment-6905</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sun, 07 Mar 2010 03:00:03 +0000</pubDate>
		<guid isPermaLink="false">http://watchitlater.com/blog/?p=180#comment-6905</guid>
		<description>@Matt, I look at this like a shell game, or one of those neat little russian dolls (where one sits inside another). For this reply I&#039;d like to assume a &quot;relatively&quot; standard web app architecture with a bounded context around a domain, with repositories at one boundary and controllers/endpoints/presenters at the other (acting as anti-corruption &amp; translation layers).
I would test repository logic, type conversion, ORM, aggregation, query builders, etc at one end in their own tests without the front-end. It saddens me when I see repository tests that need the entire application to be up and running - on one project even the JMS queue had to be enabled to wire-up a single JDBC repository.
I would test the controller/endpoint/presenter marshalling/unmarshalling logic at the other end, with more of the application configured but still in their own unit tests. If you are not tied to JSPs in java, you can actually test any &quot;logic&quot; in your templates by trying to render them out with some canned data. In a spring-wired app (for example) its not that hard to do to initialise a spring framework dispatcher servlet directly and use it in your own tests via the spring framework mock requests &amp; responses (check out my &lt;a href=&quot;http://github.com/tomcz/example-webapp&quot; rel=&quot;nofollow&quot;&gt;example-webapp&lt;/a&gt; project on GitHub). In Rails you can actually test views &amp; controllers separately as well (take a look at the excellent Pragmatic Programmers book on RSpec).
That leaves testing page flows, AJAX-y goodness and goal based testing at the front end via a browser, HtmlUnit/HttpUnit, WebDriver, Selenium, etc. If you write your flows using simple post-redirect-get behaviour and then enhance them with JS later, you can even test the flows without a deployment or a browser. The big thing is that you don&#039;t need to test fine-grained conditions at the front-end, you just have to pick where in the various layers of your system these conditions make sense to be tested. Is it a repository test, a service test, a controller test, a rendering test, a ScrewUnit JS test, or is it truly something that needs a &quot;full stack&quot;?
How much testing do we do at the front-end because its convenient to do so, rather than refactoring our applications to make it easier to test at various layers, and how much of our testing is really a belt &amp; braces approach to a lack of trust/knowledge?</description>
		<content:encoded><![CDATA[<p>@Matt, I look at this like a shell game, or one of those neat little russian dolls (where one sits inside another). For this reply I&#8217;d like to assume a &#8220;relatively&#8221; standard web app architecture with a bounded context around a domain, with repositories at one boundary and controllers/endpoints/presenters at the other (acting as anti-corruption &#038; translation layers).<br />
I would test repository logic, type conversion, ORM, aggregation, query builders, etc at one end in their own tests without the front-end. It saddens me when I see repository tests that need the entire application to be up and running &#8211; on one project even the JMS queue had to be enabled to wire-up a single JDBC repository.<br />
I would test the controller/endpoint/presenter marshalling/unmarshalling logic at the other end, with more of the application configured but still in their own unit tests. If you are not tied to JSPs in java, you can actually test any &#8220;logic&#8221; in your templates by trying to render them out with some canned data. In a spring-wired app (for example) its not that hard to do to initialise a spring framework dispatcher servlet directly and use it in your own tests via the spring framework mock requests &#038; responses (check out my <a href="http://github.com/tomcz/example-webapp" rel="nofollow">example-webapp</a> project on GitHub). In Rails you can actually test views &#038; controllers separately as well (take a look at the excellent Pragmatic Programmers book on RSpec).<br />
That leaves testing page flows, AJAX-y goodness and goal based testing at the front end via a browser, HtmlUnit/HttpUnit, WebDriver, Selenium, etc. If you write your flows using simple post-redirect-get behaviour and then enhance them with JS later, you can even test the flows without a deployment or a browser. The big thing is that you don&#8217;t need to test fine-grained conditions at the front-end, you just have to pick where in the various layers of your system these conditions make sense to be tested. Is it a repository test, a service test, a controller test, a rendering test, a ScrewUnit JS test, or is it truly something that needs a &#8220;full stack&#8221;?<br />
How much testing do we do at the front-end because its convenient to do so, rather than refactoring our applications to make it easier to test at various layers, and how much of our testing is really a belt &#038; braces approach to a lack of trust/knowledge?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham</title>
		<link>http://watchitlater.com/blog/2010/03/testing-anti-patterns-for-developers/comment-page-1/#comment-6892</link>
		<dc:creator>Graham</dc:creator>
		<pubDate>Sat, 06 Mar 2010 16:11:55 +0000</pubDate>
		<guid isPermaLink="false">http://watchitlater.com/blog/?p=180#comment-6892</guid>
		<description>I can tell you have not lost your touch. Nice post!</description>
		<content:encoded><![CDATA[<p>I can tell you have not lost your touch. Nice post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt McClure</title>
		<link>http://watchitlater.com/blog/2010/03/testing-anti-patterns-for-developers/comment-page-1/#comment-6891</link>
		<dc:creator>Matt McClure</dc:creator>
		<pubDate>Sat, 06 Mar 2010 15:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://watchitlater.com/blog/?p=180#comment-6891</guid>
		<description>Regarding #1, what *do* you suggest testing at the front end? Recognizing that you need to test *something* is step 1; testing too much and fragile tests usually result. Step 2: finding an appropriate way to test integration via the front end is significantly harder.</description>
		<content:encoded><![CDATA[<p>Regarding #1, what *do* you suggest testing at the front end? Recognizing that you need to test *something* is step 1; testing too much and fragile tests usually result. Step 2: finding an appropriate way to test integration via the front end is significantly harder.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

