<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eric Lefevre-Ardant on Java &#38; Agile &#187; tdd</title>
	<atom:link href="http://ericlefevre.net/wordpress/category/process/agile/tdd/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericlefevre.net/wordpress</link>
	<description>Eric&#039;s Earnest Elucidations</description>
	<lastBuildDate>Mon, 06 Feb 2012 06:08:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Worse than static methods or final classes?</title>
		<link>http://ericlefevre.net/wordpress/2011/11/28/worse-than-static-methods-or-final-classes/</link>
		<comments>http://ericlefevre.net/wordpress/2011/11/28/worse-than-static-methods-or-final-classes/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 09:53:56 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/?p=911</guid>
		<description><![CDATA[Do you know what&#8217;s worse that static methods or classes marked as final? I&#8217;ll tell you what&#8217;s worse: static methods that return final classes. That only provides private constructors. Here I was, merrily testing my way through a piece of &#8230; <a href="http://ericlefevre.net/wordpress/2011/11/28/worse-than-static-methods-or-final-classes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Do you know what&#8217;s worse that static methods or classes marked as final? I&#8217;ll tell you what&#8217;s worse: static methods that return final classes. That only provides private constructors.</p>
<p>Here I was, merrily testing my way through a piece of software that sends emails. According to the Java Mail documentation, you are supposed to first create an email session as follows:</p>
<pre>Session mailSession = Session.getInstance(properties);</pre>
<p>(it is worth noting that all what the getInstance() method does is call the private constructor for Session: new Session(props, null)).<br />
Had Session been a more normal class, I could have mocked it like that:</p>
<pre>Session mockSession = mock(Session.class);</pre>
<p>and probably checked how it is being passed around like this:</p>
<pre>verify(someService).startEmailSession(mockSession);</pre>
<p>What follows is what I have to do instead.</p>
<p><strong>The case of static methods</strong></p>
<p>If getInstance() had been an instance method, I would have been able to mock it:</p>
<pre>Session mockSessionProvider = mock(Session.class);
Session mockSessionInstance = mock(Session.class);
when(mockSessionProvider.getInstance()).thenReturn(mockSessionInstance);</pre>
<p>Unfortunately, a static method cannot easily be mocked with Mockito (other mocking frameworks support that, but I believe they make the tests too obscure). So, first step: create a wrapper class just for the builder method.</p>
<pre>public class SessionProvider {
	public Session getInstance(Properties properties) {
		return Session.getInstance(properties);
	}
}</pre>
<p><strong>The case of final classes</strong></p>
<p>So far, so (relatively) good. However, since Session is a final class, the usual mocking mecanism under Mockito does not work:</p>
<pre>SessionProvider mockSessionProvider = mock(SessionProvider.class);
Session mockSessionInstance = mock(Session.class); // fails because Session is final
when(mockSessionProvider.getInstance()).thenReturn(mockSessionInstance);</pre>
<p><strong>The case of private constructors</strong></p>
<p>Another option would have been to instantiate the session instance, but that fails too, since the constructor is private:</p>
<pre>SessionProvider mockSessionProvider = mock(SessionProvider.class);
Session sessionInstance = new Session(properties, null); // fails because constructor is private
when(mockSessionProvider.getInstance()).thenReturn(sessionInstance);</pre>
<p>A third way might have been to call the original Session.getInstance() to create the test object:</p>
<pre>SessionProvider mockSessionProvider = mock(SessionProvider.class);
Session sessionInstance = Session.getInstance(properties);
when(mockSessionProvider.getInstance()).thenReturn(sessionInstance);</pre>
<p>That would work, but that also opens a whole new can of worms. Session does not implement the equals() method, so if I want to check the value of the Session instance passed around, I must either:</p>
<ul>
<li>compare with the pointer to the sessionInstance &#8212; the issue is that there is no way to check that the session has not been changed (any call to a setter method on the session instance will have no effect on the comparison of pointers)</li>
<li>implement a generic deep equal matcher for Mockito &#8212; something we did at my company, but that I am reluctant to do myself</li>
<li>use an argument captor to catch the instance passed and test &#8212; which produces a fair amount of awkward lines of test</li>
<li>create a custom argument matcher &#8212; which hides the comparison in a separate class or method</li>
<li>yet another is to wrap the instance of Session in yet another class, such as SessionInstance &#8212; which would require us to also wrap any service that takes an instance of Session</li>
</ul>
<p>So we also need a wrapper for the Session instance:</p>
<pre>public class SessionInstance {
	private final Session session;

	public SessionInstance(Session session) {
		this.session = session;
	}

	public Session getSession() {
		return session;
	}
}</pre>
<p>Which forces us to change the SessionProvider:</p>
<pre>public class SessionProvider {
	public SessionInstance getInstance(Properties properties) {
		return new SessionInstance(Session.getInstance(properties));
	}
}</pre>
<p>At last, we can mock this way:</p>
<pre>SessionProvider mockSessionProvider = mock(SessionProvider.class);
SessionInstance mockSessionInstance = mock(SessionInstance.class);
when(mockSessionProvider.getInstance()).thenReturn(mockSessionInstance);</pre>
<p>Done? Hardly. All other, possibly mockable, classes from third-parties that rely on instances of Session must now also by wrapper. For example, a third-party JavaMailTransport that requires an instance of Session now needs its own wrapper if I want to test it. Sigh&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2011/11/28/worse-than-static-methods-or-final-classes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Java&#8217;s varargs are for unit tests</title>
		<link>http://ericlefevre.net/wordpress/2011/11/21/javas-varargs-are-for-unit-tests/</link>
		<comments>http://ericlefevre.net/wordpress/2011/11/21/javas-varargs-are-for-unit-tests/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 16:53:30 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/?p=947</guid>
		<description><![CDATA[At Devoxx last week, Joshua Bloch argued during his talk &#8220;The Evolution of Java: Past, Present, and Future&#8221; that varargs are only &#8220;somewhat useful&#8221;. I think he is overlooking some usages, particularly in tests. Here is my case. A reminder &#8230; <a href="http://ericlefevre.net/wordpress/2011/11/21/javas-varargs-are-for-unit-tests/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://www.devoxx.com/">Devoxx</a> last week, Joshua Bloch argued during his talk &#8220;The Evolution of Java: Past, Present, and Future&#8221; that varargs are only &#8220;somewhat useful&#8221;. I think he is overlooking some usages, particularly in tests. Here is my case.</p>
<p>A reminder on how varargs work: essentially, they allow the last parameter of a method to be made of zero to many values of the same type.<br />
For example, a method like this:</p>
<pre>int max(int... values) {...};</pre>
<p>is used by code like that:</p>
<pre>int maximum = max(1, 2, 7, 0);
int maximum = max(1);</pre>
<p>In truth, that form is only moderately useful in production code. It turns out that, on my projects at least, it is not so common for methods to be called with varying number of parameters. And in those cases, it is often acceptable to simply overload a method with more parameters.</p>
<p>There are however at least two cases where varargs shine.</p>
<p>One is in utilities classes. For example, Math.max() only takes exactly two parameters. Which comparisons between 3 or more elements very awkward. If a varargs had been used, Math.max(3, Math.max(1, 4)) would be written Math.max(3, 1, 4). Agreed, that does not happen that often. But it does occasionally.<br />
(I must admit that I do not understand exactly why Math.max() has not been modified to take a varargs nowadays)</p>
<p>However, the biggest benefit, I believe, is in the writing of tests.<br />
Tests tend to contain lots of variations in the values passed to the code under test. And it is critical to keep the clutter to a minimum.<br />
For example, here is how a typical series of tests might look like</p>
<pre>@Test
public void should_find_the_longest_name_for_a_single_user() {
	List users = new ArrayList();
	users.add(new User("eric"));
	assertThat(findLongestName(users), is("eric"));
}</pre>
<pre>@Test
public void should_find_the_longest_name_when_shorted_is_first() {
	List users = new ArrayList();
	users.add(new User("eric"));
	users.add(new User("cecile"));
	assertThat(findLongestName(users), is("cecile"));
}</pre>
<pre>@Test
public void should_find_the_longest_name_when_longest_is_first() {
	List users = new ArrayList();
	users.add(new User("cecile"));
	users.add(new User("eric"));
	assertThat(findLongestName(users), is("cecile"));
}</pre>
<pre>@Test(expected = RuntimeException.class)
public void should_fail_when_search_for_the_longest_name_with_no_users() {
	assertThat(findLongestName(new ArrayList()), is("eric"));
}</pre>
<p>Of course, they can be made a bit nicer using the varargs in Arrays.asList():</p>
<pre>@Test
public void should_find_the_longest_name_for_a_single_user() {
	assertThat(findLongestName(asList(new User("eric"))), is("eric"));
}

@Test
public void should_find_the_longest_name_when_shorted_is_first() {
	assertThat(findLongestName(asList(new User("eric"),
		new User("cecile"))), is("cecile"));
}

@Test
public void should_find_the_longest_name_when_longest_is_first() {
	assertThat(findLongestName(asList(new User("cecile"),
		new User("eric"))), is("cecile"));
}

@Test(expected = RuntimeException.class)
public void should_fail_when_search_for_the_longest_name_with_no_users() {
	findLongestName(Arrays.asList());
}</pre>
<p>However, the real goodness comes when writing our own builder method:</p>
<pre>private static List users(String... names) {
	List users = new ArrayList();
	for (String name : names) {
		users.add(new User(name));
	}
	return users;
}</pre>
<p>(side note: I like this type of methods to be private -so that I get notified when they are not used anymore- and static -mostly because they look nicer in italic, which makes it clearer that they are not part of the code being tested-)</p>
<p>which allow our tests to become:</p>
<pre>@Test
public void should_find_the_longest_name_for_a_single_user() {
	assertThat(findLongestName(users("eric")), is("eric"));
}

@Test
public void should_find_the_longest_name_when_shorted_is_first() {
	assertThat(findLongestName(users("eric", "cecile")), is("cecile"));
}

@Test
public void should_find_the_longest_name_when_longest_is_first() {
	assertThat(findLongestName(users("cecile", "eric")), is("cecile"));
}

@Test(expected = RuntimeException.class)
public void should_fail_when_search_for_the_longest_name_with_no_users() {
	findLongestName(users());
}</pre>
<p>Tests become a lot shorter, consistent, and easier to read. In fact, at this point, it is worth grouping the tests (at least those that do not throw an exception) into a single one:</p>
<pre>@Test
public void should_find_the_longest_name_for_a_single_user() {
	assertThat(findLongestName(users("eric")), is("eric"));
	assertThat(findLongestName(users("eric", "cecile")), is("cecile"));
	assertThat(findLongestName(users("cecile", "eric")), is("cecile"));
}

@Test(expected = RuntimeException.class)
public void should_fail_when_search_for_the_longest_name_with_no_users() {
	findLongestName(users());
}</pre>
<p>Final note: I prefer not to group those builder methods into a general utilities class &#8212; I tend to duplicate them in each test class. One reason is that I prefer keeping much of the test code close together. Another is that I tend to change the name of the method from test class to test class to make the code more fluent. Also, I think that DRY principles are not as important in the tests as they are in the production code.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2011/11/21/javas-varargs-are-for-unit-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bob Martin on TDD in Clojure</title>
		<link>http://ericlefevre.net/wordpress/2010/06/04/bob-martin-on-tdd-in-clojure/</link>
		<comments>http://ericlefevre.net/wordpress/2010/06/04/bob-martin-on-tdd-in-clojure/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 12:54:23 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/?p=821</guid>
		<description><![CDATA[Robert &#8220;Uncle Bob&#8221; Martin has just blogged on the differences in TDD styles using Clojure, as compared to more traditional languages such as Java. Though I am a Clojure-newbie, I mostly disagree with his conclusions. His main point is that, &#8230; <a href="http://ericlefevre.net/wordpress/2010/06/04/bob-martin-on-tdd-in-clojure/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Robert &#8220;Uncle Bob&#8221; Martin has just blogged on <a href="http://blog.objectmentor.com/articles/2010/06/03/tdd-in-clojure">the differences in TDD styles using Clojure</a>, as compared to more traditional languages such as Java. Though I am a Clojure-newbie, I mostly disagree with his conclusions.</p>
<p>His main point is that, because Clojure is a functional language, functions have no side-effects and therefore can be used directly in the tests.</p>
<p>For example, the production code</p>
<pre>(defn update-all [os]
  (update os))</pre>
<p>would be tested with something like</p>
<pre>(testing "update-all"
  (let [
    o1 (make-object ...)
    o2 (make-object ...)
    os [o1 o2]
    us (update-all os)
    ]
    (is (= (nth us 0) (update o1)))
    (is (= (nth us 1) (update o2)))
    )
  )</pre>
<h2>There is no reason to believe that the (update) function is side-effect-free</h2>
<p>Changing internal values is only one way of creating side-effect. I admit that Clojure encourages coders to write code that does not change variables (if I got it right, it is definitely possible to do so, but with some additional work). However, that effect only stops at the boundaries of the language. At some point, it might access the file system or a database. Clearly, the state might change there.</p>
<h2>Correct implementation of the (update-all) function depends on the correct implementation of (update)</h2>
<p>Bob Martin says: &#8221;this test simply checks that the appropriate three functions are getting called on each element of the list&#8221;.<br />
Suppose that the (update) function does not do anything or maybe does something that does not return a value, such as printing out to the console. Then, calling it will have the same effect as not calling it at all. The test above will pass even if the (update-all) function does not provide any implementation at all. When, later, the bug is found, it will be harder to fix.</p>
<h2>The test could be clearer (with a more powerful test framework)</h2>
<p>One of my biggest concerns is that the test looks a lot like the code itself. Looks like duplication of information to the reader.<br />
If there was a mock framework for Clojure, I would expect to see something like</p>
<pre>(testing "update-all"
  (let [
    pre-conditions (
      (should-return (update 1) 1.5)
      (should-return (update 3) 3.0) )
    o1 (make-object 1)
    o2 (make-object 3)
    os [o1 o2]
    us (update-all os)
    ]
    (is (= (nth us 0) (1.5)
    (is (= (nth us 1) (3.0)
    )
  )</pre>
<h2>Bob Martin is right to conclude that &#8220;Clojure without TDD is just as much a nightmare as Java or Ruby without TDD.&#8221;</h2>
<p>But he should also make it clearer that it is lacking a mock framework (he does point to Brian Marick&#8217;s work on this).</p>
<p>It should be noted that it is possible to get a similar implementation style in Java as in Clojure, though it is significant work. In fact, that&#8217;s often how we use it here at <a href="http://www.algodeal.com/">Algodeal</a>. That means mostly relying on <a href="http://en.wikipedia.org/wiki/Immutable_object">immutable objects</a> and state-less methods. Immutable collections from <a href="http://code.google.com/p/google-collections/">Google Collections</a> help a lot, too. Still, we like to use mocks in our tests (too much for some, probably).</p>
<p>In the end, Uncle Bob&#8217;s post is another aspect of the (almost) age-old debate described by Martin Fowler: <a href="http://martinfowler.com/articles/mocksArentStubs.html">classicists vs. mockists</a>. If you haven&#8217;t already, read Fowler&#8217;s article, it&#8217;s worth it.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2010/06/04/bob-martin-on-tdd-in-clojure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More about Coding Dojo at CITCON Amsterdam</title>
		<link>http://ericlefevre.net/wordpress/2008/10/21/more-about-coding-dojo-at-citcon-amsterdam/</link>
		<comments>http://ericlefevre.net/wordpress/2008/10/21/more-about-coding-dojo-at-citcon-amsterdam/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 20:52:42 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[citcon]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/?p=458</guid>
		<description><![CDATA[As a nice followup to my earlier post, Willem did a great write up of our Coding Dojo session at CITCON Europe, in early October. His post is supplemented with pictures by Marc.]]></description>
			<content:encoded><![CDATA[<p>As a nice followup to <a href="http://ericlefevre.net/wordpress/2008/10/08/coding-dojo-on-legacy-code/">my earlier post</a>, Willem did <a href="http://me.andering.com/2008/10/21/as-a-programmer-i-want-to-go-to-a-coders-dojo-so-that-i-can-improve-my-skills/">a great write up of our Coding Dojo session</a> at <a href="http://ericlefevre.net/wordpress/2008/10/05/back-from-citcon-europe-amsterdam-2008/">CITCON Europe</a>, in early October. His post is supplemented with <a href="http://www.flickr.com/photos/27671788@N05/sets/72157608207996555/">pictures by Marc</a>.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/27671788@N05/2957339873/in/set-72157608207996555/"><img class="aligncenter" title="Marc and Eric in action during the first 5 mins of the Coding Dojo" src="http://farm4.static.flickr.com/3033/2957339873_66447d67c8_m.jpg" alt="" width="240" height="160" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2008/10/21/more-about-coding-dojo-at-citcon-amsterdam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding Dojo on Legacy Code</title>
		<link>http://ericlefevre.net/wordpress/2008/10/08/coding-dojo-on-legacy-code/</link>
		<comments>http://ericlefevre.net/wordpress/2008/10/08/coding-dojo-on-legacy-code/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 16:31:55 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[citcon]]></category>
		<category><![CDATA[facilitation]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/?p=443</guid>
		<description><![CDATA[At CITCON Amsterdam last WE, Willem van den Ende and I facilitate a Coding Dojo session on both Mockito and Legacy Code. Willem and I thought that we had missed some of our goals (especially demonstrating Mockito), but still many people at &#8230; <a href="http://ericlefevre.net/wordpress/2008/10/08/coding-dojo-on-legacy-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://ericlefevre.net/wordpress/2008/10/05/back-from-citcon-europe-amsterdam-2008/">CITCON Amsterdam</a> last WE, <a href="http://www.willemvandenende.com/">Willem van den Ende</a> and I facilitate a <a href="http://ericlefevre.net/wordpress/2008/09/28/improvided-coding-dojo/">Coding Dojo</a> session on both <a href="http://code.google.com/p/mockito/">Mockito</a> and <a href="http://en.wikipedia.org/wiki/Legacy_code">Legacy Code</a>.</p>
<p>Willem and I thought that we had missed some of our goals (especially demonstrating Mockito), but still many people at the closing session mentioned that they enjoyed it :-)</p>
<p><a title="Coding Dojo with Legacy Code by elefevre7, on Flickr" href="http://www.flickr.com/photos/elefevre/2915504264/"><img class="alignleft" src="http://farm4.static.flickr.com/3004/2915504264_b376f0879f_m.jpg" alt="Coding Dojo with Legacy Code" width="240" height="180" /></a>We tried to prepare a bit before diving into the session. However, in practice, it became a bit chaotic, as many participants tried to make their opinion heard. This was very different than when I do that in trainings or even at Valtech. I guess this is because there were quite a few people (~20) and most of them were rather experienced and strong-headed (I guess they wouldn&#8217;t be at such a conference otherwise!).</p>
<p><a title="Coding Dojo with Legacy Code by elefevre7, on Flickr" href="http://www.flickr.com/photos/elefevre/2915505760/"><img class="alignright" src="http://farm4.static.flickr.com/3028/2915505760_6d0949840a_m.jpg" alt="Coding Dojo with Legacy Code" width="240" height="180" /></a>We managed to have a quick retrospective at the end. Here are some of the things we learnt:</p>
<li>We need to prepare the session better; half of the session was spent fixing an existing bug in the original application, instead of adding features. Also, Willem wanted to take advantage of Mockito, which was quickly forgotten as people concentrated on fixing the bug.</li>
<li>At first, do Safe Refactorings (the ones that can be done automatically by Eclipse and such tools), though you still need to be careful of what you are doing</li>
<li>It is OK to add code, not OK not remove code from the legacy application</li>
<li>Add collaborators using setters to facilitate testing</li>
<li>However, be careful: getters and setters can quickly get out of hand</li>
<li><a href="http://en.wikipedia.org/wiki/Singleton_pattern">Singletons</a> are bad, not just because they make code hard to test, but also because they create secret coupling</li>
<li>Apparently, many (bad) coders want to write singletons and <a href="http://en.wikipedia.org/wiki/Method_(computer_science)#Static_methods">static methods</a> (which are both frown upon in the context of testing), simply because they do not want to type the &#8216;new&#8217; keyword</li>
<li>We could try to rotate the copilot on a longer basis (for example, every 10 mins, instead of every 5 mins for the coder)</li>
<li>I (Eric) got concerned that the Coding Dojo format prevents participants from thinking; facilitating the session sometimes seemed to be like herding cats</li>
<li>it was clear that many people was interested in working on legacy code</li>
<li>in the end, a Coding Dojo with an appropriately complex application seemed like a good way to learn about handling legacy code</li>
<p>I need to experiment a bit more with Coding Dojo for Legacy Code, but I feel that the format is rather good. Next year, we&#8217;ll do better!</p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2008/10/08/coding-dojo-on-legacy-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Next Talk: TDD Training</title>
		<link>http://ericlefevre.net/wordpress/2008/10/01/next-talk-tdd-training/</link>
		<comments>http://ericlefevre.net/wordpress/2008/10/01/next-talk-tdd-training/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 08:04:15 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[tdd]]></category>
		<category><![CDATA[valtech]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/?p=417</guid>
		<description><![CDATA[I am giving a 3-day TDD training session at Valtech Training premises, from Monday, October 6th. I&#8217;ll introduce a Coding Dojo, like we did in the TDD training last week.]]></description>
			<content:encoded><![CDATA[<p>I am giving a 3-day TDD training session at <a href="http://www.valtech-training.fr/">Valtech Training</a> premises, from Monday, October 6th. I&#8217;ll introduce a Coding Dojo, <a href="http://ericlefevre.net/wordpress/2008/09/28/improvided-coding-dojo/">like we did in the TDD training last week</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2008/10/01/next-talk-tdd-training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improvised Coding Dojo</title>
		<link>http://ericlefevre.net/wordpress/2008/09/28/improvided-coding-dojo/</link>
		<comments>http://ericlefevre.net/wordpress/2008/09/28/improvided-coding-dojo/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 10:50:37 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[tdd]]></category>
		<category><![CDATA[valtech]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/?p=403</guid>
		<description><![CDATA[In the past three days, I have taught Test-Driven Development to a group of Java developers in Brittany. I thought it was a good idea to arrange an inpromptu Coding Dojo. That contained a moderate risk, as all dojos I &#8230; <a href="http://ericlefevre.net/wordpress/2008/09/28/improvided-coding-dojo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Coding Dojo at AgileOpen 2007 -NOT during the course- by elefevre7, on Flickr" href="http://www.flickr.com/photos/elefevre/2894952292/"><img class="alignright" src="http://farm4.static.flickr.com/3252/2894952292_17216f39d7_m.jpg" alt="Coding Dojo at AgileOpen 2007" width="240" height="160" /></a>In the past three days, I <a href="http://www.valtech-training.fr/fr/index/training/formations/methodes_pratiques_agiles/TDDJ.html">have taught Test-Driven Development</a> to a group of Java developers in <a href="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=brest,+bretagne&amp;ie=UTF8&amp;ll=48.019324,-3.131104&amp;spn=3.049726,5.603027&amp;t=h&amp;z=8">Brittany</a>. I thought it was a good idea to arrange an inpromptu <a href="http://www.codingdojo.org/">Coding Dojo</a>. That contained a moderate risk, as all dojos I knew of were attented by volunteers.</p>
<p>It turned out very well. Though one or two participants managed to check their emails at some point during the session, most were paying attention at all times.</p>
<p>A couple of things to remember for future dojos:</p>
<p> </p>
<ul>
<li>In the past, I have usually attented dojos were either everyone was in front of a computer (either coding or co-piloting), or a single pair was coding in front of the others. After watching <a href="http://www.davenicolette.net/">Dave Nicolette</a> and Ryan Hoegg <a href="http://submissions.agile2008.org/node/1650">facilitate a dojo where all got to code in front of the public at Agile 2008</a>, I thought this was a good way to get participants to do their best, plus let others to read code with a watchful eye.</li>
<li>A participant mentionned that the exercice helped him realize that names for test methods were very important. Yay!</li>
<li>For first-timers, always start with a very, very simple exercice. We did the dictionary kata (given a collection of words, find all words in a String that are not in the collection). We managed to complete it satisfactorily in 2x 30 minutes.</li>
<li>We did our best to run through the code <a href="http://www.extremeprogramming.org/rules/testfirst.html">Test First</a>, writing the tests with as little prior thinking as possible. That said, one participant suggested that pairs should talk a little before doing so, in order to get the pair to bond better. Sounds like a good suggestion, though it would probably require more time than what we had available.</li>
</ul>
<p> </p>
<p>All in all, I am happy with the outcome. We should include it in our course curriculum.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2008/09/28/improvided-coding-dojo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A few words on Test-Driven Development</title>
		<link>http://ericlefevre.net/wordpress/2008/05/12/a-few-words-on-test-driven-development/</link>
		<comments>http://ericlefevre.net/wordpress/2008/05/12/a-few-words-on-test-driven-development/#comments</comments>
		<pubDate>Mon, 12 May 2008 21:27:15 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[tdd]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[valtech]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/?p=193</guid>
		<description><![CDATA[Cédric Dhénin from TV4IT has an interview of me talking about TDD (in French). Considering this was the first time for me, and that we had to do it all in one take (no editing), I am rather happy with &#8230; <a href="http://ericlefevre.net/wordpress/2008/05/12/a-few-words-on-test-driven-development/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Cédric Dhénin from <a href="http://www.tv4it.net/">TV4IT</a> has an interview of me <a href="http://www.tv4it.net/permalink/5264/developpement-pilote-par-les-tests-quels-resultats-.aspx">talking about TDD</a> (in French).<span id="more-193"></span></p>
<p>Considering this was the first time for me, and that we had to do it all in one take (no editing), I am rather happy with the outcome. There are a couple of minor things I forgot to mention (only the interviewer had notes), but all in all, I managed to say almost all I wanted in the 5 minutes I got. Anyway, this was rather high-level; the target audience for TV4IT is mostly CIOs and project managers.</p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="280" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="bgcolor" value="#000000" /><param name="align" value="middle" /><param name="src" value="http://storage02.brainsonic.com/webtv/tv4itv2/player.swf?&amp;paramXml=http://storage02.brainsonic.com/webtv/tv4itv2/param_player.xml&amp;itemId=5264&amp;autostart=false&amp;mute=false&amp;rollover=true quality=" /><embed type="application/x-shockwave-flash" width="320" height="280" src="http://storage02.brainsonic.com/webtv/tv4itv2/player.swf?&amp;paramXml=http://storage02.brainsonic.com/webtv/tv4itv2/param_player.xml&amp;itemId=5264&amp;autostart=false&amp;mute=false&amp;rollover=true quality=" align="middle" bgcolor="#000000"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2008/05/12/a-few-words-on-test-driven-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CITCON Brussels 2007: Jester &amp; Jumble</title>
		<link>http://ericlefevre.net/wordpress/2007/10/24/citcon-brussels-2007-jester-jumble/</link>
		<comments>http://ericlefevre.net/wordpress/2007/10/24/citcon-brussels-2007-jester-jumble/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 20:03:25 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[citcon]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/2007/10/24/citcon-brussels-2007-jester-jumble/</guid>
		<description><![CDATA[I was very excited when Squirrel suggested a topic about mutation testing. I had looked at Jester &#38; Jumble before, but gave up after a couple of hours, as they are not very easy to setup, and mostly not maintained. &#8230; <a href="http://ericlefevre.net/wordpress/2007/10/24/citcon-brussels-2007-jester-jumble/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was very excited when Squirrel suggested a topic about mutation testing. I had looked at <a href="http://jester.sourceforge.net/">Jester</a> &amp; <a href="http://jumble.sourceforge.net/">Jumble</a> before, but gave up after a couple of hours, as they are not very easy to setup, and mostly not maintained.</p>
<p>The idea of those tools is to make changes to the source code (Jester) or the bytecode (Jumble), and check if the tests still pass. If they are well written, they should fail when the code is changed. If not, then the code is not covered properly. Ideally, you should only have one test failing; otherwise, it means that you have redundant tests.</p>
<p><a href="http://oocode.com/">Ivan</a>, the creator of Jester, was present, but admitted that he had not even used it in years. After seeing the interest of the participants, he seems willing to give it more time. Hurray!</p>
<p>Check out <a href="http://citconf.com/wiki/index.php?title=MutationTesting">my notes on the conference wiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2007/10/24/citcon-brussels-2007-jester-jumble/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CITCON Brussels Registrations are going nicely</title>
		<link>http://ericlefevre.net/wordpress/2007/10/02/citcon-brussels-registrations-are-going-nicely/</link>
		<comments>http://ericlefevre.net/wordpress/2007/10/02/citcon-brussels-registrations-are-going-nicely/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 10:47:00 +0000</pubDate>
		<dc:creator>Eric Lefevre-Ardant</dc:creator>
				<category><![CDATA[citcon]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://ericlefevre.net/wordpress/2007/10/02/citcon-brussels-registrations-are-going-nicely/</guid>
		<description><![CDATA[We now have more than 80 registrants for CITCON Brussels, more than 2 weeks before the 19th. This year, I have volunteered to help organize registrations, so I get to see every single registration request. It&#8217;s interesting: sometimes, you don&#8217;t &#8230; <a href="http://ericlefevre.net/wordpress/2007/10/02/citcon-brussels-registrations-are-going-nicely/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We now have more than 80 registrants for <a href="http://citconf.com/brussels2007/">CITCON Brussels</a>, more than 2 weeks before the 19th.</p>
<p>This year, I have volunteered  to help organize registrations, so I get to see every single registration request. It&#8217;s interesting: sometimes, you don&#8217;t see anyone registering for days (oh my god, is this going to be a turkey?, then 7 people register in a single day. The general pattern, though, is that the number increase more or less regularly.</p>
<p>Also, about one request in six is pure spam.<br />
We should reach the threshold for the maximum number of seats a couple of days before the event.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericlefevre.net/wordpress/2007/10/02/citcon-brussels-registrations-are-going-nicely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

