<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-34908752</atom:id><lastBuildDate>Thu, 04 Mar 2010 19:08:33 +0000</lastBuildDate><title>Mock Objects</title><description>About Mock Objects, a technique for improving the design of code within Test-Driven Development</description><link>http://www.mockobjects.com/</link><managingEditor>noreply@blogger.com (Steve Freeman)</managingEditor><generator>Blogger</generator><openSearch:totalResults>78</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-7618751480749053338</guid><pubDate>Tue, 08 Sep 2009 09:05:00 +0000</pubDate><atom:updated>2009-09-12T16:15:38.608+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>history</category><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>talk</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>A Brief History of Mock Objects</title><description>&lt;p&gt;As an afterword to &lt;a href="http://www.growing-object-oriented-software.com/"&gt;the book&lt;/a&gt;, we had &lt;a href="http://www.planningcards.com/iterex/blog.html"&gt;Tim Mackinnon&lt;/a&gt; write up a piece on how we got here. In compensation for having been so quiet for a while, here's that chapter.&lt;/p&gt;

&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;The ideas and concepts behind mock objects didn't materialise in a single day. There's a long history of experimentation, discussion, and collaboration between many different developers who have taken the seed of an idea and grown it into something more profound. The final result should help you with your software development; but the background story of “The Making of Mock Objects” is also interesting&amp;mdash;and a testament to the dedication of the people involved. I hope revisiting this history will inspire you too to challenge your thoughts on what is possible and to experiment with new practices.&lt;/p&gt;
&lt;h3&gt;Origins&lt;/h3&gt;
&lt;p&gt;The story began on a roundabout near Archway station in London in late 1999. That evening, several members of a London-based software architecture group met to discuss topical issues in software. The discussion turned to experiences with Agile Software Development and I mentioned the impact that writing tests seemed to be having on our code. This was before the first Extreme Programming book had been published, and teams like ours were still exploring how to do test-driven development—including what constituted a good test. In particular, I had noticed a tendency to add “getter” methods to our objects to facilitate testing. This felt wrong, since it could be seen as violating object-oriented principles, so I was interested in the thoughts of the other members. The conversation was quite lively—mainly centering on the tension between pragmatism in testing and pure object-oriented design. We also had a recent example of a colleague, Oli Bye, stubbing out the Java Servlet API for testing a web application without a server.&lt;/p&gt;

&lt;p&gt;I particularly remember from that evening a crude diagram of an onion and its metaphor of the many layers of software, along with the mantra “No Getters! Period!” The discussion revolved around how to safely peel back and test layers of that onion without impacting its design. The solution was to focus on the composition of software components (the group had discussed Brad Cox's ideas on software components many times before). It was an interesting collision of opinions, and the emphasis on composition—now referred to as &lt;span style="font-style:italic;"&gt;dependency injection&lt;/span&gt;—gave us a technique for eliminating the getters we were “pragmatically” adding to objects so we could write tests for them.&lt;/p&gt;

&lt;p&gt;The following day, our small team at Connextra started putting the idea into practice. We removed the getters from sections of our code and used a compositional strategy by adding constructors that took the objects we wanted to test via getters as parameters. At first this felt cumbersome, and our two recent graduate recruits were not convinced. I, however, had a Smalltalk background, so to me the idea of composition and delegation felt right. Enforcing a “no getters” rule seemed like a way to achieve a more object-oriented feeling in the Java language we were using.&lt;/p&gt;

&lt;p&gt;We stuck to it for several days and started to see some patterns emerging. More of our conversations were about expecting things to happen between our objects, and we frequently had variables with names like &lt;code&gt;expectedURL&lt;/code&gt; and &lt;code&gt;expectedServiceName&lt;/code&gt; in our injected objects. On the other hand, when our tests failed we were tired of stepping through in a debugger to see what went wrong. We started adding variables with names like &lt;code&gt;actualURL&lt;/code&gt; and &lt;code&gt;actualServiceName&lt;/code&gt; to allow the injected test objects to throw exceptions with helpful messages. Printing the expected and actual values side-by-side showed us immediately what the problem was.&lt;/p&gt;

&lt;p&gt;Over the course of several weeks we refactored these ideas into a group of classes: &lt;code&gt;ExpectationValue&lt;/code&gt; for single values, &lt;code&gt;ExpectationList&lt;/code&gt; for multiple values in a particular order, and &lt;code&gt;ExpectationSet&lt;/code&gt; for unique values in any order. Later, Tung Mac also added &lt;code&gt;ExpectationCounter&lt;/code&gt; for situations where we didn't want to specify explicit values but just count the number of calls. It started to feel as if something interesting was happening, but it seemed so obvious to me that there wasn't really much to describe. One afternoon, Peter Marks decided that we should come up with name for what we were doing—so we could at least package the code—and, after a few suggestions, proposed “mock.” We could use it both as a noun and a verb, and it refactored nicely into our code, so we adopted it.&lt;/p&gt;
&lt;h3&gt;Spreading the Word&lt;/h3&gt;
&lt;p&gt;Around this time, we also started the London Extreme Tuesday Club (XTC) to share experiences of Extreme Programming with other teams. During one meeting, I described our refactoring experiments and explained that I felt that it helped our junior developers write better object-oriented code. I finished the story by saying, “But this is such an obvious technique that I'm sure most people do it eventually anyway.” Steve pointed out that the most obvious things aren't always so obvious and are usually difficult to describe. He thought this could make a great paper if we could sort the wood from the trees, so we decided to collaborate with another XTC member (Philip Craig) and write something for the XP2000 conference. If nothing else, we wanted to go to Sardinia.&lt;/p&gt;

&lt;p&gt;We began to pick apart the ideas and give them a consistent set of names, studying real code examples to understand the essence of the technique. We backported new concepts we discovered to the original Connextra codebase to validate their effectiveness. This was an exciting time and I recall that it took many late nights to refine our ideas—although we were still struggling to come up with an accurate “elevator pitch” for mock objects. We knew what it felt like when using them to drive great code, but describing this experience to other developers who weren't part of the XTC was still challenging.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://www.mockobjects.com/files/endotesting.pdf"&gt;XP2000 paper&lt;/a&gt; and the initial mock objects library had a mixed reception—for some it was revolutionary, for others it was unnecessary overhead. In retrospect, the fact that Java didn’t have good reflection when we started meant that many of the steps were manual, or augmented with code generation tools. This turned people off—they couldn't separate the idea from the implementation.&lt;/p&gt;

&lt;h3&gt;Another Generation&lt;/h3&gt;
&lt;p&gt;The story continues when Nat Pryce took the ideas and implemented them in Ruby. He exploited Ruby's reflection to write expectations directly into the test as blocks. Influenced by his PhD work on protocols between components, his library changed the emphasis from asserting parameter values to asserting messages sent between objects. Nat then ported his implementation to Java, using the new Proxy type in Java 1.3 and defining expectations with “constraint” objects. When Nat showed us this work, it immediately clicked. He donated his library to the mock objects project and visited the Connextra offices where we worked together to add features that the Connextra developers needed.&lt;/p&gt;

&lt;p&gt;With Nat in the office where mock objects were being used constantly, we were driven to use his improvements to provide more descriptive failure messages. We had seen our developers getting bogged down when the reason for a test failure was not obvious enough (later, we observed that this was often a hint that an object had too many responsibilities). Now, constraints allowed us to write tests that were more expressive and provided better failure diagnostics, as the constraint objects could explain what went wrong. For example, a failure on a &lt;code&gt;stringBegins&lt;/code&gt; constraint could produce a message like:&lt;/p&gt;
&lt;pre&gt;Expected a string parameter beginning with "http"
 but was called with a value of "ftp.domain.com"&lt;/pre&gt;
&lt;p&gt;We released the new improved version of Nat's library under the name Dynamock.&lt;/p&gt;

&lt;p&gt;As we improved the library, more programmers started using it, which introduced new requirements. We started adding more and more options to the API until, eventually, it became too complicated to maintain—especially as we had to support multiple versions of Java. Meanwhile, Steve tired of the the duplication in the syntax required to set up expectations, so he introduced a version of a Smalltalk cascade—multiple calls to the same object.&lt;/p&gt;

&lt;p&gt;Then Steve noticed that in a statically typed language like Java, a cascade could return a chain of interfaces to control when methods are made available to the caller—in effect, we could use types to encode a workflow. Steve also wanted to improve the programming experience by guiding the new generation of IDEs to prompt with the “right” completion options. Over the course of a year, Steve and Nat, with much input from the rest of us, pushed the idea hard to produce jMock, an expressive API over our original Dynamock framework. This was also ported to C# as NMock. At some point in this process, they realized that they were actually writing a language in Java which could be used to write expectations; they wrote this up later in an &lt;a href="http://www.mockobjects.com/files/evolving_an_edsl.ooplsa2006.pdf"&gt;OOPLSA paper&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Consolidation&lt;/h3&gt;
&lt;p&gt;Through our experience in Connextra and other companies, and through giving many presentations, we improved our understanding and communication of the ideas of mock objects. Steve (inspired by some of the early lean software material) coined the term “needs-driven development,” and Joe Walnes, another colleague, drew a nice visualisation of islands of objects communicating with each other. Joe also had the insight of using mock objects to drive the design of interfaces between objects. At the time, we were struggling to promote the idea of using mock objects as a design tool; many people (including some authors) saw it only as a technique for speeding up unit tests. Joe cut through all the conceptual barriers with his simple heuristic of “Only mock types you own.”&lt;/p&gt;

&lt;p&gt;We took all these ideas and wrote a second conference paper, &lt;a href="http://www.mockobjects.com/files/mockrolesnotobjects.pdf"&gt;“Mock Roles not Objects”&lt;/a&gt;. Our initial description had focused too much on implementation, whereas the critical idea was that the technique emphasizes the roles that objects play for each other. When developers are using mock objects well, I observe them drawing diagrams of what they want to test, or using CRC cards to roleplay relationships“these then translate nicely into mock objects and tests that drive the required code.
Since then, Nat and Steve have reworked jMock to produce &lt;a href="http://www.jmock.org/"&gt;jMock2&lt;/a&gt;, and Joe has extracted constraints into the &lt;a href="http://code.google.com/p/hamcrest/"&gt;Hamcrest&lt;/a&gt; library (now adopted by JUnit). There’s also now a wide selection of mock object libraries, in many different languages.&lt;/p&gt;

&lt;p&gt;The results have been worth the effort. I think we can finally say that there is now a well-documented and polished technique that helps you write better software. From those humble “no getters” beginnings, this book summarizes years of experience from all of us who have collaborated, and adds Steve and Nat's language expertise and careful attention to detail to produce something that is greater than the sum of its parts.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-7618751480749053338?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2009/09/brief-history-of-mock-objects.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-2173802873256900680</guid><pubDate>Wed, 12 Aug 2009 08:51:00 +0000</pubDate><atom:updated>2009-10-18T23:22:08.715+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>news</category><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Book: The Worst is Over</title><description>&lt;p&gt;We've been silent for a while, getting on with writing.&lt;/p&gt;
&lt;p&gt;The news is that we're done with copy editing and now it's into the presentation work such as formatting, proofing, and indexing. We're even up on Amazon, although our editor says that we should be out before November.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-2173802873256900680?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2009/08/book-worst-is-over.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>5</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-337741654357909160</guid><pubDate>Thu, 11 Jun 2009 20:24:00 +0000</pubDate><atom:updated>2009-06-11T21:27:17.393+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>publications</category><category domain='http://www.blogger.com/atom/ns#'>news</category><title>Using Mocks and Tests to Design Role-Based Objects</title><description>&lt;p&gt;Isaiah Perumalla has had a &lt;a href="http://msdn.microsoft.com/magazine/dd882516.aspx"&gt;paper&lt;/a&gt; published by MSDN. They trimmed it a bit, so we're hosting the original &lt;a href="http://www.mockobjects.com/files/usingmocksandtests.pdf"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-337741654357909160?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2009/06/using-mocks-and-tests-to-design-role.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-2744820081195496219</guid><pubDate>Thu, 21 May 2009 21:30:00 +0000</pubDate><atom:updated>2009-05-21T22:32:24.657+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>news</category><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Another update to the book</title><description>We've gone very quiet for a while because we've been busy writing (and rewriting, and rewriting). We've reworked some of the example, and done some substantial clean-up in parts III and IV. 

Let us know on the list what you think.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-2744820081195496219?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2009/05/another-update-to-book.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-5950926793103686499</guid><pubDate>Thu, 02 Apr 2009 21:43:00 +0000</pubDate><atom:updated>2009-04-02T22:46:04.086+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Book. More and more</title><description>As the deadlines approach&amp;hellip;

We've published new chapters: another chapter in the example on handling failures, one on our approach to Object-Oriented design and one on how that relates to Mock Objects, and one on testing asynchronous code.

Enjoy&amp;mdash;and comment.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-5950926793103686499?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2009/04/book-more-and-more.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-3904585910047796341</guid><pubDate>Fri, 27 Mar 2009 11:05:00 +0000</pubDate><atom:updated>2009-03-27T11:10:10.093Z</atom:updated><category domain='http://www.blogger.com/atom/ns#'>news</category><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Book. More chapters posted</title><description>We've been quiet for a while because we've been trying to make progress with &lt;a href="http://www.mockobjects.com/book"&gt;the book&lt;/a&gt;. To let you know how we're doing, we've just posted some more draft chapters: there's more from the extended example, one on how to maintain ongoing TDD, and one on how to cope with threading.

As always comments welcome, and join the &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;discussion list&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-3904585910047796341?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2009/03/book-more-chapters-posted.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-4930483981012318712</guid><pubDate>Sat, 13 Dec 2008 20:16:00 +0000</pubDate><atom:updated>2008-12-13T20:18:13.612Z</atom:updated><category domain='http://www.blogger.com/atom/ns#'>mocks in action</category><category domain='http://www.blogger.com/atom/ns#'>news</category><title>googlemock</title><description>&lt;p&gt;Google have just announced googlemock, their C++ mocking framework. More details at &lt;a href="http://code.google.com/p/googlemock/"&gt;http://code.google.com/p/googlemock/&lt;/a&gt;. It looks like they've done a lot of work.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-4930483981012318712?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/12/googlemock.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-8036856493562093753</guid><pubDate>Thu, 27 Nov 2008 17:07:00 +0000</pubDate><atom:updated>2008-11-27T17:17:52.762Z</atom:updated><category domain='http://www.blogger.com/atom/ns#'>explanation</category><category domain='http://www.blogger.com/atom/ns#'>design</category><title>Only mock types you own (revisited)</title><description>&lt;p&gt;There was a brief discussion on the &lt;a href="http://archive.hausfoundation.org/lists/org.codehaus.jmock.user/msg/492E6E5D.2060209@historicalengineering.com"&gt;JMock mailing list&lt;/a&gt; recently where we helped out a new user. In the process, we noticed that he was mocking Java &lt;code&gt;Set&lt;/code&gt;, which we tend to avoid, because it's not a type that we own&amp;mdash;it's not in the domain of the problem we're trying to solve. The way I put it was,&lt;/p&gt;

&lt;blockquote&gt;We see a lot of people using, for example, &lt;code&gt;List&amp;lt;House&amp;gt;&lt;/code&gt; when what they actually mean is &lt;code&gt;Street&lt;/code&gt;. We try to use types we own that represent concepts in the domain, rather than built-in or library types which we keep for implementing these domain types. If the domain types are defined in terms of roles, then they're often appropriate for mocking.&lt;/blockquote&gt;

&lt;p&gt;Isiah followed up with an &lt;a href="http://isaiahperumalla.wordpress.com/2008/05/28/test-driven-design-using-mocks-lessons-learnt-part-2/"&gt;old post&lt;/a&gt; of his own.&lt;/p&gt;

&lt;p&gt;I think we have a satisfied customer:&lt;/p&gt;

&lt;blockquote&gt;Thank you Steve and Isiah, I think I just took a large step in the world  of TDD.&lt;/blockquote&gt;

&lt;p&gt;It's nice when that happens...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-8036856493562093753?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/11/only-mock-types-you-own-revisited.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-3204768351602030738</guid><pubDate>Thu, 27 Nov 2008 17:03:00 +0000</pubDate><atom:updated>2008-11-27T17:06:14.822Z</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>More example, reworking the process</title><description>We've posted some more chapters from the long worked example. We've also been reworking the material on the Process of TDD. Take a &lt;a href="http://www.mockobjects.com/book"&gt;look&lt;/a&gt;, and comments are always welcome.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-3204768351602030738?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/11/more-example-reworking-process.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-6215585331821856039</guid><pubDate>Thu, 25 Sep 2008 19:30:00 +0000</pubDate><atom:updated>2008-09-25T20:32:32.777+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>mocks in action</category><category domain='http://www.blogger.com/atom/ns#'>design</category><category domain='http://www.blogger.com/atom/ns#'>testability</category><title>TDD. Killing the messenger?</title><description>&lt;p&gt;Are we really doomed to another generation of procedural code masquerading as objects?&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/rosherove/archive/2008/09/20/goodbye-mocks-farewell-stubs.aspx"&gt;Roy Osherove&lt;/a&gt; has come out against "mocking" in favour of "isolating". One reading of his point is that mocking is just too hard for the bulk of the programmers he sees. Perhaps that's true (the others developers who discovered the technique are all very good) but I hope not (either that or I should increase my rates). And I'm pleased to see &lt;a href="http://ayende.com/Blog/archive/2008/09/23/cuddling-is-consider-harmful.aspx"&gt;Oren&lt;/a&gt;, for one, has responded.&lt;/p&gt;

&lt;p&gt;Roy addresses important issues which we need to think about, but we shouldn't pitch the whole industry at the level of its least skilled members; I've spent too much of my life cleaning up code that should never have been written in the first place. In the meantime, if his staff don't understand basic Object-Orientation, then that's what he should be teaching first, with a sprinkling of acceptance testing on top for regression.
&lt;/p&gt;

&lt;p&gt;Reading the post and its comments again, I see repeated "Doctor, it hurts when I do that" moments. Roy's response is to back off interaction testing, but that misses the experience and insight that led us into this situation in the first place. My call is that, like Object-Orientation, the technique is widely misunderstood, which is why the same objections keep coming back. This isn't a comfortable position.
&lt;/p&gt;

&lt;p&gt;To take the most obvious example, as Roy says himself, record/replay just doesn't cut it. That's why we've never supported it. It's easy to start with, but then my experience is that it encourages unmaintainable tests. It focusses the language of a test on the accident of the current implementation, rather than on the significant relationships between objects. It also encourages asserting every interaction, which leads to just the sort of problem that everyone complains about, brittle overspecified tests. That's why we don't do it, we only assert interactions that can affect the world around the object under test and stub the rest.
&lt;/p&gt;

&lt;p&gt;The other disaster (yes, I think record/replay has been a disaster) was our early attempt to mock the entire Java libraries. Apart from being unrealistic, it sent entirely the wrong message, emphasising isolating from databases over guiding the design. Later, Joe Walnes coined the notion of "Only Mock types you own", which really helped some people get the idea.
&lt;/p&gt;

&lt;p&gt;
As someone posted somewhere in this exchange, TDD will punish you if you don't understand design. I'd argue that that's what it's &lt;em&gt;for&lt;/em&gt;, and that it's essential to listen to what the tests are saying rather than turning down the volume.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-6215585331821856039?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/09/tdd-killing-messenger.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-1866667085705153978</guid><pubDate>Tue, 23 Sep 2008 07:44:00 +0000</pubDate><atom:updated>2008-09-23T19:19:13.152+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Reordering chapters</title><description>&lt;p&gt;We've cut down the introduction and moved some of the material into a new section, &lt;em&gt;Examining the Process&lt;/em&gt;. &lt;a href="/book"&gt;Check it out and let us know what you think&lt;/a&gt;. More content to follow soon.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-1866667085705153978?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/09/reordering-chapters.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-2018949831318665434</guid><pubDate>Thu, 04 Sep 2008 07:03:00 +0000</pubDate><atom:updated>2008-09-23T08:43:52.450+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Chapter 9. Passing the First Test</title><description>&lt;p&gt;We've posted &lt;a href="http://www.mockobjects.com/book/example.passing-the-first-test.html"&gt;another episode&lt;/a&gt; from our long worked example.&lt;/p&gt;

&lt;blockquote&gt;At the start of every test run, we need our test script to start up the Openfire server, create accounts for the Sniper and Auction, and then run the tests. Each test will start instances of the application and fake auction and test their communication through the server.&lt;/blockquote&gt;

&lt;p&gt;We've also made some changes in response to comments on &lt;a href="http://www.mockobjects.com/book/example.passing-the-first-test.html"&gt;the discussion list&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-2018949831318665434?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/09/chapter-9-passing-first-test.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-564167118864406992</guid><pubDate>Thu, 28 Aug 2008 09:44:00 +0000</pubDate><atom:updated>2008-08-28T10:47:46.592+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Long Worked Example</title><description>&lt;p&gt;We've posted the first couple of chapters of the long worked example from our book, &lt;a href="/book"&gt;Growing Object Oriented Software Guided by Tests&lt;/a&gt;.  It's work in progress: some of the diagrams have not been finished quite yet.  As ever, feedback is welcome via the &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;discussion group&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-564167118864406992?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/08/long-worked-example.html</link><author>noreply@blogger.com (Nat Pryce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-1932381629602196613</guid><pubDate>Thu, 21 Aug 2008 22:03:00 +0000</pubDate><atom:updated>2008-08-21T23:07:06.724+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>New Table of Contents Online</title><description>We've posted the new &lt;a href="/book/index.html"&gt;Table of Contents&lt;/a&gt;.  From now on, we'll update this as we put chapters online and shuffle content about.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-1932381629602196613?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/08/new-table-of-contents-online.html</link><author>noreply@blogger.com (Nat Pryce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-3832507931748878177</guid><pubDate>Thu, 21 Aug 2008 12:59:00 +0000</pubDate><atom:updated>2008-08-26T23:20:47.087+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Chapter 5. An Introduction to the Tools</title><description>&lt;p&gt;We have put a new chapter of the &lt;a href="http://www.mockobjects.com/2008/07/growing-object-oriented-software-guided.html"&gt;book&lt;/a&gt; online: &lt;a href="/book/tdd-tools-api-intro.html"&gt;Chapter 5. An Introduction to the Tools&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What happened to chapter 4?  We've moved some chapters around after reading people's comments in the &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;discussion group&lt;/a&gt; and will publish chapter 4 as soon as we've finished it and polished it up.  We'll put the new table of contents up ASAP.&lt;/p&gt;

&lt;p&gt;You can give comments and feedback via the &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;discussion group&lt;/a&gt; or as blog comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; explained why we are only giving a cursory introduction to the tools.  Improve explanation of why we chose JUnit and include where you can download it from.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-3832507931748878177?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/08/chapter-5-introduction-to-tools.html</link><author>noreply@blogger.com (Nat Pryce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-1327875878353912862</guid><pubDate>Wed, 06 Aug 2008 10:52:00 +0000</pubDate><atom:updated>2008-08-26T23:22:09.204+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Chapter 3. Kick-Starting the Test-Driven Cycle</title><description>&lt;p&gt;We have put a new chapter of the &lt;a href="http://www.mockobjects.com/2008/07/growing-object-oriented-software-guided.html"&gt;book&lt;/a&gt; online: &lt;a href="/book/kickstarting-tdd.html"&gt;Chapter 3. Kick-Starting the Test-Driven Cycle&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can give comments and feedback via the &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;discussion group&lt;/a&gt; or as blog comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; added a sidebar about kick-starting "brownfield" development.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-1327875878353912862?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/08/chapter-3-kick-starting-test-driven.html</link><author>noreply@blogger.com (Nat Pryce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-1803261065041684719</guid><pubDate>Fri, 25 Jul 2008 11:50:00 +0000</pubDate><atom:updated>2008-08-07T11:14:00.276+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Chapter 2. Test-Driven Development with Objects</title><description>&lt;p&gt;We are now publishing chapters of our book, &lt;a href="http://www.mockobjects.com/2008/07/growing-object-oriented-software-guided.html"&gt;Growing Object-Oriented Software Guided by Tests&lt;/a&gt; in a separate section of the site. We will publish news about new content in the blog but will not include the entire contents of each chapter as blog posts.&lt;/p&gt;
&lt;p&gt;We have updated Chapter 2, &lt;a href="/book/tdd-with-objects-intro.html"&gt;Test-Driven Development with Objects&lt;/a&gt; in response to feedback from blog comments and the &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;discussion group&lt;/a&gt; and improved some of the diagrams.  More comments are always welcome.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-1803261065041684719?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/07/chapter-2-test-driven-development-with.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-482063379702960285</guid><pubDate>Wed, 16 Jul 2008 12:13:00 +0000</pubDate><atom:updated>2008-07-16T13:16:47.975+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Book Discussion Group</title><description>&lt;p&gt;We have created a &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;Yahoo Group&lt;/a&gt; to host feedback and discussion about &lt;a href="http://www.mockobjects.com/2008/07/growing-object-oriented-software-guided.html"&gt;the book&lt;/a&gt; we're working on.  If you have &lt;em&gt;any&lt;/em&gt; feedback we'd love to hear from you.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-482063379702960285?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/07/book-discussion-group.html</link><author>noreply@blogger.com (Nat Pryce)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-6456729585893974156</guid><pubDate>Mon, 14 Jul 2008 20:34:00 +0000</pubDate><atom:updated>2008-08-07T11:13:12.330+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Chapter 1. What's the point of Test-Driven Development?</title><description>&lt;p&gt;We are now publishing chapters of our book, &lt;a href="http://www.mockobjects.com/2008/07/growing-object-oriented-software-guided.html"&gt;Growing Object-Oriented Software Guided by Tests&lt;/a&gt; in a separate section of the site. We will publish news about new content in the blog but will not include the entire contents of each chapter as blog posts.&lt;/p&gt;

&lt;p&gt;We have updated Chapter 1, &lt;a href="/book/tdd-introduction.html"&gt;What's the Point of Test-Driven Development?&lt;/a&gt; in response to feedback from blog comments and the &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;discussion group&lt;/a&gt; and improved some of the diagrams.  More comments are always welcome.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-6456729585893974156?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/07/chapter-point-of-test-driven.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>7</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-177692450366289973</guid><pubDate>Sun, 13 Jul 2008 22:49:00 +0000</pubDate><atom:updated>2008-08-21T23:02:16.592+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>growing object-oriented software</category><category domain='http://www.blogger.com/atom/ns#'>book</category><title>Growing Object-Oriented Software, Guided by Tests</title><description>&lt;p&gt;We have been working for some time on a book about our approach to developing software test-first. We've been working at it long enough that we though it was time to start putting up some material to get some feedback which, after all, is a technique we go on and &lt;i&gt;on&lt;/i&gt; about. We'll start with chapters in HTML, then add some PDFs on the side as the material grows.&lt;/p&gt;
&lt;p&gt;Here's our opening.&lt;/p&gt;

&lt;h3&gt;A Deceptively Simple Idea&lt;/h3&gt;
&lt;blockquote&gt;Test-Driven Development (TDD) is a deceptively simple idea: write the tests for your code before writing the code itself. We say “deceptively simple” because this reversal fundamentally changes the role that testing plays in the development process and challenges the industry's assumptions about what testing is for. Testing is no longer just about keeping defects from the users, instead it's about helping the team to understand the features that the users need and to deliver those features reliably and predictably. When followed to its conclusions, TDD radically changes the way we develop software and, in our experience, dramatically improves the quality of the systems we build, in particular their reliability and their flexibility in response to new requirements. &lt;/blockquote&gt;

&lt;blockquote&gt;Test-Driven Development is widely used in “agile” software development methods. It is a core practice of Extreme Programming (XP) [Beck99], is recommended by Crystal Clear [Cockburn04] and often used in Scrum™ [SB01] projects. If you're going to work on an agile project, you will probably use TDD. We've used TDD on every agile project we've been involved in and have snuck the practises in to non-agile projects. We've even found it useful in pure R&amp;D projects that explore possibilities rather than meet customer needs and so have no need of the customer-facing project management practices of agile methods.&lt;/blockquote&gt;

&lt;h3&gt;More...&lt;/h3&gt;

&lt;p&gt;The &lt;a href="/book/index.html"&gt;Table of Contents&lt;/a&gt; links to the published chapters.&lt;/p&gt;

&lt;h3&gt;Feedback and Discussion&lt;/h3&gt;

&lt;p&gt;If you want to give us feedback on what we've written so far and see what other people think about it, please join the &lt;a href="http://tech.groups.yahoo.com/group/growing-oo-software-guided-by-tests/"&gt;discussion group&lt;/a&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-177692450366289973?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/07/growing-object-oriented-software-guided.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>6</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-4742962158675255814</guid><pubDate>Thu, 05 Jun 2008 14:43:00 +0000</pubDate><atom:updated>2008-06-05T16:16:08.013+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>news</category><category domain='http://www.blogger.com/atom/ns#'>training</category><category domain='http://www.blogger.com/atom/ns#'>junit4</category><category domain='http://www.blogger.com/atom/ns#'>jmock</category><title>Public training courses?</title><description>&lt;p&gt;We've had a couple of inquiries about whether we will be running our &lt;a href="http://www.mockobjects.com/2008/05/learn-from-source.html"&gt;training course&lt;/a&gt; publicly. We hadn't planned to, but perhaps we should. We propose to run a two-day course priced at £1100 if booked less than 4 weeks ahead of the teach date, with a discount to £800 if booked earlier (plus UK VAT). The most obvious location is London (UK).&lt;/p&gt;

&lt;p&gt;If you think you might be interested (no commitment implied), please drop us an email at &lt;a href="mailto:public.course@mockobjects.com?subject=Prospective Course&amp;body=Name:%0ALondon is acceptable:%0APreferred other location:%0APreferred month for teach date:%0APossible number of attendees:%0ACoding experience (years):%0ATDD experience (years):%0AContact email:%0AContact phone:"&gt;public.course@mockobjects.com&lt;/a&gt; with this information:&lt;/p&gt;

&lt;pre&gt;
Name: 
London is acceptable:
Preferred other location:
Preferred month for teach date:
Possible number of attendees:
Coding experience (years): 
TDD experience (years):
Contact email:
Contact phone:
&lt;/pre&gt;

&lt;p&gt;We'll see if we can work something out&lt;/p&gt;

&lt;p style="font-size: 0.8em;"&gt;In case you're feeling nervous, whatever details we receive will be used only by us just to coordinate a course. We won't hassle you or pass them on to anyone else.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-4742962158675255814?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/06/public-training-courses.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-5676539118854047395</guid><pubDate>Fri, 30 May 2008 09:47:00 +0000</pubDate><atom:updated>2008-05-30T11:15:45.913+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>news</category><category domain='http://www.blogger.com/atom/ns#'>talk</category><title>Talk at London Geek Night.</title><description>&lt;p&gt;Nat and I gave a talk at the most recent &lt;a href="http://londongeeknights.wetpaint.com/page/Mocking+with+Java+Night"&gt;London Geek Night&lt;/a&gt;. It was an introduction to our approach to Test-Driven Development, incidentally making the point that some of the state- vs. interaction-based TDD wars are a bit specious; it's a matter of picking the right tool for the job. We had a good crowd and some useful questions. Afterwards, there was a Code Dojo in which Nat took part while I got stuck at the back talking to people. Thanks again to our hosts for an interesting evening.&lt;/p&gt;

&lt;p&gt;We've uploaded the &lt;a href="/files/talk-geeknight-2008.pdf"&gt;slides with notes&lt;/a&gt;. The format's a little odd because we used the toolchain we use for our &lt;a href="http://www.mockobjects.com/2008/05/learn-from-source.html"&gt;courses&lt;/a&gt;, but the material's all there.&lt;/p&gt;

&lt;p&gt;There are couple of other relevant links. Nils Haugen has a nice talk he did on &lt;a href="http://www4.java.no/presentations/javazone/2007/slides/5262.pdf"&gt;Improving Test Maintainability&lt;/a&gt;, which is about making sure the tests make sense. Our interest is more in the stage after that, which is about listening to &lt;a href="http://www.mockobjects.com/labels/listening%20to%20the%20tests.html"&gt;what the tests are telling you&lt;/a&gt; about the design of your code.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-5676539118854047395?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/05/talk-at-london-geek-night.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-6915536228811279767</guid><pubDate>Fri, 23 May 2008 16:37:00 +0000</pubDate><atom:updated>2008-06-05T15:42:47.951+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>news</category><category domain='http://www.blogger.com/atom/ns#'>training</category><category domain='http://www.blogger.com/atom/ns#'>junit4</category><category domain='http://www.blogger.com/atom/ns#'>jmock</category><title>Learn from the source!</title><description>&lt;p&gt;Nat, &lt;a href="http://www.cocking.co.uk/blog/"&gt;Romilly Cocking&lt;/a&gt;, and I are now open for business for training. We have a course on &lt;span style="font-weight:bold;"&gt;Test-Driven Development&lt;/span&gt; that reflects nearly a decade of experience writing tests first (that's 30 years in parallel). We also have significant experience in training, Romilly has a couple of decades on his own, and Nat and I have taught commercially and at two of the top CS departments in the country.&lt;/p&gt;

&lt;p&gt;The course teaches the practice of Test-Driven Development, based on a solid understanding of Object-Oriented design, and with a strong emphasis on making tests expressive and maintainable. We also make a point of exploring how unit tests can be used to &lt;span style="font-style:italic;"&gt;drive&lt;/span&gt; the design of the code, not just protect it.&lt;/p&gt;

&lt;p&gt;The content is modular, so we can adjust it to match the needs of the participants. The full-length course is three busy days, and we've taught versions that are a half-day and whole-day long.&lt;/p&gt;

&lt;p&gt;We teach the course using &lt;a href="http://sourceforge.net/projects/junit"&gt;jUnit4&lt;/a&gt;, &lt;a href="http://code.google.com/p/hamcrest/"&gt;Hamcrest&lt;/a&gt;, and (of course) &lt;a href="http://www.jmock.org"&gt;jMock2&lt;/a&gt;. Talk to us if you want something different.&lt;/p&gt;

&lt;p&gt;For more information, contact us at: &lt;span style="font-weight:bold;"&gt;training@mockobjects.com&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Here's what some attendees liked about the course:&lt;/p&gt;
&lt;blockquote&gt;&amp;ldquo;The practical exposure to a better way of testing&amp;rdquo;&lt;/blockquote&gt;
&lt;blockquote&gt;&amp;ldquo;Practical lab work, real-world concrete examples, Expert lecturers!&amp;rdquo;&lt;/blockquote&gt;
&lt;blockquote&gt;&amp;ldquo;Chance to make mistakes and learn. Exposure to new technology.&amp;rdquo;&lt;/blockquote&gt;
&lt;blockquote&gt;&amp;ldquo;A very good whole picture view of TDD and mocks&amp;rdquo;&lt;/blockquote&gt;
&lt;blockquote&gt;&amp;ldquo;Interaction and explanation of course materials particularly through the exercises.&amp;rdquo;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-6915536228811279767?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/05/learn-from-source.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-2597209967263939177</guid><pubDate>Sat, 08 Mar 2008 09:52:00 +0000</pubDate><atom:updated>2008-03-08T11:24:30.404Z</atom:updated><category domain='http://www.blogger.com/atom/ns#'>ide</category><category domain='http://www.blogger.com/atom/ns#'>design</category><category domain='http://www.blogger.com/atom/ns#'>testability</category><title>Another round in the testability debate</title><description>&lt;p&gt;This time a &lt;a href="http://blogs.msdn.com/ploeh/default.aspx"&gt;posting&lt;/a&gt; from Mark Seemann has raised a slew of comments.&lt;/p&gt; 
&lt;p&gt;One of them is a note from Colin Jack about the annoyance of producing interface/implementation pairs all the time. My first response is that that sounds to me a bit like a problem with style. Maybe it's just wordplay, but usually I don't &lt;span style="font-style:italic;"&gt;extract&lt;/span&gt; interfaces from classes, I &lt;span style="font-style:italic;"&gt;implement&lt;/span&gt; interfaces that I've already discovered in some previous test.&lt;/p&gt;

&lt;p&gt;My second response is to wonder how much this is a tools issue. I don't believe there's anything in the .Net world that yet matches the responsiveness of the usual Java IDE's. It makes a difference as to what's plausible. I remember the huge shift in perception when first VisualAge for Java and then JetBrains' Idea came out. In retrospect, I always spent more on time on rework than many people I worked with &lt;sup&gt;1&lt;/sup&gt; but it sure took a lot more time in emacs (and I was pretty good at it), even if I was working in a &lt;a href="http://modula3.org/"&gt;better language&lt;/a&gt;.
&lt;/p&gt;

&lt;hr/&gt;
&lt;p&gt;1) which is not to say who was right, I'm just wired that way...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-2597209967263939177?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/03/another-round-in-testability-debate.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>5</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-34908752.post-2795194424094785701</guid><pubDate>Tue, 12 Feb 2008 10:03:00 +0000</pubDate><atom:updated>2008-02-12T10:05:11.787Z</atom:updated><category domain='http://www.blogger.com/atom/ns#'>news</category><title>New Tutorial at QCon</title><description>On Tuesday 11th March, at QCon London, &lt;a href="http://www.cocking.co.uk/blog/"&gt;Romilly Cocking &lt;/a&gt;and I will be running a new tutorial we're developing with &lt;a href="http://nat.truemesh.com"&gt;Nat Pryce&lt;/a&gt; on 

&lt;a href="http://qcon.infoq.com/london/presentation/TDD+with+MockObjects"&gt;Test-Driven Development with Mock Objects&lt;/a&gt;

following on from a successful first run at the last XpDay. 

Sign up soon!&lt;div class="blogger-post-footer"&gt;&lt;a href="http://technorati.com/claim/e3dy57vh3k" rel="me"&gt;Technorati Profile&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34908752-2795194424094785701?l=www.mockobjects.com%2Findex.html' alt='' /&gt;&lt;/div&gt;</description><link>http://www.mockobjects.com/2008/02/new-tutorial-at-qcon.html</link><author>noreply@blogger.com (Steve Freeman)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item></channel></rss>