<?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: Tag TFP</title>
    <link>http://blog.objectmentor.com/articles/tag/tfp</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Which came First?</title>
      <description>I like mnemonics. Many years ago, a colleague of mine, James, gave me a way to remember something. First I&amp;#8217;ll give you the letters:
	&lt;ul&gt;
	&lt;li&gt;   &lt;span class="caps"&gt;CCCCDPIPE&lt;/span&gt;&lt;/li&gt;
	&lt;/ul&gt;


These letters are a way to remember Craig Larman&amp;#8217;s &lt;span class="caps"&gt;GRASP&lt;/span&gt; patterns (version 1). This and knowing that in the second version of the &lt;span class="caps"&gt;GRASP&lt;/span&gt; patterns Craig replaced the D for P (D &#226;&#8364;&#8220; Don&amp;#8217;t talk to strangers &#226;&#8364;&#8220; the Law of Demeter, P &#226;&#8364;&#8220; Protected Variation). By the way, here are all of them:
	&lt;ul&gt;
	&lt;li&gt;Coupling (low)&lt;/li&gt;
		&lt;li&gt;Cohesion (high)&lt;/li&gt;
		&lt;li&gt;Creator&lt;/li&gt;
		&lt;li&gt;Controller&lt;/li&gt;
		&lt;li&gt;Don&amp;#8217;t talk to strangers (mentioned above and replaced with Protected Variation)&lt;/li&gt;
		&lt;li&gt;Polymorphism&lt;/li&gt;
		&lt;li&gt;Indirection&lt;/li&gt;
		&lt;li&gt;Pure Fabrication&lt;/li&gt;
		&lt;li&gt;Expert&lt;/li&gt;
	&lt;/ul&gt;


How do I remember the letters? Well walk through this bad pun with me:
	&lt;ul&gt;
	&lt;li&gt;&lt;span class="caps"&gt;CCCC&lt;/span&gt; (4 c&amp;#8217;s, foresees)&lt;/li&gt;
		&lt;li&gt;D (the)&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;PIPE&lt;/span&gt; (pipe)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;So who foresees the pipe? The Psychic Plumber.&lt;/p&gt;


	&lt;p&gt;The Psychic Plumber??? I know, it&amp;#8217;s awful. However, I heard it once in something like 1999 and I&amp;#8217;ve never forgotten it.&lt;/p&gt;


	&lt;p&gt;That leads me to some other oldies but goodies: &lt;span class="caps"&gt;SOLID&lt;/span&gt;, INVEST, &lt;span class="caps"&gt;SMART&lt;/span&gt; and a relative new-comer: &lt;span class="caps"&gt;FIRST&lt;/span&gt;. While these are actually acronyms (not just abbreviations but real, dictionary-defined acronyms), they are also mnemonics.&lt;/p&gt;


	&lt;p&gt;You might be thinking otherwise. Typically what people call acronyms are actually just abbreviations. And in any case, they tend to obfuscate rather than elucidate. However, if you&amp;#8217;ll lower your guard for just a few more pages, you might find some of these helpful.&lt;/p&gt;


Your software should be &lt;span class="caps"&gt;SOLID&lt;/span&gt;:
	&lt;ul&gt;
	&lt;li&gt;Single Responsibility&lt;/li&gt;
		&lt;li&gt;Open/Closed Principle&lt;/li&gt;
		&lt;li&gt;Liskov Substitution Principle&lt;/li&gt;
		&lt;li&gt;Interface Segregation&lt;/li&gt;
		&lt;li&gt;Dependency Inversion Principle (not to be confused with Dependency Inversion)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I think we should change the spelling: &lt;span class="caps"&gt;SOLIDD&lt;/span&gt; and tack on &#226;&#8364;&#339;Demeter &#226;&#8364;&#8220; the Law Of. But that&amp;#8217;s just me. Of course if we do this, then it is no longer technically an acronym. That&amp;#8217;s OK, because my preference is for mnemonics, not acronyms.&lt;/p&gt;


When you&amp;#8217;re working on your user stories, make sure to &lt;span class="caps"&gt;INVEST&lt;/span&gt; in them:
	&lt;ul&gt;
	&lt;li&gt;Independent&lt;/li&gt;
		&lt;li&gt;Negotiable&lt;/li&gt;
		&lt;li&gt;Valuable&lt;/li&gt;
		&lt;li&gt;Estimable&lt;/li&gt;
		&lt;li&gt;Small        &lt;/li&gt;
		&lt;li&gt;Testable&lt;/li&gt;
	&lt;/ul&gt;


And if you&amp;#8217;re working on tasks, make sure to keep them &lt;span class="caps"&gt;SMART&lt;/span&gt;:
	&lt;ul&gt;
	&lt;li&gt;Specific&lt;/li&gt;
		&lt;li&gt;Measurable&lt;/li&gt;
		&lt;li&gt;Achievable&lt;/li&gt;
		&lt;li&gt;Relevant&lt;/li&gt;
		&lt;li&gt;Time-boxed&lt;/li&gt;
	&lt;/ul&gt;


What what is &lt;span class="caps"&gt;FIRST&lt;/span&gt;? Well have you ever heard Test Driven Development (TDD)? Some people call it by an older name, Test-First Programming (TFP). I don&amp;#8217;t think of these as the same thing but that&amp;#8217;s neither here nor there. What if the F in &lt;span class="caps"&gt;TFP&lt;/span&gt; really stands for &lt;span class="caps"&gt;FIRST&lt;/span&gt; (notice how I sneaked in the capitals)? If so, then here&amp;#8217;s one possible interpretation:
	&lt;ul&gt;
	&lt;li&gt;Fast &amp;#8211; tests should run fast.  We should be able to run all of the tests in seconds or minutes. Running the tests should never feel like a burden. If a developer ever hesitates to execute tests because of time, then the tests tests take too long.&lt;/li&gt;
		&lt;li&gt;Isolated &amp;#8211; A test is a sealed environment.  Tests should not depend on the results of  other tests, nor should they depend on external resources such as databases.&lt;/li&gt;
		&lt;li&gt;Repeatable &#226;&#8364;&#8220; when a test fails, it should fail because the production code is broken, not  because some external dependency failed (e.g. database unavailable, network  problems, etc.)&lt;/li&gt;
		&lt;li&gt;Self-Validating &amp;#8211; Manual interpretation of results does not scale. A test should * verify that it passed or failed. Going one step further, a test should report nothing but success or failure.&lt;/li&gt;
		&lt;li&gt;Timely &amp;#8211; tests should be written concurrently (and preferably before) with production code.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;So where does this acronym come from? A while back, a colleague of mine, Tim Ottinger, and I were working on some course notes. I had a list of four out of five of these ideas. We were working on the characteristics of a good unit test. At one point, Tim said to me &#226;&#8364;&#339;Add a T.&#226;&#8364;&#157;&lt;/p&gt;


	&lt;p&gt;I can be pretty dense fairly often. I didn&amp;#8217;t even understand what he was telling me to do. He had to repeat himself a few times. I understood the words, but not the meaning (luckily that doesn&amp;#8217;t happen to other people or we&amp;#8217;d have problems writing software). Anyway, I finally typed a &#226;&#8364;&#339;T&#226;&#8364;&#157;. And then I asked him &#226;&#8364;&#339;Why?&#226;&#8364;&#157; I didn&amp;#8217;t see the word. Apparently you don&amp;#8217;t want me on your unscramble team either.&lt;/p&gt;


	&lt;p&gt;Well eventually he led me to see the word &lt;span class="caps"&gt;FIRST&lt;/span&gt; and it just seemed to fit (not sure if that pun was intended).&lt;/p&gt;


	&lt;p&gt;Of course, you add all of these together and what do you get? The best I can come up with is: &lt;span class="caps"&gt;SFP&lt;/span&gt;-IS. I was hoping I could come up with a Roman numeral or something because then I could say developers should always wear &lt;span class="caps"&gt;SPF IS&lt;/span&gt; &amp;#8211; which is true because we say out of the sun and burn easily. Unfortunately that did not work. If you look at your phone, you can convert this to the number: 73747&lt;/p&gt;


	&lt;p&gt;If there are any numerologists out there, maybe you can make some sense of it.&lt;/p&gt;


	&lt;p&gt;In any case, consider remembering some of these mnemonics. If you actually do more than remember them and start practicing them, I believe you&amp;#8217;ll become a better developer.&lt;/p&gt;</description>
      <pubDate>Thu, 02 Aug 2007 16:43:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:24504899-46fc-4769-9d4d-4796aa318cb2</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2007/08/02/which-came-first</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>TFP</category>
      <category>FIRST</category>
      <category>Unit</category>
      <category>Tests</category>
    </item>
  </channel>
</rss>
