<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrea Laforgia</title>
    <description>The latest articles on DEV Community by Andrea Laforgia (@andrealaforgia).</description>
    <link>https://dev.to/andrealaforgia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F216628%2F916d46b8-2ab2-4d85-a927-9684c64e6a3c.jpg</url>
      <title>DEV Community: Andrea Laforgia</title>
      <link>https://dev.to/andrealaforgia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andrealaforgia"/>
    <language>en</language>
    <item>
      <title>Test-Driven Development or Test-Driven Design?</title>
      <dc:creator>Andrea Laforgia</dc:creator>
      <pubDate>Sun, 14 Mar 2021 16:49:00 +0000</pubDate>
      <link>https://dev.to/andrealaforgia/why-test-driven-design-386c</link>
      <guid>https://dev.to/andrealaforgia/why-test-driven-design-386c</guid>
      <description>&lt;p&gt;We all know that TDD means “Test-Driven Development” but I think of TDD more as a design tool than a testing tool.&lt;/p&gt;

&lt;p&gt;That’s why I call it “Test-Driven Design”.&lt;/p&gt;

&lt;p&gt;Imagine that you want to implement a software component to evaluate a mathematical expression. I’ll assume a class, but it could be anything (a function, etc.).&lt;/p&gt;

&lt;p&gt;I would write a test first (in pseudocode, the specific language is not important here):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ExpressionEvaluatorTest:
    shouldEvaluateExpression():
        expressionEvaluator = ExpressionEvaluator()
        value = expressionEvaluator.evaluate(“-(3-2)/4^-2”)
        assert value == -16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This would be the very starting point for the creation of all the sub-components required to accomplish this task. &lt;/p&gt;

&lt;p&gt;Writing the code for &lt;code&gt;ExpressionEvaluator.evaluate()&lt;/code&gt; would reveal the need for an &lt;code&gt;ExpressionParsingStrategyFactory&lt;/code&gt; class that would &lt;code&gt;build()&lt;/code&gt; an instance of an &lt;code&gt;ExpressionParsingStrategy&lt;/code&gt; class, which would &lt;code&gt;execute()&lt;/code&gt; on the expression and generate an instance of an &lt;code&gt;ExpressionParseTree&lt;/code&gt; class, whose &lt;code&gt;evaluate()&lt;/code&gt; method would return the final value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ExpressionEvaluator:
    evaluate(expression):
        parsingStrategy = ExpressionParsingStrategyFactory.build(SHIFT_REDUCE_PS)
        parseTree = parsingStrategy.parse(expression)
        return parseTree.evaluate()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each class should be in turn TD-designed, so &lt;code&gt;ExpressionParsingStrategyFactoryTest&lt;/code&gt; would drive the design of the &lt;code&gt;ExpressionParsingStrategyFactory&lt;/code&gt; class, which would reveal the need for a &lt;code&gt;ShiftReduceParsingStrategyTest&lt;/code&gt;, which would drive the design of a &lt;code&gt;ShiftReduceParsingStrategy&lt;/code&gt; class, which would lead to an &lt;code&gt;ExpressionTokenAnalyserTest&lt;/code&gt;, which would drive the design of the &lt;code&gt;ExpressionTokenAnalyser&lt;/code&gt; class, which would make the class &lt;code&gt;ExpressionToken&lt;/code&gt; emerge, whose design would be driven by &lt;code&gt;ExpressionTokenTest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So TDD is really a way of discovering the various components required by our code, and &lt;em&gt;only those&lt;/em&gt; components. This enforces the &lt;em&gt;S&lt;/em&gt;, the &lt;em&gt;I&lt;/em&gt;, and the &lt;em&gt;D&lt;/em&gt; principles in &lt;a href="https://en.m.wikipedia.org/wiki/SOLID"&gt;SOLID&lt;/a&gt; and leads to a better modularization than classic code-first methods. &lt;/p&gt;

</description>
      <category>tdd</category>
      <category>programming</category>
    </item>
    <item>
      <title>Don't do Agile - be agile.</title>
      <dc:creator>Andrea Laforgia</dc:creator>
      <pubDate>Tue, 25 Feb 2020 14:54:04 +0000</pubDate>
      <link>https://dev.to/andrealaforgia/don-t-do-agile-be-agile-3ab9</link>
      <guid>https://dev.to/andrealaforgia/don-t-do-agile-be-agile-3ab9</guid>
      <description>&lt;p&gt;Cargo culting is defined as "an approach that copies an existing successful approach without properly analysing and understanding it."&lt;/p&gt;

&lt;p&gt;I've seen way too many places cargo-culting Agile and ending up in what is normally called "Agile Theatre". &lt;/p&gt;

&lt;p&gt;If you are just starting with Agile, or going through a transformation from Waterfall, be as little dogmatic as possible about which approach to follow.&lt;/p&gt;

&lt;p&gt;Be careful about involving experienced, long-time Agile practitioners into an inexperienced team.&lt;/p&gt;

&lt;p&gt;Don't let experts impose rules (or, even worse, "ceremonies") that nobody fully understands.&lt;/p&gt;

&lt;p&gt;Teach your team what being agile really means, instead: what advantages and what disadvantages.&lt;/p&gt;

&lt;p&gt;Start simple; then increase complexity if and when the team is ready to digest it.&lt;/p&gt;

&lt;p&gt;Remember: there's no obligation to adopt Scrum. There's no obligation to adopt Kanban. Just let whatever works in your place mature as a process - don't even give it a name. Stick to whatever way of working enables you to be truly agile and produce the value you want and need.&lt;/p&gt;

&lt;p&gt;Beware of Agile - be agile instead.&lt;/p&gt;

&lt;p&gt;Remember that those big Agile gurus out there, who keep writing books and selling courses, have a vested interest in promoting Scrum or Kanban, or whatever other Agile paradigms. They have often set up a company that makes money off that. Not all of them are malicious but, ultimately, they don't care about what's best for you; they care about what's best for them.&lt;/p&gt;

&lt;p&gt;Abandon the word "ceremonies".&lt;/p&gt;

&lt;p&gt;Ditch estimates if you can: &lt;a href="http://noestimates.org/blog/"&gt;http://noestimates.org/blog/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
