<?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: Kalpesh Darji</title>
    <description>The latest articles on DEV Community by Kalpesh Darji (@kalpeshbdarji).</description>
    <link>https://dev.to/kalpeshbdarji</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%2F33884%2F2af7143e-eb87-448a-bf1e-4fe55348a220.jpg</url>
      <title>DEV Community: Kalpesh Darji</title>
      <link>https://dev.to/kalpeshbdarji</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kalpeshbdarji"/>
    <language>en</language>
    <item>
      <title>The Outrageous Cost of Skipping TDD </title>
      <dc:creator>Kalpesh Darji</dc:creator>
      <pubDate>Tue, 09 Oct 2018 14:25:14 +0000</pubDate>
      <link>https://dev.to/kalpeshbdarji/the-outrageous-cost-of-skipping-tdd--497a</link>
      <guid>https://dev.to/kalpeshbdarji/the-outrageous-cost-of-skipping-tdd--497a</guid>
      <description>&lt;p&gt;You’ve already heard of Test-Driven Development. Finally, you get down to trying it out for real. You even manage to convince your whole team to adopt it with you. Now you ask yourself how to find out, whether TDD actually benefits your team. &lt;/p&gt;

&lt;p&gt;Here's the comprehensive blog &lt;a href="https://simform.com/what-is-tdd/"&gt;What is TDD?&lt;/a&gt; to know more about Test-driven development.   &lt;/p&gt;

&lt;p&gt;One of the primary reasons managers cite for waiting so long to implement TDD is the cost. It’s common for the initial project &lt;a href="https://www.computer.org/csdl/mags/so/2007/03/s3024.pdf"&gt;build-outs to take up to 30% longer with TDD&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What those managers need to know is that &lt;a href="https://www.computer.org/csdl/mags/so/2007/03/s3024.pdf"&gt;TDD reduces production bug density 40% — 80%&lt;/a&gt;, and that makes all the difference. More bugs in production leads to a dramatic rise in maintenance costs.&lt;/p&gt;

&lt;p&gt;Before adopting TDD, we ran a small survey project with and without TDD. There were 4 developers working on each project with an average salary of $150. Here are the results of each project.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Without TDD:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. of man-hours to complete a project: 200 hours&lt;br&gt;
No. of production bugs without TDD: 70&lt;br&gt;
Average time to fix bug at production: 4 hours&lt;br&gt;
Total hours: 200 + (70x4=280) = 480 hours&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With TDD:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. of man-hours to complete a project: 240 hours&lt;br&gt;
No. of production bugs without TDD: 70&lt;br&gt;
Average time to fix bug at the implementation: 1 hour&lt;br&gt;
Total hours: 240+70 = 310 hours&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We saved 480-310= 170 hours X $150/hour = $ 25500.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why cost of fixing production bugs is less in TDD?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In TDD, your team can maintain a stable code base throughout the development lifecycle. By properly creating tests first, and then writing code that passes those tests, the chances of regressive bugs popping up drops dramatically.&lt;/p&gt;

&lt;p&gt;On the other hand, in traditional approach cost of fixing production bugs is high because developers are pulled out of the context in which they’re currently working and dumped into the context of the bug. It takes time to absorb the related code and flow, diagnose a root cause, fix the bug, and then reabsorb the context of what they were working on before.&lt;/p&gt;

&lt;p&gt;In other words, the cost of fixing bugs that get released in production isn’t just about the cost of fixing the production bug. Interruptions increase the cost of current development work and introduce more bugs that will eventually need fixing, too.&lt;/p&gt;

&lt;p&gt;What is your experience with TDD in terms of cost and development time?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>tdd</category>
      <category>programming</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
