<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel><title>tdd | Hugo Ferreira</title>
    <link>https://hugo.ferreira.cc/tags/tdd/</link>
    <description>Recent content in Tdd by Hugo Ferreira</description>
    <image>
      <title>tdd | Hugo Ferreira</title>
      <url>https://hugo.ferreira.cc/hf-bw.jpg</url>
      <link>https://hugo.ferreira.cc/tags/tdd/</link>
    </image>
    <generator>Hugo -- 0.124.1</generator>
    <language>en</language>
    <copyright>2000–2024 by Hugo Ferreira · CC BY 4.0</copyright>
    <lastBuildDate>Fri, 15 Mar 2024 08:26:06 +0000</lastBuildDate>
    <atom:link href="https://hugo.ferreira.cc/tags/tdd/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>🔗 Test-Driven Development Guided by ZOMBIES</title>
      <link>https://hugo.ferreira.cc/tdd-zombies/</link>
      <pubDate>Fri, 15 Mar 2024 08:26:06 +0000</pubDate>
      <guid>https://hugo.ferreira.cc/tdd-zombies/</guid>
      <description>Test-Driven Development Guided by ZOMBIES | Agile Alliance
The acronym stands for:
Z – Zero O – One M – Many (or More complex) B – Boundary Behaviors I – Interface definition E – Exercise Exceptional behavior S – Simple Scenarios, Simple Solutions </description>
      <content:encoded><![CDATA[<p><a href="https://www.agilealliance.org/resources/sessions/test-driven-development-guided-by-zombies/">Test-Driven Development Guided by ZOMBIES | Agile Alliance</a></p>
<blockquote>
<p>The acronym stands for:</p>
<ul>
<li>Z – Zero</li>
<li>O – One</li>
<li>M – Many (or More complex)</li>
<li>B – Boundary Behaviors</li>
<li>I – Interface definition</li>
<li>E – Exercise Exceptional behavior</li>
<li>S – Simple Scenarios, Simple Solutions</li>
</ul>
</blockquote>
]]></content:encoded>
    </item>
    <item>
      <title>📺 Transformation Priority Premise</title>
      <link>https://hugo.ferreira.cc/uncle-bob-martin-walks-through-the-prime-factors/</link>
      <pubDate>Tue, 18 Mar 2014 07:07:28 +0000</pubDate>
      <guid>https://hugo.ferreira.cc/uncle-bob-martin-walks-through-the-prime-factors/</guid>
      <description>Uncle Bob Martin walks through the &amp;ldquo;Prime Factors&amp;rdquo; kata in Java (29m06s) to illustrate the concept of Transformation Priority Premise as a way to address the common complaint about TDD: the brainlessness
&amp;ldquo;As the tests get more specific, the code gets more generic.&amp;rdquo;
&amp;hellip; and &amp;ldquo;here&amp;rsquo;s the list of transformations&amp;rdquo; (47m53s):
So what are these transformations? Perhaps we can make a list of them:
({}&amp;ndash;&amp;gt;nil) no code at all-&amp;gt;code that employs nil (nil-&amp;gt;constant) (constant-&amp;gt;constant+) a simple constant to a more complex constant (constant-&amp;gt;scalar) replacing a constant with a variable or an argument (statement-&amp;gt;statements) adding more unconditional statements.</description>
      <content:encoded><![CDATA[<p>Uncle Bob Martin walks through the &ldquo;Prime Factors&rdquo; kata in Java (<a href="http://www.youtube.com/watch?v=B93QezwTQpI#t=20m06s">29m06s</a>) to illustrate the concept of <a href="http://blog.8thlight.com/uncle-bob/2013/05/27/TheTransformationPriorityPremise.html">Transformation Priority Premise</a> as a way to address the common complaint about TDD: <em>the brainlessness</em></p>
<blockquote>
<p>&ldquo;As the tests get more specific, the code gets more generic.&rdquo;</p>
</blockquote>
<p>&hellip; and &ldquo;<a href="http://www.youtube.com/watch?v=B93QezwTQpI#t=47m53s">here&rsquo;s the list of transformations</a>&rdquo; (<a href="http://www.youtube.com/watch?v=B93QezwTQpI#t=47m53s">47m53s</a>):</p>
<blockquote>
<p>So what are these transformations? Perhaps we can make a list of them:</p>
<ol>
<li><strong>({}&ndash;&gt;nil)</strong> no code at all-&gt;code that employs nil</li>
<li><strong>(nil-&gt;constant)</strong></li>
<li><strong>(constant-&gt;constant+)</strong> a simple constant to a more complex
constant</li>
<li><strong>(constant-&gt;scalar)</strong> replacing a constant with a variable or an
argument</li>
<li><strong>(statement-&gt;statements)</strong> adding more unconditional statements.</li>
<li><strong>(unconditional-&gt;if)</strong> splitting the execution path</li>
<li><strong>(scalar-&gt;array)</strong></li>
<li><strong>(array-&gt;container)</strong></li>
<li><strong>(statement-&gt;recursion)</strong></li>
<li><strong>(if-&gt;while)</strong></li>
<li><strong>(expression-&gt;function)</strong> replacing an expression with a
function or algorithm</li>
<li><strong>(variable-&gt;assignment)</strong> replacing the value of a variable.</li>
</ol>
<p>There are likely others.</p>
</blockquote>
<p>&hellip; and, the process:</p>
<blockquote>
<p>If we accept the Priority Premise, then we should amend the typical
<code>red-green-refactor</code> process of TDD with the following provision:</p>
<ul>
<li>When passing a test, prefer higher priority [<em>simpler</em>]
transformations.</li>
<li>When posing a test choose one that can be passed with higher
priority [<em>simpler</em>] transformations.</li>
<li>When an implementation seems to require a low priority
transformation, backtrack to see if there is a simpler test to
pass.</li>
</ul>
</blockquote>
<p>( Source: <a href="https://www.youtube.com/">https://www.youtube.com/</a> )</p>
]]></content:encoded>
    </item>
    <item>
      <title>📜 First make it work (get tests to pass)</title>
      <link>https://hugo.ferreira.cc/first-make-it-work-get-tests-to-pass-then-make/</link>
      <pubDate>Tue, 03 Dec 2013 07:07:28 +0000</pubDate>
      <guid>https://hugo.ferreira.cc/first-make-it-work-get-tests-to-pass-then-make/</guid>
      <description>First make it work (get tests to pass).
Then make it right (clean it).
Then make it fast. (if it needs it).
Uncle Bob (via How to convince &amp;lsquo;performance guys&amp;rsquo; to Clean Code &amp;ndash; Google Groups )</description>
      <content:encoded><![CDATA[<blockquote>
<p>First make it work (get tests to pass).<br>
Then make it right (clean it).<br>
Then make it fast. (if it needs it).</p>
</blockquote>
<p>Uncle Bob (via <a href="https://groups.google.com/forum/#!search/authormsg%243Aclean-code-discussion%242Ci4DMN-ez5YUJ%2420after%243A2013%242F7%242F1%2420before%243A2013%242F8%242F1%7Csort:date/clean-code-discussion/sEXle5y9flM/2n7Osv0eaycJ">How to convince &lsquo;performance guys&rsquo; to Clean Code &ndash;
Google
Groups</a>
)</p>
]]></content:encoded>
    </item>
    <item>
      <title>🔗 Mocks Aren&#39;t Stubs</title>
      <link>https://hugo.ferreira.cc/mocks-arent-stubs/</link>
      <pubDate>Thu, 24 Oct 2013 07:07:28 +0000</pubDate>
      <guid>https://hugo.ferreira.cc/mocks-arent-stubs/</guid>
      <description>Mocks Aren&amp;rsquo;t Stubs
Meszaros uses the term Test Double as the generic term for any kind of pretend object used in place of a real object for testing purposes. The name comes from the notion of a Stunt Double in movies. (&amp;hellip;) Meszaros then defined four particular kinds of double:
Dummy objects are passed around but never actually used. Usually they are just used to fill parameter lists. Fake objects actually have working implementations, but usually take some shortcut which makes them not suitable for production (an in memory database is a good example).</description>
      <content:encoded><![CDATA[<p><a href="http://martinfowler.com/articles/mocksArentStubs.html">Mocks Aren&rsquo;t
Stubs</a></p>
<blockquote>
<p>Meszaros uses the term <strong>Test Double</strong> as the generic term for any
kind of pretend object used in place of a real object for testing
purposes. The name comes from the notion of a Stunt Double in movies.
(&hellip;) Meszaros then defined four particular kinds of double:</p>
<ul>
<li><strong>Dummy</strong> objects are passed around but never actually used.
Usually they are just used to fill parameter lists.</li>
<li><strong>Fake</strong> objects actually have working implementations, but
usually take some shortcut which makes them not suitable for
production (an in memory database is a good example).</li>
<li><strong>Stubs</strong> provide canned answers to calls made during the test,
usually not responding at all to anything outside what&rsquo;s
programmed in for the test. Stubs may also record information
about calls, such as an email gateway stub that remembers the
messages it &lsquo;sent&rsquo;, or maybe only how many messages it &lsquo;sent&rsquo;.</li>
<li><strong>Mocks</strong> are what we are talking about here: objects
pre-programmed with expectations which form a specification of the
calls they are expected to receive.</li>
</ul>
</blockquote>
<blockquote>
<p>The <strong>classical TDD</strong> style is to use real objects if possible and a
double if it&rsquo;s awkward to use the real thing. So a classical TDDer
would use a real warehouse and a double for the mail service. The kind
of double doesn&rsquo;t really matter that much.</p>
<p>A <strong>mockist TDD</strong> practitioner, however, will always use a mock for
any object with interesting behavior. In this case for both the
warehouse and the mail service.</p>
</blockquote>
]]></content:encoded>
    </item>
  </channel>
</rss>
