<?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"
	>
<channel>
	<title>Comments on: Experimental Programming</title>
	<atom:link href="http://cafe.elharo.com/blogroll/experimental-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://cafe.elharo.com/blogroll/experimental-programming/</link>
	<description>Longer than a blog; shorter than a book</description>
	<pubDate>Fri, 21 Nov 2008 21:15:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: John Cowan</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-26218</link>
		<dc:creator>John Cowan</dc:creator>
		<pubDate>Tue, 31 Oct 2006 19:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-26218</guid>
		<description>Apparently this is a known anti-pattern called &lt;a href="http://en.wikipedia.org/wiki/Programming_by_permutation" rel="nofollow"&gt;programming by permutation&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Apparently this is a known anti-pattern called <a href="http://en.wikipedia.org/wiki/Programming_by_permutation" onclick="javascript:pageTracker._trackPageview('/outbound/comment/en.wikipedia.org');" rel="nofollow">programming by permutation</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Cafes &#187; Negative Experimental Programming</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-17087</link>
		<dc:creator>The Cafes &#187; Negative Experimental Programming</dc:creator>
		<pubDate>Thu, 21 Sep 2006 11:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-17087</guid>
		<description>[...] I&#8217;ve previously written about the benefits of experimental programming: fixing code until all tests pass without necessarily understanding at a theoretical level why they pass. This scares the bejeezus out of a lot of developers, but I&#8217;m convinced it&#8217;s going to be increasingly necessary as software grows more and more complex. The whole field of genetic algorithms is just an extreme example of this. Simulated annealing is another. However those techniques are primarily used by scientists who are accustomed to learning by experiment before they have a full and complete understanding of the underlying principles. Computer scientists are temperamentally closer to mathematicians, who almost never do experiments; and who certainly don&#8217;t trust the results of an experiment unless they can prove it theoretically. [...]</description>
		<content:encoded><![CDATA[<p>[...] I&#8217;ve previously written about the benefits of experimental programming: fixing code until all tests pass without necessarily understanding at a theoretical level why they pass. This scares the bejeezus out of a lot of developers, but I&#8217;m convinced it&#8217;s going to be increasingly necessary as software grows more and more complex. The whole field of genetic algorithms is just an extreme example of this. Simulated annealing is another. However those techniques are primarily used by scientists who are accustomed to learning by experiment before they have a full and complete understanding of the underlying principles. Computer scientists are temperamentally closer to mathematicians, who almost never do experiments; and who certainly don&#8217;t trust the results of an experiment unless they can prove it theoretically. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harry</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-176</link>
		<dc:creator>Harry</dc:creator>
		<pubDate>Wed, 22 Feb 2006 22:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-176</guid>
		<description>Elliotte, you missed a chance to publish this on April's Fool day!</description>
		<content:encoded><![CDATA[<p>Elliotte, you missed a chance to publish this on April&#8217;s Fool day!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hannu Terava</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-173</link>
		<dc:creator>Hannu Terava</dc:creator>
		<pubDate>Sun, 19 Feb 2006 17:38:19 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-173</guid>
		<description>Good example. I agree that there are uses for the programming style you described.</description>
		<content:encoded><![CDATA[<p>Good example. I agree that there are uses for the programming style you described.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliotte Rusty Harold</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-168</link>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
		<pubDate>Thu, 16 Feb 2006 13:44:46 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-168</guid>
		<description>Pascal Van Cauwenberghe &lt;a href="http://blog.nayima.be/blog/Entry20051214.html" rel="nofollow"&gt;describes&lt;/a&gt; a real world legacy system that he modified through experimental development; in his case sufficiently that he eventually did come to understand it. 

I'm afraid this is the reality we all too often have to deal with. Certainly you'd like to perfectly understand every part of your system, but what do you do when you don't? Throw up your hands in the air and refuse to fix anything because you might break something else? 

Pascal's story is particularly interesting because he did not start out with a solid test suite. He had to develop the test suite as he went.</description>
		<content:encoded><![CDATA[<p>Pascal Van Cauwenberghe <a href="http://blog.nayima.be/blog/Entry20051214.html" onclick="javascript:pageTracker._trackPageview('/outbound/comment/blog.nayima.be');" rel="nofollow">describes</a> a real world legacy system that he modified through experimental development; in his case sufficiently that he eventually did come to understand it. </p>
<p>I&#8217;m afraid this is the reality we all too often have to deal with. Certainly you&#8217;d like to perfectly understand every part of your system, but what do you do when you don&#8217;t? Throw up your hands in the air and refuse to fix anything because you might break something else? </p>
<p>Pascal&#8217;s story is particularly interesting because he did not start out with a solid test suite. He had to develop the test suite as he went.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hannu Terava</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-167</link>
		<dc:creator>Hannu Terava</dc:creator>
		<pubDate>Thu, 16 Feb 2006 09:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-167</guid>
		<description>I've been calling this method Attempt-Driven Development aka ADD (as mentioned here http://radio.javaranch.com/lasse/2005/05/09/1115665561552.html). However, I consider ADD as a bad practice as such. Even if I can fix something without understanding the code fully, I make sure that someone else from our team reviews the change. This kind of combination of ADD and code review works great.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been calling this method Attempt-Driven Development aka ADD (as mentioned here <a href="http://radio.javaranch.com/lasse/2005/05/09/1115665561552.html" onclick="javascript:pageTracker._trackPageview('/outbound/comment/radio.javaranch.com');" rel="nofollow">http://radio.javaranch.com/lasse/2005/05/09/1115665561552.html</a>). However, I consider ADD as a bad practice as such. Even if I can fix something without understanding the code fully, I make sure that someone else from our team reviews the change. This kind of combination of ADD and code review works great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Myatt</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-166</link>
		<dc:creator>Adam Myatt</dc:creator>
		<pubDate>Thu, 16 Feb 2006 01:28:02 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-166</guid>
		<description>I think we can agree that there are definitely negatives to the paradigm of modifying code without understanding it fully. However I agree with Elliotte in that it is a benefit to not have to fully and completely understand the code to make a small simple change. 

I work exclusively with offshore developers in India. The India-based organization we work with sees frequent turnover of developers. Developers also are responsible for understanding the internal functions of numerous applications. Often when a new developer is brought on board we are in the middle of several small/simple, yet critical, tweaks to a system. Often we do not have the time to wait for the developer to get 100% complete understanding of some of the complex applications before making simple changes. TDD with very thorough suites of test cases combined with code profiling applications (Eclipse TPTP, etc.) and code coverage applications (Cobertura) allow developers to make changes to our code, run full test suites, send JUnit, code profiling, and code coverage reports to project managers here in the U.S. 

Through this process we have been able to keep code quality high, bugs low, and provide flexibility on projects that might otherwise have had to been delayed.

Given this is not necessarily an average case, but does happen at least once or twice a year.</description>
		<content:encoded><![CDATA[<p>I think we can agree that there are definitely negatives to the paradigm of modifying code without understanding it fully. However I agree with Elliotte in that it is a benefit to not have to fully and completely understand the code to make a small simple change. </p>
<p>I work exclusively with offshore developers in India. The India-based organization we work with sees frequent turnover of developers. Developers also are responsible for understanding the internal functions of numerous applications. Often when a new developer is brought on board we are in the middle of several small/simple, yet critical, tweaks to a system. Often we do not have the time to wait for the developer to get 100% complete understanding of some of the complex applications before making simple changes. TDD with very thorough suites of test cases combined with code profiling applications (Eclipse TPTP, etc.) and code coverage applications (Cobertura) allow developers to make changes to our code, run full test suites, send JUnit, code profiling, and code coverage reports to project managers here in the U.S. </p>
<p>Through this process we have been able to keep code quality high, bugs low, and provide flexibility on projects that might otherwise have had to been delayed.</p>
<p>Given this is not necessarily an average case, but does happen at least once or twice a year.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliotte Rusty Harold</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-146</link>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
		<pubDate>Tue, 24 Jan 2006 21:12:49 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-146</guid>
		<description>You have to take what static code analysis tools report for JUnit tests with a grain of salt. JUnit tests are not typical code and don't follow the same rules. For instance, they often deliberately trigger error conditions to see what happens. For instance, this pattern is common in JUnit tests:

&lt;pre&gt;testFailingOp() {
  try {
    doSomethingBad();
    fail("No exception thrown");
  }
  catch (Exception ex) {
    // Cool. the code worked as expected.
  }&lt;/pre&gt;

However most static code analysis tools will flag that as an empty catch block. I sometimes test the exception message just to avoid that.

Here's another one: JUnit test method names can be extremely long. For instance, one of XOM's is &lt;code&gt;testConvertSingleElementDocumentFromXOMToDOM&lt;/code&gt;. Some static code analysis tools will flag that as an exceptionally long method name, and normally they'd be right; but not here. 

They're a lot of other areas where the usual rules are actively misleading when applied to JUnit tests.

Finally keep in mind that test code, although public,  is not meant to be reusable or to be invoked by anything other than a test runner. That also suggests it doesn't follow the same rules as most code does and can get away with simpler rules because it's simpler code. The unit nature of unit tests means the tests can be considered in isolation, and thus it's not nearly as important to sand down all the rough edges as it is in code where each method will be just one cog in a well-oiled program.</description>
		<content:encoded><![CDATA[<p>You have to take what static code analysis tools report for JUnit tests with a grain of salt. JUnit tests are not typical code and don&#8217;t follow the same rules. For instance, they often deliberately trigger error conditions to see what happens. For instance, this pattern is common in JUnit tests:</p>
<pre>testFailingOp() {
  try {
    doSomethingBad();
    fail("No exception thrown");
  }
  catch (Exception ex) {
    // Cool. the code worked as expected.
  }</pre>
<p>However most static code analysis tools will flag that as an empty catch block. I sometimes test the exception message just to avoid that.</p>
<p>Here&#8217;s another one: JUnit test method names can be extremely long. For instance, one of XOM&#8217;s is <code>testConvertSingleElementDocumentFromXOMToDOM</code>. Some static code analysis tools will flag that as an exceptionally long method name, and normally they&#8217;d be right; but not here. </p>
<p>They&#8217;re a lot of other areas where the usual rules are actively misleading when applied to JUnit tests.</p>
<p>Finally keep in mind that test code, although public,  is not meant to be reusable or to be invoked by anything other than a test runner. That also suggests it doesn&#8217;t follow the same rules as most code does and can get away with simpler rules because it&#8217;s simpler code. The unit nature of unit tests means the tests can be considered in isolation, and thus it&#8217;s not nearly as important to sand down all the rough edges as it is in code where each method will be just one cog in a well-oiled program.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Brosius</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-145</link>
		<dc:creator>Dave Brosius</dc:creator>
		<pubDate>Tue, 24 Jan 2006 17:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-145</guid>
		<description>&#62;&#62; If your tests were sound and complete, in theory you could implement your program by testing random code until it passes all the tests.

Yup. I run code checkers on all kinds of open source code all the time. By far the lousiest code out there is the code found in junit tests.</description>
		<content:encoded><![CDATA[<p>&gt;&gt; If your tests were sound and complete, in theory you could implement your program by testing random code until it passes all the tests.</p>
<p>Yup. I run code checkers on all kinds of open source code all the time. By far the lousiest code out there is the code found in junit tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliotte Rusty Harold</title>
		<link>http://cafe.elharo.com/blogroll/experimental-programming/#comment-144</link>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
		<pubDate>Tue, 24 Jan 2006 16:20:34 +0000</pubDate>
		<guid isPermaLink="false">http://minicafe.elharo.com/java/experimental-programming/#comment-144</guid>
		<description>All that's needed to write tests is understanding what the code is supposed to do. You absolutely do not need to know how the code does it. On some teams there are people whose job title is tester, not programmer. They are responsible for testing the program, but not for writing it. 

In fact, I think a test is better precisely if it doesn't have any special dependence on how the model code operates. This allows more flexible programs because you can refactor and experiment and try different algorithms and approaches without changing the tests. This is the whole point of data encapsulation. The class is a black box which is accessed solely through its public interface. The internal details are deliberately opaque, and thus can be changed as necessary to improve performance or other desirable characteristics without breaking client code.</description>
		<content:encoded><![CDATA[<p>All that&#8217;s needed to write tests is understanding what the code is supposed to do. You absolutely do not need to know how the code does it. On some teams there are people whose job title is tester, not programmer. They are responsible for testing the program, but not for writing it. </p>
<p>In fact, I think a test is better precisely if it doesn&#8217;t have any special dependence on how the model code operates. This allows more flexible programs because you can refactor and experiment and try different algorithms and approaches without changing the tests. This is the whole point of data encapsulation. The class is a black box which is accessed solely through its public interface. The internal details are deliberately opaque, and thus can be changed as necessary to improve performance or other desirable characteristics without breaking client code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
