<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>HanLHo. - Fractional Architect &amp; Software Product Engineer - gherkin</title>
    <link rel="self" type="application/atom+xml" href="https://hanlho.com/tags/gherkin/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://hanlho.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2024-11-14T00:00:00+00:00</updated>
    <id>https://hanlho.com/tags/gherkin/atom.xml</id>
    <entry xml:lang="en">
        <title>Notes on 🚀 TDD, Where Did It All Go Wrong</title>
        <published>2024-11-14T00:00:00+00:00</published>
        <updated>2024-11-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://hanlho.com/p/notes-on-tdd-where-did-it-all-go-wrong/"/>
        <id>https://hanlho.com/p/notes-on-tdd-where-did-it-all-go-wrong/</id>
        
        <content type="html" xml:base="https://hanlho.com/p/notes-on-tdd-where-did-it-all-go-wrong/">&lt;p&gt;My short notes on &lt;a href=&quot;https:&#x2F;&#x2F;youtube.com&#x2F;watch?v=EZ05e7EMOLM&amp;amp;si=z4CYVriIZOOKwQNV&quot;&gt;🚀 TDD, Where Did It All Go Wrong&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Still a lot of testing wisdom in this talk (re-watched 6 years after publication).&lt;&#x2F;p&gt;
&lt;h2 id=&quot;focus-on-behaviour&quot;&gt;Focus on behaviour&lt;&#x2F;h2&gt;
&lt;p&gt;Behaviour should be your primary focus when writing tests. The need for a new test should arise from new behaviour or requirements. While TDD is often contrasted with BDD, Kent Beck&#x27;s early work already emphasised the importance of focusing on behaviour.&lt;&#x2F;p&gt;
&lt;p&gt;When writing tests, be mindful of coupling. Your tests should not all fail when you change your code. Write tests against public contracts where possible. In my experience, you can deviate from this rule if your unit under test has a stable internal contract.&lt;&#x2F;p&gt;
&lt;p&gt;This approach leads to better &#x27;refactorability&#x27;. For a practical demonstration, I recommend watching &lt;a href=&quot;https:&#x2F;&#x2F;youtube.com&#x2F;watch?v=1WBIUYJVnok&amp;amp;si=ZiyE8Hvx3U5LsNHR&quot;&gt;TDD &amp;amp; DDD From the Ground Up Live Coding by Chris Simon&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;atdd-tools-are-not-worth-it-if-business-is-not-actively-participating&quot;&gt;ATDD tools are not worth it if business is not actively participating&lt;&#x2F;h2&gt;
&lt;p&gt;While I have promoted the use of ATDD (Acceptance Test Driven Development) tools like Gherkin, I must agree, the burden of translating between natural language and code can be &#x27;horrible&#x27;, to the point where internal frameworks are implemented to manage this complexity.&lt;&#x2F;p&gt;
&lt;p&gt;More importantly, the effort may not be worthwhile without an engaged business analyst or product owner. In my experience, business stakeholders rarely show interest in participating. While I&#x27;ve questioned whether I could have done more to encourage engagement, this talk confirms this is a common challenge. Though disappointing to acknowledge, as the practice appears promising on paper, this seems to be the reality we face.&lt;&#x2F;p&gt;
&lt;p&gt;That said, the consistent style these tools promote can still be valuable in test writing.&lt;&#x2F;p&gt;
&lt;p&gt;If you had success using Gherkin or similar tool I would be interested in learn how.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;do-not-forget-about-refactor&quot;&gt;Do not forget about Refactor&lt;&#x2F;h2&gt;
&lt;p&gt;The TDD-cycle is Red-Green-&lt;strong&gt;Refactor&lt;&#x2F;strong&gt;. First fix the problem, then improve the design. The central idea is to decouple thinking about the problem from thinking about the design. The Refactor step is where the design is improved and is an integral part of the cycle.&lt;&#x2F;p&gt;
&lt;p&gt;This methodical approach leads to more maintainable code, contrasting with the approach of the &#x27;Duct-tape Programmer&#x27; (this talk) or &#x27;Tactical Tornado&#x27; (&lt;a href=&quot;https:&#x2F;&#x2F;www.goodreads.com&#x2F;book&#x2F;show&#x2F;39996759-a-philosophy-of-software-design?from_search=true&amp;amp;from_srp=true&amp;amp;qid=VdXFhGejkS&amp;amp;rank=1&quot;&gt;Ousterhout&lt;&#x2F;a&gt;) approach.&lt;&#x2F;p&gt;
&lt;p&gt;When you can improve the design without changing tests, you have achieved good decoupling.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
