<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Object Mentor Blog</title>
    <link>http://blog.objectmentor.com</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>The 4-contact points of software development</title>
      <description>The three laws of &lt;span class="caps"&gt;TDD&lt;/span&gt; are:
	&lt;ul&gt;
	&lt;li&gt;Write no production code without a failing test&lt;/li&gt;
		&lt;li&gt;Write just enough of a test to fail&lt;/li&gt;
		&lt;li&gt;Write just enough production code to get the test to pass&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;This list doesn&amp;#8217;t include refactoring, which is typically an assumed activity. In fact, some people refer to these rules as &amp;#8220;red, green, refactor&amp;#8221;. An even older version of this, from the Smalltalk community, is Red, Green, Blue. (Why Blue for refactor? I think someone was thinking &lt;span class="caps"&gt;RBG&lt;/span&gt; for a color space, luckily they didn&amp;#8217;t try to use &lt;span class="caps"&gt;CMYK&lt;/span&gt; or &lt;span class="caps"&gt;LAB&lt;/span&gt;!)&lt;/p&gt;


	&lt;p&gt;In this simple model, there two kinds of code: test &amp;#38; production. There are two kinds of activity: writing &amp;#38; refactoring. Interestingly, at one level it is all code. The thing that distinguishes both sets is intent.&lt;/p&gt;


	&lt;p&gt;The intent of a test is to demonstrate or maybe specify behavior. The intent of production code is to implement (hopefully) business-relevant functionality.&lt;/p&gt;


	&lt;p&gt;The intent of writing code is creation. The intent of refactoring code is to change (hopefully improve) its structure without changing its behavior (this is oversimplified but essentially correct).&lt;/p&gt;


If you mix those combinations you have the&lt;i&gt; &lt;b&gt;4-limbs of development&lt;/b&gt;&lt;/i&gt;:
	&lt;ul&gt;
	&lt;li&gt;Writing a test&lt;/li&gt;
		&lt;li&gt;Writing production code&lt;/li&gt;
		&lt;li&gt;Refactoring a test&lt;/li&gt;
		&lt;li&gt;Refactoring production code&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;An important behavior to practice is doing only one of these at a time. That is, when you are writing tests, don&amp;#8217;t also write production code. Sure, you might use tools to stub out missing methods and classes, but the heart of what you are doing is writing a test. Finish that train of thought before focusing on writing production code.&lt;/p&gt;


	&lt;p&gt;On the other hand, if you are refactoring production code, do just that. Don&amp;#8217;t change tests at the same time, try to only do one refactoring at a time, etc.&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;WHY&lt;/span&gt;?&lt;/p&gt;


	&lt;p&gt;First an analogy that almost always misses since most developers don&amp;#8217;t additionally rock climb.&lt;/p&gt;


	&lt;p&gt;When rock climbing, a good general bit of advice is to only move one contact point at a time. For this discussion, consider your two hands and two feet as your four contact points. Sure, you can use your face or knee, but neither are much fun. So just considering two hands and two feet, that suggests that if, for example, you move your right hand, then leave your left hand and both feet in place.&lt;/p&gt;


	&lt;p&gt;This gives you stability, a chance to easily recover by simply moving the most recent appendage back in place and, when the inevitable happens, another appendage slips, you have a better chance of not eating rock face. If you move more than one thing at a time, you are in more danger because you&amp;#8217;ve taken a risky action and reduced the number of points of contact, or stability.&lt;/p&gt;


	&lt;p&gt;Will you sometimes move multiple appendages? Sure. But not as a habit. Sometimes you need to take risks. The rock face may not always offer up movement patterns that make applying this recommendation possible. Since you know the environment will occasionally work against you, you need to maintain some slack for the inevitable.&lt;/p&gt;


	&lt;p&gt;Practicing Test Driven Development is similar. If you change production code and tests at the same time, what happens if a test fails? What is wrong? The production code, the test, both, neither? An even more subtle problem is that tests pass but the test is fragile or heavily implementation-dependent. While not necessarily an immediate threat, it represents design debt that will eventually cause problems. (This also happens frequently when tests are written after the production code as it&amp;#8217;s seductively easy to write tests that exercise code, expressing the production&amp;#8217;s code implementation but fundamentally hiding the intent.)&lt;/p&gt;


	&lt;p&gt;Notice, if you had only refactored code, then you know the problem is in one place. When you change both, the problem space actually goes from 1 to 3 (4 if you allow for neither). Furthermore, if you are changing both production and test code at the same time and you get to a point where you&amp;#8217;ve entered a bottomless pit, you&amp;#8217;ll end up throwing away more work if you choose to restore from the repository.&lt;/p&gt;


	&lt;p&gt;Are there going to be times when you change both? Sure. Sometimes you may not see a clear path that gives you the option to do only one thing at a given time. Sometimes the tests and code will work against you. Often, you&amp;#8217;ll be working in a legacy code base where there are no tests. Given that the environment will occasionally (or frequently) work against you, you need to maintain some slack.&lt;/p&gt;


	&lt;p&gt;Essentially, be focused on a single goal at any given time: write a test. then get it to pass. clean up production code &amp;#38; keep the tests first unchanging and then passing.&lt;/p&gt;


	&lt;p&gt;I find that this is a hard thing both to learn and to apply. I frequently jump ahead of myself. Unfortunately I&amp;#8217;m &amp;#8220;lucky&amp;#8221; enough when I do jump ahead that when I fail, I thoroughly fall flat on my face.&lt;/p&gt;


	&lt;p&gt;This approach is contextual (aren&amp;#8217;t they all?). Every time you start working on code, you&amp;#8217;ll be faced with these four possibilities. Each time you are, you need to figure out what is the most important thing in the moment, and do that one thing. Once you&amp;#8217;ve taken care of the most important thing, you may have just promoted the second most important thing to first place. Even so, reassess. What is the most important thing now? Do that.&lt;/p&gt;


	&lt;p&gt;Good luck trying to apply this idea to your development work. I&amp;#8217;m interesting in hearing about it.&lt;/p&gt;</description>
      <pubDate>Thu, 19 Aug 2010 22:59:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:a43fda5f-eaf6-4d2d-bb76-34f395bebda2</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/08/19/the-4-contact-points-of-software-development</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>refactoring</category>
      <category>4</category>
      <category>contact</category>
      <category>points</category>
    </item>
    <item>
      <title>Is it worth killing trees over another C&amp;amp;#43;&amp;amp;#43; Book?</title>
      <description>&lt;p&gt;I&amp;#8217;ve taught a few C&amp;#43;&amp;#43; courses recently to people primarily moving from C to C&amp;#43;&amp;#43;. I know C&amp;#43;&amp;#43; has been around for years and it&amp;#8217;s not in vogue like it was 15 years ago. I stopped using it full time in 1997. Even so, there&amp;#8217;s been quite a bit of work on the library and language standard. And there are still a lot of places developing new systems with C&amp;#43;&amp;#43;. I know some people are still be learning C&amp;#43;&amp;#43; in school.&lt;/p&gt;


	&lt;p&gt;In my most recent classes, I&amp;#8217;ve been teaching students who have recently taken a class on &lt;span class="caps"&gt;OO A&lt;/span&gt; &amp;#38; D based on the work of Craig Larman. The C&amp;#43;&amp;#43; class attempts to follow that class by dovetailing into what it covers. Because of this, I did not use ObjectMentors&amp;#8217; standard C&amp;#43;&amp;#43; and &lt;span class="caps"&gt;OOD&lt;/span&gt; class. Good as it is, it has different starting assumptions. I instead wrote a class, using two problems as the entire basis of all the material I cover. I know, &amp;#8220;not build here syndrom.&amp;#8221; It pained me to do this, I did my research and I considered retro-fitting the OM course. The discrepancy was too large to consider reuse. And refactoring the existing class to accomodate changes, which I also considered, wasn&amp;#8217;t practical. Looking back I made the right decision.&lt;/p&gt;


So this course has a few key design elements:
	&lt;ul&gt;
	&lt;li&gt;Problem focused&lt;/li&gt;
		&lt;li&gt;Test oriented (sometimes test-first, other times test-driven, occasionally refactor-oriented)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The problem-focus limits the topic coverage. If something about the language doesn&amp;#8217;t come up somewhat naturally (not contrived) in the two projects I use, I don&amp;#8217;t cover the material. For example, I don&amp;#8217;t mention placement new, I only cover Multiple Inheritance if asked about it. I also try to focus on classes in the standard library. For example, std::array, std::vector, std::map, std::shared_ptr.&lt;/p&gt;


	&lt;p&gt;Additionally, there&amp;#8217;s an early focus on testing. That&amp;#8217;s another thing that&amp;#8217;s different from how I taught C&amp;#43;&amp;#43; say before 1995 &amp;#8211; I really didn&amp;#8217;t teach it from 1995 &amp;#8211; 2007, so no comments on what I might have done differently in that span of years.&lt;/p&gt;


	&lt;p&gt;To give you an idea of how early the focus is on test, I only show cout if asked. The first main() calls CommandLineTestRunner::RunAllTests and everything after that runs within a unit test. the last time I taught the class, I demonstrated tests executing with cslim, but still, a test focus.&lt;/p&gt;


	&lt;p&gt;I have them use unit tests as a way to experiment with the language. In one example, I have them write tests that force a method to become virtual that was not virtual before. In another case, I do the same thing with a virtual destructor. I have them test from raw pointers into shared_ptr and then update their code accordingly.&lt;/p&gt;


Because of the test focus, I make certain recommendations that impact overall class design. That means learning C&amp;#43;&amp;#43; with designs supporting testability early on. In C&amp;#43;&amp;#43; this means (among other things):
	&lt;ul&gt;
	&lt;li&gt;Dependency Injection (OK, this is not just C&amp;#43;&amp;#43;)&lt;/li&gt;
		&lt;li&gt;Virtual functions and by corollary a virtual destructor&lt;/li&gt;
		&lt;li&gt;Storing pointers because 1. calling methods through an auto object are not virtually dispatched, and 2. you cannot put references in the standard collections&lt;/li&gt;
		&lt;li&gt;Use std::shared_ptr to avoid memory leaks, which are detected by the unit testing tool I have them use.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I take the class to a certain level, but I make it clear I&amp;#8217;m just scratching the surface. I believe it&amp;#8217;s not really possible to learn C&amp;#43;&amp;#43; in a 1-week class. You can get the beginnings of proficiency and be in a good position to continue learning &amp;#8211; that&amp;#8217;s an assumption I state up front after the students have had their first exercise &amp;#8211; about 5 minutes into the start of the class. I try to only go into detail as the students ask questions, but at times I just want to really open up the beast and get into what&amp;#8217;s really happening.&lt;/p&gt;


	&lt;p&gt;To address this, I&amp;#8217;ve started novelizing the class I&amp;#8217;ve been teaching. I&amp;#8217;m following the same outline as the class, but I dive under the surface and at times get to quite a bit of detail that I would not typically get into in a 4.5 day class.&lt;/p&gt;


I know this material will augment the class. This will give my students three sources of information:
	&lt;ul&gt;
	&lt;li&gt;The class itself, which is exercise-driven&lt;/li&gt;
		&lt;li&gt;Online videos&lt;/li&gt;
		&lt;li&gt;A novelization of the class, going into much more detail&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The thing I&amp;#8217;m wondering is, would the book be worth making more generally available? I&amp;#8217;m writing it so that it can stand on its own. There&amp;#8217;s a certain advantage to knowing my students have taken the previous &lt;span class="caps"&gt;OO A&lt;/span&gt; &amp;#38; D class I mentioned because it uses a problem that I&amp;#8217;ve used on and off since 1992. This allows me to give examples from a problem they have looked at in the past and then at the current problem. I&amp;#8217;ve not yet made references to that problem in the book I&amp;#8217;m writing. I could, I just have not done so yet &amp;#8211; it&amp;#8217;s more natural in the second problem and I&amp;#8217;m still working on the first problem (and therefor the first half of the book). I&amp;#8217;m certain I can make those references without the previous class experience. (It&amp;#8217;s the Monopoly problem.)&lt;/p&gt;


In any case, I need to do some research. If I do start the publishing process, a key step involves competitive research. Can you recommend any books published for the first time this century (really in the past 7 years) that have any of these characteristics:
	&lt;ul&gt;
	&lt;li&gt;Cover a minimal set of C&amp;#43;&amp;#43;, enough for decent OO solutions&lt;/li&gt;
		&lt;li&gt;Have any kind of emphasis on test &amp;#8211; at least half the book?&lt;/li&gt;
		&lt;li&gt;Cover the language strictly through a problem-based approach rather than from a language perspective?&lt;/li&gt;
		&lt;li&gt;Involve deliberately making mistakes and observing those mistakes to learn how the language works?&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Additionally, can you recommend any great C&amp;#38;#43&amp;#38;#43 books? I can list many of the ones I&amp;#8217;ve read and enjoyed, but the last time I bought a book for myself on the topic, Amazon did not exist as an online company.&lt;/p&gt;


	&lt;p&gt;Independent of whether I deal with trying to get this thing published as a printed book, I&amp;#8217;m going to finish it because I think it will be useful to my students. I suspect I&amp;#8217;ll be teaching this class in the future, so I will find it useful in the future as well. If I don&amp;#8217;t attempt publishing it through a major publisher, I&amp;#8217;ll put it on my wiki at the very least. Though it&amp;#8217;s going to be quite a bit more effort than my typical wiki articles.&lt;/p&gt;


	&lt;p&gt;But the question I keep coming back to, is this: Is there really a need for this book dead tree version,  or it is primarily useful as supplemental material for a class I teach?&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;d like to hear your opinions.&lt;/p&gt;</description>
      <pubDate>Tue, 17 Aug 2010 00:17:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:66306ecb-5578-4490-9b17-69cd5da4547f</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/08/17/is-it-worth-killing-trees-over-another-c-43-43-book</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>43</category>
      <category>ood</category>
      <category>automated</category>
      <category>test</category>
    </item>
    <item>
      <title>Game Of Life with @lunivore</title>
      <description>&lt;p&gt;At the &lt;a href="http://coderetreat.com/how-it-works.html"&gt;#coderetreat&lt;/a&gt; in Orlando I spent an hour programming with &lt;a href="http://twitter.com/lunivore"&gt;@lunivore&lt;/a&gt; (Liz Keogh).  We worked in Clojure on Conway&amp;#8217;s game of life.  It was quite an experience!&lt;/p&gt;


	&lt;p&gt;Liz was not very familiar with Clojure, so I felt I had the advantage.  Wrong!  By the end of the hour she had taken charge and was programming rings around me.  It was a lot of fun; if a bit humbling.&lt;/p&gt;


	&lt;p&gt;Liz came into the session knowing the structure of the algorithm she wanted to implement.  She just didn&amp;#8217;t know how to implement it in Clojure.  When the starting gun was fired, she showed me a picture of a glider (a standard form in life) and said she wanted this to be the acceptance test.&lt;/p&gt;


	&lt;p&gt;During the session we wrote only a very few unit tests, each very focussed on one particular part of the problem.  The size of the steps was considerably larger than I am used to in Java or Ruby; yet it didn&amp;#8217;t seem to matter.  Writing functions in clojure is easy, and apparently far less error prone.&lt;/p&gt;


	&lt;p&gt;We finished 10 minutes before the end of the session, and had some time to refactor.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve posted the code below.  I&amp;#8217;ve cleaned it up a bit (being unable to leave it alone); but the algorithm remains the same; as are the tests.&lt;/p&gt;


&lt;script src="http://gist.github.com/526188.js"&gt; &lt;/script&gt;</description>
      <pubDate>Sun, 15 Aug 2010 20:40:21 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:7f23560e-7e6a-44c0-861c-f3bb7e794934</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/08/15/game-of-life-with-lunivore</link>
    </item>
    <item>
      <title>Nearly 22 years ago</title>
      <description>&lt;p&gt;Moved the article and the file. Reduced resolution from 300 dpi to 75 dpi (using a quartz filter on &lt;span class="caps"&gt;OS X&lt;/span&gt; from &lt;a href="http://discussions.apple.com/profile.jspa?userID=57524"&gt;Jerome Colas&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s the story with the updated location: &lt;a href="http://schuchert.wikispaces.com/IntorductionToMicrocomputersAndDataProcessing"&gt;The Moved Blog&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 11 Aug 2010 22:23:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6ce78f16-6696-4c53-a7d9-6151d4b81bd9</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/08/11/nearly-22-years-ago</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>old</category>
      <category>computer</category>
      <category>book</category>
      <category>FIRST</category>
      <category>the</category>
      <category>80</category>
      <category>s</category>
    </item>
    <item>
      <title>Getting Started With cslim in Visual Studio 2010 Using the Command Line Tools</title>
      <description>&lt;p&gt;Some of you asked for it. Here&amp;#8217;s something to get you started: &lt;blockquote&gt;&lt;a href="http://schuchert.wikispaces.com/cpptraining.UsingCSlimWithVisualStudio2010"&gt;http://schuchert.wikispaces.com/cpptraining.UsingCSlimWithVisualStudio2010&lt;/a&gt;&lt;/blockquote&gt;&lt;/p&gt;


	&lt;p&gt;These instructions are a work in progress and alpha. However, they do get the basics working.&lt;/p&gt;


	&lt;p&gt;If you are so inclined, have a look at the NMakefile (you&amp;#8217;ll come across it in the instructions) and give me a better way to build it.&lt;/p&gt;


	&lt;p&gt;I spent probably 8 hours getting a working environment (much yak shaving including a faulty mac book pro &lt;span class="caps"&gt;DVD&lt;/span&gt; drive). I then spent another 8 &amp;#8211; 10 hours getting this working. I worked through it about 5 times to minimize the amount of changes I needed to make to the original library source.&lt;/p&gt;


	&lt;p&gt;I ended up using some link and pre-processor seams to get most of this built. However, most of my time was spent trying to figure out the command line tools and their options.&lt;/p&gt;


	&lt;p&gt;If you can give me some guidance on improving this, I&amp;#8217;d like to hear it. However, this is now a low-burning thread, so some assembly required!&lt;/p&gt;


	&lt;p&gt;Enjoy,&lt;/p&gt;</description>
      <pubDate>Sun, 08 Aug 2010 22:08:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b9ed3dc1-bb3c-4c54-beb5-9f6785ea21c6</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/08/08/getting-started-with-cslim-in-visual-studio-2010-using-the-command-line-tools</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>cpp</category>
      <category>cslim</category>
      <category>visual</category>
      <category>studio</category>
      <category>2010</category>
    </item>
    <item>
      <title>Rough Notes on using FitNesse with C++</title>
      <description>&lt;p&gt;I&amp;#8217;ve been working with FitNesse.slim, using the cslim implementation to execute C++ code. I have some rough notes online. These should be enough to get started, though you&amp;#8217;ll need to be using G++ 4.4 or later.&lt;/p&gt;


	&lt;p&gt;In any case, have a look. Give me some feedback if you&amp;#8217;d like. I&amp;#8217;ll be working on these over the next month or so:
&lt;a href="http://schuchert.wikispaces.com/cpptraining.ExecutingBinaryOperators"&gt;http://schuchert.wikispaces.com/cpptraining.ExecutingBinaryOperators&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 30 Jul 2010 22:09:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:155f5034-8a3b-48d9-aa7c-d68584e51670</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/07/30/rough-notes-on-using-fitnesse-with-c</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>FitNesse</category>
      <category>cslim</category>
    </item>
    <item>
      <title>Preprocessor seams and assignment of responsibility</title>
      <description>In my &lt;a href="http://tinyurl.com/2fljzng"&gt;previous blog&lt;/a&gt; I mentioned adding a single method to the cslim library:
&lt;blockquote&gt;
&lt;b&gt;cslim/include/CSlim/SlimListSerializer.h:&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;void SlimList_Release(char *serializedResults);&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;b&gt;cslim/src/CSlim/SlimListSerializer.c:&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;void SlimList_Release(char *serializedResults)
{
  if(serializedResults)
    free(serializedResults);
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;

Now I&amp;#8217;m going to explain how I came across this need, what it took to figure it out and then why I picked this solution.
&lt;h2&gt;Background&lt;/h2&gt;
In FitNesse, Query Table Results are a list of list of list:

	&lt;ul&gt;
	&lt;li&gt;The outer-most list represents &amp;#8220;rows&amp;#8221;. It collects all objects found. It has zero or more entries.&lt;/li&gt;
		&lt;li&gt;The inner-most list represents a single field. It is a key value pair. It is a list of size 2. The first entry is the name of the field (column to FitNesse). The second field is the value. Both are strings.&lt;/li&gt;
		&lt;li&gt;The middle list represents a single object. It is a collection of fields. It has zero or more entires.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I understand the need for this representation and it takes a little bit to get it built correctly. So much so, I built a &lt;a href="http://github.com/schuchert/queryresultbuilder"&gt;simple tool to do it in java&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;C&amp;#43;&amp;#43; is no different. In fact, the authors of cslim though the same thing and they created a C Abstract Data Type to help out (and an add-on method to create the correct final form):&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;SlimList&lt;/li&gt;
		&lt;li&gt;SlimList_Serializer&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;They use C because it can be used by both C and C&amp;#43;&amp;#43;. I&amp;#8217;m using C&amp;#43;&amp;#43; and I wanted to make building query results even easier, so I built a QueryResultAccumulator. The most recent source is in the &lt;a href="http://tinyurl.com/2fljzng"&gt;previous blog&lt;/a&gt; and I&amp;#8217;ll be putting it on github after I&amp;#8217;ve had some more time to work on it.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s the progression to my QueryResultAccumulator class:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Wrote a Query-Table based fixture and followed the example provided with cslim (thank you for that!)&lt;/li&gt;
		&lt;li&gt;Moved the code from functions into methods on a class&lt;/li&gt;
		&lt;li&gt;Extracted a class, called SlimListWrapper, which made the fixture code easier to follow.&lt;/li&gt;
		&lt;li&gt;Went to get takeout and realized that I had named the class incorrectly and that it was really accumulating query results (thus the name). The SlimList was a mechanism, not an intent.&lt;/li&gt;
		&lt;li&gt;Refactored the class into QueryResultAccumulator (I left the original alone, created a new class, copied code from one to the other and changed it around a bit.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Now it might sound like I didn&amp;#8217;t have any tests. In fact, I did. I had my original Acceptance Test in FitNesse. I kept running that, so in a sense I was practicing &lt;span class="caps"&gt;ATDD&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;I was not happy with that, because I was not sure that I had properly handled memory allocation correctly. In fact, I had not. The final result is dynamically allocated and I was not releasing that. So I &amp;#8220;fixed&amp;#8221; it. (It needs to be released &lt;b&gt;after&lt;/b&gt; the return from slim back to FitNesse, so the typical pattern is to lazily delete it, or release it in a &amp;#8220;destroy&amp;#8221; method called after the execution of a single table.)&lt;/p&gt;


&lt;h2&gt;I have a memory leak?!&lt;/h2&gt;
I am simplifying this story a bit. So I&amp;#8217;m skipping some intermediate results. Ultimately I wrote the following test to check that you could use a single query result accumulator for multiple results correctly:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;TEST(QueryResultAccumulator, CanProduceFinalResultsMultipleTimes) {
    QueryResultAccumulator accumulator;
    accumulator.produceFinalResults();
    accumulator.produceFinalResults();
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;This caused a memory leak of 60 bytes. It was at this point I was up too late and banging my head against a wall. About 3 hours later I figured that out and went to bed. I fixed the problem and sent a patch to authors of cslim in maybe 45 minutes. So I should have gotten more sleep.&lt;/p&gt;


&lt;h2&gt;Where is that damn thing&lt;/h2&gt;
In any case, I visually checked the code. I debugged it. I did everything I could initially think of, and I was convinced that my code was correct. (As we&amp;#8217;ll see it both was and was not due to a preprocessor seam in cslim.) I got to the point where I even tried different versions of gcc. (I found a parsing error in g&amp;#43;&amp;#43; 4.5 when handling templates, so in desperation and late at night I wasted 5 minutes switching my compiler.)

I had the following code in my class:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;  if(result)
    free(result);&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;This was the correct thing, but it was in the wrong location. Again, this was related to a preprocessor seam in cslim.&lt;/p&gt;


&lt;h2&gt; Eureka!&lt;/h2&gt;
I looked at the cslim code and confirmed it was doing basic C stuff, nothing surprising. It was at that point that I remembered something important:
&lt;blockquote&gt;
cslim depends on CppUTest and uses a different malloc/free
&lt;/blockquote&gt;

	&lt;p&gt;Ah ha! That&amp;#8217;s it. So I tired to recompile my C&amp;#43;&amp;#43; code to use the same thing. However, I was not able to do that. CppUTest&amp;#8217;s memory tracking implementation does not work with many of the C&amp;#43;&amp;#43; standard classes like &amp;lt;string&amp;gt; and &amp;lt;vector&amp;gt;. So I could not compile my code using the same approach.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m glad this happened becuase it made me realize that it was the wrong place anyway. Here&amp;#8217;s the logic:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;CSlim has a preprocessor seam, comile with or without -Dfree=cpputest_free, -Dmalloc=cpputest_malloc&lt;/li&gt;
		&lt;li&gt;I&amp;#8217;m using a class in cslim to do the allocation, where the policy of allocation is stored&lt;/li&gt;
		&lt;li&gt;I should &lt;b&gt;not&lt;/b&gt; release the memory but instead allow the cslim library to release the memory becaue it has the allocation policy, and therefore the release policy.&lt;/li&gt;
	&lt;/ul&gt;


About 2 minutes later, I had added a single function to the library:
&lt;blockquote&gt;
&lt;b&gt;cslim/include/CSlim/SlimListSerializer.h:&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;void SlimList_Release(char *serializedResults);&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;b&gt;cslim/src/CSlim/SlimListSerializer.c:&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;void SlimList_Release(char *serializedResults)
{
  if(serializedResults)
    free(serializedResults);
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/blockquote&gt;

	&lt;p&gt;I updated my QueryResultAccumulator to use SlimList_Release and my false positive disappeared.&lt;/p&gt;


	&lt;p&gt;It also turns out that this improved symmetry in the library. To allocate and release entries in an SlimList you use the following functions:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;SlimList* SlimList_Create() &lt;/li&gt;
		&lt;li&gt;void SlimList_Destroy(SlimList*);&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Now to serlalize a list and release the memory later you use:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;SlimList_Serialize&lt;/li&gt;
		&lt;li&gt;SlimList_Release&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;As I write this, I think there&amp;#8217;s a better name. I&amp;#8217;ll let the authors give it a better name (like SlimList_Release_Serialization_Results). But in any case, if you use a function in the cslim library that allocates something, you use another method in the cslim library to release it.&lt;/p&gt;


	&lt;p&gt;Since the libray has a preprocessor seam, that symmetry removes a false-positive memory leak.&lt;/p&gt;


&lt;h2&gt;What took so long?&lt;/h2&gt;
I had an interesting time with this. Originally I had not released that memory in the class but rather in the unit test. I was working too late and not thinking clearly. I realized that my class needed to manage that.

	&lt;p&gt;When I called free in the unit test, it was calling the correct version of free, cpputest_free, becasue it was a unit test using CppUTest. When I moved the code into the class, which has no knowledge of CppUTest (nor can it), the flow of the code was correct, but the compilation (preprocessor symbols) were different and it caused a false positive.&lt;/p&gt;


	&lt;p&gt;Since I changed the code, I assumed it was a problem with how I changed the code. To me more clear, I though it was a code-flow problem, not a preprocessor seam problem. So I spent a lot of time verifyig my code. Once I determined it was correct, I then moved into debugger mode.&lt;/p&gt;


	&lt;p&gt;It was not long after that when I finally figured out what was going on.&lt;/p&gt;


&lt;h2&gt;Conslusions&lt;/h2&gt;
As with many things in life, this is intuitive once you understand it!-)

	&lt;p&gt;That cslim depends on CppUTest might be questionable. However, if I treat cslim as a (mostly) black box, and I don&amp;#8217;t know its allocation policy, I should not assume a deallocation policy.&lt;/p&gt;


	&lt;p&gt;By putting the responsiblity in the correct library level, it fixed the problem and added symmetry to the overall solution.&lt;/p&gt;


	&lt;p&gt;I also really enjoyed this (after it was done). I&amp;#8217;ve come across memory leaks using CppUTest in the past. Often they were my fault. Sometimes they were not. This was interesting because it both was and was not my fault. I originally had written the code incorrectly. When I put he correct steps in my code, I still had wrong code because I put the responsibility in the wrong place. It really was only correct after I moved the actual implementation into the library and then called it from my code that I had finally written it correctly.&lt;/p&gt;</description>
      <pubDate>Thu, 22 Jul 2010 10:32:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:dfbd2b43-7d99-443b-8325-bfa1b93ed842</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/07/22/preprocessor-seams-and-assignment-of-responsibility</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>FitNesse</category>
      <category>cslim</category>
      <category>assignment</category>
      <category>of</category>
      <category>responsibility</category>
      <category>malloc</category>
      <category>free</category>
      <category>preprocessor</category>
      <category>seam</category>
    </item>
    <item>
      <title>Some C++ Fixtures for FitNesse.slim</title>
      <description>&lt;p&gt;I continue working on these. I was stuck in the airport for 5 hours. Between that and the actual flight, I managed to create three different test examples against a C++ RpnCalculator. Each example uses a different kind of fixture. I had a request from @lrojas to publish some results on the blog. So this is that, however these are in progress and rough.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m still trying different forms to figure out what I like the best.&lt;/p&gt;


	&lt;p&gt;By the way, that lastValue stuff in the fixtures has to do with the fact that all of the hook methods return a char* but I&amp;#8217;m responsible for cleaning up after myself.&lt;/p&gt;


&lt;h2&gt;A Decision Table&lt;/h2&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;!|ExecuteBinaryOperator    |
|lhs|rhs|operator|expected?|
|3  |4  |-       |-1       |
|5  |6  |*       |30       |&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;And Its Fixture Code&lt;/h2&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string&amp;gt;
#include &amp;quot;RpnCalculator.h&amp;quot;
#include &amp;quot;OperationFactory.h&amp;quot;
#include &amp;quot;Fixtures.h&amp;quot;
#include &amp;quot;SlimUtils.h&amp;quot;

struct ExecuteBinaryOperator {
    ExecuteBinaryOperator() {
        lastValue[0] = 0;
    }

    int execute() {
        RpnCalculator calculator(factory);
        calculator.enterNumber(lhs);
        calculator.enterNumber(rhs);
        calculator.executeOperator(op);
        return calculator.getX();
    }

    static ExecuteBinaryOperator* From(void *fixtureStorage) {
        return reinterpret_cast&amp;lt;ExecuteBinaryOperator*&amp;gt;(fixtureStorage);
    }

    OperationFactory factory;
    int lhs;
    int rhs;
    std::string op;
    char lastValue[32];
};

extern &amp;quot;C&amp;quot; {
void* ExecuteBinaryOperator_Create(StatementExecutor* errorHandler, SlimList* args) {
    return new ExecuteBinaryOperator;
}

void ExecuteBinaryOperator_Destroy(void* self) {
    delete ExecuteBinaryOperator::From(self);
}

static char* setLhs(void* fixture, SlimList* args) {
    ExecuteBinaryOperator *self = ExecuteBinaryOperator::From(fixture);
    self-&amp;gt;lhs = getFirstInt(args);
    return self-&amp;gt;lastValue;
}

static char* setRhs(void* fixture, SlimList* args) {
    ExecuteBinaryOperator *self = ExecuteBinaryOperator::From(fixture);
    self-&amp;gt;rhs = getFirstInt(args);
    return self-&amp;gt;lastValue;
}

static char* setOperator(void *fixture, SlimList* args) {
    ExecuteBinaryOperator *self = ExecuteBinaryOperator::From(fixture);
    self-&amp;gt;op = getFirstString(args);
    return self-&amp;gt;lastValue;
}
static char* expected(void* fixture, SlimList* args) {
    ExecuteBinaryOperator *self = ExecuteBinaryOperator::From(fixture);
    int result = self-&amp;gt;execute();
    snprintf(self-&amp;gt;lastValue, sizeof(self-&amp;gt;lastValue), &amp;quot;%d&amp;quot;, result);
    return self-&amp;gt;lastValue;
}

SLIM_CREATE_FIXTURE(ExecuteBinaryOperator)
    SLIM_FUNCTION(setLhs)
    SLIM_FUNCTION(setRhs)
    SLIM_FUNCTION(setOperator)
    SLIM_FUNCTION(expected)
SLIM_END

}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
There&amp;#8217;s a bit of duplication. I&amp;#8217;ve been experimenting with pointers to member functions and template functions to make it better. I really should be using lambdas, but I&amp;#8217;m not there yet. I have them available in some form since I&amp;#8217;m using gcc 4.5. I simply compile with the option -sdd=c++0x. Even so, I&amp;#8217;m not quite ready to do that.

&lt;h2&gt;A Script Table&lt;/h2&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;!|script           |ProgramTheCalculator                   |
|startProgramCalled|primeFactorsOfSum                      |
|addOperation      |sum                                    |
|addOperation      |primeFactors                           |
|saveProgram                                               |
|enter             |4                                      |
|enter             |13                                     |
|enter             |7                                      |
|execute           |primeFactorsOfSum                      |
|check             |stackHas|3|then|2|then|2|then|2|is|true|&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;And Its Fixture Code&lt;/h2&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string&amp;gt;
#include &amp;quot;RpnCalculator.h&amp;quot;
#include &amp;quot;OperationFactory.h&amp;quot;
#include &amp;quot;SlimUtils.h&amp;quot;
#include &amp;quot;SlimList.h&amp;quot;
#include &amp;quot;Fixtures.h&amp;quot;

struct ProgramTheCalculator {
    ProgramTheCalculator() : calculator(factory) {
    }

    static ProgramTheCalculator* From(void *fixtureStorage) {
        return reinterpret_cast&amp;lt;ProgramTheCalculator*&amp;gt;(fixtureStorage);
    }

    OperationFactory factory;
    RpnCalculator calculator;
};

extern &amp;quot;C&amp;quot; {

void* ProgramTheCalculator_Create(StatementExecutor* errorHandler, SlimList* args) {
    return new ProgramTheCalculator;
}

void ProgramTheCalculator_Destroy(void *fixture) {
    delete ProgramTheCalculator::From(fixture);
}

static char* startProgramCalled(void *fixture, SlimList *args) {
    auto *self = ProgramTheCalculator::From(fixture);
    self-&amp;gt;calculator.createProgramNamed(getFirstString(args));
    return remove_const(&amp;quot;&amp;quot;);
}

static char* addOperation(void *fixture, SlimList *args) {
    auto *self = ProgramTheCalculator::From(fixture);
    self-&amp;gt;calculator.addOperation(getFirstString(args));
    return remove_const(&amp;quot;&amp;quot;);
}

static char* saveProgram(void *fixture, SlimList *args) {
    auto *self = ProgramTheCalculator::From(fixture);
    self-&amp;gt;calculator.saveProgram();
    return remove_const(&amp;quot;&amp;quot;);
}

static char* enter(void *fixture, SlimList *args) {
    auto *self = ProgramTheCalculator::From(fixture);
    self-&amp;gt;calculator.enterNumber(getFirstInt(args));
    return remove_const(&amp;quot;&amp;quot;);
}

static char* execute(void *fixture, SlimList *args) {
    auto *self = ProgramTheCalculator::From(fixture);
    self-&amp;gt;calculator.executeOperator(getFirstString(args));
    return remove_const(&amp;quot;&amp;quot;);
}

static char* stackHasThenThenThenIs(void *fixture, SlimList *args) {
    auto *self = ProgramTheCalculator::From(fixture);
    for(int i = 0; i &amp;lt; 4; ++i) {
            if(self-&amp;gt;calculator.getX() != getIntAt(args, i))
                return remove_const(&amp;quot;false&amp;quot;);
            self-&amp;gt;calculator.executeOperator(&amp;quot;drop&amp;quot;);
    }

      return remove_const(&amp;quot;true&amp;quot;);
}

SLIM_CREATE_FIXTURE(ProgramTheCalculator)
    SLIM_FUNCTION(startProgramCalled)
    SLIM_FUNCTION(addOperation)
    SLIM_FUNCTION(saveProgram)
    SLIM_FUNCTION(enter)
    SLIM_FUNCTION(execute)
    SLIM_FUNCTION(stackHasThenThenThenIs)
SLIM_END

}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
This one is a bit more regular. I am using the updated auto keyword in this code. The fixture is just holding the calculator and its OperationFactory (not my preferred name, but that&amp;#8217;s what students wanted to call things like +, -, etc, operations not operators).

&lt;h2&gt;The Dreaded Query Table&lt;/h2&gt;
It&amp;#8217;s a bit of a pain to produce query results. So much so, I wrote a simple library in Java to make it easier. I can create a well-formed query result from a single object or a list of objects and even do basic transforms (in names and in paths to data). I started using the jakarta bean utils, but my use was so simple (2 methods), I ripped out that library and just hand-wrote the methods I needed. It was not a case of &amp;#8220;not invented here syndrom.&amp;#8221; I started by using the library, and I had tests. I didn&amp;#8217;t like the size of the library relative to how much I was using it, so I just got rid of it.

	&lt;p&gt;Well here I am working C++ and I felt compelled to make it easier work with query results in C++.&lt;/p&gt;


First the FitNesse table, then the fixture and finally the support  class. I have tests for it as well, I&amp;#8217;m not going to show those, however.
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;!|Query: SingleCharacterNameOperators|
|op                                  |
|+                                   |
|*                                   |
|/                                   |
|!                                   |
|-                                   |&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;And Its Fixture Code&lt;/h2&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;string&amp;gt;
#include &amp;lt;memory&amp;gt;
#include &amp;quot;RpnCalculator.h&amp;quot;
#include &amp;quot;OperationFactory.h&amp;quot;
#include &amp;quot;Fixtures.h&amp;quot;
#include &amp;quot;SlimUtils.h&amp;quot;
#include &amp;quot;QueryResultAccumulator.h&amp;quot;

struct SingleCharacterNameOperators {
    OperationFactory factory;
    RpnCalculator calculator;

    SingleCharacterNameOperators() :
        calculator(factory), result(0) {
    }

    ~SingleCharacterNameOperators() {
        delete result;
    }
    static SingleCharacterNameOperators* From(void *fixtureStorage) {
        return reinterpret_cast&amp;lt;SingleCharacterNameOperators*&amp;gt; (fixtureStorage);
    }

    void resetResult(char *newResult) {
        delete result;
        result = newResult;
    }

    void conditionallyAddOperatorNamed(const std::string &amp;amp;name) {
        if (name.size() == 1) {
            accumulator.addFieldNamedWithValue(&amp;quot;op&amp;quot;, name);
            accumulator.finishCurrentObject();
        }
    }

    void buildResult() {
        v_string names = calculator.allOperatorNames();
        buildResult(names);
    }

    void buildResult(v_string &amp;amp;names) {
        for (v_string::iterator iter = names.begin(); iter != names.end(); ++iter)
            conditionallyAddOperatorNamed(*iter);

        resetResult(accumulator.produceFinalResults());
    }

    QueryResultAccumulator accumulator;
    char *result;
};

extern &amp;quot;C&amp;quot; {
void* SingleCharacterNameOperators_Create(StatementExecutor* errorHandler,
        SlimList* args) {
    return new SingleCharacterNameOperators;
}

void SingleCharacterNameOperators_Destroy(void *fixture) {
    delete SingleCharacterNameOperators::From(fixture);
}

static char* query(void *fixture, SlimList *args) {
    auto *self = SingleCharacterNameOperators::From(fixture);
    self-&amp;gt;buildResult();
    return self-&amp;gt;result;
}

SLIM_CREATE_FIXTURE(SingleCharacterNameOperators)
    SLIM_FUNCTION(query)SLIM_END
SLIM_END&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;And the Helper Class&lt;/h2&gt;
&lt;b&gt;QueryResultAccumulator.h&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#pragma once
#ifndef QUERYRESULTACCUMULATOR_H_
#define QUERYRESULTACCUMULATOR_H_

class SlimList;
#include &amp;lt;vector&amp;gt;
#include &amp;lt;string&amp;gt;
class QueryResultAccumulator {
public:
    typedef std::vector&amp;lt;SlimList*&amp;gt; v_SlimList;
    typedef v_SlimList::iterator iterator;

    QueryResultAccumulator();
    virtual ~QueryResultAccumulator();

    void finishCurrentObject();
    void addFieldNamedWithValue(const std::string &amp;amp;name, const std::string &amp;amp;value);
    char *produceFinalResults();

private:
    SlimList* allocate();
    void releaseAll();
    void setInitialConditions();

private:
    v_SlimList created;
    SlimList *list;
    SlimList *currentObject;
    int lastFieldCount;
    int currentFieldCount;
    char *result;

private:
    QueryResultAccumulator(const QueryResultAccumulator&amp;amp;);
    QueryResultAccumulator&amp;amp; operator=(const QueryResultAccumulator&amp;amp;);
};

#endif
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I know there are too many fields. The counts help with validating correct usage. I also wrote it so one instance could be re-used and I tried to make sure it was in a &amp;#8220;ready to receive fields&amp;#8221; state when necessary. In any case, this error checking helped find a defect I introduced while refactoring.&lt;/p&gt;


&lt;b&gt;QueryResultAccumulator.cpp&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#include &amp;quot;QueryResultAccumulator.h&amp;quot;
#include &amp;quot;DifferentFieldCountsInObjects.h&amp;quot;
#include &amp;quot;InvalidStateException.h&amp;quot;

extern &amp;quot;C&amp;quot; {
#include &amp;quot;SlimList.h&amp;quot;
#include &amp;quot;SlimListSerializer.h&amp;quot;
}

QueryResultAccumulator::QueryResultAccumulator() : result(0) {
    setInitialConditions();
}

QueryResultAccumulator::~QueryResultAccumulator() {
    releaseAll();
    SlimList_Release(result);
}

void QueryResultAccumulator::setInitialConditions() {
    releaseAll();
    list = allocate();
    currentObject = allocate();
    lastFieldCount = -1;
    currentFieldCount = -1;
}

SlimList* QueryResultAccumulator::allocate() {
    SlimList *list = SlimList_Create();
    created.push_back(list);
    return list;
}

void QueryResultAccumulator::releaseAll() {
    for (iterator i = created.begin(); i != created.end(); ++i)
        SlimList_Destroy(*i);
    created.clear();
}

void QueryResultAccumulator::finishCurrentObject() {
    if(lastFieldCount &amp;gt;= 0 &amp;amp;&amp;amp; lastFieldCount != currentFieldCount)
        throw DifferentFieldCountsInObjects(lastFieldCount, currentFieldCount);

    SlimList_AddList(list, currentObject);
    currentObject = allocate();

    lastFieldCount = currentFieldCount;
    currentFieldCount = -1;
}

void QueryResultAccumulator::addFieldNamedWithValue(const std::string &amp;amp;name, const std::string &amp;amp;value) {
    SlimList *fieldList = allocate();
    SlimList_AddString(fieldList, name.c_str());
    SlimList_AddString(fieldList, value.c_str());
    SlimList_AddList(currentObject, fieldList);
    ++currentFieldCount;
}

char* QueryResultAccumulator::produceFinalResults() {
    if(currentFieldCount != -1)
        throw InvalidStateException(&amp;quot;Current object not written&amp;quot;);

    SlimList_Release(result);
    result = SlimList_Serialize(list);
    setInitialConditions();
    return result;
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

Note, this code uses a method I added to the cslim library:
&lt;b&gt;SlimListSerializer.h &amp;#8211; in include/CSlim&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;void SlimList_Release(char *serializedResults);&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;b&gt;SlimListSerializer.c &amp;#8211; in src/CSlim&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;void SlimList_Release(char *serializedResults)
{
  if(serializedResults)
    free(serializedResults);
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;I needed to add these methods due to a false-positive memory leak indicated when using CppUTest to test this code. That&amp;#8217;s another blog.&lt;/p&gt;</description>
      <pubDate>Thu, 22 Jul 2010 00:32:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:63a89994-cb84-4422-b3c8-5ac5e7f53331</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/07/22/some-c-fixtures-for-fitnesse-slim</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>FitNesse</category>
      <category>cslim</category>
    </item>
    <item>
      <title>FitNesse, C++ and cslim, step-by-step instructions</title>
      <description>&lt;p&gt;Title says it all:
&lt;a href="http://schuchert.wikispaces.com/cpptraining.GettingStartedWithFitNesseInCpp"&gt;http://schuchert.wikispaces.com/cpptraining.GettingStartedWithFitNesseInCpp&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;First draft. If you have problems, please let me know.&lt;/p&gt;</description>
      <pubDate>Mon, 19 Jul 2010 23:26:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d1463d08-3298-4a46-bb72-4208f313a52a</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/07/19/fitnesse-c-and-cslim-step-by-step-instructions</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>FitNesse</category>
      <category>cslim</category>
    </item>
    <item>
      <title>A Few C plus plus TDD videos</title>
      <description>&lt;p&gt;Using CppUTest, gcc 4.4 and the Eclipse &lt;span class="caps"&gt;CDT&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;Rough, as usual.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.vimeo.com/album/254486"&gt;The Video Album&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Might redo first one with increased font size. Considering redoing whole series at 800&amp;#215;600.&lt;/p&gt;</description>
      <pubDate>Mon, 12 Jul 2010 06:30:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:a05f9c5f-4b90-46ab-9eaf-72750d3ae303</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/07/12/a-few-c-plus-plus-tdd-videos</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>c</category>
      <category>plus</category>
      <category>std</category>
      <category>tr1</category>
      <category>accumulate</category>
      <category>for_each</category>
      <category>bind</category>
      <category>_1</category>
      <category>refactoring</category>
      <category>array</category>
      <category>vector</category>
      <category>random</category>
    </item>
    <item>
      <title>Software Calculus - The Missing Abstraction.</title>
      <description>&lt;p&gt;The problem of infinity plagued mathematicians for millennia.  Consider Xeno&amp;#8217;s paradox; the one with Achilles and the tortoise.  While it was intuitively clear that Achilles would pass the Tortoise quickly, the algebra and logic of the day seemed to suggest that the Tortoise would win every race given a head start. &lt;em&gt;Every time&lt;/em&gt; Achilles got to where the tortoise was, the tortoise would have moved on.  The ancients had no way to see that an infinite sum could be finite.&lt;/p&gt;


	&lt;p&gt;Then came Leibnitz and everything changed.  Suddenly infinity was tractable.  Suddenly you could sum infinite series and write the equations that showed Achilles passing the tortoise.  Suddenly a whole range of calculations that had either been impossible or intractable became trivial.&lt;/p&gt;


	&lt;p&gt;Calculus was a watershed invention for mathematics.  It opened up vistas that we have yet to fully plumb.  It made possible things like Newtonian mechanics, Maxwell&amp;#8217;s equations, special and general relativity and quantum mechanics.  It supports the entire framework of our modern world.  We need a watershed like that for software.&lt;/p&gt;


	&lt;p&gt;If you listen to my keynote: &lt;a href="http://en.oreilly.com/rails2010/public/schedule/detail/14134"&gt;Twenty-Five Zeros&lt;/a&gt; you&amp;#8217;ll hear me go on and on about how even though software has changed a lot in form over the last fifty years, it has changed little in substance.  Software is still the organization of sequence, selection, and iteration.&lt;/p&gt;


	&lt;p&gt;For fifty years we have been inventing new languages, notations, and formulations to manage Sequence, Selection, and Iteration (SSI).  Structured Programming is simply a way to organize &lt;span class="caps"&gt;SSI&lt;/span&gt;.  Objects are another way to organize &lt;span class="caps"&gt;SSI&lt;/span&gt;.  Functional is still another.  Indeed, almost all of our software technologies are just different ways of organizing Sequence, Selection, and Iteration.&lt;/p&gt;


	&lt;p&gt;This is similar to Algebra in the days before calculus.  We knew how to solve linear and polynomial equations.  We knew how to complete squares and find roots.  But in the end it was all just different ways to organize adding.  That may sound simplistic, but it&amp;#8217;s not.  Subtracting is just adding in reverse.  Multiplying is just adding repeatedly.  Division is just multiplication in reverse.  In short, Algebra is an organizational strategy for adding.&lt;/p&gt;


	&lt;p&gt;Algebra went through many different languages and notations too, just like software has.  Think about Roman and Greek numerals.  Think how long it took to invent the concept of zero, or the positional exponential notation we use today.&lt;/p&gt;


	&lt;p&gt;And then one day Newton saw an apple fall, and he changed the way we &lt;em&gt;thought&lt;/em&gt; about mathematics.  Suddenly it wasn&amp;#8217;t about adding anymore.  Suddenly it was about infinities and differentials. Mathematical reasoning was raised to a new order of abstraction.&lt;/p&gt;


	&lt;p&gt;Where is that apple for software (pun intended).  Where is the Newton or Leibnitz that will transform everything about the way we &lt;em&gt;think&lt;/em&gt; about software.  Where is that long-sought new level of abstraction?&lt;/p&gt;


	&lt;p&gt;For awhile we thought it would be &lt;span class="caps"&gt;MDA&lt;/span&gt;.  Bzzzzt, wrong.  We thought it would be logic programming like prolog&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt;.  Bzzzt.   We thought it would be database scripts and 4GLs.  Bzzzt.  None of those did it.  None of those can do it.  They are still just various ways of organizing sequence, selection, and iteration.&lt;/p&gt;


	&lt;p&gt;Some people have set their sights on quantum computing.  While I&amp;#8217;ll grant you that computations with bits that can be both states simultaneously is &lt;em&gt;interesting&lt;/em&gt;, in the end I think this is just another hardware trick to increase throughput as opposed to a whole new way to think about software.&lt;/p&gt;


	&lt;p&gt;This software transformation, whatever it is, is coming.  It must come; because we simply cannot keep piling complexity upon complexity.   We need some new organizing principle that revamps the very foundations of the way we think about software and opens up vistas that will take us into the 22nd century.&lt;/p&gt;


	&lt;p id="fn1"&gt;&lt;sup&gt;1&lt;/sup&gt;  Prolog comes closest to being something more than a simple reorganization of sequence, selection, and iteration.  At first look logic programming seems very different.  In the end, however, an algorithm expressed in prolog can be translated into any of the other languages, demonstrating the eventual equivalence.&lt;/p&gt;</description>
      <pubDate>Mon, 05 Jul 2010 20:26:15 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4780351e-b2f2-4152-b4ef-0691cab0ff92</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/07/05/software-calculus-the-missing-abstraction</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>C++ Algorithms, Boost and function currying</title>
      <description>&lt;p&gt;I&amp;#8217;ve been experimenting with C++ using the Eclipse &lt;span class="caps"&gt;CDT&lt;/span&gt; and gcc 4.4. Since I&amp;#8217;m a fan of boost, I&amp;#8217;ve been using that as well. I finally got into I realistic use of boost::bind.&lt;/p&gt;


I converted this:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;int Dice::total() const {
  int total = 0;

  for(const_iterator current = dice.begin();
      current != dice.end();
      ++current)
    total += (*current)-&amp;gt;faceValue();

  return total;
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
Into this:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;int Dice::total() const {
  return std::accumulate(
      dice.begin(),
      dice.end(),
      0,
      bind(std::plus&amp;lt;int&amp;gt;(), _1, bind(&amp;amp;Die::faceValue, _2))
  );
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;To see how to go from the first version to the final version with lots of steps in between: &lt;a href="http://schuchert.wikispaces.com/cpptraining.SummingAVector"&gt;http://schuchert.wikispaces.com/cpptraining.SummingAVector&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;This is a first draft. I&amp;#8217;ll be cleaning it up over the next few days. If you see typos, or if anything is not clear from the code, please let me know where. Also, if my interpretation of what boost is doing under the covers (there&amp;#8217;s not much of that) is wrong, please correct me.&lt;/p&gt;


	&lt;p&gt;Thanks!&lt;/p&gt;</description>
      <pubDate>Sat, 12 Jun 2010 23:41:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:549aae6e-42fc-4ae7-ad78-126667918e8d</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/06/12/c-algorithms-boost-and-function-currying</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>cpp</category>
      <category>boost</category>
      <category>function</category>
      <category>currying</category>
      <category>std</category>
      <category>for_each</category>
      <category>vector</category>
      <category>shared_ptr</category>
      <category>accumulate</category>
    </item>
    <item>
      <title>TDD in Clojure</title>
      <description>&lt;p&gt;OO is a tell-don&amp;#8217;t-ask paradigm.  Yes, I know people don&amp;#8217;t always use it that way, but one of Kay&amp;#8217;s original concepts was that objects were like cells in a living creature.  The cells in a living creature do not ask any questions.  They simply tell each other what to do.  Neurons are tellers, not askers.  Hormones are tellers not askers.  In biological systems, (and in Kay&amp;#8217;s original concept for OO) communication was half-duplex.&lt;/p&gt;


	&lt;p&gt;Clojure is a functional language.  Functional languages are ask-dont-tell.  Indeed, the whole notion of &amp;#8220;tell&amp;#8221; is to change the state of the system.  In a functional program there is no state to change.  So &amp;#8220;telling&amp;#8221; makes little sense.&lt;/p&gt;


	&lt;p&gt;When we use &lt;span class="caps"&gt;TDD&lt;/span&gt; to develop a tell-don&amp;#8217;t-ask system, we start at the high level and write tests using mocks to make sure we are issuing the correct &amp;#8220;tells&amp;#8221;.  We proceed from the top of the system to the bottom of the system.  The last tests we write are for the utilities at the very bottom.&lt;/p&gt;


	&lt;p&gt;In an ask-don&amp;#8217;t-tell system, data starts at the bottom and flows upwards.  The operation of each function depends on the data fed to it by the lower level functions.  There is no mocking framework.  So we write tests that start at the bottom, and we work our way up the the top.&lt;/p&gt;


	&lt;p&gt;Therein lies the rub.&lt;/p&gt;


	&lt;p&gt;In a tell-don&amp;#8217;t-ask system, the tells at the high level are relatively complex.  They branch out into lower subsystems getting simpler, but more numerous as they descend.  Testing these tells using mocks is not particularly difficult because we don&amp;#8217;t need to depend on the lower level functions being there.  The mocks make them irrelevant.&lt;/p&gt;


	&lt;p&gt;In an ask-don&amp;#8217;t-tell system the asks at the low level are simple, but as the data moves upwards it gets grouped and composed into lists, maps, sets, and other complex data structures.  At the top the data is in it&amp;#8217;s most complex form.  Writing tests against that complex data is difficult at best.  And there is currently no way to mock out the lower levels&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt; so all tests written at the high level depend on all the functions below.&lt;/p&gt;


	&lt;p&gt;The perception of writing tests from the bottom to the top can be horrific at first.  Consider, for example, the &lt;a href="http://github.com/unclebob/clojureOrbit"&gt;Orbit program&lt;/a&gt; I just wrote.  This program simulates N-body gravitation.  Imagine that I am writing tests at the top level.  I have three bodies at position Pa, Pb, and Pc.  They have masses Ma, Mb, and Mc.  They have velocity vectors of Va, Vb, Vc.  The test I want to write needs to make sure that new positions Pa&amp;#8217;, Pb&amp;#8217;, Pc&amp;#8217;, and new Velocity vectors Va&amp;#8217;, Vb&amp;#8217;, and Vc&amp;#8217; are computed correctly.  How do I do that?&lt;/p&gt;


Should I write a test that looks like this?
&lt;pre&gt;
test-update {
  Pa = (1,1)
  Ma = 2
  Va = (0,0)

  Pb = (1,2)
  Mb = 3
  Vb = (0,0)

  Pc = (4,5)
  Mc = 4
  Vc = (0,0)

  update-all

  Pa should == (1.096, 4.128)
  Va should == (0.096, 3.128)

  Pb should == (1.1571348402636772, 0.1571348402636774)
  Vb should == (0.15713484026367727, -1.8428651597363226)

  Pc should == (3.834148869802242, 4.818148869802242)
  Vc should == (-0.16585113019775796, -0.18185113019775795)
}
&lt;/pre&gt;
A test like this is awful.  It&amp;#8217;s loaded with magic numbers, and secret information.  It tells me nothing about &lt;em&gt;how&lt;/em&gt; the update-all function is working.  It only tells me that it generated certain numbers.  Are those numbers correct?  How would I know?

	&lt;p&gt;But wait!  I&amp;#8217;m working in a &lt;em&gt;functional language&lt;/em&gt;.  That means that every function I call with certain inputs will &lt;em&gt;always&lt;/em&gt; return the same value; no matter how many times I call it.  Functions don&amp;#8217;t change state!  And that means that I can write my tests quite differently.&lt;/p&gt;


	&lt;p&gt;How does update-all work?  Simple, given a list of objects it performs the following operations (written statefully):&lt;/p&gt;


&lt;pre&gt;
  update-all(objects) {
    for each object in objects {
      accumulate-forces(object, objects)
    }
    for each object in objects {
      accelerate(object)
      reposition(object)
    }
  }
&lt;/pre&gt; 

	&lt;p&gt;This is written in stateful form to make is easier for our non-functional friends to follow.  First we accumulate the force of gravity between all the objects.  This amounts to evaluating Newton&amp;#8217;s F=Gm1m1/r^2 formula for each pair of objects, and adding up the force vectors.&lt;/p&gt;


	&lt;p&gt;Then, for each object we accelerate that object by applying the force vector to it&amp;#8217;s mass, and adding the resultant delta-v vector to it&amp;#8217;s velocity vector.&lt;/p&gt;


	&lt;p&gt;Then, for each object we reposition that object by applying the velocity vector to it&amp;#8217;s current position.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s the clojure code for update-all&lt;/p&gt;


&lt;pre&gt;
(defn update-all [os]
  (reposition-all (accelerate-all (calculate-forces-on-all os))))
&lt;/pre&gt;

	&lt;p&gt;In this code you can clearly see the bottom-to-top flow of the application.  First we calculate forces, then we accelerate, and finally we reposition.&lt;/p&gt;


	&lt;p&gt;Now, what do these -all functions look like?  Here they are:&lt;/p&gt;


&lt;pre&gt;
(defn calculate-forces-on-all [os]
  (map #(accumulate-forces % os) os))

(defn accelerate-all [os]
  (map accelerate os))

(defn reposition-all [os]
  (map reposition os))
&lt;/pre&gt;

	&lt;p&gt;If you don&amp;#8217;t read clojure, don&amp;#8217;t worry.  the map function simply creates a new list from an old list by applying a function to each element of the old list.  So in the case of reposition-all it simply calls reposition on the list of objects (os) producing a new list of objects that have been repositioned.&lt;/p&gt;


	&lt;p&gt;From this we can determine that the function of update-all is to call the three functions (accumulate-forces, accelerate, and reposition) on each element of the input list, producing a new list.&lt;/p&gt;


	&lt;p&gt;Notice how similar that is to a statement we might make about a high level method in an OO program.  (It&amp;#8217;s got to call these three functions on each element of the list).  In an OO language we would mock out the three functions and just make sure they&amp;#8217;d been called for each element.  The calculations would be bypassed as irrelevant.&lt;/p&gt;


	&lt;p&gt;Oddly, we can make the same statement in clojure.  Here&amp;#8217;s the test for update-all&lt;/p&gt;


&lt;pre&gt;
(testing "update-all" 
  (let [
    o1 (make-object ...)
    o2 (make-object ...)
    o3 (make-object ...)
    os [o1 o2 o3]
    us (update-all os)
    ]
    (is (= (nth us 0) (reposition (accelerate (accumulate-forces os o1)
    (is (= (nth us 1) (reposition (accelerate (accumulate-forces os o2)
    (is (= (nth us 2) (reposition (accelerate (accumulate-forces os o3)
    )
  )
&lt;/pre&gt;  

	&lt;p&gt;If you don&amp;#8217;t read clojure don&amp;#8217;t worry.  All this is saying is that we test the update-all function by calling the appropriate functions for each input object, and then see if the elements in the output list match them.&lt;/p&gt;


	&lt;p&gt;In an OO program we&amp;#8217;d find this dangerous because of side-effects.  We couldn&amp;#8217;t be sure that the functions could safely be called without changing the state of some object in the system.  But in a functional language it doesn&amp;#8217;t matter how many times you call a function.  So long as you pass in the same data, you will get the same result.&lt;/p&gt;


	&lt;p&gt;So this test simply checks that the appropriate three functions are getting called on each element of the list.  This is exactly the same thing an OO programmer would do with a mock object!&lt;/p&gt;


	&lt;h3&gt;Is &lt;span class="caps"&gt;TDD&lt;/span&gt; necessary in Clojure?&lt;/h3&gt;


	&lt;p&gt;If you follow the code in the Orbit example, you&amp;#8217;ll note that I wrote tests for all the computations, but did not write tests for the Swing-Gui.  This is typical of the way that I work.  I try to test all business rules, but I &amp;#8220;fiddle&amp;#8221; with the &lt;span class="caps"&gt;GUI&lt;/span&gt; until I like it.&lt;/p&gt;


	&lt;p&gt;If you look carefully you&amp;#8217;ll find that amidst the &lt;span class="caps"&gt;GUI&lt;/span&gt; functions there are some &amp;#8220;presentation&amp;#8221; functions that &lt;em&gt;could&lt;/em&gt; have been tested, but that I neglected to write with &lt;span class="caps"&gt;TDD&lt;/span&gt;[2].  These functions were the worst to get working.  I continuously encountered NPEs and Illegal Cast exceptions while trying to get them to work.&lt;/p&gt;


	&lt;p&gt;My conclusion is that Clojure without &lt;span class="caps"&gt;TDD&lt;/span&gt; is just as much a nightmare as Java or Ruby without &lt;span class="caps"&gt;TDD&lt;/span&gt;.&lt;/p&gt;


	&lt;h3&gt;Summary&lt;/h3&gt;


	&lt;p&gt;In OO we tend to &lt;span class="caps"&gt;TDD&lt;/span&gt; our way from the top to the bottom by using Mocks.  In Clojure we tend to &lt;span class="caps"&gt;TDD&lt;/span&gt; our way from the bottom to the top.  In either case we can compose our tests in terms of the functions they should call on the lower level objects.  In the case of OO we use mocks to tell us if the functions have been called properly.  This protects us from side-effects and allows us to decouple our tests from the whole system.  In clojure we can rely on the fact that the language is functional, and that no matter how many times you call a function it will return the same value.&lt;/p&gt;


	&lt;p id="fn1"&gt;&lt;sup&gt;1&lt;/sup&gt; Brian Marick is working on something that looks a lot like a mocking framework for clojure.  If his ideas pan out, we may be able to &lt;span class="caps"&gt;TDD&lt;/span&gt; from the top to the bottom in Clojure.&lt;/p&gt;


	&lt;p id="fn2"&gt;&lt;sup&gt;2&lt;/sup&gt; This is an unconscious game we all play with ourselves.  When we have a segment of code that we consider to be immune to &lt;span class="caps"&gt;TDD&lt;/span&gt; (like &lt;span class="caps"&gt;GUI&lt;/span&gt;) then we unconsciously move lots of otherwise testable code into that segment.  Yes, I heard my green band complain every time I did it; but I ignored it because I was in the &lt;span class="caps"&gt;GUI&lt;/span&gt;.  Whoops.&lt;/p&gt;</description>
      <pubDate>Thu, 03 Jun 2010 12:33:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:496c0f47-16d5-480d-9530-125b7ee235d8</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/06/03/tdd-in-clojure</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>Orbit in Clojure</title>
      <description>&lt;p&gt;I spent the last two days (in between the usual BS) writing a simple orbital simulator in Clojure using Java interop with Swing.  This was a very pleasant experience, and I like the way the code turned out &amp;#8211; even the swing code!&lt;/p&gt;


	&lt;p&gt;You can see the source code &lt;a href="http://github.com/unclebob/clojureOrbit"&gt;here&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Those of you who are experienced with Clojure, I&amp;#8217;d like your opinion on my use of namespaces and modules and other issues of style.&lt;/p&gt;


	&lt;p&gt;Those of you who are not experienced with Clojure, should start.  You might want to use this application as a tutorial.&lt;/p&gt;


	&lt;p&gt;And just have fun watching the simulation of the coalescence of an accretion disk around a newly formed star.&lt;/p&gt;</description>
      <pubDate>Wed, 02 Jun 2010 17:08:56 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6e0975f7-8396-4428-90d5-1500c373c64a</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/06/02/orbit-in-clojure</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>A Coverage Metric That Matters</title>
      <description>&lt;p&gt;How much test coverage should your code have?  80%?  90%?  If you&amp;#8217;ve been writing tests from the beginning of your project, you probably have a percentage that hovers around 90%, but what about the typical project?  The project which was started years ago, and contains hundreds of thousands of lines of code? Or millions of lines of code?  What can we expect from it?&lt;/p&gt;


	&lt;p&gt;One of the things that I know is that in these code bases, one could spend one&amp;#8217;s entire working life writing tests without doing anything else.  There&amp;#8217;s simply that much untested code. It&amp;#8217;s better to write tests for the new code that you write and write tests for existing code you have to change, at the time you have to change it.  Over time, you get more coverage, but your coverage percentage isn&amp;#8217;t a goal.  The goal is to make your changes safely.  In a large existing code base, you may never get more than 20% coverage over its lifetime.&lt;/p&gt;


	&lt;p&gt;Changes occur in clusters in applications.  There&amp;#8217;s some code that you will simply never change and there&amp;#8217;s other areas of code which change quite often.  The other day it occurred to me that we could use that fact to arrive at a better metric, one that is a bit less disheartening and also gives us a sense of our true progress.&lt;/p&gt;


	&lt;p&gt;The metric I&amp;#8217;m thinking about is percentage of commits on files which are covered by tests relative to the number of commits on files without tests.&lt;/p&gt;


	&lt;p&gt;In the beginning, you can expect to have a very low percentage, but as you start to get tests in place for changes that you make, your percentage will rise rapidly.  If you write tests for all of your changes, it will continue to rise.  At a certain point, you may want to track only a window of commits, say, the commits which have happened only in the last year.  When you do this, you can end up very close to 100%.&lt;/p&gt;


	&lt;p&gt;If you think this through, it might seem a bit dodgy on a couple of fronts.  The first is that having tests for code within a file does not mean that that code is completely covered by those tests.  But, I often find that the hardest part of getting started with unit testing is getting classes isolated enough from their dependencies to be testable in a harness at all.  Another dodgy bit is the fact that once you get some tests in place for a file, all of the commits you&amp;#8217;ve ever done for that file count in the percentage.  Again, that&amp;#8217;s okay for fundamentally the same reason.  Once you start getting coverage, you are in a good position with that particular code.&lt;/p&gt;


	&lt;p&gt;What about the moving window?  If you track this metric over, say, the last N months of commits, you&amp;#8217;ll progressively lose information about the code that you just aren&amp;#8217;t changing.  To me, that&amp;#8217;s fine.  Coverage matters for the code that we are changing.&lt;/p&gt;


	&lt;p&gt;The metric I&amp;#8217;m considering (maybe we can call it &amp;#8216;change coverage&amp;#8217;) gives us information about how tests are really impacting our day to day work.  Moreover, it&amp;#8217;s likely that it would be a good motivational tool, and really, that&amp;#8217;s one of the things that a good metric should be.&lt;/p&gt;</description>
      <pubDate>Fri, 28 May 2010 05:39:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:69f3cdd3-eff2-4646-9dd1-d0488a651525</guid>
      <author>Michael Feathers</author>
      <link>http://blog.objectmentor.com/articles/2010/05/28/a-coverage-metric-that-matters</link>
      <category>Michaels Musings</category>
    </item>
    <item>
      <title>Hello World Revisited</title>
      <description>&lt;p&gt;Surprising revelations while taking a &lt;span class="caps"&gt;TDD&lt;/span&gt; approach to writing hello world.&lt;/p&gt;


	&lt;p&gt;Here it nearly 21 years since I started writing in C++ (and more for C+) and I realize I&amp;#8217;ve been blindly writing main functions to actually do something.&lt;/p&gt;


	&lt;p&gt;This insanity must stop!&lt;/p&gt;


	&lt;p&gt;What am I talking about? &lt;a href="http://schuchert.wikispaces.com/Tdd.HelloWorld.Cpp"&gt;Read it here.&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 20 May 2010 10:12:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d09424a6-eb8f-4d9a-8025-35839675f928</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/05/20/hello-world-revisited</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>seam</category>
      <category>link</category>
    </item>
    <item>
      <title>Clojure Prime Factors</title>
      <description>&lt;p&gt;Can anyone create a simpler version of prime factors in Clojure?&lt;/p&gt;


&lt;pre&gt;
(ns primeFactors)

(defn of
  ([n]
    (of [] n 2))
  ([factors n candidate]
    (cond
      (= n 1) factors
      (= 0 (rem n candidate)) (recur (conj factors candidate) (quot n candidate) candidate)
      (&amp;gt; candidate (Math/sqrt n)) (conj factors n)
      :else (recur factors n (inc candidate))
      )
    )
  )
&lt;/pre&gt;</description>
      <pubDate>Sat, 15 May 2010 19:09:59 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:dc11f22c-be2f-4173-b06e-1f6926e7c70c</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/05/15/clojure-prime-factors</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>TDD is wasting time if...</title>
      <description>&lt;p&gt;You have no design sense.&lt;/p&gt;


	&lt;p&gt;OK, discuss.&lt;/p&gt;</description>
      <pubDate>Sat, 08 May 2010 10:36:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f6a0d637-2639-493f-ba51-4535409bd137</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/05/08/tdd-is-wasting-time-if</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>design</category>
    </item>
    <item>
      <title>Sufficient Design means Damned Good Design.</title>
      <description>&lt;p&gt;@JoshuaKerievsky wrote a &lt;a href="https://elearning.industriallogic.com/gh/submit?Action=PageAction&amp;#38;album=blog2009&amp;#38;path=blog2009/2010/sufficientDesign&amp;#38;devLanguage=Java"&gt;blog&lt;/a&gt; entitled &amp;#8220;Sufficient Design&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;Josh makes this point:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8216;Yet some programmers argue that the software design quality of every last piece of code ought to be as high as possible. &amp;#8220;Produce clean code or you are not a software craftsman!&amp;#8221;&amp;#8217;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;He goes on to say:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8220;Yet ultimately the craftsmanship advice fails to consider simple economics: If you take the time to craft code of little or moderate value to users, you&amp;#8217;re wasting time and money.&amp;#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Now this sounds like heresy, and I can imagine that software craftsmanship supporters (like me) are ready to storm the halls of Industrial Logic and string the blighter up by his toenails!&lt;/p&gt;


	&lt;p&gt;But hold on there craftsmen, don&amp;#8217;t get the pitchforks out yet. Look at the scenario that Josh describes.  It&amp;#8217;s quite revealing.&lt;/p&gt;


	&lt;p&gt;Josh&amp;#8217;s example of &amp;#8220;not being a craftsman&amp;#8221; is his niggling worry over a function that returns a string but in one derivative case ought to return a void.&lt;/p&gt;


	&lt;p&gt;Horrors!  Horrors!  He left a bit of evolved cruft in the design!  Revoke his craftsman license and sick the dogs on him!&lt;/p&gt;


	&lt;p&gt;Ah, but wait.  He also says that he spent a half-day trying to refactor this into a better shape but eventually had to give up.&lt;/p&gt;


	&lt;p&gt;The fool!  The nincompoop!  The anti-craftsman!  A pox on him and all his ilk!&lt;/p&gt;


&lt;hr&gt;

	&lt;p&gt;OK, enough hyperbole.  It seems to me that Josh was behaving exactly as a craftsman should.  He was worrying about exactly the kinds of things a craftsman ought to worry about.  He was making the kinds of pragmatic decisions a craftsman ought to make.  He was not leaving a huge mess in the system and rushing on to the next feature to implement.  Instead he was taking care of his code.  The fact that he put so much energy, time, and thought into such a small issue as an inconsistent return type speaks volumes for Josh&amp;#8217;s integrity as a software craftsman.&lt;/p&gt;


	&lt;p&gt;So, as far as Josh Kerievsky is concerned &amp;#8220;Sufficient Design&amp;#8221; is &amp;#8220;Pretty Damned Good Design&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;Look, all our software will have little tiny warts.  There&amp;#8217;s no such thing as a perfect system.  Craftsmen like Josh work hard to keep those warts as small as possible, and to sequester them into parts of the system where they can do the least harm.&lt;/p&gt;


	&lt;p&gt;So the only aspect of Josh&amp;#8217;s post that I disagree with is his contention that the &amp;#8220;craftsman&amp;#8221; message is one of unrelenting perfection.  Craftsmen are first and foremost pragmatists.  They seek very high quality code; but they are not so consumed with perfection that they make foolish economic tradeoffs.&lt;/p&gt;</description>
      <pubDate>Wed, 28 Apr 2010 18:02:10 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:7af1f4ce-c8d6-40c7-aa72-57d9c40f32be</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/04/28/sufficient-design-means-damned-good-design</link>
      <category>Uncle Bob's Blatherings</category>
      <category>Software Craftsmanship</category>
    </item>
    <item>
      <title>Certification:  Don't Waste Your Time!</title>
      <description>&lt;p&gt;As I have said before, there&amp;#8217;s nothing particularly wrong with the current mania for certification.  If you want to be certified at the cost of a 2-day course, by all means get certified.  If you want to certify people for attending your 2-day course, by all means hold the course and hand out the certificates.  It&amp;#8217;s all good.  Make money!  Be fruitful and multiply!&lt;/p&gt;


	&lt;p&gt;But be careful not to waste your time.&lt;/p&gt;


	&lt;p&gt;How could certification be a waste of time?  That depends on your motive.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;If you are getting certified in order to impress someone, like a hiring manager, or a recruiter, or your peers, &lt;em&gt;you are wasting your time.&lt;/em&gt;  Nobody worth impressing is going to find this certification impressive.  Indeed, the people you &lt;em&gt;really&lt;/em&gt; want to impress are likely to find it a bit mundane.  &lt;/li&gt;
		&lt;li&gt;If you are getting certified in order to get hired, &lt;em&gt;you are wasting your time&lt;/em&gt;.  Nobody is going to hire you simply because of that &amp;#8220;C&amp;#8221;, and nobody worth working for is going to require that &amp;#8220;C&amp;#8221;. &lt;/li&gt;
		&lt;li&gt;If you have decided to hire only &lt;em&gt;certified&lt;/em&gt; people, &lt;em&gt;you are wasting your time&lt;/em&gt;.  The population of certified people is not richer in talent, skill, or knowledge.  Indeed, it may be poorer.  Remember, those who have talent don&amp;#8217;t &lt;em&gt;need&lt;/em&gt; certification as much as those who don&amp;#8217;t.&lt;/li&gt;
	&lt;/ul&gt;


&lt;p/&gt;
&lt;br/&gt;

	&lt;p&gt;What part of certification is &lt;em&gt;not&lt;/em&gt; a waste of time?&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;The primary benefit you are getting is the instruction; but be careful: There are lots of pretty mediocre instructors out there.  Some of the instructors teach pretty good courses, but others are just hoping that all you care about is the certification.  &lt;/li&gt;
		&lt;li&gt;So do a little research and find the best instructors.  You may, in fact, find that some of the best instructors and courses do not offer certification.  That shouldn&amp;#8217;t stop you from considering them.&lt;/li&gt;
	&lt;/ul&gt;


&lt;p/&gt;
&lt;br/&gt;
But wait, aren&amp;#8217;t the instructors certified as trainers?

	&lt;ul&gt;
	&lt;li&gt;Sure.  They paid the money and took the course to become a certified trainer.  &lt;/li&gt;
		&lt;li&gt;But that doesn&amp;#8217;t necessarily mean that they:
	&lt;ul&gt;
	&lt;li&gt;are a good instructor.&lt;/li&gt;
		&lt;li&gt;know what they are teaching.&lt;/li&gt;
		&lt;li&gt;have done what they are teaching.&lt;/li&gt;
		&lt;li&gt;are qualified to teach &lt;em&gt;you&lt;/em&gt;.&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
	&lt;/ul&gt;


&lt;p/&gt;
&lt;br/&gt;
OK, but isn&amp;#8217;t there &lt;em&gt;some&lt;/em&gt; benefit to the certification itself?  

	&lt;ul&gt;
	&lt;li&gt;Sure.  A nice piece of paper.&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Tue, 27 Apr 2010 15:11:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:0bd59c14-765c-48d4-9a9f-537c09e56da7</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/04/27/certification-dont-waste-your-time</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>Pair Management</title>
      <description>&lt;p&gt;Every once in a while in life, you get a lucky break.  My lucky break was right as I was graduating from college.  One of my favorite professors told the class that there were some people interviewing potential hires on campus and they were looking for a programmer.  I remember standing dutifully outside his office, in line, waiting for my little mini-interview.  When it was my turn, they didn&#8217;t see me for a little while &#8211; the door stayed closed after they let the last interviewee out.  I found out later, that my professor was telling the interviewers that I was the guy that they wanted.&lt;/p&gt;


	&lt;p&gt;I came in, and showed them some code I&#8217;d written outside of schoolwork, and we talked about it.   I told them about my passion for programming languages and they said that the job would be at a research department and they needed someone to design and implement a new programming language. I was over the moon.  It was my dream job.  And, sure enough, it was real.  When I was hired, I sat down with my boss and went over ideas for syntax with him, and he pretty much left me alone for a couple of months to design the language, and implement a compiler for it.  I was sitting in my first job, with some real responsibility, struggling with &lt;span class="caps"&gt;YACC&lt;/span&gt;, designing a symbol table.  It was all very heady.&lt;/p&gt;


	&lt;p&gt;In retrospect, I was extremely lucky.   I not only had more individual trust and responsibility than many developers ever get in their career, I also became part of an extremely good working environment.  The guys who hired me, David Lopez de Quintana, and Carlos Perez, also ran the team I was part of.  We were a group of about four which eventually grew to about 12.  Although, we weren&#8217;t working on one big integrated project, we saw ourselves as a team and we had a great cooperative culture.   We each had our area of expertise, and most of us were in our 20s, ready to stretch.  We tackled all sorts of interesting problems at the intersection of software, mechanics, electronics, optics, physics, chemistry and biology.&lt;/p&gt;


	&lt;p&gt;About six months into the job, I had an odd experience.  Carlos called me to his office and told me he was going to give me my review.  I was a bit shocked.  The way I understood things, David was actually the guy I worked for, and Carlos headed up part of the team but not my part.  Carlos gave me a big smile and said &#8220;Yeah, well, you&#8217;ve been working for me for the past few months, but we didn&#8217;t tell you.&#8221;&lt;/p&gt;


	&lt;p&gt;The review went great and I happily went back to work.  I always knew that, on paper we were two different teams, but Dave and Carlos treated us as one big team.  We had one big meeting every week or so, and they shared responsibilities and pretty much kept us from having to care about anything outside the work we had to do.&lt;/p&gt;


	&lt;p&gt;It was a very cool experience.  Sometimes, Dave would spend more time outside the team, sort of managing our interface with the rest of the organization.  Part of the group wrote software to support research but we had customers outside of our group too.  Dave would be off at meetings, and Carlos would handle the day-to-day stuff with our team.  Sometimes they reversed the roles.  Dave would handle us day to day and Carlos would manage the world outside.  The thing is, no one was asking them to allocate responsibilities that way; they just found it a comfortable way of working.  It was pair management.  Sort of like pair-programming, but at the management level.&lt;/p&gt;


	&lt;p&gt;The funny thing is that I haven&#8217;t seen this much since.  Yes, I&#8217;ve visited organizations with teams that do something close to this, but it seems like all sorts of forces are aligned against it.  The thing which made it work for Dave and Carlos is that they were very good friends.  They were hired at the same time in entry-level non-management positions and they rose through the ranks together.  They saw each other outside work all the time and joked together at work, making it all a very rich experience.  Importantly, their manager never seemed to put them in competition with each other.  As I reflect on it more, I think that was the key.  Managers are often in competition with each other and that can impede the sort of collaboration and culture that Dave and Carlos built up.  They created a wonderful high-performing team.  It was one of those once in a lifetime things, and it&amp;#8217;s a time that I&#8217;ll always remember.&lt;/p&gt;


	&lt;p&gt;Whenever I think about team health and culture, that first team I joined is my benchmark.  I don&amp;#8217;t know where the magic came from, but it was there and I think that the culture that Dave and Carlos created with pair management was a very important part of it. In their interactions with each other, they provided a model for us, showing us how to treat each other at work.&lt;/p&gt;</description>
      <pubDate>Mon, 26 Apr 2010 04:52:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5391d702-b996-475b-b84d-604766493c1c</guid>
      <author>Michael Feathers</author>
      <link>http://blog.objectmentor.com/articles/2010/04/26/pair-management</link>
      <category>Michaels Musings</category>
    </item>
    <item>
      <title>The Tricky Bit</title>
      <description>&lt;p&gt;I once heard a story about the early days of the Concorde.  A british MP was on board for a demonstration flight.  As the jet went supersonic he disappointedly commented to one of the designers that it didn&amp;#8217;t feel any different at all.  The designer beamed and said: &amp;#8220;Yes, &lt;em&gt;that&lt;/em&gt; was the tricky bit.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;I wonder if the MP would have been happier if the plane had begun to vibrate and shake and make terrifying noises.&lt;/p&gt;


	&lt;p&gt;While at #openvolcano10, Gojko Adzic and Steve Freeman told the story of a company in which one team, among many, had gone agile.  Over time that team managed to get into a nice rhythm, passing it&amp;#8217;s continuous builds, adding lots of business value, working normal hours, and keeping their customers happy.  Meanwhile other teams at this company were facing delays, defects, frustrated customers, and lots of overtime.&lt;/p&gt;


	&lt;p&gt;The managers at this company looked at the agile team, working like a well-oiled machine, and looked at all the other teams toiling in vain at the bilge pump, and came to the conclusion that the project that the agile team was working on was too simple to keep them busy.  That the other teams&amp;#8217; projects were far more difficult.  It didn&amp;#8217;t even occur to them that the agile team had figured out the tricky bit.&lt;/p&gt;</description>
      <pubDate>Fri, 23 Apr 2010 04:28:35 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:51763c35-d308-49f1-8291-7aa690e33425</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/04/23/the-tricky-bit</link>
      <category>Uncle Bob's Blatherings</category>
      <category>Agile Methods</category>
    </item>
    <item>
      <title>The R.E.A.L.I.T.Y. principles of Agile Software Certification.</title>
      <description>&lt;p&gt;As you are probably aware the Scrum Alliance is planning to offer a &lt;em&gt;Certified Scrum Developer&lt;/em&gt; program.  You can read about it &lt;a href="http://www.scrumalliance.org/CSD"&gt;here&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Interestingly enough Microsoft, in collaboration with Ken Schwaber, is offering a &lt;em&gt;Professional Scrum Developer&lt;/em&gt; program.  You can read about that &lt;a href="http://www.scrum.org/newsandupdates/tag/certified-scrum-developer"&gt;here&lt;/a&gt; (look carefully at the url).&lt;/p&gt;


	&lt;p&gt;The scrum alliance program seems to be about agile skills.  The Microsoft program seems to be about Visual Studio.  So all is right with the world.&lt;/p&gt;


	&lt;p&gt;Is there anything wrong with this?  Is this somehow immoral or &lt;em&gt;bad&lt;/em&gt;?  Not at all.  This is just people doing what people do: Selling services and making money.  I&amp;#8217;m all for it.  I expect the courses to be of a quality that you&amp;#8217;d expect from professionals; and I&amp;#8217;m sure that students will learn useful information.  Indeed, from time to time, even I have offered &lt;span class="caps"&gt;CSM&lt;/span&gt; courses taught by people I trust and respect.&lt;/p&gt;


	&lt;p&gt;There are, however, some claims that need to be dealt with.  The most important is that these programs &lt;em&gt;shorten&lt;/em&gt; the recruiting process.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve been thinking about offering a &lt;em&gt;Certified Recruiter for Agile Professionals&lt;/em&gt; course.  This fifty-two week course will teach, and reteach, a number of principles of Agile Software Certification.  I call this repertoire of principles: R.E.A.L.I.T.Y.&lt;/p&gt;


	&lt;p&gt;The first principle is the &lt;em&gt;Redaction of Certification Principle&lt;/em&gt; (RCP).  The principle states:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&lt;em&gt;Certifications generally certify nothing whatever about experience, knowledge, or skill.  Generally they certify that the certificate holder has attended (or at least paid to attend) a course.  Perhaps they took (and maybe even passed) an exam based on that course.&lt;/em&gt;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Based on this principle, any recruiter taking my &lt;em&gt;Certified Recruiter for Agile Professionals&lt;/em&gt; course will not be allowed to complete the course or receive their certification until they have taken the following oath.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt; As a &lt;em&gt;Cerftified Recruiter for Agile Professionals&lt;/em&gt; I solemnly swear before Knuth and all here present:&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;blockquote&gt;
		&lt;p&gt;That before I read a resume, I will find every use of the word &amp;#8220;certified&amp;#8221; on that document and redact it with whiteout.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;blockquote&gt;
		&lt;p&gt;That if a candidate uses the word &amp;#8220;certified&amp;#8221; in an interview, I will ask the candidate to repeat him- or herself without using that word.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;blockquote&gt;
		&lt;p&gt;That I will pay &lt;em&gt;no&lt;/em&gt; attention whatever to any implications of that word, nor will that word in any way influence my opinions regarding that candidate.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;This oath is an exemplar of the &lt;em&gt;Certification Nullification Principle&lt;/em&gt; (CNP), which is another of the R.E.A.L.I.T.Y. principles of common sense and moderately competent thinking.  The principle states:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;The word &amp;#8220;certified&amp;#8221;, when used in the context of Agile Software Development, is a filler word that has no bearing on anything salient or interesting about individuals, skills, knowledge, or anything else.  It is a marketing word similar to &amp;#8220;new&amp;#8221;, &amp;#8220;improved&amp;#8221;, &amp;#8220;natural&amp;#8221; and &amp;#8220;organic&amp;#8221;.  It can safely be removed from all documents and discussions without changing their meaning.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;This principle leads to the well known &lt;em&gt;Certification Uncertainty Principle&lt;/em&gt; (CUP), yet another of the R.E.A.L.I.T.Y. principles.  This principle states:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Any acronym that includes the letter &amp;#8216;C&amp;#8217; standing for the word &amp;#8220;Certification&amp;#8221; can be safely changed into a similar acronym that eliminates the letter &amp;#8216;C&amp;#8217; and puts a &amp;#8217;?&amp;#8217; at the end.  This transformation of the acronym vastly improves the meaning of the orginal.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;That last sentence probably requires some justification.  After all, extraordinary claims require extraordinary substantiation.  So lets try a few experiments:&lt;/p&gt;


&lt;pre&gt;
Statement                    Ac'nm   CUP  Resulting Statement 
---------------------------- -----   ---- ---------------------
Certified Scrum Master        CSM    SM?  Scrum Master?
Certified Scrum Developer     CSD    SD?  Scrum Developer?
Certified Scrum Trainer       CST    ST?  Scrum Trainer?
Certified Scrum Professional  CSP    SP?  Scrum Professional?
Certified Scrum Product Owner CSPO   SPO? Scrum Product Owner?
Certified Scrum Coach         CSC    SC?  Scrum Coach?       
&lt;/pre&gt;

	&lt;p&gt;As we can see, the meanings of the statements are indeed clarified. In my course the &lt;em&gt;Certified Recruiter for Agile Professionals&lt;/em&gt; is taught that the question mark is the most significant aspect of each of the resultant statements.&lt;/p&gt;


	&lt;p&gt;In recent weeks we have uncovered a potentially profound new principle which we may find necessary to include in the R.E.A.L.I.T.Y. repertoire.  This is the so-called &lt;em&gt;Scrum Exclusion Principle&lt;/em&gt; (SEP) which tentatively states:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Wherever the word &lt;span class="caps"&gt;SCRUM&lt;/span&gt; appears in any statement, or is represented within any acronym, it can be safely excluded without changing any meaning.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;The following table show just how profound the effects of this principle are:&lt;/p&gt;


&lt;pre&gt;
Statement                    Ac'nm   CUP  SEP   Resulting Statement 
---------------------------- -----   ---- ----  ---------------------
Certified Scrum Master        CSM    SM?  M?    Master?
Certified Scrum Developer     CSD    SD?  D?    Developer?
Certified Scrum Trainer       CST    ST?  T?    Trainer?
Certified Scrum Professional  CSP    SP?  P?    Professional?
Certified Scrum Product Owner CSPO   SPO? PO?   Product Owner?
Certified Scrum Coach         CSC    SC?  C?    Coach?       
&lt;/pre&gt;

	&lt;p&gt;We are not yet willing to say that these transformation are a reliable feature of nature.  We can only say that, at this point, there are very troubling implications that support it.&lt;/p&gt;


	&lt;p&gt;Our final advice to &lt;em&gt;Certified Recruiters for Agile Professionals&lt;/em&gt; is based on one final principle: The &lt;em&gt;Smoke and Mirrors&lt;/em&gt; principle, (SAM) which states:&lt;/p&gt;


	&lt;p&gt;Well&amp;#8230;  You know what it states.&lt;/p&gt;</description>
      <pubDate>Wed, 21 Apr 2010 05:29:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9ebfb589-8dc1-482f-a1bc-b170e3605e75</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/04/21/the-r-e-a-l-i-t-y-principles-of-agile-software-certification</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>The Mayans are Coming!</title>
      <description>&lt;p&gt;This one is just a quickie; too long for a tweet.&lt;/p&gt;


	&lt;p&gt;I gave a lightning keynote (actually a key-rant) today at #accu2010.  It was about a bet between John Lakos and Kevlin Henney.  Kevlin &amp;#8220;won&amp;#8221; the bet last night by showing that he could get a C++ program to behave in a way that John said couldn&amp;#8217;t be done.  My rant was about how both of them were wrong (not technically, but morally) and so they both owed &lt;em&gt;me&lt;/em&gt; the sum of the bet.  (I&amp;#8217;m always happy to insert myself into any available revenue stream.)&lt;/p&gt;


	&lt;p&gt;The problem they had coded, and for which I presented a &lt;em&gt;far superior&lt;/em&gt; solution in Clojure, was that old work-horse of prob/stat: &amp;#8220;What&amp;#8217;s the probability that out of N people in a room two will have the same birthday?&amp;#8221;&lt;/p&gt;


	&lt;p&gt;Now, just to show you how strange James Bach is (and why his strangeness is in some bizarre way actually valuable); once my talk was done, James got up and said &amp;#8220;What if some of the people in the room are ancient Mayans who use a completely different kind of calendar making it impossible to compare their birthdays?&amp;#8221;&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve long said that testers were deviant souls with twisted minds that delight in reducing helpless software systems into piles of smoking slag.  I believe James may be the exemplar.&lt;/p&gt;</description>
      <pubDate>Sat, 17 Apr 2010 11:22:59 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:edce528f-1582-4928-b139-3d3393c0e5ae</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/04/17/the-mayans-are-coming</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>Parts 5 and 6 of the 4-part series</title>
      <description>&lt;p&gt;The title says it all. I was bothered by a few things in the Shunting Yard Algorithm (actually many more things), but I felt compelled to fix two of those things.&lt;/p&gt;


So if you have a &lt;a href="http://vimeo.com/album/210446"&gt;look at the album&lt;/a&gt;, you&amp;#8217;ll notice 2 more videos:
	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://vimeo.com/10979675"&gt;Video 5 of 4&lt;/a&gt;: Remove the need for spaces between tokens.&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10994492"&gt;Video 6 of 4&lt;/a&gt;: Remove duplication of operators in algorithm and tokenizer.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Hope these are interesting or at least entertaining.&lt;/p&gt;</description>
      <pubDate>Fri, 16 Apr 2010 20:57:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e2b52b26-ffe1-4953-8749-9f6987cb224a</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/04/16/parts-5-and-6-of-the-4-part-series</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>TDD</category>
      <category>visual</category>
      <category>studio</category>
      <category>resharper</category>
      <category>shunting</category>
      <category>yard</category>
      <category>algorithm</category>
      <category>dry</category>
      <category>SRP</category>
      <category>don</category>
      <category>t</category>
      <category>repeat</category>
      <category>yourself</category>
      <category>single</category>
      <category>responsibility</category>
      <category>Principle</category>
      <category>refactoring</category>
    </item>
    <item>
      <title>Sapient Testing: The &amp;quot;Professionalism&amp;quot; meme.</title>
      <description>&lt;p&gt;James Bach gave a stirring keynote today at &lt;span class="caps"&gt;ACCU 2010&lt;/span&gt;.  He described a vision of testing that our industry sorely needs.  Towit: Testing requires sapience.&lt;/p&gt;


	&lt;p&gt;Testing, according to Bach, is not about assuring conformance to requirements; rather it is about &lt;em&gt;understanding&lt;/em&gt; the requirements.  Even that&amp;#8217;s not quite right.  It is not sufficient to simply understand and verify the requirements.  A good tester uses the behavior of the system and the descriptions in the requirements, (and face-to-face interaction with the authors of both) to &lt;em&gt;understand the motivation behind the system&lt;/em&gt;.  Ultimately it is the tester&amp;#8217;s job to divine the system that the customer &lt;em&gt;imagined&lt;/em&gt;; and then to illuminate those parts of the system that are not consistent with that imagination.&lt;/p&gt;


	&lt;p&gt;It seems to me that James is attempting to define &amp;#8220;professionalism&amp;#8221; as it applies to testing.  A professional tester does not blindly follow a test plan.  A professional tester does not simply write test plans that reflect the stated requirements.  Rather a professional tester takes responsibility for &lt;em&gt;interpreting&lt;/em&gt; the requirements with intelligence.  He tests, not only the system, but also (and more importantly) the assumptions of the programmers, and specifiers.&lt;/p&gt;


	&lt;p&gt;I like this view.  I like it a lot.  I like the fact that testers are seeking professionalism in the same way that developer are.  I like the fact that testing is becoming a &lt;em&gt;craft&lt;/em&gt;, and that people like James are passionate about that craft.  There may yet be hope for our industry!&lt;/p&gt;


	&lt;p&gt;There has been a long standing frission between James&amp;#8217; view of testing and the Agile emphasis on &lt;span class="caps"&gt;TDD&lt;/span&gt; and automated tests.  Agilists have been very focussed on creating suites of automated tests, and exposing the insanity (and inanity) of huge manual testing suites.  This focus can be (and has been) misinterpreted as an &lt;em&gt;anti-tester&lt;/em&gt; bias.&lt;/p&gt;


	&lt;p&gt;It seems to me that professional testers are completely compatible with agile development.  No, that&amp;#8217;s wrong.  I think professional testers are &lt;em&gt;utterly essential&lt;/em&gt; to agile development. I don&amp;#8217;t want testers who rotely execute brain-dead manual test plans.  I want testers &lt;em&gt;using their brains&lt;/em&gt;!  I want testers to be partners in the effort to create world-class, high-quality software.  As a professional developer I want &amp;#8211; I need &amp;#8211; professional testers helping me find my blind spots, illuminating the naivete of my assumptions, and partnering with me to satisfy the needs of our customers.&lt;/p&gt;</description>
      <pubDate>Thu, 15 Apr 2010 06:18:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b9343975-d80a-4e70-86ef-41a3c95ec5fd</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/04/15/sapient-testing-the-professionalism-meme</link>
      <category>Uncle Bob's Blatherings</category>
      <category>Software Craftsmanship</category>
      <category>Agile Methods</category>
    </item>
    <item>
      <title>C# TDD Videos - You asked for them</title>
      <description>&lt;p&gt;Several people asked for them, so here is a series of 4 videos. The first series on the &lt;span class="caps"&gt;RPN&lt;/span&gt; calculator in Java was a bit rough, these are even rougher.&lt;/p&gt;


	&lt;p&gt;Even so, hope you find them valuable.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://vimeo.com/album/210446"&gt;Shunting Yard Algorithm in C# Video Album&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Comments and feedback welcome.&lt;/p&gt;</description>
      <pubDate>Wed, 14 Apr 2010 23:29:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1cbbb31c-687f-4789-97f7-496168f5d0e4</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/04/14/c-tdd-videos-you-asked-for-them</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>TDD</category>
      <category>visual</category>
      <category>studio</category>
      <category>resharper</category>
      <category>shunting</category>
      <category>yard</category>
      <category>algorithm</category>
    </item>
    <item>
      <title>Open Spaces at conferences, what's your take?</title>
      <description>&lt;p&gt;I&amp;#8217;m the host for an open space this year at &lt;a href="http://www.agiletestingdays.com/"&gt;Agile Testing Days 2010, Berlin&lt;/a&gt; (October 4th &amp;#8211; 7th, the open space being the 7th). I&amp;#8217;ve attended a few open spaces and I have some ideas on what the role of host might entail.&lt;/p&gt;


	&lt;p&gt;But, I know I&amp;#8217;m better at collecting requirements than sourcing them, so what have you experienced that worked. What has not worked. Any advice you want to give me?&lt;/p&gt;


	&lt;p&gt;Please help me better understand what I can do to facilitate a successful open space.&lt;/p&gt;


	&lt;p&gt;What questions should I be asking?&lt;/p&gt;


	&lt;p&gt;Do you think having a few things scheduled up front in one room, and several unscheduled rooms left to be determined October 4th &amp;#8211; 6th, through a a mix if you will, is an OK thing to do, or should what happens be left completely open?&lt;/p&gt;


	&lt;p&gt;Or, leave everything completely open until the 7th, then start with the &amp;#8220;traditional&amp;#8221; introductions and let the agenda form then an there?&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m aware of a few models of open spaces. What I really want to know is, what works for&lt;i&gt;  &lt;b&gt;you&lt;/i&gt;&lt;/b&gt;.&lt;/p&gt;</description>
      <pubDate>Wed, 07 Apr 2010 10:39:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:135e7271-d989-42a8-b37c-632b0b6ddc96</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/04/07/open-spaces-at-conferences-whats-your-take</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>open</category>
      <category>space</category>
      <category>agile</category>
      <category>testing</category>
      <category>days</category>
    </item>
    <item>
      <title>20% more bugs?  Or 20% less features?</title>
      <description>&lt;p&gt;People often make the argument that time to market is more important that quality.  I&amp;#8217;m not sure just what they mean by that.  Do they mean that it&amp;#8217;s ok if 20% of the features don&amp;#8217;t work so long as they deliver quickly?  If so, that&amp;#8217;s just stupid.  Why not develop 20% fewer features, and develop them well.  It seems to me that &lt;em&gt;choosing&lt;/em&gt; which 20% you are not going to develop and then &lt;em&gt;choosing&lt;/em&gt; to develop the other 80% to a high standard of quality is a better management decision than telling the developers to work sloppily.&lt;/p&gt;</description>
      <pubDate>Tue, 06 Apr 2010 22:03:23 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9282cb2f-5432-45d6-a819-1df5fde99b61</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/04/06/20-more-bugs-or-20-less-features</link>
      <category>Uncle Bob's Blatherings</category>
      <category>Clean Code</category>
    </item>
    <item>
      <title>First Pass Completed: Rough Draft TDD Demonstration Videos</title>
      <description>&lt;p&gt;As promised, I&amp;#8217;ve made a complete sweep through a series of videos. You can find all of them: &lt;a href="http://www.vimeo.com/album/205252"&gt;here&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;These videos include several warts and false starts. Depending on the interest and feedback, I&amp;#8217;ll redo these at some point in the future.&lt;/p&gt;


	&lt;p&gt;Question: Should I repeat this series in C#, or some other language? Some people have expressed interest in this. It&amp;#8217;s probably 15 hours of work in C#, so I&amp;#8217;d need to know it was worth the effort. What&amp;#8217;s your opinion on that?&lt;/p&gt;


The videos are meant to be watched in order. The link above is to an album that is in the correct order. Here are the direct links (also in the intended order):
	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://vimeo.com/10569751"&gt;Getting Started&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10570537"&gt;Adding Basic Operators&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10597511"&gt;Removing Duplication&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10597797"&gt;Extracting to Strategy&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10639853"&gt;Removing Duplication via Refactoring&lt;/a&gt; or &lt;a href="http://vimeo.com/10647496"&gt;Removing Duplication via Tdd using Mockito&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10647851"&gt;Introducing an Abstract Factory&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10679730"&gt;Adding a Sum operator&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10681803"&gt;Adding Prime Factors Operator&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10685388"&gt;Composing Operators and Programming the Calculator&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10686005"&gt;Using FitNesse to Program the Calculator&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I&amp;#8217;ve already received several comments both here on the blog as well as with the videos. I&amp;#8217;ll keep track of those comments and incorporate the ones that fit for me.&lt;/p&gt;


Each video has a link on its page to download it. However, to download a video, you will have to create an account and log in. So here are the links, these won&amp;#8217;t work without first creating an account (I&amp;#8217;ll update original blog with these as well):
	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18304530?v=2&amp;#38;e=1270570714&amp;#38;h=b96f13f4196fb68985933c1c21fb5806&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Getting Started Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18306776?v=2&amp;#38;e=1270570773&amp;#38;h=c38f8df6121e8df77af35fcd36e419bf&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Adding Basic Ops Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18366822?v=2&amp;#38;e=1270570794&amp;#38;h=407bf072c5fca10490bcf35d77ccf220&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Removing Duplication Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18367523?v=2&amp;#38;e=1270570821&amp;#38;h=318f20bb72e306d89fe8970ab7005ab0&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Extracting to Strategy&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18461046?v=2&amp;#38;e=1270570837&amp;#38;h=a77d9a69d45406e22265ab01b899c9f3&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Removing Dups/Refactoring Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18514764?v=2&amp;#38;e=1270570854&amp;#38;h=44c7be60020a70b78731eae5e5d9eb45&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Removing Dups/Tdd Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18507614?v=2&amp;#38;e=1270570871&amp;#38;h=1d52c79bdec4ab10c5201eb58b1024c7&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Abstract Factory Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18549114?v=2&amp;#38;e=1270570893&amp;#38;h=70bb69d0d935a26baf4048ec173bb6ae&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Sum Operator Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18553519?v=2&amp;#38;e=1270570907&amp;#38;h=e6147f1020074049b8047a38623940e7&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Prime Factors Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18561716?v=2&amp;#38;e=1270570924&amp;#38;h=5ef2bec871f87e2c694c7baaddab20b2&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Composing Math Operators Download&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/download/video:18563340?v=2&amp;#38;e=1270570944&amp;#38;h=cfe26669faf53b7521f6ef9b992311ec&amp;#38;uh=336ace2a37cb6bd8e82e9fac1c0b7f02"&gt;Using FitNesse Download&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Mon, 05 Apr 2010 01:15:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6b7e69d3-afbb-42a9-9d56-0319292ef786</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/04/05/first-pass-completed-rough-draft-tdd-demonstration-videos</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>mockito</category>
      <category>FitNesse</category>
      <category>video</category>
      <category>Eclipse</category>
      <category>Java</category>
    </item>
    <item>
      <title>Some Rough Draft TDD Demonstration Videos</title>
      <description>&lt;p&gt;I&amp;#8217;m doing a series of videos on &lt;span class="caps"&gt;TDD&lt;/span&gt;. The ultimate result will be a much more polished version with embedded slides, and such. But as a part of the development process, I&amp;#8217;m creating scratch videos.&lt;/p&gt;


	&lt;p&gt;Much of what you see in these videos will be in the final versions, but those are far in the future relative to this work.&lt;/p&gt;


	&lt;p&gt;Hope you find them interesting.&lt;/p&gt;


	&lt;p&gt;Comments welcome.&lt;/p&gt;


Here is what is already available:
	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://vimeo.com/10569751"&gt;Getting started&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10570537"&gt;Adding Operators&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


Next up:
	&lt;ul&gt;
	&lt;li&gt;Removing violation of Open/Closed principle&lt;/li&gt;
		&lt;li&gt;Removing duplication in operations with a combination of the Strategy pattern and the Template Method pattern&lt;/li&gt;
		&lt;li&gt;Adding new operators after the removal of duplication.&lt;/li&gt;
		&lt;li&gt;Reducing coupling by using the Abstract Factory pattern, Dependency Inversion and Dependency Injection&lt;/li&gt;
		&lt;li&gt;Adding a few more operations&lt;/li&gt;
		&lt;li&gt;Allowing the creation of complex &amp;#8220;programs&amp;#8221; or &amp;#8220;macros&amp;#8221; by using the Composite pattern &amp;#8211; and avoiding Liskov Substitution Principle inherent in the GoF version of the pattern&lt;/li&gt;
		&lt;li&gt;Driving the calculator via FitNesse + Slim&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Anyway, that&amp;#8217;s the plan. I&amp;#8217;ll try to add each of these videos over the next few weeks.&lt;/p&gt;</description>
      <pubDate>Tue, 30 Mar 2010 21:01:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f9144f21-6bbf-4e5d-b525-9e526c000fe8</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/03/30/some-rough-draft-tdd-demonstration-videos</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>bdd</category>
      <category>video</category>
      <category>demonstration</category>
      <category>design</category>
      <category>patterns</category>
      <category>SRP</category>
      <category>LSP</category>
      <category>OCP</category>
      <category>DIP</category>
    </item>
    <item>
      <title>Injecting Those Dependencies</title>
      <description>&lt;p&gt;Last week I was teaching a class with a good group of C++ developers in Chicago. They were up on C++, current standardization efforts, virtual machines, performance analysis and tuning. At one point I mentioned a metric for virtual method dispatch on the &lt;span class="caps"&gt;JVM&lt;/span&gt; and one of the students used my numbers to work backwards to determine the number of instructions on different processors.&lt;/p&gt;


	&lt;p&gt;I was teaching our Working Effectively with Legacy Code class. Michael Feathers usually teaches this class, but he was busy (probably working with legacy code somewhere, which, ironically, is why he wrote the book &amp;#8211; to solve the problem once and for all and to stop working with legacy code).&lt;/p&gt;


In an early project we have some problem code (the class was in Java, but we discussed C++ quite a bit):
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;    public void addEvent(Event event) {
        event.added();
        events.add(event);
        mailService.sendMail(&amp;quot;jacques@spg1.com&amp;quot;, &amp;quot;Event Notification&amp;quot;, event
                .toString());
        display.showEvent(event);
    }&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

The problem with this code, however, comes from what happens in the constructor:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;    public Scheduler(String owner, SchedulerDisplay display) {
        this.owner = owner;

        mailService = MailService.getInstance();
        this.display = new SchedulerDisplay();
    }&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;The display object is associated with a real device (OK, not in our simulation, but you get the point). We need to fix that dependency.&lt;/p&gt;


So we traditionally talk about a few ways to address that:
	&lt;ol&gt;
	&lt;li&gt;Create an interface and then have a concrete and test-double implementation&lt;/li&gt;
		&lt;li&gt;Create a test subclass&lt;/li&gt;
	&lt;/ol&gt;


Those are a few typical ways to handle this problem, but given that the students also worked in C++ and were very concerned with performance (and dynamic binding), so we discussed more alternatives:
1. Link seam &amp;#8211; build the system using the original SchedulerDispaly header file but link in a different version of the class. 2. Template parameter (compiler seam) &amp;#8211; introduce a template parameter and compile in the dependency rather than link it in.
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;#pragma once

template&amp;lt;class D&amp;gt; class Scheduler
{
public:
  Scheduler(D &amp;amp;display);
  ~Scheduler();
  void handleEvent();

private:
  D &amp;amp;display;
};&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

So here are 4 ways to remove the dependency (working bottom up in a sense):
	&lt;ol&gt;
	&lt;li&gt;Link seam: link in a different version of SchedulerDisplay&lt;/li&gt;
		&lt;li&gt;Compiler seam: use a template parameter&lt;/li&gt;
		&lt;li&gt;Dynamic seam: create a test subclass that removes external dependency&lt;/li&gt;
		&lt;li&gt;Dynamic seam: extract an interface from existing concrete class, and make Scheduler depend on the new interface.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;For C++, the first option might be a good option if it allows a very quick build/test cycle. Imagine using a class that brings in several unwanted dependencies. By making a test version replacement and linking to it, you might be able to get up and running quickly. On the other hand, you have to have a custom build target, which is really outside of the language.&lt;/p&gt;


The second option is good for C++ and maybe C#, but not Java. Java&amp;#8217;s implementation of generics is so bad, that it requires an interface for this particular case, so you end up with the final option anyway. Using templates puts the seam into the language rather than the build system. It will affect clients because either:
	&lt;ol&gt;
	&lt;li&gt;They will have to provide a template parameter&lt;/li&gt;
		&lt;li&gt;Or, by providing a default value for the template parameter, clients will be aware of a class they were not previously aware of. Still, a viable option, but it will increase build time at least a little.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;The third option may not work in any language without changing the original problem code. Imagine a no argument constructor that performs some static initialization. Without changing the constructor, you cannot guarantee that this approach will work. In any case, the problem as presented requires a change since the constructor was doing the initialization of the display; it did not allow for dependency injection.&lt;/p&gt;


	&lt;p&gt;The final option requires a bit more change, but is pretty flexible if you can afford the virtual method overhead. In Java this isn&amp;#8217;t much of an issue (for a number of reasons, mostly related to effective &lt;span class="caps"&gt;JIT&lt;/span&gt; optimization). The cost is a bit more of a problem in C++ because introducing a first virtual method is a big deal. Personally, I don&amp;#8217;t work on embedded systems, so I can generally ignore that problem. But this is not something to simply ignore, context does matter.&lt;/p&gt;


	&lt;p&gt;So which option is the best?&lt;/p&gt;


	&lt;p&gt;None of the above.&lt;/p&gt;


	&lt;p&gt;As a developer, you should probably be aware of all of these options (or maybe not the template option of you&amp;#8217;re strictly a Java developer). Then, when you are faced with a legacy coding problem, you&amp;#8217;ll have more tools from which to choose.&lt;/p&gt;</description>
      <pubDate>Mon, 22 Mar 2010 16:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:079869bc-e7ef-4708-9a69-7b24541bd190</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/03/22/injecting-those-dependencies</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>welc</category>
      <category>refactoring</category>
      <category>dependency</category>
      <category>injection</category>
    </item>
    <item>
      <title>Developer Certification WTF?</title>
      <description>&lt;p&gt;Watch the following video.  It will convince you that we have to do &lt;em&gt;something&lt;/em&gt; about the horrible state of software engineering.&lt;/p&gt;


&lt;object width="400" height="300"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9981123&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=9981123&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;p&gt;&lt;a href="http://vimeo.com/9981123"&gt;Bad Code&lt;/a&gt; from &lt;a href="http://vimeo.com/user947916"&gt;unclebob&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;

	&lt;p&gt;How could any team of disciplined professionals have produced a wretched mess like that?  Clearly they were ignorant of good practices. Clearly they were inexperienced novices.  Clearly their priorities and values were all wrong.  If only they had been taught good coding practices, and good development skills.  If only we could have gotten to them before they made such a horrible mess.&lt;/p&gt;


	&lt;p&gt;What we need to do is create a &lt;em&gt;certification program&lt;/em&gt; that provides developers with the knowledge and skills that they need.  This program will involve a course that teaches good development practice, and a &lt;em&gt;certification&lt;/em&gt; that they are now knowledgeable developers.  They can use that certification to prove to their employers and their fellow professionals that they are worthy of being considered true and clean software developers.&lt;/p&gt;


	&lt;p&gt;That&amp;#8217;s what we need.  Right?....&lt;/p&gt;


	&lt;h1&gt;&lt;strong&gt;Eagle&amp;#8217;s Entrails!  Deer Droppings!  and Elephant Phlatulence!&lt;/strong&gt;&lt;/h1&gt;


	&lt;p&gt;I&amp;#8217;m sorry, am I being vague?  Is my opinion not clear enough?  All right then, allow me to elaborate.&lt;/p&gt;


	&lt;h2&gt;What Problem does Certification solve?&lt;/h2&gt;


	&lt;p&gt;Certainly there are certification organizations who have the problem of dwindling revenues.  A new developer certification program would likely solve &lt;em&gt;their&lt;/em&gt; problem.&lt;/p&gt;


	&lt;p&gt;And just as certainly there are tin-men who need hearts, lions who need courage, scarecrows who need brains, and developers who need self-esteem. A new developer certification program might just help those lackluster developers.&lt;/p&gt;


	&lt;p&gt;But who else is served by a developer certification program?  Employers?&lt;/p&gt;


	&lt;h2&gt;The Trials of Hercules.&lt;/h2&gt;


	&lt;p&gt;Consider Doctors and Lawyers.  When a medical student earns an M.D., or a law student passes the Bar, that&amp;#8217;s an &lt;em&gt;achievement&lt;/em&gt;.  The certification, in those cases is deeply meaningful because the certification is &lt;em&gt;not easily won&lt;/em&gt;.  To get it you have to spend many years, and many tens of thousands of dollars.  What&amp;#8217;s more, you have to acquire in-depth knowledge and at least a modicum of provable skill.  You have to do something &lt;em&gt;significant&lt;/em&gt;.&lt;/p&gt;


	&lt;p&gt;If we had a developer certification like &lt;em&gt;that&lt;/em&gt;, then employers might find it useful.  But I know of no developer certification program (except for one that I&amp;#8217;ll mention later) that offers proof that the developer has accomplished anything of significance.  Most certification programs prove little more than that the &amp;#8220;developer&amp;#8221; paid to attend a 3-5 day course.  As an employer, I&amp;#8217;m not particularly interested in the ability of a developer to pay to attend a 3-5 day course.  As an employer I want to know what the developer can &lt;em&gt;do&lt;/em&gt;.&lt;/p&gt;


	&lt;h2&gt;Michaelangelo&amp;#8217;s Apprentice.&lt;/h2&gt;


	&lt;p&gt;If you were hiring a guitarist for your band, you might be very impressed with someone who toured with Clapton.  You don&amp;#8217;t get to tour with Clapton unless you are talented.  But more than just talented, you have to show up every day, you have to work well with others, you have to be willing to get the job done under pressure.  Clapton doesn&amp;#8217;t work with slouches!&lt;/p&gt;


	&lt;p&gt;A signed letter of recommendation from &lt;em&gt;Clapton&lt;/em&gt; is a certification of &lt;em&gt;significance&lt;/em&gt;!  Not just anyone can get one of those.  That letter will impress potential employers forever after.&lt;/p&gt;


	&lt;p&gt;As an employer, I want to hire people who have succeeded at working with others in the past.  The more I trust those others, the better!  No developer certification program that I know of (except for one that I&amp;#8217;ll mention later) provides that kind of credible reference.&lt;/p&gt;


	&lt;h2&gt;Over-promise and Under-deliver.&lt;/h2&gt;


	&lt;p&gt;The certification programs that I know of (except for one that I&amp;#8217;ll mention later) make implicit promises that they can&amp;#8217;t hope to begin to deliver.  The implied promise is that the certificant has been shown to have some &lt;em&gt;significant&lt;/em&gt; skill, ability, or knowledge.  The reality is that you have to look at the word &amp;#8220;significant&amp;#8221; through the wrong end of some very powerful binoculars before it matches the truth.  Indeed, there are certification programs that show absolutely nothing about the certificant except that they bought a seat in a class.&lt;/p&gt;


	&lt;p&gt;Notice that I said that the promises were &lt;em&gt;implicit&lt;/em&gt;.  That&amp;#8217;s the whole key to making lightweight certifications profitable.  The goal is to imply that the benefits of certification are so huge that people will pay to get the certification.  Often that implication can be as simple and subtle as the choice of words used to &lt;em&gt;name&lt;/em&gt; the certification.&lt;/p&gt;


	&lt;p&gt;Consider, for example, the title of &amp;#8220;Certified Development Chief&amp;#8221; imprinted on the certificate of someone who just took a &amp;#8220;Development Chief&amp;#8221; course.  Who wouldn&amp;#8217;t want to be a &lt;em&gt;Certified&lt;/em&gt; Development Chief?  And if you aren&amp;#8217;t a &lt;em&gt;Certified&lt;/em&gt; Development Chief, then what kind of Development Chief are you?&lt;/p&gt;


	&lt;h2&gt;A course, a card, and a Bridge to sell.&lt;/h2&gt;


	&lt;p&gt;What significant accomplishment can a developer make by paying to attend (or even actually attending) an 3-5 day course?  How credible a recommendation about any of the 20-odd students could an instructor of such a course make?  I can answer both questions in two words, with apologies to &lt;span class="caps"&gt;SNL&lt;/span&gt;.  &amp;#8220;Jack&amp;#8221; and &amp;#8220;Cheese&amp;#8221;.  The accomplishment is miniscule, and the recommendation is meaningless.&lt;/p&gt;


	&lt;p&gt;So as an employer of developers I think you can take your course and card and show it to some other sucker.  It don&amp;#8217;t impress me much.  Go away and come back later when you&amp;#8217;ve accomplished the trials of Hercules and apprenticed under Michaelangelo.  And make sure you bring letters of reference.  &lt;span class="caps"&gt;NEXT&lt;/span&gt;!&lt;/p&gt;


	&lt;h2&gt;The one I said I&amp;#8217;d mention later.&lt;/h2&gt;


	&lt;p&gt;I&amp;#8217;ve got an idea for a certification program that just might work.  Now, bear with me because this is a little complicated.  It&amp;#8217;s an idea so revolutionary, so different, so incredibly &lt;em&gt;new&lt;/em&gt; that I&amp;#8217;m getting giddy just thinking about it.&lt;/p&gt;


	&lt;p&gt;What if we asked young graduates to actually get jobs as &amp;#8220;interns&amp;#8221; for awhile.  What if we gave out responsibility to them in small incremental measures.  What if they gradually learned more and more things while working for us.  What if we guided them to ever greater accomplishments.  What if we slowly gave them trials of Hercules to follows, and had them work with Michaelangelos.&lt;/p&gt;


	&lt;p&gt;Of course some of our people might leave and go to greener pastures.  We&amp;#8217;ll need to replace them.  Also, our company might succeed and grow, so we&amp;#8217;ll need to hire more good developers.  So what if we&amp;#8230;&lt;/p&gt;


	&lt;p&gt;OK, now hold on to your hat because this is where it gets really tricky.   You might want to get up and walk around a bit, get a diet coke, eat a twinkie, or something to get your brain working.&lt;/p&gt;


	&lt;p&gt;Ready?  OK, here we go&amp;#8230;&lt;/p&gt;


	&lt;p&gt;So what if we&amp;#8230; &lt;em&gt;interviewed&lt;/em&gt; ... candidate developers?  What if we asked them what accomplishments they&amp;#8217;d achieved in previous employment.  What if we asked them who they used to work with.  And&amp;#8230;  ok, this is even wilder   ...  what if we &lt;em&gt;called&lt;/em&gt; those references and checked them out?&lt;/p&gt;


	&lt;p&gt;Are you still with me?&lt;/p&gt;


	&lt;p&gt;What if we&amp;#8230;.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Naaaaahhhhh.&lt;/em&gt;  Dumb idea.&lt;/p&gt;


	&lt;p&gt;Honestly, I think I&amp;#8217;ve wasted your time.  It&amp;#8217;s a stupid idea.  Never mind.  We should all just go get certified instead.&lt;/p&gt;</description>
      <pubDate>Sun, 07 Mar 2010 12:16:43 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:0867886b-db75-4f5a-a52c-c00ea09f6b89</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/03/07/developer-certification-wtf</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>One way to configure FitNesse for team Development</title>
      <description>&lt;p&gt;Here are some notes (and instructions) on a way to configure FitNesse for use in a team environment: &lt;a href="http://schuchert.wikispaces.com/FitNesse.PageHierarchyForTeamDevelopment"&gt;Page Hierarchy For Team Development&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Comments and suggestions welcome.&lt;/p&gt;</description>
      <pubDate>Fri, 19 Feb 2010 14:12:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:35d8f8e2-f3c5-4b68-a893-9d8e457c67ed</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/02/19/one-way-to-configure-fitnesse-for-team-develomment</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>FitNesse</category>
      <category>team</category>
      <category>development</category>
      <category>server</category>
      <category>configuration</category>
    </item>
    <item>
      <title>Updated ConTest Instructions</title>
      <description>&lt;p&gt;Just updated the instructions for using ConTest &amp;#8211; a tool to assist in testing concurrent applications for Java. Check them out here: &lt;a href="http://tinyurl.com/ydq83rn"&gt;ConTest Instructions&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 18 Feb 2010 12:12:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:fb2adb07-9afb-44d4-9f18-f8efe67dd563</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/02/18/updated-contest-instructions</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>concurrent</category>
      <category>testing</category>
    </item>
    <item>
      <title>DotNet Development Using Parallels Is No Longer Painful</title>
      <description>&lt;p&gt;Because of the travel involved with being an Object Mentor, my main computer is my laptop, a MacBookPro. I have to be able to work wherever I happen to be, whether I&amp;#8217;m at home, at Object Mentor Galactic Headquarters, or in a plane, train, or automobile.  We&amp;#8217;re allowed to buy whatever we want, and we all have independently settled on Macs, running &lt;span class="caps"&gt;OS X&lt;/span&gt;. I&amp;#8217;ve developed on lots of different platforms over the years, but I find that &lt;span class="caps"&gt;OS X&lt;/span&gt; is &lt;b&gt;the&lt;/b&gt; most productive development environment that I&amp;#8217;ve ever used.&lt;/p&gt;


	&lt;p&gt;Besides the travel, we have to be jacks of all trades. One week I&amp;#8217;m programming in Java, the next week I&amp;#8217;m teaching a design class, and the next I&amp;#8217;m developing in .NET. I&amp;#8217;m able to do it all on my Mac, even the .NET work, through the magic of virtualization. I choose to run Parallels so that I&amp;#8217;m able to run Windows as a process under &lt;span class="caps"&gt;OS X&lt;/span&gt;. Windows crashing isn&amp;#8217;t a problem anymore, in that it doesn&amp;#8217;t bring my entire computer down. One process just dies (or I&amp;#8217;m forced to kill it) and I just start it up again, and all the other running processes just keep right on working.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m a backup fanatic. Besides having bootable backups produced using SuperDuper, I just love the way TimeMachine is built into &lt;span class="caps"&gt;OS X&lt;/span&gt;, allowing me to recover versions of any file on my computer going back months. And it&amp;#8217;s all automatic. TimeMachine just runs in the background, keeping me safe.&lt;/p&gt;


	&lt;p&gt;But the thing about Parallels + TimeMachine that I just hate, is that Parallels stores all of Windows as one big file. A big one. Huge! So whenever I&amp;#8217;m working in Parallels, the one big file is being changed and is going to be backed up again the next time TimeMachine runs. Needless to say this takes up a lot of space on my TimeMachine drive, but it&amp;#8217;s also a damn nuisance. About the time that TimeMachine finishes its backup, it&amp;#8217;s time to start all over again just because of the file size. Yet I dare not back up. I&amp;#8217;m in the camp that believes it&amp;#8217;s not a question of &lt;b&gt;if&lt;/b&gt; your computer will fail, but &lt;b&gt;when&lt;/b&gt;.&lt;/p&gt;


	&lt;p&gt;Because Parallels creates a share with my home directory on the &lt;span class="caps"&gt;OS X&lt;/span&gt; side, I thought about just keeping my source code there. That actually works, until I try to build or do anything with the code other than edit it, and then I get a security violation of some sort.&lt;/p&gt;


	&lt;p&gt;While I&amp;#8217;m developing in Windows, I do frequent commits to git, my new favorite source code control system. It&amp;#8217;s easy to go back to a previous version of any file, something that I can&amp;#8217;t say about ctrl-z in Visual Studio.&lt;/p&gt;


	&lt;p&gt;The light finally lit up over my bald head. Git is a &lt;i&gt;distributed&lt;/i&gt; version control system. Distributed doesn&amp;#8217;t have to be any farther away than the &lt;span class="caps"&gt;OS X&lt;/span&gt; side of my file system.&lt;/p&gt;


	&lt;p&gt;I set up a git repository in &lt;span class="caps"&gt;OS X&lt;/span&gt; for every project that I work on. Then I can push/pull from/to it, just like I would do if I was working on a team project hosted on github. Why don&amp;#8217;t I just get a private github account? This is easier and I don&amp;#8217;t have to be connected to the net to do push/pulls.&lt;/p&gt;


	&lt;p&gt;Here are the details in case anyone wants to try it.&lt;/p&gt;


	&lt;p&gt;In a Terminal window in &lt;span class="caps"&gt;OS X&lt;/span&gt;:&lt;/p&gt;


&lt;code&gt;
    &lt;pre&gt;
        MBP:~ bob$ cd Archive/git
        MBP:git bob$ mkdir PresenterAsStateMachine.git
        MBP:git bob$ cd PresenterAsStateMachine.git
        MBP:PresenterAsStateMachine.git bob$ 

        MBP:PresenterAsStateMachine.git bob$ git --bare init
        Initialized empty Git repository in /Users/bob/Archive/git/PresenterAsStateMachine.git/
        MBP:PresenterAsStateMachine.git bob$
    &lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;then, in Windows, using the bash window that comes with git:&lt;/p&gt;


&lt;code&gt;
    &lt;pre&gt;
        $ git init
        Initialized empty Git repository in c:/Documents and Settings/Administrator/My Documents/Visual Studio 2008/Projects/PresenterAsStateMachine/.git/

        $ git add .

        $ git commit -a -m "Initial commit. Ready to add state machine." 
        [master (root-commit) f844369] Initial commit.  Ready to add state machine.
         16 files changed, 795 insertions(+), 0 deletions(-)
         create mode 100644 .gitignore
         create mode 100644 PresenterAsStateMachine.sln
         create mode 100644 PresenterAsStateMachine.suo
         create mode 100644 PresenterAsStateMachine/Form1.Designer.cs
         create mode 100644 PresenterAsStateMachine/Form1.cs
         create mode 100644 PresenterAsStateMachine/Form1.resx
         create mode 100644 PresenterAsStateMachine/LoginPresenter.cs
         create mode 100644 PresenterAsStateMachine/LoginPresenterTest.cs
         create mode 100644 PresenterAsStateMachine/LoginView.cs
         create mode 100644 PresenterAsStateMachine/PresenterAsStateMachine.csproj
         create mode 100644 PresenterAsStateMachine/Program.cs
         create mode 100644 PresenterAsStateMachine/Properties/AssemblyInfo.cs
         create mode 100644 PresenterAsStateMachine/Properties/Resources.Designer.cs
         create mode 100644 PresenterAsStateMachine/Properties/Resources.resx
         create mode 100644 PresenterAsStateMachine/Properties/Settings.Designer.cs
         create mode 100644 PresenterAsStateMachine/Properties/Settings.settings 
    &lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;Now I set up the git repository that I had previously created in &lt;span class="caps"&gt;OS X&lt;/span&gt; as the remote:&lt;/p&gt;


&lt;code&gt;
    &lt;pre&gt;
        $ git remote add origin //.psf/Home/Archive/git/PresenterAsStateMachine.git/

        $ git push origin master
        Counting objects: 20, done.
        Compressing objects: 100% (19/19), done.
        Writing objects: 100% (20/20), 12.74 KiB, done.
        Total 20 (delta 1), reused 0 (delta 0)
        Unpacking objects: 100% (20/20), done.
        To //.psf/Home/Archive/git/PresenterAsStateMachine.git/
         * [new branch]      master -&amp;gt; master

    &lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;And now push and pull to my heart&amp;#8217;s content, as well as add and commit to my local repository.&lt;/p&gt;


	&lt;p&gt;Now I configure TimeMachine to not back up the Parallels virtual machine directory. It still gets backed up daily by SuperDuper, but they only files that I want to be able to recover versions of is the source code that I&amp;#8217;m working on &amp;#8211; and this technique serves me well for that.&lt;/p&gt;</description>
      <pubDate>Tue, 16 Feb 2010 15:16:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:5d549c00-51a6-45cc-930f-3fd9b4088c28</guid>
      <author>Bob Koss</author>
      <link>http://blog.objectmentor.com/articles/2010/02/16/dotnet-development-using-parallels-is-no-longer-painful</link>
      <category>Young Bob's Rants</category>
    </item>
    <item>
      <title>Getting Started in Objective-C with XCode</title>
      <description>&lt;p&gt;As I mentioned in a previous &lt;a href="http://blog.objectmentor.com/articles/2010/02/08/rudimentary-tdd-with-xcode-and-objective-c"&gt;previous blog&lt;/a&gt;, I wrote up some notes on getting started practicing &lt;span class="caps"&gt;TDD&lt;/span&gt; using XCode and Objective-C. I&amp;#8217;m intending to write a bit more, so the top level of the overall tutorial path starts here: &lt;a href="http://schuchert.wikispaces.com/tdd.objectivec.AFirstProject"&gt;A First Objective-C Project&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;If you just want to see the details of getting started: &lt;a href="http://schuchert.wikispaces.com/tdd.objectivec.XCodeProjectSetup"&gt;XCodeProjectSetup&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;The biggest change from the previous blog is an embedded video demonstration. If you&amp;#8217;re just interested in the video: &lt;a href="http://vimeo.com/9394596"&gt;Getting started&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Want to seem more? Something in particular? Let me know.&lt;/p&gt;


	&lt;p&gt;Comments welcome.&lt;/p&gt;</description>
      <pubDate>Thu, 11 Feb 2010 23:07:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:24a88145-37df-44a3-94f7-e91671b790af</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/02/11/getting-started-in-objective-c-with-xcode</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>objective</category>
      <category>c</category>
      <category>getting</category>
      <category>started</category>
    </item>
    <item>
      <title>Is TDD Language Neutral?</title>
      <description>On another blog, a commenter wrote (I&amp;#8217;m leaving names out, though you can see the original blog if you look):
&lt;blockquote&gt;
    I don&#8217;t think that it makes sense to say &#8220;teach a &lt;span class="caps"&gt;TDD&lt;/span&gt; class in several languages simultaneously&#8221;. &lt;span class="caps"&gt;TDD&lt;/span&gt; is a language-independent technique. 
&lt;/blockquote&gt;

	&lt;p&gt;What follows is a slightly changed version of my response. What I&amp;#8217;m wondering is this: Do you think the practice of &lt;span class="caps"&gt;TDD&lt;/span&gt; is fundamentally impacted by your programming language?&lt;/p&gt;


	&lt;p&gt;Read on for my response. You might want to add a comment before reading my response to avoid &amp;#8220;group think.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;Based on the original comment, I started with: It seems to me that you&#8217;ve not written professionally in many different languages. Or if you have, you&#8217;ve not effectively used those different programming languages.&lt;/p&gt;


	&lt;p&gt;Now let me be a bit more clear. Java and C++ are different languages, to be sure. However, they are both class-based, statically typed languages without lambdas (well C++ and Java will both be getting them, but they don&#8217;t have them now).&lt;/p&gt;


	&lt;p&gt;Contrast Java and C++ with Smaltalk and Self. Smalltalk is class based and supports inheritance but it is dynamically typed. Self is object-oriented, but it does not have classes. In fact, it technically does not have inheritance, but it fully supports &lt;span class="caps"&gt;OOP&lt;/span&gt;. How? Delegation. JavaScript is closer to Self than it is to Smalltalk. But JavaScript, Self and Smalltalk are all closer than C++, Java, C# and Objective-C.&lt;/p&gt;


	&lt;p&gt;How about the Open/Closed principle? How I interpret that design principle depends on the context (language) in which work. In raw Java, what I think needs to be closed is different than say raw Ruby. If I add Aspect Oriented Programming into the mix (yes, I&#8217;ve actually written and deployed systems that used Aspect J &#8211; in a limited fashion), then that opens things up a bit, but still not as much as in Ruby.&lt;/p&gt;


	&lt;p&gt;In Smalltalk, the closest analog to static methods are class methods. However, a class method in Smalltalk is actually an instance method on a class object, which is a subclass of the Class class. (Yes, that&#8217;s what I meant.)&lt;/p&gt;


	&lt;p&gt;Why is this important? When I&#8217;m working with legacy code in C++/Java/C#/VB.Net &#8211; languages where static methods are never dynamically bound, I avoid using static methods and, in fact, I redesign using what Michel Feathers calls &#8220;Introducing an Instance Delegator&#8221;.&lt;/p&gt;


	&lt;p&gt;In Smalltalk, this technique is irrelevant and unnecessary.&lt;/p&gt;


	&lt;p&gt;In languages like JavaScript, Self, Smaltalk, Ruby, etc., interfaces are not really necessary. Sure you can use them, but they are more for documentation.&lt;/p&gt;


	&lt;p&gt;Consider templates in C++ versus generics in Java. In Java, generics experience type erasure so you often need to use interfaces with generics &#8211; or at least tell the compiler a type it can assume will always be used with a generic. In C++, the most you really need to do is let the complier know that a template parameter is a typename as opposed to a primitive. When the code is compiled, any implied requirements of the type parameter will either be satisfied or not. (Woe be it to you if they are not!)&lt;/p&gt;


	&lt;p&gt;Why? In Java, generics are syntactic sugar. C++ generates a unique class for each template occurrence. C# is much closer to C++ than Java in this respect. Java got it wrong (in my opinion) &#8211; though what they did add did improve the language a bit.&lt;/p&gt;


	&lt;p&gt;How about moving away from OO languages? Scala is a mixed language, as is F#. Haskel is not. Lisp as well. How you break a problem into parts is (or at least should be) different in these languages. I don&#8217;t mean different in syntax, to be sure it will be. I mean how you break a problem into its parts is fundamentally different in pure functional languages than OO languages.&lt;/p&gt;


	&lt;p&gt;Or consider &lt;span class="caps"&gt;COBOL&lt;/span&gt;. I&#8217;ve programmed in it. I can thank &lt;span class="caps"&gt;COBOL&lt;/span&gt; for my touch-typing skills. &lt;span class="caps"&gt;COBOL&lt;/span&gt; is yet a different kind of language. Yes, syntactically, but that&#8217;s not the interesting difference. &lt;span class="caps"&gt;COBOL&lt;/span&gt; is a record-oriented processing language. It is well suited to batch processing. &lt;span class="caps"&gt;AWK&lt;/span&gt; is similar in this respect as is &lt;span class="caps"&gt;SNOBOL&lt;/span&gt;. (I&#8217;ve used &lt;span class="caps"&gt;AWK&lt;/span&gt; quite a bit, and I&#8217;ve used a variant of &lt;span class="caps"&gt;SNOBOL&lt;/span&gt; called &lt;span class="caps"&gt;SPITBOL&lt;/span&gt; as well.)&lt;/p&gt;


	&lt;p&gt;Let&#8217;s continue with a building analogy. If all I have to build is bamboo then I have available to me certain techniques for building a house. If I have steel, I have different alternatives. The design of my house will be directly impacted by the media (language) available.&lt;/p&gt;


	&lt;p&gt;Additionally, if I&#8217;m building on clay versus bedrock, I will also make fundamentally different design issues. When I lived in Texas I had a floating slab foundation, which were common for several reasons: cost, temperature zone, available building materials. Texas was the first place I lived that did not in general have basements. The other option, pier and beam, was no longer practiced in general due to cost.&lt;/p&gt;


	&lt;p&gt;I&#8217;m originally from the Mid-West (Iowa). In Iowa, buildings are built such that their foundation is below the frost line. The frost line was something like 30&#8221; (I&#8217;m remembering something from 20 &#8211; 30 years ago). So all the houses had basements. Or if not basements, half-basements.&lt;/p&gt;


	&lt;p&gt;The same kinds of things can be said about programming languages as well as their ecosystems as well as the political environment. I&#8217;ve already made the language point above. But what about the political environment?&lt;/p&gt;


	&lt;p&gt;I have worked at places where open source was forbidden. So this rules out Hibernate and Spring. Taking away these tools does not stop me from building a system, but it does have an impact on gross assignment of responsibility, which is an important component of software architecture.&lt;/p&gt;


	&lt;p&gt;Now, back down to a &lt;span class="caps"&gt;TDD&lt;/span&gt; class. When I teach &lt;span class="caps"&gt;TDD&lt;/span&gt;, I am not teaching just &lt;span class="caps"&gt;TDD&lt;/span&gt;. Furthermore, I am not just talking about &lt;span class="caps"&gt;TDD&lt;/span&gt;. I want students to apply the practice.
So I start with a problem &#8211; a requirements statement. That does not initially vary with the language. In practice it eventually does for several reasons:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;How far the class can get with the problem is impacted by by their skills as well as the programming language. C++ and vi are slower to work in that Java and Eclipse.&lt;/li&gt;
		&lt;li&gt;What you can reasonably do is impacted by both the language as its environment. For example, it is easy to look at a &lt;span class="caps"&gt;DLL&lt;/span&gt; and dynamically find all concrete implementations of an interface in any .Net language. It&#8217;s harder to do that in Java, though possible. In C++ it is platform specific.&lt;/li&gt;
		&lt;li&gt;There are more&#8230;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The students do need to learn the mechanics:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;How to write a test using a particular unit testing framework&lt;/li&gt;
		&lt;li&gt;How to write production code&lt;/li&gt;
		&lt;li&gt;The shortcut keys of the environment&lt;/li&gt;
		&lt;li&gt;The refactoring support in the &lt;span class="caps"&gt;IDE&lt;/span&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;But what are the students testing? Units? Sure, let&#8217;s go there.&lt;/p&gt;


	&lt;p&gt;Language affects the units. You are testing units. Different kinds of units, different kinds of responsibilities. Different kinds of responsibilities to be verified, different unit tests.&lt;/p&gt;


	&lt;p&gt;Things are not so cleanly separated as you would like to imagine.&lt;/p&gt;


	&lt;p&gt;This very idea can be seen in natural languages. Different languages are better/worse at expressing things. The language you use directly affects how you interpret the world. This actually impacts the physical wiring in the brain. Really, it does.&lt;/p&gt;


	&lt;p&gt;So I do not agree.&lt;/p&gt;


	&lt;p&gt;And I challenge you to write the same problem in two fundamentally different languages (e.g. Java and Lisp) using &lt;span class="caps"&gt;TDD&lt;/span&gt;. Then have those two different solutions reviewed by experts in each of those languages.&lt;/p&gt;


	&lt;p&gt;I claim that if you&#8217;ve done an effective job of using those languages, your solutions will be different &lt;span class="caps"&gt;AND&lt;/span&gt; the unit tests you created to get to those solutions will be fundamentally different (not just mechanically different).&lt;/p&gt;


	&lt;p&gt;If, on the other hands, the unit tests are the same (other than the mechanics), then at least one group of people will say your solution is a bad use of their particular language. You&#8217;ll either be programming Java in Lisp or Lisp in Java.&lt;/p&gt;</description>
      <pubDate>Tue, 09 Feb 2010 09:38:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:99b04a35-41dd-4abc-9cc7-feeb9d67c715</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/02/09/is-tdd-language-neutral</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>language</category>
      <category>impact</category>
      <category>TDD</category>
    </item>
    <item>
      <title>Rudimentary TDD with XCode and Objective-C</title>
      <description>We have a potential client that would like us to teach a &lt;span class="caps"&gt;TDD&lt;/span&gt; class in several languages simultaneously:
	&lt;ul&gt;
	&lt;li&gt;Java&lt;/li&gt;
		&lt;li&gt;JavaScript&lt;/li&gt;
		&lt;li&gt;C++&lt;/li&gt;
		&lt;li&gt;Objective-C&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;In turns out that for what we teach in our &lt;span class="caps"&gt;TDD&lt;/span&gt; class, Java, C++ and Objective-C can be taught at the same time fairly easily. JavaScript, however, not so much. It is a very different (great, but different) beast.&lt;/p&gt;


	&lt;p&gt;In fact I could add C# to the mix as well, but I&amp;#8217;d have to leave out &lt;span class="caps"&gt;LINQ&lt;/span&gt; and Lambdas.&lt;/p&gt;


	&lt;p&gt;In any case, to teach a class like that, I prefer to have the students do a bit of preliminary work so that they know how to set up their environments. When there&amp;#8217;s just one language, I do this on the fly. But when there&amp;#8217;s 3, I don&amp;#8217;t want 2/3rds of the class waiting while 1/3rd learns how to create a basic project supporting &lt;span class="caps"&gt;TDD&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;The last time I used Objective-C was in 1991, so I needed to figure out how to do this in the environment it is most likely to be used. This turned out to be a bit more work than I expected. I found it all using the good old google-machine, but in pieces. Since there really wasn&amp;#8217;t a great (in my opinion) one-stop place that clearly laid out all of the steps, &lt;a href="http://schuchert.wikispaces.com/tdd.objectivec.XCodeProjectSetup"&gt;I created one&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;This is in a early state. If you have comments, I&amp;#8217;d appreciate them. I&amp;#8217;ll probably add more. (If you&amp;#8217;d like to see more, let me know that as well.) At this point, the basics are pretty much there, so I don&amp;#8217;t actually need to do anything else. However, I have taken this just a bit further: &lt;a href=http://schuchert.wikispaces.com/tdd.objectivec.AFirstProject"&gt;This is the top-level of the tutorial&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Again, comments and suggestions welcome.&lt;/p&gt;</description>
      <pubDate>Mon, 08 Feb 2010 18:24:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:76caf33c-893e-4e12-9803-e4f2992165ba</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/02/08/rudimentary-tdd-with-xcode-and-objective-c</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>objective</category>
      <category>c</category>
      <category>xcode</category>
      <category>ocunit</category>
    </item>
    <item>
      <title>CppUTest Recent Experiences</title>
      <description>&lt;h2&gt;Background&lt;/h2&gt;
Mid last year I ported several exercises from Java to C++. At that time, I used CppUTest 1.x and Boost 1.38. Finally, half a year later, it was time to actually brush the dust off those examples and make sure they still work.&lt;p/&gt;

	&lt;p&gt;They didn&amp;#8217;t. Bit rot. Or user error. Not sure which.&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;Bit rot&lt;/b&gt;: bits decay to the point where things start failing. Compiled programs&lt;i&gt; &lt;b&gt;do&lt;/b&gt;&lt;/i&gt; have a half-life.&lt;p/&gt;
&lt;b&gt;User Error&lt;/b&gt;: maybe things were not checked in as clean as I remember. Though I suspect they were, I don&amp;#8217;t really have any evidence to prove it, so I have to leave that option available.&lt;/p&gt;


	&lt;p&gt;To add to the mix, I decided to upgrade to CppUTest 2.x and to the latest version of the Boost library (1.41). I think that broke many several things. But the fixes were simple, once I figured out what I needed to do.&lt;/p&gt;


&lt;h2&gt;The Fixes&lt;/h2&gt;
What follows are the three things I needed to do to get CppUTest 2.0, Boost and those exercises playing nicely together.&lt;p/&gt;

&lt;h3&gt;Header File Include Order&lt;/h3&gt;
First, I used to have the header file for the CppUTest Test Harness, &lt;CppUTest/TestHarness.h&gt; included first. It seems logical, but it caused all sorts of problems with CppUTest 2. That header file, includes a file, that ultimately includes something that uses macros to redefine new and delete. This is done so the testing framework can do simple memory tracking, which lets you know if your unit tests contains memory leaks.&lt;p/&gt;

	&lt;p&gt;I like this feature. Sure, it&amp;#8217;s simple and light-weight, but it coves a lot of ground for a little hassle. The hassle? Include that header file last, instead of first. Problem Solved. Well at least the code compiles without hundreds of errors.&lt;p/&gt;&lt;/p&gt;


&lt;h3&gt;Boost Shared Pointer&lt;/h3&gt;
Rather than hold pointers directly, I used the boost shared pointer class for a light-weight way to manage memory allocation. This is something I would do on a real project as well.&lt;p/&gt;

	&lt;p&gt;Somehow, the updated memory tracking in CppUTest 2.0 found something I had missed when using CppUTest 1.0.&lt;/p&gt;


	&lt;p&gt;I need to be able to control the date, so I have a simple date factory. By default, the date factory, when asked for the current date, returns the current date. Several unit tests want to simulate different dates. E.g., check out a book on one day, return it 14 days later. To do that, I manipulate the date factory (a form of dependency injection). This works fine, but by default the date factory is allocated using new.&lt;p/&gt;&lt;/p&gt;


When I replaced the existing date factory, I was not resetting it after the test. It turns out that this did not break anything because I was &amp;#8220;lucky&amp;#8221;. (Actually unlucky, I like things to&lt;i&gt; &lt;b&gt;fail fast&lt;/b&gt;&lt;/i&gt;.) CppUTest caught this in the form of not deallocating memory correctly:
	&lt;ul&gt;
	&lt;li&gt;I want to replace behavior&lt;/li&gt;
		&lt;li&gt;To do so I used polymorphism&lt;/li&gt;
		&lt;li&gt;Polymorphism in C++ requires virtual methods (please don&amp;#8217;t correct me by suggesting that overloading is polymorphism, that is an opinion with which I strongly disagree)&lt;/li&gt;
		&lt;li&gt;Methods are only virtually dispatched via references or pointers&lt;/li&gt;
		&lt;li&gt;References cannot be changed, so I must use a pointer if I want a substitutable factory, which I wanted&lt;/li&gt;
		&lt;li&gt;Pointers suggest dynamic memory allocation&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;To fix this, I updated the setup method to store the original date factory in an attribute and then I updated the teardown method to restore the original date factory from that attribute. That I missed this suggests that my test suite is not adequate. I did not fix this problem for no good reason other than I was porting existing tests, so I left it as is. For the context it will not cause a problem. Pragmatic or lazy? You decide.&lt;p/&gt;&lt;/p&gt;


&lt;h3&gt;One Time Allocation&lt;/h3&gt;
Here is a simple utility that uses Boost dates and regex:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_cpp "&gt;ptime DateUtil::dateFromString(const string &amp;amp;dateString) {
  boost::regex e(&amp;quot;^(\\d{1,2})/(\\d{1,2})/(\\d{4})$&amp;quot;);
  string replace(&amp;quot;\\3/\\1/\\2&amp;quot;);
  string isoDate = boost::regex_replace(dateString, e, replace, boost::match_default | boost::format_sed);
  return ptime(date(from_string(isoDate)));
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Now this is somewhat simplistic code. So be it, it serves the purposes of the exercise. I can think of ways to fix this, but there&amp;#8217;s an underling issue that exists if you use the regex library from Boost.&lt;p/&gt;&lt;/p&gt;


	&lt;p&gt;When you use the library, it allocates (in this example) 10 blocks of memory. If you read the documentation (I did), it&amp;#8217;s making space for its internal state machine for regex evaluation. This is done once and then kept around.&lt;p/&gt;&lt;/p&gt;


So what&amp;#8217;s the problem? Well, when I run my tests, the first test that happens to exercise this block of code reports some memory allocation issues:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;c:\projects\cppppp\dependencyinversionprinciple\dependencyinversionprinciple\pat
rongatewaytest.cpp:34: error: Failure in TEST(PatronGateway, AddAFew)
        Memory leak(s) found.
Leak size: 1120 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: &amp;quot;
?&amp;quot;
Leak size: 16 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: ?a&amp;quot;
Leak size: 20 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: &amp;quot;&#234;&#224;4&amp;quot;
Leak size: 52 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: &#228;4&amp;quot;
Leak size: 4096 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: &amp;quot;&amp;quot;
Leak size: 52 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: &amp;quot;&#234;&#226;4&amp;quot;
Leak size: 20 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: ~4&amp;quot;
Leak size: 32 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: &amp;quot;?&#224;4&amp;quot;
Leak size: 32 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: &amp;quot;h~4&amp;quot;
Leak size: 80 Allocated at: &amp;lt;unknown&amp;gt; and line: 0. Type: &amp;quot;new&amp;quot; Content: &amp;quot;&#234;&#228;4&amp;quot;
Total number of leaks:  10&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;This is a false positive. This is a one-time allocation and a side-effect of C++ memory allocation and static initialization.&lt;p/&gt;&lt;/p&gt;


	&lt;p&gt;There is a way to &amp;#8220;fix&amp;#8221; this. You use a command line option, -r, to tell the command line test runner to run the tests twice. If the allocation problem happens the first time but not the second time, then the tests are &amp;#8220;OK&amp;#8221;.&lt;p/&gt;&lt;/p&gt;


I didn&amp;#8217;t want to do this. 
	&lt;ul&gt;
	&lt;li&gt;The tests do take some time to run (30 seconds maybe, but still that doubles the time)&lt;/li&gt;
		&lt;li&gt;The output is ugly&lt;/li&gt;
		&lt;li&gt;It&amp;#8217;s off topic for what the exercise is trying to accomplish&lt;/li&gt;
	&lt;/ul&gt;


I tried a few different options but ultimately I went with simply calling that method before using the command line test runner. So I changed my main from:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_cpp "&gt;#include &amp;lt;CppUTest/CommandLineTestRunner.h&amp;gt;

int main(int argc, char **argv) {
  return CommandLineTestRunner::RunAllTests(argc, argv);
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

To this:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_cpp "&gt;#include &amp;quot;DateUtil.h&amp;quot;
#include &amp;lt;CppUTest/CommandLineTestRunner.h&amp;gt;

/** ************************************************************
    The boost regex library allocates several blocks of memory
    for its internal state machine. That memory is listed as a 
    memory leak in the first test that happens to use code that
    uses the boost regext library. To avoid having to run the
    tests twice using the -r option, we instead simply force
    this one-time allocation before starting test execution.
    *********************************************************** **/

void forceBoostRegexOneTimeAllocation() {
  DateUtil::dateFromString(&amp;quot;1/1/1980&amp;quot;);
}

int main(int argc, char **argv) {
  forceBoostRegexOneTimeAllocation();
  return CommandLineTestRunner::RunAllTests(argc, argv);
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Since this one-time allocation happens before any of the tests run, it is no longer reported as a problem by CppUTest.&lt;/p&gt;


	&lt;p&gt;Before I introduced this &amp;#8220;fix&amp;#8221;, I spent quite a bit of time to verify that each of the 10 allocations were done by one of the three lines dealing with regex code in my DateUtil class. I used a conditional breakpoint and looked at the stack trace. (I know, using the debugger is considered a code smell, but not all smells are bad.)&lt;/p&gt;


&lt;h3&gt;Conclusion&lt;/h3&gt;
I still like CppUTest. I&amp;#8217;ve used a few C++ unit testing tools but there are several I have not tried. I don&amp;#8217;t have enough face-time with C++ for this to be an issue. I am not terribly comfortable with the order of includes sensitivity. I&amp;#8217;m not sure if that would scale.&lt;p/&gt;

	&lt;p&gt;I do appreciate the assistance with memory checking, though dealing with false positives can be a bit of a hassle. There was another technique, that of expressing the number of allocations. But in this case, that simply deferred the reporting of memory leaks to after test execution. In any case, I do like this. I&amp;#8217;m not sure how well it would scale so it leaves me a bit uneasy.&lt;p/&gt;&lt;/p&gt;


	&lt;p&gt;If you happen to be using these tools, hope this helps. If not, and you are using C++, what can you say about your experiences with using this or other unit testing tools?&lt;/p&gt;</description>
      <pubDate>Thu, 04 Feb 2010 13:42:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:3b1ab465-7276-4c72-9361-9103092a7ca5</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/02/04/cpputest-recent-experiences</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>c</category>
      <category>boost</category>
      <category>memory</category>
      <category>allocation</category>
    </item>
    <item>
      <title>Software on the Cheap</title>
      <description>&lt;p&gt;When it comes to software, you get what you pay for.&lt;/p&gt;


	&lt;p&gt;Have you ever stopped to wonder how much a line of code costs?  
It ought to be easy to figure out.&lt;/p&gt;


	&lt;p&gt;In the last 14 months, I have written about 20KSLOC in FitNesse.  Of course that was part time.  My real job is running Object Mentor, consulting, teaching, mentoring, writing, and a whole load of other things.  Programming takes up perhaps 15% of my time.&lt;/p&gt;


	&lt;p&gt;On the other hand most programmers have lots of other things to do.  They go to meetings, and then they go to more meetings.  When they are done with those meetings, they go to meetings.  And then there are the meetings to go to.  Oh yeah, and then there&amp;#8217;s all the fiddling around with time accounting tools, and horrific source code control systems that perform like a salamander crawling through frozen mud.&lt;/p&gt;


	&lt;p&gt;So, maybe 15% isn&amp;#8217;t such a bad ratio.&lt;/p&gt;


	&lt;p&gt;The loaded rate (Salary plus everything else) for a typical programmer is on the order of $200K. (I know that sounds like a lot, but you can look it up.) So $200K / (20KSLOC / 14mo * 12mo) = $11.66/SLOC.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s look at one of those lines: &lt;code&gt;StringBuffer nameBuffer = new StringBuffer();&lt;/code&gt;
Does that look like $11.66 to you?  Would you pay that much for it?  Well, don&amp;#8217;t answer yet, because for each &lt;code&gt;StringBuffer&lt;/code&gt; line you buy, you get &lt;code&gt;import java.lang.StringBuffer;&lt;/code&gt; absolutely free!&lt;/p&gt;


	&lt;p&gt;Some factories pay their employees a &amp;#8220;piece rate&amp;#8221;.  Would you accept $11.66 per line of code instead of a salary? Of course it couldn&amp;#8217;t just be any old line of code.  It&amp;#8217;d have to be tested!&lt;/p&gt;


	&lt;p&gt;Hey, I bet all programmers would do &lt;span class="caps"&gt;TDD&lt;/span&gt; if we paid them a piece rate!&lt;/p&gt;


	&lt;h2&gt;Down to business.&lt;/h2&gt;


	&lt;p&gt;The point of that silly analysis was to demonstrate that software is &lt;em&gt;expensive&lt;/em&gt;.  Even the dumbest little app will likely require more than 1,000 lines of code; and that means it could cost $12K to write!&lt;/p&gt;


	&lt;p&gt;Imagine that you aren&amp;#8217;t a programmer, but you have a clever idea for a new website that&amp;#8217;ll make you a zillion dollars.  You&amp;#8217;ve storyboarded it all out.  You&amp;#8217;ve worked out all the details.  Now all you need is some high-school kid to zip out the code for you. Right?  Hell, you could pay him minimum wage!  The little twerp would be happy to get it!&lt;/p&gt;


	&lt;p&gt;That tragic comedy is altogether too common.  Too many people have borrowed money against their father&amp;#8217;s retirement account to fund a terrible implementation of a good idea.  Appalled at how much the reputable firms charge per hour ($100 or more) they go looking for a cheap solution.&lt;/p&gt;


	&lt;p&gt;&amp;#8220;After all, this software is &lt;em&gt;simple&lt;/em&gt;.&amp;#8221; Or so the reasoning goes.  &amp;#8220;It&amp;#8217;s not like we&amp;#8217;re trying to send a rocket to the moon or anything.  And, besides, those expensive guys were just out to cheat us.  Software just isn&amp;#8217;t that hard to write.&amp;#8221;  Uh huh.&lt;/p&gt;


	&lt;p&gt;So the poor schmuck finds some freshman in college, or maybe a bored housewife who read a book on &lt;span class="caps"&gt;HTML&lt;/span&gt; last year and created a cute website to show off her kittens. Have these programmers heard about &lt;span class="caps"&gt;TDD&lt;/span&gt;?  Have they heard about Design Patterns?  Principles?  How about source code control?&lt;/p&gt;


	&lt;p&gt;Clearly they haven&amp;#8217;t.  They&amp;#8217;re going to sling a bunch of horrific code together, without any tests, versioning, or control.  The project will start well, with exciting initial results.  But then it will slowly grind to a halt, while the cash continues out the door unabated.&lt;/p&gt;


	&lt;p&gt;In the end the website isn&amp;#8217;t going to get built (and the poor schmuck&amp;#8217;s father won&amp;#8217;t be retiring as soon as he thought). It will be a disaster that will either be terminated, or will require double or triple the investment to get right.&lt;/p&gt;


	&lt;h2&gt;The Bottom Line.&lt;/h2&gt;


	&lt;p&gt;The bottom line is that, when it comes to software, you get what you pay for.  If you want good software done well, then you are going to pay for it, and it will probably cost you $12/line or more.  And, believe me, that&amp;#8217;s the &lt;em&gt;cheapest&lt;/em&gt; way to get your software done.&lt;/p&gt;


	&lt;p&gt;If you go out hunting for the cheap solution, then you&amp;#8217;re going to end up paying more, and losing time.  Software is one of those things that costs a fortune to write well, and double that to write poorly.  If you go for cheap, you&amp;#8217;re going to pay double; and maybe even triple.&lt;/p&gt;</description>
      <pubDate>Mon, 01 Feb 2010 16:17:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:85351364-b4f5-4faa-af8a-4fb1f604ecae</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/02/01/software-on-the-cheap</link>
      <category>Uncle Bob's Blatherings</category>
      <category>Clean Code</category>
    </item>
    <item>
      <title>Makefiles, what are you doing with them?</title>
      <description>&lt;p&gt;Half a year ago, I took some exercises written in Java and ported them to C++. At that time I punted on writing makefiles and decided to reply on an &lt;span class="caps"&gt;IDE&lt;/span&gt; (Visual Studio). That worked fine but recently we almost had a customer that was going to take this class and, bless their heart, use the command line.&lt;/p&gt;


	&lt;p&gt;Turns out they are going to use visual studio, so I can shelve this, but I figured I&amp;#8217;d get feedback on what I have created for a makefile. Since I have not written a makefile for 12ish years, I figured things have changed. They have, but I suspect they have even more.&lt;/p&gt;


	&lt;p&gt;What follows are my environment assumptions and the makefile. I&amp;#8217;d appreciate any suggestions.&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;FWIW&lt;/span&gt;, I wrote this makefile because it turns out fully building all files takes longer than just building what has changed. I know this seems obvious, but it is not always the case with small projects like this. There is some point where the project becomes big enough to warrant dependency-based building. The exercise meets that criteria. Sometimes the time taken to evaluate build changes is enough overhead that it can be safely removed in lieu of a full build. This is a consideration when creating custom build files for legacy-based refactoring efforts.&lt;/p&gt;


&lt;b&gt;Environment&lt;/b&gt;
	&lt;ul&gt;
	&lt;li&gt;Generic Unix&lt;/li&gt;
		&lt;li&gt;zsh &amp;#8211; though any shell will do really &lt;/li&gt;
		&lt;li&gt;g++&lt;/li&gt;
		&lt;li&gt;gnu make&lt;/li&gt;
		&lt;li&gt;This source base will still be used in Visual Studio but not this makefile&lt;/li&gt;
		&lt;li&gt;CppUTest used for unit testing tool&lt;/li&gt;
		&lt;li&gt;Provide default location for CppUTest, which can be overridden by environment variable&lt;/li&gt;
		&lt;li&gt;Boost library installed in /usr/local/include and /usr/local/lib (reasonable assumption or should I go ahead and allow this to be configured easily in the makefile &amp;#8211; what&amp;#8217;s your opinion?)&lt;/li&gt;
		&lt;li&gt;Project is small enough that all headers and source files are in the same directory (should I build the .o&amp;#8217;s and put them in another directory to hide them?)&lt;/li&gt;
	&lt;/ul&gt;


&lt;b&gt;Current Makefile&lt;/b&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;ifdef CPP_U_TEST
    CppUTest_base = $(CPP_U_TEST)
else
    CppUTest_base = $(wildcard ~/src/cpputest)
endif

LIB_DIRS = -L$(CppUTest_base)/lib
INC_DIRS = -I$(CppUTest_base)/include
LIBS = -lCppUTest -lboost_date_time -lboost_regex -lboost_thread
CFLAGS = -g $(INC_DIRS) 
LDFLAGS = $(LIB_DIRS) $(LIBS)
CC = g++
SRCS := $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
OUT = run_all_tests
DEP_DIR = dependencies

all: $(OBJS)
    $(CC) $(CFLAGS) $(LDFLAGS) -o $(OUT) $(OBJS)

clean:
    @rm -rf $(DEP_DIR) $(OBJS) $(OUT)

-include $(SRCS:.cpp=$(dep_dir)/.d)

.cpp.o:
    @if [ ! -d $(DEP_DIR) ] ; then mkdir $(DEP_DIR) ; fi
    $(CC) -c $(CFLAGS) -o $@ $&amp;lt; 
    @$(CC) -MM $(CFLAGS) $*.cpp &amp;gt; $(DEP_DIR)/$*.d&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
      <pubDate>Wed, 27 Jan 2010 09:02:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:2e89212d-2630-4f8c-ac26-b1c8091cd19c</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/01/27/makefiles-what-are-you-doing-with-them</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>makefile</category>
      <category>gnu</category>
      <category>build</category>
    </item>
    <item>
      <title>Mocking Mocking and Testing Outcomes.</title>
      <description>&lt;p&gt;The number of mocking frameworks has proliferated in recent years.  This pleases me because it is a symptom that testing in general, and &lt;span class="caps"&gt;TDD&lt;/span&gt; in particular, have become prevalent enough to support a rich panoply of third-party products.&lt;/p&gt;


	&lt;p&gt;On the other hand, all frameworks carry a disease with them that I call &lt;em&gt;The Mount Everest Syndrome&lt;/em&gt;: &amp;#8220;I use it because it&amp;#8217;s there.&amp;#8221;  The more mocking frameworks that appear, the more I see them enthusiastically used.  Yet the prolific use of mocking frameworks is a rather serious design smell&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Lately I have seen several books and articles that present &lt;span class="caps"&gt;TDD&lt;/span&gt; through the lens of a mocking framework.  If you were a newbie to &lt;span class="caps"&gt;TDD&lt;/span&gt;, these writings might give you the idea that &lt;span class="caps"&gt;TDD&lt;/span&gt; was defined by the use of mocking tools, rather than by the &lt;a href="http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd"&gt;disciplines&lt;/a&gt; of &lt;span class="caps"&gt;TDD&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;So when should use use a mocking framework?  The answer is the same for any other framework.  You use a framework only when that framework will give you a significant advantage.&lt;/p&gt;


	&lt;p&gt;Why so austere?  Why shouldn&amp;#8217;t you use frameworks &amp;#8220;just because they are there&amp;#8221;?  Because frameworks &lt;em&gt;always&lt;/em&gt; come with a cost.  They must be learned by the author, and by all the readers.  They become part of the configuration and have to be maintained.  They must be tracked from version to version.  But perhaps the most significant reason is that once you have a hammer, everything starts to look like a nail.  The framework will put you into a constraining mindset that prevents you from seeing other, better solutions.&lt;/p&gt;


Consider, for example, this lovely bit of code that I&amp;#8217;ve been reviewing recently.  It uses the Moq framework to initialize a test double:
&lt;pre&gt;&lt;code&gt;
var vehicleMock = Mocks.Create&amp;lt;IClientVehicle&amp;gt;()
 .WithPersistentKey()
 .WithLogicalKey().WithLogicalName()
 .WithRentalSessionManager(rsm =&amp;gt;
    {
      var rs = Mocks.Create&amp;lt;IRentalSession&amp;gt;();
      rsm.Setup(o =&amp;gt; o.GetCurrentSession()).Returns(rs.Object);
      rsm.Setup(o =&amp;gt;
       o.GetLogicalKeyOfSessionMember(It.IsAny&amp;lt;string&amp;gt;(),
        It.IsAny&amp;lt;int&amp;gt;())).Returns("Rental");
    })
 .AddVehicleMember&amp;lt;IRoadFactory&amp;gt;()
 .AddVehicleMember&amp;lt;IRoadItemFactory&amp;gt;(rf =&amp;gt; rf.Setup(t =&amp;gt; 
    t.CreateItems(It.IsAny&amp;lt;IRoad&amp;gt;())).Returns(pac))
 .AddVehicleMember&amp;lt;ILegacyCorporateRental&amp;gt;()
 .AddVehicleMember&amp;lt;IRentalStation&amp;gt;(
    m =&amp;gt; m.Setup(k =&amp;gt; k.Facility.FacilityID).Returns(0))
 .AddVehicleMember&amp;lt;IRoadManager&amp;gt;(m=&amp;gt;
    m.Setup(k=&amp;gt;k.GetRoundedBalanceDue(25,It.IsAny&amp;lt;IRoad&amp;gt;())).Returns(25));
&lt;/code&gt;&lt;/pre&gt;
Some of you might think I&amp;#8217;m setting up a straw-man.  I&amp;#8217;m not.  I realize that bad code can be written in any language or framework, and that you can&amp;#8217;t blame the language or framework for bad code.  
&lt;p/&gt;&lt;p/&gt;
The point I am making is that code like this was &lt;em&gt;the way&lt;/em&gt; that all unit tests in this application were written.  The team was new to &lt;span class="caps"&gt;TDD&lt;/span&gt;, and they got hold of a tool, and perhaps read a book or article, and decided that &lt;span class="caps"&gt;TDD&lt;/span&gt; was done by using a mocking tool.  This team is not the first team I&amp;#8217;ve seen who have fallen into this trap.  In fact, I think that the &lt;span class="caps"&gt;TDD&lt;/span&gt; industry as a whole has fallen into this trap to one degree or another.

	&lt;p&gt;Now don&amp;#8217;t get me wrong.  I like mocking tools.  I use them in Ruby, Java, and .Net. I think they provide a convenient way to make test-doubles in situations where more direct means are difficult.&lt;/p&gt;


For example, I recently wrote the following unit test in FitNesse using the Mockito framework.  
&lt;pre&gt;&lt;code&gt;
  @Before
  public void setUp() {
    manager = mock(GSSManager.class);
    properties = new Properties();
  }

  @Test
  public void credentialsShouldBeNullIfNoServiceName() throws Exception {
    NegotiateAuthenticator authenticator = 
      new NegotiateAuthenticator(manager, properties);
    assertNull(authenticator.getServerCredentials());
    verify(manager, never()).createName(
      anyString(), (Oid) anyObject(), (Oid) anyObject());
  }
&lt;/code&gt;&lt;/pre&gt;
The first line in the &lt;code&gt;setUp&lt;/code&gt; function is lovely.  It&amp;#8217;s kind of hard to get prettier than that.  Anybody reading it understands that &lt;code&gt;manager&lt;/code&gt; will be a mock of the &lt;code&gt;GSSManager&lt;/code&gt; class.  
&lt;p/&gt;&lt;p/&gt;
It&amp;#8217;s not too hard to understand the test itself.  Apparently we are happy to have the &lt;code&gt;manager&lt;/code&gt; be a dummy object with the constraint that &lt;code&gt;createName&lt;/code&gt; is never called by &lt;code&gt;NegotiateAuthenticator&lt;/code&gt;.  The &lt;code&gt;anyString()&lt;/code&gt; and &lt;code&gt;anyObject()&lt;/code&gt; calls are pretty self explanatory.

	&lt;p&gt;On the other hand, I wish I could have said this:&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;assertTrue(manager.createNameWasNotCalled());&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;That statement does not require my poor readers to understand anything about Mockito.  Of course it does require me to hand-roll a manager mock.  Would that be hard?  Let&amp;#8217;s try.&lt;/p&gt;


First I need to create a dummy.  
&lt;pre&gt;&lt;code&gt;
  private class MockGSSManager extends GSSManager {
    public Oid[] getMechs() {
      return new Oid[0];
    }

    public Oid[] getNamesForMech(Oid oid) throws GSSException {
      return new Oid[0];
    }

    public Oid[] getMechsForName(Oid oid) {
      return new Oid[0];
    }

    public GSSName createName(String s, Oid oid) throws GSSException {
      return null;
    }

    public GSSName createName(byte[] bytes, Oid oid) throws GSSException {
      return null;
    }

    public GSSName createName(String s, Oid oid, Oid oid1) throws GSSException {
      return null;
    }

    public GSSName createName(byte[] bytes, Oid oid, Oid oid1) throws GSSException {
      return null;
    }

    public GSSCredential createCredential(int i) throws GSSException {
      return null;
    }

    public GSSCredential createCredential(GSSName gssName, int i, Oid oid, int i1) throws GSSException {
      return null;
    }

    public GSSCredential createCredential(GSSName gssName, int i, Oid[] oids, int i1) throws GSSException {
      return null;
    }

    public GSSContext createContext(GSSName gssName, Oid oid, GSSCredential gssCredential, int i) throws GSSException {
      return null;
    }

    public GSSContext createContext(GSSCredential gssCredential) throws GSSException {
      return null;
    }

    public GSSContext createContext(byte[] bytes) throws GSSException {
      return null;
    }

    public void addProviderAtFront(Provider provider, Oid oid) throws GSSException {
    }

    public void addProviderAtEnd(Provider provider, Oid oid) throws GSSException {
    }
  }
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&amp;#8220;Oh, ick!&amp;#8221; you say.  Yes, I agree it&amp;#8217;s a lot of code.  On the other hand, it took me just a single keystroke on my &lt;span class="caps"&gt;IDE&lt;/span&gt; to generate all those dummy methods.  (In IntelliJ it was simply command-I to implement all unimplemented methods.)  So it wasn&amp;#8217;t particularly hard.  And, of course, I can put this code somewhere where nobody had to look at it unless they want to.  It has the advantage that anybody who knows Java can understand it, and can look right at the methods to see what they are returning.  No &amp;#8220;special&amp;#8221; knowledge of the mocking framework is necessary.&lt;/p&gt;


Next, let&amp;#8217;s&amp;#8217; make a test double that does precisely what this test needs.
&lt;pre&gt;&lt;code&gt;
  private class GSSManagerSpy extends MockGSSManager {
    public boolean createNameWasCalled;

    public GSSName createName(String s, Oid oid) throws GSSException {
      createNameWasCalled = true;
      return null;
    }
  }
&lt;/code&gt;&lt;/pre&gt;
Well, that just wasn&amp;#8217;t that hard.  It&amp;#8217;s really easy to understand too. 

Now, let&amp;#8217;s rewrite the test.
&lt;pre&gt;&lt;code&gt;
  @Test
  public void credentialsShouldBeNullIfNoServiceNameWithHandRolledMocks() throws Exception {
    NegotiateAuthenticator authenticator = new NegotiateAuthenticator(managerSpy, properties);
    assertNull(authenticator.getServerCredentials());
    assertFalse(managerSpy.createNameWasCalled);
  }
&lt;/code&gt;&lt;/pre&gt;
Well, that test is just a &lt;em&gt;load&lt;/em&gt; easier to read than &lt;code&gt;verify(manager, never()).createName(anyString(), (Oid) anyObject(), (Oid) anyObject());&lt;/code&gt;.
&lt;p/&gt;&lt;p/&gt;
&amp;#8220;But Uncle Bob!&amp;#8221; I hear you say.  &amp;#8220;That scenario is too simple.  What if there were lots of dependencies and things&amp;#8230;&amp;#8221; 

I&amp;#8217;m glad you asked that question, because the very next test is just such a situation.  
&lt;pre&gt;&lt;code&gt;
  @Test
  public void credentialsShouldBeNonNullIfServiceNamePresent() throws Exception {
    properties.setProperty("NegotiateAuthenticator.serviceName", "service");
    properties.setProperty("NegotiateAuthenticator.serviceNameType", "1.1");
    properties.setProperty("NegotiateAuthenticator.mechanism", "1.2");
    GSSName gssName = mock(GSSName.class);
    GSSCredential gssCredential = mock(GSSCredential.class);
    when(manager.createName(anyString(), (Oid) anyObject(), (Oid) anyObject())).thenReturn(gssName);
    when(manager.createCredential((GSSName) anyObject(), anyInt(), (Oid) anyObject(), anyInt())).thenReturn(gssCredential);
    NegotiateAuthenticator authenticator = new NegotiateAuthenticator(manager, properties);
    Oid serviceNameType = authenticator.getServiceNameType();
    Oid mechanism = authenticator.getMechanism();
    verify(manager).createName("service", serviceNameType, mechanism);
    assertEquals("1.1", serviceNameType.toString());
    assertEquals("1.2", mechanism.toString());
    verify(manager).createCredential(gssName, GSSCredential.INDEFINITE_LIFETIME, mechanism, GSSCredential.ACCEPT_ONLY);
    assertEquals(gssCredential, authenticator.getServerCredentials());
  }
&lt;/code&gt;&lt;/pre&gt;
Now I&amp;#8217;ve got three test doubles that interact with each other; and I am verifying that the code under test is manipulating them all correctly.  I &lt;em&gt;could&lt;/em&gt; create hand-rolled test doubles for this; but the wiring between them would be scattered in the various test-double derivatives.  I&amp;#8217;d also have to write a significant number of accessors to get the values of the arguments to &lt;code&gt;createName&lt;/code&gt; and &lt;code&gt;createCredential&lt;/code&gt;.  In short, the hand-rolled test-double code would be harder to understand than the Mockito code.  The Mockito code puts the whole story in one simple test method rather than scattering it hither and yon in a plethora of little derivatives.
&lt;p/&gt;&lt;p/&gt;
What&amp;#8217;s more, since it&amp;#8217;s clear that I should use a mocking framework for this test, I think I should be consistent and use if for &lt;em&gt;all&lt;/em&gt; the tests in this file.   So the hand-rolled &lt;code&gt;MockGSSManager&lt;/code&gt; and &lt;code&gt;ManagerSpy&lt;/code&gt; are history.

	&lt;p&gt;&amp;#8220;But Uncle Bob, aren&amp;#8217;t we always going to have dependencies like that?  So aren&amp;#8217;t we &lt;em&gt;always&lt;/em&gt; going to have to use a mocking framework?&amp;#8221;&lt;/p&gt;


	&lt;p&gt;That, my dear reader, is the real point of this blog.  The answer to that salient questions is a profound: &amp;#8220;&lt;strong&gt;No!&lt;/strong&gt;&amp;#8220;&lt;/p&gt;


	&lt;p&gt;Why did I have to use Mockito for these tests?  Because the number of objects in play was large.  The module under test (&lt;code&gt;NegotiateAuthenticator&lt;/code&gt;) used &lt;code&gt;GSSName&lt;/code&gt;, &lt;code&gt;GSSCredential&lt;/code&gt;, and &lt;code&gt;GSSManager&lt;/code&gt;.  In other words the coupling between the module under test and the test itself was high.  (I see lightbulbs above some of your heads.) That&amp;#8217;s right, boys and girls, we don&amp;#8217;t want coupling to be high!&lt;/p&gt;


	&lt;p&gt;It is the high coupling between modules and tests that creates the need for a mocking framework.  This high coupling is also the cause of the dreaded &amp;#8220;Fragile Test&amp;#8221; problem.  How many tests break when you change a module?  If the number is high, then the coupling between your modules and tests in high.  Therefore, I conclude that those systems that make prolific use of mocking frameworks are likely to suffer from fragile tests.&lt;/p&gt;


	&lt;p&gt;Of the 277 unit test files in FitNesse, only 11 use Mockito.  The reason for small number is two-fold.  First, we test outcomes more often than we test mechanisms.  That means we test how a small group of classes behaves, rather than testing the dance of method calls between those classes.  The second reason is that our test doubles have no middle class.  They are either very simple stubs and spies or they are moderately complex fakes.&lt;/p&gt;


	&lt;p&gt;Testing outcomes is a traditional decoupling technique.  The test doesn&amp;#8217;t care &lt;em&gt;how&lt;/em&gt; the end result is calculated, so long as the end result is correct.  There may be a dance of several method calls between a few different objects; but the test is oblivious since it only checks the answer.  Therefore the tests are not strongly coupled to the solution and are not fragile.&lt;/p&gt;


	&lt;p&gt;Keeping middle-class test doubles (i.e. Mocks) to a minimum is another way of decoupling.  Mocks, by their very nature, are coupled to mechanisms instead of outcomes.  Mocks, or the setup code that builds them, have deep knowledge of the inner workings of several different classes.  That knowledge is the very definition of high-coupling.&lt;/p&gt;


	&lt;p&gt;What is a &amp;#8220;moderately complex fake&amp;#8221; and why does it help to reduce coupling?  One example within FitNesse is &lt;code&gt;MockSocket&lt;/code&gt;.  (The name of this class is historical.  Nowadays it should be called &lt;code&gt;FakeSocket&lt;/code&gt;.)  This class derives from &lt;code&gt;Socket&lt;/code&gt; and implements all its methods either to remember what was sent to the socket, or to allow a user to read some canned data.  This is a &amp;#8220;fake&amp;#8221; because it simulates the behavior of a socket.  It is not a mock because it has no coupling to any mechanisms.  You don&amp;#8217;t ask it whether it succeeded or failed, you ask it to send or recieve a string.  This allows our unit tests to test outcomes rather than mechanisms.&lt;/p&gt;


	&lt;p&gt;The moral of this story is that the point at which you start to really need a mocking framework is the very point at which the coupling between your tests and code is getting too high.  There are times when you can&amp;#8217;t avoid this coupling, and those are the times when mocking frameworks &lt;em&gt;really&lt;/em&gt; pay off.  However, you should strive to keep the coupling between your code and tests low enough that you don&amp;#8217;t need to use the mocking framework very often.&lt;/p&gt;


	&lt;p&gt;You do this by testing outcomes instead of mechanisms.&lt;/p&gt;</description>
      <pubDate>Sat, 23 Jan 2010 11:32:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:b863ec60-399c-430f-8e82-78e54684cae4</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/01/23/mocking-mocking-and-testing-outcomes</link>
      <category>Uncle Bob's Blatherings</category>
      <category>Design Principles</category>
      <category>Clean Code</category>
    </item>
    <item>
      <title>Dependency Injection Inversion</title>
      <description>&lt;p&gt;Dependency Injection is all the rage.  There are several frameworks that will help you inject dependencies into your system.  Some use &lt;span class="caps"&gt;XML&lt;/span&gt; (God help us) to specify those dependencies.  Others use simple statements in code.  In either case, the goal of these frameworks is to help you create instances without having to resort to &lt;code&gt;new&lt;/code&gt; or Factories.&lt;/p&gt;


	&lt;p&gt;I think these frameworks are great tools.  But I also think you should carefully restrict how and where you use them.&lt;/p&gt;


	&lt;p&gt;Consider, for example, this simple example using Google&amp;#8217;s Guice framework.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
 public class BillingApplication {
   public static void main(String[] args) {
    Injector injector = Guice.createInjector(new BillingModule());
    BillingService billingService = injector.getInstance(BillingService.class);
    billingService.processCharge(2034, "Bob");
  }
 }
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;My goal is to create an instance of &lt;code&gt;BillingService&lt;/code&gt;.  To do this, I first get an &lt;code&gt;Injector&lt;/code&gt; from Guice.  Then I use the &lt;code&gt;injector&lt;/code&gt; to get an instance of my &lt;code&gt;BillingService&lt;/code&gt; class.  What&amp;#8217;s so great about this?  Well, take a look at the constructor of the &lt;code&gt;BillingService&lt;/code&gt; class.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
class BillingService {
  private CreditCardProcessor processor;
  private TransactionLog transactionLog;

  @Inject
  BillingService(CreditCardProcessor processor, TransactionLog transactionLog) {
    this.processor = processor;
    this.transactionLog = transactionLog;
  }

  public void processCharge(int amount, String id) {
    boolean approval = processor.approve(amount, id);
    transactionLog.log(
      String.format("Transaction by %s for %d %s",
      id, amount, approvalCode(approval)));
  }

  private String approvalCode(boolean approval) {
    return approval?"approved":"denied";
  }
}

&lt;/code&gt;&lt;/pre&gt;
Oh ho!  The &lt;code&gt;BillingService&lt;/code&gt; constructor requires two arguments!  A &lt;code&gt;CreditCardProcessor&lt;/code&gt; and a &lt;code&gt;TransactionLog&lt;/code&gt;.  How was the &lt;code&gt;main&lt;/code&gt; program able to create an instance of &lt;code&gt;BillingService&lt;/code&gt; without those two arguments?  That&amp;#8217;s the magic of Guice (and of all Dependency Injection frameworks).  Guice knows that the &lt;code&gt;BillingService&lt;/code&gt; needs those two arguments, and it knows how to create them.  Did you see that funky &lt;code&gt;@Inject&lt;/code&gt; attribute above the constructor?  That&amp;#8217;s how it got connected into Guice.

	&lt;p&gt;And here&amp;#8217;s the magic module that tells Guice how to create the arguments for the &lt;code&gt;BillingService&lt;/code&gt;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
public class BillingModule extends AbstractModule {
  protected void configure() {
    bind(TransactionLog.class).to(DatabaseTransactionLog.class);
    bind(CreditCardProcessor.class).to(MyCreditCardProcessor.class);
  }
}

&lt;/code&gt;&lt;/pre&gt;
Clever these Google-folk!  The two &lt;code&gt;bind&lt;/code&gt; functions tell Guice that whenever we need an instance of a &lt;code&gt;TransactionLog&lt;/code&gt; it should use an instance of &lt;code&gt;DatabaseTransactionLog&lt;/code&gt;.  Whenever it needs a &lt;code&gt;CreditCardProcessor&lt;/code&gt; it should use an instance of &lt;code&gt;MyCreditCardProcessor&lt;/code&gt;.

	&lt;p&gt;Isn&amp;#8217;t that cool!  Now you don&amp;#8217;t have to build factories.  You don&amp;#8217;t have to use &lt;code&gt;new&lt;/code&gt;.  You just tell Guice how to map interfaces to implementations, and which constructors to inject those implementations in to, and then call &lt;code&gt;Injector.getInstance(SomeClass.class);&lt;/code&gt; and voila!  You have your instance automatically constructed for you.  Cool.&lt;/p&gt;


	&lt;p&gt;Well, yes it&amp;#8217;s cool.  On the other hand, consider this code:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
public class BillingApplicationNoGuice {
  public static void main(String[] args) {
    CreditCardProcessor cp = new MyCreditCardProcessor();
    TransactionLog tl = new DatabaseTransactionLog();
    BillingService bs = new BillingService(cp, tl);
    bs.processCharge(9000, "Bob");
  }
}

&lt;/code&gt;&lt;/pre&gt; 
Why is this worse?  It seems to me it&amp;#8217;s better.

	&lt;p&gt;&lt;em&gt;But Uncle Bob&lt;/em&gt;, you&amp;#8217;ve violated &lt;span class="caps"&gt;DIP&lt;/span&gt; by creating concrete instances!&lt;/p&gt;


	&lt;p&gt;True, but you have to mention concrete instances somewhere.  &lt;code&gt;main&lt;/code&gt; seems like a perfectly good place for that.  Indeed, it seems better than hiding the concrete references in &lt;code&gt;BillingModule&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;I don&amp;#8217;t want a bunch of secret modules with &lt;code&gt;bind&lt;/code&gt; calls scattered all around my code.  I don&amp;#8217;t want to have to hunt for the particular &lt;code&gt;bind&lt;/code&gt; call for the &lt;code&gt;Zapple&lt;/code&gt; interface when I&amp;#8217;m looking at some module.  I want to know where all the instances are created.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;But Uncle Bob&lt;/em&gt;, You&amp;#8217;d know where they are because this is a &lt;em&gt;Guice&lt;/em&gt; application.&lt;/p&gt;


	&lt;p&gt;I don&amp;#8217;t want to write a &lt;em&gt;Guice&lt;/em&gt; application.  Guice is a framework, and I don&amp;#8217;t want framework code smeared all through my application.  I want to keep frameworks nicely decoupled and at arms-length from the main body of my code.  I don&amp;#8217;t want to have &lt;code&gt;@Inject&lt;/code&gt; attributes everywhere and &lt;code&gt;bind&lt;/code&gt; calls hidden under rocks.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;But Uncle Bob&lt;/em&gt;, What if I want to get an instance of &lt;code&gt;BillingService&lt;/code&gt; from deep in the bowels of my application?  With Guice I can just say &lt;code&gt;injector.getInstance(BillingService.class);&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;True, but I don&amp;#8217;t want to have &lt;code&gt;createInstance&lt;/code&gt; calls scattered all through my code.  I don&amp;#8217;t want Guice to be poured all over my app. I want my app to be clean, not soaked in Guice.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;But Uncle Bob&lt;/em&gt;, That means I have to use &lt;code&gt;new&lt;/code&gt; or factories, or pass globals around.&lt;/p&gt;


	&lt;p&gt;You think the &lt;code&gt;injector&lt;/code&gt; is not a global?  You think &lt;code&gt;BillingService.class&lt;/code&gt; is not a global?  There will always be globals to deal with.  You can&amp;#8217;t write systems without them.  You just need to manage them nicely.&lt;/p&gt;


	&lt;p&gt;And, no, I don&amp;#8217;t have to use &lt;code&gt;new&lt;/code&gt; everywhere, and I don&amp;#8217;t need factories.  I can do something as simple as:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
public class BillingApplicationNoGuice {
  public static void main(String[] args) {
    CreditCardProcessor cp = new MyCreditCardProcessor();
    TransactionLog tl = new DatabaseTransactionLog();
    BillingService.instance = new BillingService(cp, tl);

    // Deep in the bowels of my system.
    BillingService.instance.processCharge(9000, "Bob");
  }
}

&lt;/code&gt;&lt;/pre&gt;
&lt;em&gt;But Uncle Bob&lt;/em&gt;, what if you want to create many instances of &lt;code&gt;BillingService&lt;/code&gt; rather than just that one singleton?

	&lt;p&gt;Then I&amp;#8217;d use a factory, like so:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
public class BillingApplication {
   public static void main(String[] args) {
    Injector injector = Guice.createInjector(new BillingModule());
    BillingService.factory = new BillingServiceFactory(injector);

    // Deep in the bowels of my code.
    BillingService billingService = BillingService.factory.make();
    billingService.processCharge(2034, "Bob");
  }
}

&lt;/code&gt;&lt;/pre&gt;
&lt;em&gt;But Uncle Bob&lt;/em&gt;, I thought the whole idea was to avoid factories!

	&lt;p&gt;Hardly.  After all, Guice is just a big factory.  But you didn&amp;#8217;t let me finish.  Did you notice that I passed the Guice injector into the factory?  Here&amp;#8217;s the factory implementation.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
public class BillingServiceFactory extends AbstractModule {
  private Injector injector;

  public BillingServiceFactory(Injector injector) {
    this.injector = injector;
  }

  protected void configure() {
    bind(TransactionLog.class).to(DatabaseTransactionLog.class);
    bind(CreditCardProcessor.class).to(MyCreditCardProcessor.class);
  }

  public BillingService make() {
    return injector.getInstance(BillingService.class);
  }
}

&lt;/code&gt;&lt;/pre&gt;
I like this because now all the Guice is in one well understood place.  I don&amp;#8217;t have Guice all over my application.  Rather, I&amp;#8217;ve got factories that contain the Guice.  Guicey factories that keep the Guice from being smeared all through my application.  

	&lt;p&gt;What&amp;#8217;s more, if I wanted to replace Guice with some other DI framework, I know exactly what classes would need to change, and how to change them.  So I&amp;#8217;ve kept Guice uncoupled from my application.&lt;/p&gt;


	&lt;p&gt;Indeed, using this form allows me to defer using Guice until I think it&amp;#8217;s necessary.  I can just build the factories the good old &lt;span class="caps"&gt;GOF&lt;/span&gt; way until the need to externalize dependencies emerges.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;But Uncle Bob&lt;/em&gt;, don&amp;#8217;t you think Dependency Injection is a good thing?&lt;/p&gt;


	&lt;p&gt;Of course I do.  Dependency Injection is just a special case of Dependency Inversion.  I think Dependency Inversion is so important that I want to invert the dependencies on Guice!  I don&amp;#8217;t want lots of concrete Guice dependencies scattered through my code.&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;BTW&lt;/span&gt;, did you notice that I was using Dependency Injection even when I wasn&amp;#8217;t using Guice at all?  This is nice and simple &lt;em&gt;manual&lt;/em&gt; dependency injection.  Here&amp;#8217;s that code again in case you don&amp;#8217;t want to look back:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;

public class BillingApplicationNoGuice {
  public static void main(String[] args) {
    CreditCardProcessor cp = new MyCreditCardProcessor();
    TransactionLog tl = new DatabaseTransactionLog();
    BillingService bs = new BillingService(cp, tl);
    bs.processCharge(9000, "Bob");
  }
}

&lt;/code&gt;&lt;/pre&gt;
Dependency Injection doesn&amp;#8217;t require a framework; it just requires that you invert your dependencies and then construct and pass your arguments to deeper layers.   Consider, for example, that the following test works just fine in &lt;em&gt;all&lt;/em&gt; the cases above.  It does not rely on Guice, it only relies on the fact that dependencies were inverted and can be injected into &lt;code&gt;BillingService&lt;/code&gt;

&lt;pre&gt;&lt;code&gt;

public class BillingServiceTest {
  private LogSpy log;

  @Before
  public void setup() {
    log = new LogSpy();
  }

  @Test
  public void approval() throws Exception {
    BillingService bs = new BillingService(new Approver(), log);
    bs.processCharge(9000, "Bob");
    assertEquals("Transaction by Bob for 9000 approved", log.getLogged());
  }

  @Test
  public void denial() throws Exception {
    BillingService bs = new BillingService(new Denier(), log);
    bs.processCharge(9000, "Bob");
    assertEquals("Transaction by Bob for 9000 denied", log.getLogged());    
  }
}

class Approver implements CreditCardProcessor {
  public boolean approve(int amount, String id) {
    return true;
  }
}

class Denier implements CreditCardProcessor {
  public boolean approve(int amount, String id) {
    return false;
  }
}

class LogSpy implements TransactionLog {
  private String logged;

  public void log(String s) {
    logged = s;
  }

  public String getLogged() {
    return logged;
  }
}

&lt;/code&gt;&lt;/pre&gt;
Also notice that I rolled my own Test Doubles (we used to call them mocks, but we&amp;#8217;re not allowed to anymore.)  It would have been tragic to use a mocking framework for such a simple set of tests.

	&lt;p&gt;Most of the time the best kind of Dependency Injection to use, is the manual kind.  Externalized dependency injection of the kind that Guice provides is appropriate for those classes that you &lt;em&gt;know&lt;/em&gt; will be extension points for your system.&lt;/p&gt;


	&lt;p&gt;But for classes that aren&amp;#8217;t obvious extension points, you will simply know the concrete type you need, and can create it at a relatively high level and inject it down as an interface to the lower levels.  If, one day, you find that you need to externalize that dependency, it&amp;#8217;ll be easy because you&amp;#8217;ve already inverted and injected it.&lt;/p&gt;</description>
      <pubDate>Sun, 17 Jan 2010 12:42:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:00f97566-88ff-41a0-a0b1-4baee8225dc0</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2010/01/17/dependency-injection-inversion</link>
      <category>Uncle Bob's Blatherings</category>
      <category>Design Principles</category>
      <category>Clean Code</category>
    </item>
    <item>
      <title>UI Test Automation Tools are Snake Oil</title>
      <description>&lt;p&gt;It happens over and over again.  I visit a team and I ask about their testing situation.  We talk about unit tests, exploratory testing, the works.  Then, I ask about automated end-to-end testing and they point at a machine in the corner.  That poor machine has an installation of some highly-priced per seat testing tool (or an open source one, it doesn&amp;#8217;t matter), and the chair in front of it is empty.  We walk over,  sweep the dust away from the keyboard, and load up the tool.  Then, we glance through their set of test scripts and try to run them.  The system falls over a couple of times and then they give me that sheepish grin and say &amp;#8220;we tried.&amp;#8221;  I say, &amp;#8220;don&amp;#8217;t worry, everyone does.&amp;#8221;  

&lt;p&gt;It&amp;#8217;s a very familiar &amp;#8216;rabbit hole&amp;#8217; in the industry.  It&amp;#8217;s sort of like the old days when you&amp;#8217;d find a couple of classes generated by a &lt;span class="caps"&gt;CASE&lt;/span&gt; tool in every code base you visited if you  looked hard enough.  People started with the merry notion that they were going to round-trip code with some &lt;span class="caps"&gt;CASE&lt;/span&gt; tool and they learned (like most lucky teams do) that it just doesn&amp;#8217;t pay for itself, it&amp;#8217;s not worth the time or the frustration.  UI Test Automation tools are in the same category.  Personally, I think that in this day and age selling them is irresponsible.  Developing them open-source?  Well, let your conscience be your guide, but really, even though people can use them responsibly, they hardly ever do because these tools are sold with a dream, a very seductive and dangerous one.

&lt;h2&gt;The Dream&lt;/h2&gt;

&lt;p&gt;Janet comes into work in the morning and she sits down at her super-duper testing console.  She presses a button and the testing system springs to life.  The application comes up all at once across ten monitors.  Cursors move, selections are made (silently) and tests run against the user interface magically, as if some eager set of ghost elves took control, mischievously burrowing through the nooks and crannies of the application, running scripts to completion, and making little notes whenever there is a failure.  Janet sits back in her chair, waiting for the elves to report back to her.  She stirs her coffee gently.

&lt;h2&gt;The Reality&lt;/h2&gt;

&lt;p&gt;Janet hasn&amp;#8217;t gone home yet.  It&amp;#8217;s 2AM and she has to report completion of all her test cases at a meeting in the morning.  She thinks she&amp;#8217;s past the last configuration issue but she&amp;#8217;s not sure.  For the last hour, she&amp;#8217;s been trying to make sure that a particular button is pressed at step 14 of her script, but quirky latency on the server is preventing it from happening consistently.  Sadly, she has to run the script from the beginning each time.  Oh, and five hours ago she discovered UI changes which invalidated 30% of the regression tests.  Most of the changes were easy but she still has 12 cases to go and her 9AM meeting looms ahead of her.

&lt;p&gt;This gap between the dream and the reality is not a matter of flawed execution, it&amp;#8217;s endemic.  Here&amp;#8217;s the scoop.

&lt;h2&gt;UI Test Automation Tools are Brittle&lt;/h2&gt;

&lt;p&gt;You might not think this is fair but it is, really.  I haven&amp;#8217;t seen one of these tools yet which isn&amp;#8217;t susceptible to missed events or timing madness.  It just happens.  The fact of the matter is, it is hard to sit on the outside of an application an instrument it.  It&amp;#8217;s a very technology sensitive problem.  You need to hook into either the OS or the browser or both.  Neither are ever really built from the ground up for that sort of access.

&lt;h2&gt;UI Based Testing Is Not the Solution That Vendors Imply It Is&lt;/h2&gt;

&lt;p&gt;This is the big issue, the one which really hurts the industry.  The fact of the matter is that UI based testing should be used for UIs: that&amp;#8217;s it.  You should not be testing your full application end-to-end through a UI Testing tool.  First of all, that sort of testing couples some of the most important tests in your system to one of the most volatile parts of it.  It&amp;#8217;s easy for us to see business logic as volatile, but really, the UI is the thing which twists and ripples in the winds of change. When customers want new features, often those features involve new workflows.  When usability experts discover better ways of models of interaction, an agile business seizes upon them and makes the changes&amp;#8212;if they can.  You&amp;#8217;d be surprised at the number of applications which continue to sport out of day user interfaces simply because the development organization is terrified of throwing away all of their regression tests which (by the way) go through the UI.  Even if you&amp;#8217;re not a consultant like me, visiting teams and seeing their development processes, you can see hints from the outside.  Think of every website or shrink-wrap application which has &amp;#8220;the same old workflow&amp;#8221; and a UI that has become more cluttered over the years.  Often it&amp;#8217;s because of that lock-in.

&lt;h2&gt;UI Based Testing Takes More Staff and Time Than You Expect&lt;/h2&gt;

&lt;p&gt;This, really, is the most common failure case.  It&amp;#8217;s the case which explains the dust on the testing box&amp;#8217;s keyboard.  Someone, usually disconnected from the development organization, decides that &amp;#8220;hey, we need to solve the testing problem.  We have too many people doing manual testing.  It&amp;#8217;s taking forever.&amp;#8221;  So, they do their research, find a vendor with with a good licensing model and a good pitch and then they push it on the development organization.  They are, of course, looking to reduce staff so when they realize that translating all of those manual tests to the tool is very labor-intensive, they are taken aback.  But, of course, it is just a temporary cost, right? But, then it takes far longer than they expect.  Remember Janet&amp;#8217;s story?  It&amp;#8217;s really hard to catch up with a UI-Based testing tool.  It&amp;#8217;s hard to even stay in place with one.  Typically it takes a number of people to do UI-Based automated testing for a development team in sync with an iteration and worse, they&amp;#8217;ll always lag behind a bit because you can&amp;#8217;t really write UI-based tests ahead of time the way you can with &lt;span class="caps"&gt;FIT&lt;/span&gt; and other beneath-the-UI testing tools. From what I&amp;#8217;ve seen UI-based testing, done diligently, takes the effort of about one tester for every two to three developers.  That&amp;#8217;s what it seems to cost amortized across all of the maintenance of UI-induced test breakage. Oh, and by the way, if think you are going to save labor using record and playback?  Nope, you aren&amp;#8217;t.  It doesn&amp;#8217;t work.

&lt;h2&gt;Solutions&lt;/h2&gt;

&lt;p&gt;The fact of the matter is, you can use these tools effectively, but in a very narrow space.  It&amp;#8217;s nice to be able to test the UI&amp;#8212;by itself.  However, this sort of thing &lt;a href=http://www.computer.org/portal/web/csdl/doi/10.1109/MS.2005.110&gt;requires an architectural change&lt;/a&gt;. 

&lt;p&gt; In general, UIs are too volatile for end-to-end testing.  Teams that do it well, typically develop a small task-focused scripting layer and build tests on top if it so that the actual tests don&amp;#8217;t touch the UI directly.  But, if they happen across that technique, they are lucky. Still, it isn&amp;#8217;t an ideal solution. You really want to be &lt;i&gt;below&lt;/i&gt; the UI working against an &lt;span class="caps"&gt;API&lt;/span&gt; which exposes the business logic.  And, because of that nearly mystical synergy between testability and good design, that &lt;span class="caps"&gt;API&lt;/span&gt; layer is often useful for many things other than testing.

&lt;h2&gt;Conclusion/Challenge&lt;/h2&gt; 

&lt;p&gt;I recognize that I&amp;#8217;ve been rather vicious in the this blog.  If you develop these tools for a living, you might not think it&amp;#8217;s fair. But consider this.  If you don&amp;#8217;t think I&amp;#8217;m being fair, take a look at how your tools are marketed.  In particular, show me where the product literature discourages end-to-end testing through the tool.  Otherwise, well, you know, you are probably developing snake-oil.</description>
      <pubDate>Mon, 04 Jan 2010 05:35:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:b8d700fd-4c7c-4e3c-8d6f-d91710d990d4</guid>
      <author>Michael Feathers</author>
      <link>http://blog.objectmentor.com/articles/2010/01/04/ui-test-automation-tools-are-snake-oil</link>
      <category>Michaels Musings</category>
    </item>
    <item>
      <title>The Polyglot Tester</title>
      <description>&lt;p&gt;Behavior Driven Development, and it&amp;#8217;s emphasis on the &lt;em&gt;Given&lt;/em&gt; / &lt;em&gt;When&lt;/em&gt; / &lt;em&gt;Then&lt;/em&gt; structure of specification has been well accepted by many parts of the software industry.  Tools such as JBehave, Cucumber, GivWenZen, have taken a prominent role, and rightly so.  After all, it&amp;#8217;s hard to argue with the elegance of simple statements such as:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Given that I am a user named Bob with password xyzzy
&lt;br/&gt;When I log in with username Bob and password xyzzy
&lt;br/&gt;Then I should see &amp;#8220;Welcome Bob, you have logged in&amp;#8221;.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Yes, it&amp;#8217;s hard to argue with it, but argue I shall&amp;#8230;&lt;/p&gt;


	&lt;p&gt;The &lt;span class="caps"&gt;BDD&lt;/span&gt; style is very pretty.  Certainly business people can easily read and write it.  Moreover, the &lt;span class="caps"&gt;BDD&lt;/span&gt; style provides a conceptual framework within which automated test specification and be efficiently composed. Better still, the &lt;span class="caps"&gt;BDD&lt;/span&gt; tools provide a powerful parsing mechanism that conveniently translates the natural &lt;span class="caps"&gt;GWT&lt;/span&gt; statements into function calls to be executed as tests.&lt;/p&gt;


	&lt;p&gt;The problem is that the &lt;span class="caps"&gt;BDD&lt;/span&gt; style is simply not appropriate for all, or even most kinds of tests.  Why?  Because it&amp;#8217;s &lt;em&gt;wordy&lt;/em&gt;.  Consider:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Given a Juke box that shows 0 credits
&lt;br/&gt;When I deposit .25
&lt;br/&gt;Then the Juke Box shows 1 credit.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Given a Juke box that shows 0 credits.
&lt;br/&gt;When I deposit 1.00
&lt;br/&gt;Then the Juke Box shows 5 credits.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Given a Juke Box that shows 0 credits.
&lt;br/&gt;When I deposit 5.00
&lt;br/&gt;Then the Juke Box shows 30 credits.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;How is this better than:&lt;/p&gt;


	&lt;h3&gt;Jukebox Credit Table&lt;/h3&gt;


	&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;strong&gt;Deposit&lt;/strong&gt;&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;Credits&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;25&lt;/td&gt;
			&lt;td&gt;1&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;1.00&lt;/td&gt;
			&lt;td&gt;5&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;5.00&lt;/td&gt;
			&lt;td&gt;30&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;




	&lt;ul&gt;
	&lt;li&gt;Which of the two is the more elegant?  &lt;/li&gt;
		&lt;li&gt;Which of the two is easier to read?  &lt;/li&gt;
		&lt;li&gt;If you were looking for a specification error, in which of the two would you be more likely to find it?&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I think the answers are rather obvious.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;There is value in brevity.  &lt;/li&gt;
		&lt;li&gt;There is elegance in sparseness.  &lt;/li&gt;
		&lt;li&gt;Elaborate wordy structures are not always the best approach.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;OK, I can hear the complaints starting to bubble up already; so hold on.  I&amp;#8217;m not arguing against &lt;span class="caps"&gt;BDD&lt;/span&gt;.  I really like the &lt;span class="caps"&gt;GWT&lt;/span&gt; style.  And Yes, I realize that many of the &lt;span class="caps"&gt;BDD&lt;/span&gt; testing tools allow you to compress your tests into tables so that you can avoid the wordiness.&lt;/p&gt;


	&lt;p&gt;My issue is not with the tools.  My issue is with the idea that &lt;span class="caps"&gt;BDD&lt;/span&gt; is the only true way, and that all tests should be expressed in &lt;span class="caps"&gt;GWT&lt;/span&gt; format forever and ever amen.&lt;/p&gt;


	&lt;p&gt;Is this a strawman?  Unfortunately not.  In my travels over the last several years, I have seen this attitude showing up over and over again.  Someone will write a suite of complex tests using &lt;span class="caps"&gt;GWT&lt;/span&gt; style, without realizing that they could shorten it by a factor of 10 or so by recomposing it into a simple table.&lt;/p&gt;


	&lt;p&gt;Actually my issue &lt;em&gt;is&lt;/em&gt; with the tools.  Cucumber, for example, is written around &lt;em&gt;Given&lt;/em&gt;, &lt;em&gt;When&lt;/em&gt;, &lt;em&gt;Then&lt;/em&gt;.  If you use Cucumber, or JBehave, or any of the other &lt;span class="caps"&gt;BDD&lt;/span&gt; tools, you &lt;em&gt;think&lt;/em&gt; in &lt;span class="caps"&gt;GWT&lt;/span&gt; and find it hard to even express something as simple as the table above.&lt;/p&gt;


	&lt;p&gt;Consider, for example, the following strange test.  It measures how well the juke box selects random songs based upon their popularity.  More popular songs should be played more often than less popular songs.  You might specify it this way in &lt;span class="caps"&gt;GWT&lt;/span&gt; style.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Given a Juke box with 1 credit
&lt;br/&gt;When the user presses &amp;#8220;You Decide&amp;#8221; 
&lt;br/&gt;Then the juke box will randomly choose a song based on its ranking.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Now this is a perfectly good statement of intent, and I&amp;#8217;d certainly want it to turn green if I ran the test.  However, if this turns green, what have we really learned?  The test result does not really tell us whether or not the selection algorithm is accurate.  The &lt;span class="caps"&gt;GWT&lt;/span&gt; statements above are really just hand-waving statements that loudly say &lt;em&gt;Trust Me&lt;/em&gt; without necessarily verifying anything.&lt;/p&gt;


	&lt;p&gt;Now look at the following tables.&lt;/p&gt;


	&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;Repeat you decide 10000 times and count results&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Average credits should ~=1.3&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;




&lt;p/&gt;

	&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;strong&gt;Song&lt;/strong&gt;&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;Times played&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Stairway to Heaven&lt;/td&gt;
			&lt;td&gt;880 &amp;lt; _ &amp;lt; 1120&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;In-a-godda-da-vida&lt;/td&gt;
			&lt;td&gt;1880 &amp;lt; _ &amp;lt; 2120&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Viva La Vida&lt;/td&gt;
			&lt;td&gt;2880 &amp;lt; _ &amp;lt; 3120&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Incense and Peppermint&lt;/td&gt;
			&lt;td&gt;880 &amp;lt; _ &amp;lt; 1120&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Comfortably Numb&lt;/td&gt;
			&lt;td&gt;2880 &amp;lt; _ &amp;lt; 3120&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;




&lt;p/&gt;

	&lt;p&gt;Perhaps you don&amp;#8217;t like the magic numbers.  There are ways to deal with that, but they are beyond the scope of this blog.  So let&amp;#8217;s forget about the magic-ness of the numbers for the moment.  When you run this test you see something like this:&lt;/p&gt;


	&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;Repeat you decide 10000 times and count results&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Average credits should &lt;span style="color:green;"&gt;1.295 ~=1.3&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;




&lt;p/&gt;

	&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;&lt;strong&gt;Song&lt;/strong&gt;&lt;/td&gt;
			&lt;td&gt;&lt;strong&gt;Times played&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Stairway to Heaven&lt;/td&gt;
			&lt;td&gt;&lt;span style="color:green;"&gt;880 &amp;lt; 998 &amp;lt; 1120&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;In-a-godda-da-vida&lt;/td&gt;
			&lt;td&gt;&lt;span style="color:green;"&gt;1880 &amp;lt; 2007 &amp;lt; 2120&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Viva La Vida&lt;/td&gt;
			&lt;td&gt;&lt;span style="color:green;"&gt;2880 &amp;lt; 2950 &amp;lt; 3120&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Incense and Peppermint&lt;/td&gt;
			&lt;td&gt;&lt;span style="color:green;"&gt;880 &amp;lt; 1019 &amp;lt; 1120&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;Comfortably Numb&lt;/td&gt;
			&lt;td&gt;&lt;span style="color:green;"&gt;2880 &amp;lt; 3026 &amp;lt; 3120&lt;/span&gt;&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;




&lt;p/&gt;

	&lt;p&gt;It&amp;#8217;s hard to argue that the green-ness is hand-waving.  Nothing here says: &lt;em&gt;Trust Me&lt;/em&gt;.  You can see that the selection algorithm is random, and is weighted properly.&lt;/p&gt;


	&lt;p&gt;Now I&amp;#8217;m certain that we could construct a set of &lt;span class="caps"&gt;GWT&lt;/span&gt; statements that captures the above semantics perfectly; but why would we?  The simple tables express the intent in a format that is simpler and more accessible than &lt;span class="caps"&gt;GWT&lt;/span&gt;.&lt;/p&gt;


	&lt;h2&gt;Conclusion&lt;/h2&gt;


	&lt;p&gt;As programmers we have already learned that we must be polyglots. If you want to write a rails system you&amp;#8217;d better know ruby, haml, css, erb, xml, etc.  If you want to write a &lt;span class="caps"&gt;J2EE&lt;/span&gt; system, you&amp;#8217;d better know Java, &lt;span class="caps"&gt;JSP&lt;/span&gt;, HTML, &lt;span class="caps"&gt;XML&lt;/span&gt;, CSS, etc.&lt;/p&gt;


	&lt;p&gt;Testers also need to be polyglots.  Writing in a single style such as &lt;span class="caps"&gt;GWT&lt;/span&gt; is not going to cut it.  &lt;span class="caps"&gt;GWT&lt;/span&gt; has it&amp;#8217;s place, but it&amp;#8217;s not sufficient.  Other testing languages are also useful.  Therefore testing tools need to be polyglot tools.&lt;/p&gt;</description>
      <pubDate>Sat, 19 Dec 2009 11:22:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:0c3c7428-9f2b-42ac-90f3-24f20733dc99</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2009/12/19/the-polyglot-tester</link>
    </item>
    <item>
      <title>Name that refactoring: 2 - Version 2</title>
      <description>&lt;p&gt;A few updates applied to the second name that refactoring. Note that I&amp;#8217;m using a star to represent a problem dependency. It is the &amp;#8220;star&amp;#8221; of the refactoring. I&amp;#8217;m looking for a better image. I could go with a database icon, but the principle is more general than that. The cloud was confusing. So if you have an idea, please let me know what it is!&lt;/p&gt;


	&lt;p&gt;Again, thanks for taking a look and giving me the feedback.&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 0: Problematic Dependency&lt;/i&gt;&lt;/b&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_2-0.png/109818239/NameThatRefactoring_2-0.png"/&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 1: Capture dependency in a single class&lt;/i&gt;&lt;/b&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_2-1.png/109818237/NameThatRefactoring_2-1.png"/&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 2: Raise the abstraction to a domain-level interface&lt;/i&gt;&lt;/b&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_2-2.png/109818235/NameThatRefactoring_2-2.png" /&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 3: Introduce test doubles as needed&lt;/i&gt;&lt;/b&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_2-3.png/109818233/NameThatRefactoring_2-3.png" /&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 16 Dec 2009 02:14:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:8a78598f-7598-49e9-85c3-415b4afb89f3</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2009/12/16/name-that-refactoring-2-version-2</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>refactoring</category>
      <category>TDD</category>
      <category>picture</category>
      <category>writing</category>
    </item>
    <item>
      <title>Name that refactoring: 1 - Version 2</title>
      <description>&lt;p&gt;Here is an update to the first name that refactoring based on feedback. How about this?&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 0: Method with embedded dependency&lt;/b&gt;&lt;/i&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_1-1.png/109816073/NameThatRefactoring_1-1.png"/&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 1:Extract method to move dependency to another method&lt;/b&gt;&lt;/i&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_1-2.png/109816629/NameThatRefactoring_1-2.png"/&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 2: Subclass and override method with new code that does not have original dependency&lt;/b&gt;&lt;/i&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_1-3.png/109816627/NameThatRefactoring_1-3.png"/&gt;&lt;/p&gt;


	&lt;p&gt;So what do you think? Better or worse?&lt;/p&gt;


	&lt;p&gt;What about using the star in other image? In general, the star could represent the dependency we&amp;#8217;re trying to get rid of.&lt;/p&gt;</description>
      <pubDate>Wed, 16 Dec 2009 01:43:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:f54168c7-20d6-4c62-ba6f-7de62ec2295d</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2009/12/16/name-that-refactoring-1-version-2</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>refactoring</category>
      <category>TDD</category>
      <category>picture</category>
      <category>writing</category>
    </item>
    <item>
      <title>Name that refactoring: 2</title>
      <description>&lt;p&gt;Ok, so I&amp;#8217;m getting good feedback on the first picture. Now for a series of pictures.&lt;/p&gt;


	&lt;p&gt;How do you interpret this series?&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 0&lt;/b&gt;&lt;/i&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_2-1.png/109310773/NameThatRefactoring_2-1.png"/&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 1&lt;/b&gt;&lt;/i&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_2-2.png/109310771/NameThatRefactoring_2-2.png"/&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 2&lt;/b&gt;&lt;/i&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_2-3.png/109310769/NameThatRefactoring_2-3.png"/&gt;&lt;/p&gt;


	&lt;p&gt;&lt;b&gt;&lt;i&gt;Step 3&lt;/b&gt;&lt;/i&gt;&lt;p/&gt;
&lt;img src="http://schuchert.wikispaces.com/file/view/NameThatRefactoring_2-4.png/109310767/NameThatRefactoring_2-4.png"/&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 13 Dec 2009 22:51:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:f612878a-68b6-427b-bca5-78783f70c884</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2009/12/13/name-that-refactoring-2</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>refactoring</category>
      <category>TDD</category>
      <category>picture</category>
      <category>writing</category>
    </item>
    <item>
      <title>Name that refactoring: 1</title>
      <description>&lt;p&gt;I&amp;#8217;m working on writing up a few handouts I can use in a &lt;span class="caps"&gt;TDD&lt;/span&gt; class (and a few other places). There are a few drawings I keep doing and I&amp;#8217;m trying to replicate them so I can refer to something.&lt;/p&gt;


Problem is, with many such drawings, the observation of the creation is as important as the end product. I&amp;#8217;d like your feedback/recommendations (or links to better pictures). I&amp;#8217;m curious about at least two things.
	&lt;ul&gt;
	&lt;li&gt;What does this picture suggest to you or what can you draw from it, if anything?&lt;/li&gt;
		&lt;li&gt;Do you think this would be better served as a series of pictures showing the build-up?&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;img src=http://schuchert.wikispaces.com/file/view/NameThatRefactoring_1.png/109280805/NameThatRefactoring_1.png"&gt;&lt;/p&gt;


	&lt;p&gt;Thanks for your feedback.&lt;/p&gt;</description>
      <pubDate>Sun, 13 Dec 2009 19:35:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:55886ea2-c35a-4ab2-a166-7e2dd425404b</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2009/12/13/name-that-refactoring-1</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>refactoring</category>
      <category>TDD</category>
      <category>picture</category>
      <category>writing</category>
    </item>
  </channel>
</rss>
