<?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: Why I Prefer Test-Later</title>
	<atom:link href="http://paul-m-jones.com/archives/275/feed" rel="self" type="application/rss+xml" />
	<link>http://paul-m-jones.com/archives/275?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-i-prefer-test-later</link>
	<description>It&#039;s not enough to be smart; you have to actually know things.</description>
	<lastBuildDate>Wed, 08 Feb 2012 21:50:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Satya Prakash</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-348570</link>
		<dc:creator>Satya Prakash</dc:creator>
		<pubDate>Fri, 09 May 2008 07:03:47 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-348570</guid>
		<description>I agree with you that during the development developer learns about the system they are going to develop. But those who proposes test-first will tell they can learn the system when they write test cases. 
I am opposed to this because this hampers my creativity. Test cases force me to focus on where system can fail, Instead of thinking how well i can accomplish my each task in system.</description>
		<content:encoded><![CDATA[<p>I agree with you that during the development developer learns about the system they are going to develop. But those who proposes test-first will tell they can learn the system when they write test cases.<br />
I am opposed to this because this hampers my creativity. Test cases force me to focus on where system can fail, Instead of thinking how well i can accomplish my each task in system.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew van der Stock</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-305218</link>
		<dc:creator>Andrew van der Stock</dc:creator>
		<pubDate>Sun, 16 Mar 2008 04:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-305218</guid>
		<description>Paul,

I have to disagree with you here. Although running 500,000 tests does not guarantee quality (or any other metric), running the right tests as a matter of course is a boon to application security. 

I&#039;ve been reviewing web apps since the late 1990&#039;s before it was even known that this needed to be done. The first application I came across that made me sweat was from an agile team (again back in the days when if you did agile, you probably wore official Star Trek rank insignia to work on casual days). 

In the intervening years, there is a direct casual relationship between insecure software (which typically, but not always) has no tests and relatively secure software, which universally has tests. 

It doesn&#039;t mean that the developers knew any more about web application security, for indeed no one (not even me!) has a perfectly secure application, as they tested their code extensively, and as a byproduct of that effort, made the application *accidentally* secure. 

They also had a handle on software engineering processes, which also helps application security. Stuff like repeatable automated installs. The costs to remediate cost which have testers in senior positions is nearly always cheaper to fix, because they don&#039;t stress about changing a piece of code here or there as they know they can re-test it in a reasonable time frame and in a cost effective way. Folks who don&#039;t do this, rarely fix my lower risk (notes, lows, and mediums, and even occasionally high) items as they cannot predict what impact the changes required would have on their system. 

So, although I am not impressed by test counts alone, and although initially skeptical about TDD&#039;s / FDD / pretty much every agile methodology, I personally am now converted to the test first/write later paradigm through personal experience over nearly 6 years with many different dev teams in many different industries. They simply produce better, safer code, which is cheaper to fix and far, far faster from a &quot;discovery of issue to fix (that works) running in production&quot; point of view. 

These are THE metrics that are the true payoff for a business whose bread and butter may not necessarily be cutting code. They simply don&#039;t care about the initial pass at cutting code nor how productive a developer is - coding fresh code - although the thing that makes us happy - is but a tiny, tiny fraction of the cost and time put into enterprise level projects over their entire lifespan. 

For example, I&#039;ve reviewed production code that has portions older than me (and I&#039;m 37). The devs probably wrote the initial pass in around a year or two, costing probably about a million bucks in today&#039;s money. We&#039;re talking a couple hundred thousand lines of COBOL here and several hundred core transactions. That company has invested hundreds of millions of dollars and many hundreds of developer years in looking after that code as it&#039;s their competitive advantage and how they&#039;ve done business for the better part of my lifetime. 

So I&#039;m all for code we write today to be written as if it was written with a future of refactoring and maintenance in mind, even the small stuff like forums and our private collection of open source personal itches. 

Andrew</description>
		<content:encoded><![CDATA[<p>Paul,</p>
<p>I have to disagree with you here. Although running 500,000 tests does not guarantee quality (or any other metric), running the right tests as a matter of course is a boon to application security. </p>
<p>I&#8217;ve been reviewing web apps since the late 1990&#8242;s before it was even known that this needed to be done. The first application I came across that made me sweat was from an agile team (again back in the days when if you did agile, you probably wore official Star Trek rank insignia to work on casual days). </p>
<p>In the intervening years, there is a direct casual relationship between insecure software (which typically, but not always) has no tests and relatively secure software, which universally has tests. </p>
<p>It doesn&#8217;t mean that the developers knew any more about web application security, for indeed no one (not even me!) has a perfectly secure application, as they tested their code extensively, and as a byproduct of that effort, made the application *accidentally* secure. </p>
<p>They also had a handle on software engineering processes, which also helps application security. Stuff like repeatable automated installs. The costs to remediate cost which have testers in senior positions is nearly always cheaper to fix, because they don&#8217;t stress about changing a piece of code here or there as they know they can re-test it in a reasonable time frame and in a cost effective way. Folks who don&#8217;t do this, rarely fix my lower risk (notes, lows, and mediums, and even occasionally high) items as they cannot predict what impact the changes required would have on their system. </p>
<p>So, although I am not impressed by test counts alone, and although initially skeptical about TDD&#8217;s / FDD / pretty much every agile methodology, I personally am now converted to the test first/write later paradigm through personal experience over nearly 6 years with many different dev teams in many different industries. They simply produce better, safer code, which is cheaper to fix and far, far faster from a &#8220;discovery of issue to fix (that works) running in production&#8221; point of view. </p>
<p>These are THE metrics that are the true payoff for a business whose bread and butter may not necessarily be cutting code. They simply don&#8217;t care about the initial pass at cutting code nor how productive a developer is &#8211; coding fresh code &#8211; although the thing that makes us happy &#8211; is but a tiny, tiny fraction of the cost and time put into enterprise level projects over their entire lifespan. </p>
<p>For example, I&#8217;ve reviewed production code that has portions older than me (and I&#8217;m 37). The devs probably wrote the initial pass in around a year or two, costing probably about a million bucks in today&#8217;s money. We&#8217;re talking a couple hundred thousand lines of COBOL here and several hundred core transactions. That company has invested hundreds of millions of dollars and many hundreds of developer years in looking after that code as it&#8217;s their competitive advantage and how they&#8217;ve done business for the better part of my lifetime. </p>
<p>So I&#8217;m all for code we write today to be written as if it was written with a future of refactoring and maintenance in mind, even the small stuff like forums and our private collection of open source personal itches. </p>
<p>Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Federico</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-303572</link>
		<dc:creator>Federico</dc:creator>
		<pubDate>Fri, 14 Mar 2008 17:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-303572</guid>
		<description>@Test-first forces us to define the API first and clearly think about how our code will be used.

No it doesn&#039;t. That&#039;s just an excuse to justify the *first* mistake.</description>
		<content:encoded><![CDATA[<p>@Test-first forces us to define the API first and clearly think about how our code will be used.</p>
<p>No it doesn&#8217;t. That&#8217;s just an excuse to justify the *first* mistake.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Federico</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-303567</link>
		<dc:creator>Federico</dc:creator>
		<pubDate>Fri, 14 Mar 2008 17:12:07 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-303567</guid>
		<description>I agree with you Paul. TDD is great, but it has a flaw, the word &quot;first&quot; in its definition: &quot;new functionality is written *first* as a test case&quot;. I&#039;m more into SCRUM than XP, and this doesn&#039;t work for me. XP supports the TDD approach, they encourage you to Test first, then Design and Develop. While SCRUM, on the other hand, encourages you to Design first, then Test and Develop. 

Companies like Google and BBC are using SCRUM, and it works. While Testing is also a huge part of SCRUM, you are not forced to test a script before you design the component, can be a class skeleton, a use case or both.</description>
		<content:encoded><![CDATA[<p>I agree with you Paul. TDD is great, but it has a flaw, the word &#8220;first&#8221; in its definition: &#8220;new functionality is written *first* as a test case&#8221;. I&#8217;m more into SCRUM than XP, and this doesn&#8217;t work for me. XP supports the TDD approach, they encourage you to Test first, then Design and Develop. While SCRUM, on the other hand, encourages you to Design first, then Test and Develop. </p>
<p>Companies like Google and BBC are using SCRUM, and it works. While Testing is also a huge part of SCRUM, you are not forced to test a script before you design the component, can be a class skeleton, a use case or both.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TIm Koschuetzki</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-279748</link>
		<dc:creator>TIm Koschuetzki</dc:creator>
		<pubDate>Fri, 22 Feb 2008 17:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-279748</guid>
		<description>Sam, I have to fully agree with you.

I think Paul&#039;s post is very nice and controversial. The thing I cannot agree with is that when I am not sure what the problem is, I start out with some code snippets and go from there. I mean how can you start writing code if you have no clue what you need to do?

What I do in these cases is do normal paper sketches - define classes based on the nouns I write own when I describe the problem in three sentences. I then sit down, finding some mathematical dependencies and as soon as I have two or three of those I write the first tests and go from there TDD-wise. Actually that&#039;s not true. For me a ongoing mix of test-first and test-after has been the best thing to do so far.

Back to the I-dont-know-what-the-problem-is: Usually, the customer will tell you what they want.. Maybe I am getting something wrong? Paul, can you name a problem where you said down having no clue what to do and then starting out with some snippets?</description>
		<content:encoded><![CDATA[<p>Sam, I have to fully agree with you.</p>
<p>I think Paul&#8217;s post is very nice and controversial. The thing I cannot agree with is that when I am not sure what the problem is, I start out with some code snippets and go from there. I mean how can you start writing code if you have no clue what you need to do?</p>
<p>What I do in these cases is do normal paper sketches &#8211; define classes based on the nouns I write own when I describe the problem in three sentences. I then sit down, finding some mathematical dependencies and as soon as I have two or three of those I write the first tests and go from there TDD-wise. Actually that&#8217;s not true. For me a ongoing mix of test-first and test-after has been the best thing to do so far.</p>
<p>Back to the I-dont-know-what-the-problem-is: Usually, the customer will tell you what they want.. Maybe I am getting something wrong? Paul, can you name a problem where you said down having no clue what to do and then starting out with some snippets?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William Pietri</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-279382</link>
		<dc:creator>William Pietri</dc:creator>
		<pubDate>Thu, 21 Feb 2008 21:44:31 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-279382</guid>
		<description>I can&#039;t speak for all TDD adherents, but I&#039;d agree that when you don&#039;t know what you want, it&#039;s hard to test for it.

When I&#039;m just noodling around trying to figure out an approach or a set of tools, I&#039;ll write some scratch code to explore the problem space. Once I actually understand what&#039;s going on, I generally throw that code out and start over, testing all the way.

Why? Well, if I don&#039;t know enough about what I&#039;m doing to write good tests, I certainly don&#039;t know enough to design things well, either. I also don&#039;t know yet which bits of code will turn out to be the good ones, so there&#039;s often a bunch of cruft lying around.

Of course, I could try to clean up the experiments, but I find it faster just to start with a blank slate, glancing back at my experiments as a reference.</description>
		<content:encoded><![CDATA[<p>I can&#8217;t speak for all TDD adherents, but I&#8217;d agree that when you don&#8217;t know what you want, it&#8217;s hard to test for it.</p>
<p>When I&#8217;m just noodling around trying to figure out an approach or a set of tools, I&#8217;ll write some scratch code to explore the problem space. Once I actually understand what&#8217;s going on, I generally throw that code out and start over, testing all the way.</p>
<p>Why? Well, if I don&#8217;t know enough about what I&#8217;m doing to write good tests, I certainly don&#8217;t know enough to design things well, either. I also don&#8217;t know yet which bits of code will turn out to be the good ones, so there&#8217;s often a bunch of cruft lying around.</p>
<p>Of course, I could try to clean up the experiments, but I find it faster just to start with a blank slate, glancing back at my experiments as a reference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David&#8217;s Tech Blog &#187; Blog Archive &#187; Test first or test later</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-278580</link>
		<dc:creator>David&#8217;s Tech Blog &#187; Blog Archive &#187; Test first or test later</dc:creator>
		<pubDate>Thu, 21 Feb 2008 03:34:57 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-278580</guid>
		<description>[...] go on at length about it, but actually somebody else has already said it clearly, so here&#8217;s a link to what Paul M Jones said about it instead of boring everybody with a retelling here.Â  I&#8217;m pretty sure he&#8217;s [...]</description>
		<content:encoded><![CDATA[<p>[...] go on at length about it, but actually somebody else has already said it clearly, so here&#8217;s a link to what Paul M Jones said about it instead of boring everybody with a retelling here.Â  I&#8217;m pretty sure he&#8217;s [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Woodwork &#187; Blog Archive &#187; Pragmatic bullshit</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-276140</link>
		<dc:creator>The Woodwork &#187; Blog Archive &#187; Pragmatic bullshit</dc:creator>
		<pubDate>Tue, 19 Feb 2008 10:06:53 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-276140</guid>
		<description>[...] been proven to be better than broken â€œsoftware as constructionâ€ ISO 9001 software paradigms and been crushed by process-less development before you have to say: Shit, sure itâ€™s a lot better than the heavyweight bullshit I was taught [...]</description>
		<content:encoded><![CDATA[<p>[...] been proven to be better than broken â€œsoftware as constructionâ€ ISO 9001 software paradigms and been crushed by process-less development before you have to say: Shit, sure itâ€™s a lot better than the heavyweight bullshit I was taught [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam McAfee</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-275301</link>
		<dc:creator>Sam McAfee</dc:creator>
		<pubDate>Mon, 18 Feb 2008 15:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-275301</guid>
		<description>Paul, one thing missing from your post and the comments thus far is that TDD is designed to be part of the larger picture of Agile development. Agile is all about working with your customer to determine the requirements in an iterative fashion, and adapting your code to those requirements based on feedback you receive as you build and release incrementally.

Usually, the engineer does know as much about the problem domain as his/her customer. It is through working with the customer that you determine what tests to write, based on what they want their software to do. And these need not be just unit tests, but also functional (or acceptance) tests that are more clearly based on the UI or the expectations of the user. In fact, working top-down, you can start with acceptance tests which the client can articulate, and which verify the business rules of the application, and gradually work your way down into unit tests that verify that functionality on a class by class, or method by method, level.

We have found test-first development to produce far better code--code that is designed from the perspective of the API, not the internals of that particular module--than when we write tests later for the same code. Test-first forces us to define the API first and clearly think about how our code will be used. As such, it encourages reuse and greater encapsulation. Combined with the practices of working in iterations, refactoring when needed, and running your tests in an automated, continuous integration process, you can derive the most benefit from TDD.

Also, in my experience, tests are more likely to be written at all if you write them before you write the business code that will be tested. That said, there are many engineers who do write solid tests immediately after they finish writing some code, and having tests at all is far better than having none.

I think the decision on whether to do test-first or test-later development is personal choice for the developer doing the work. It is a practice you can teach and encourage, but you cannot enforce it. On our team, not everyone codes test-first all the time. But we all recognize the benefits and strive to do it as much as we can.</description>
		<content:encoded><![CDATA[<p>Paul, one thing missing from your post and the comments thus far is that TDD is designed to be part of the larger picture of Agile development. Agile is all about working with your customer to determine the requirements in an iterative fashion, and adapting your code to those requirements based on feedback you receive as you build and release incrementally.</p>
<p>Usually, the engineer does know as much about the problem domain as his/her customer. It is through working with the customer that you determine what tests to write, based on what they want their software to do. And these need not be just unit tests, but also functional (or acceptance) tests that are more clearly based on the UI or the expectations of the user. In fact, working top-down, you can start with acceptance tests which the client can articulate, and which verify the business rules of the application, and gradually work your way down into unit tests that verify that functionality on a class by class, or method by method, level.</p>
<p>We have found test-first development to produce far better code&#8211;code that is designed from the perspective of the API, not the internals of that particular module&#8211;than when we write tests later for the same code. Test-first forces us to define the API first and clearly think about how our code will be used. As such, it encourages reuse and greater encapsulation. Combined with the practices of working in iterations, refactoring when needed, and running your tests in an automated, continuous integration process, you can derive the most benefit from TDD.</p>
<p>Also, in my experience, tests are more likely to be written at all if you write them before you write the business code that will be tested. That said, there are many engineers who do write solid tests immediately after they finish writing some code, and having tests at all is far better than having none.</p>
<p>I think the decision on whether to do test-first or test-later development is personal choice for the developer doing the work. It is a practice you can teach and encourage, but you cannot enforce it. On our team, not everyone codes test-first all the time. But we all recognize the benefits and strive to do it as much as we can.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://paul-m-jones.com/archives/275/comment-page-1#comment-275011</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Mon, 18 Feb 2008 10:20:19 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/?p=275#comment-275011</guid>
		<description>For me TDD is fine for libraries, or actually a must. For anything with a UI, I also remain unconvinced, mainly because I prefer a more design centric way of thinking there. That being said, as more and more things are done in a REST kind of way, more and more of what used to be UI logic is moved to nice API&#039;s that fall more into the category of libraries. And all the other stuff is javascript, which I dont get :)</description>
		<content:encoded><![CDATA[<p>For me TDD is fine for libraries, or actually a must. For anything with a UI, I also remain unconvinced, mainly because I prefer a more design centric way of thinking there. That being said, as more and more things are done in a REST kind of way, more and more of what used to be UI logic is moved to nice API&#8217;s that fall more into the category of libraries. And all the other stuff is javascript, which I dont get :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

