---
title: Why TDD is a must from a Return on Investment (ROI) point of view
description: TDD is a concept wherein developers write automated test cases that test out the source code implementation. It's not a tool or technology, rather practice to be followed. The practice dictates that before writing your implementation you should write automated test cases.
image: https://blog.e-zest.com/hubfs/blog-files/TDD.jpg
---

[![e-Zest logo\_An accion lab company\_Colour](https://blog.e-zest.com/hubfs/images/Logos%20with%20Tagline/Corporate/SVG/e-Zest%20logo_An%20accion%20lab%20company_Colour.svg "e-Zest logo_An accion lab company_Colour")](https://www.e-zest.com/)

- [WORK](https://www.e-zest.com/our-work)
- [SERVICES](https://www.e-zest.com/our-services) 
    - [Product Engineering](https://www.e-zest.com/digital-product-engineering-services)
    - [Enterprise Data Services](https://www.e-zest.com/enterprise-data-services)
    - [Digital Commerce](https://www.e-zest.com/digital-commerce-services)
    - [Digital Operations](https://www.e-zest.com/digital-operations)
    - [Digital Consulting](https://www.e-zest.com/digital-transformation-consulting-services)
    - [Digital Experience Design](https://www.e-zest.com/digital-experience-design)
- [INSIGHTS](https://blog.e-zest.com/)
- [CAREERS](https://www.e-zest.com/careers)
- [ENTERPRISE DATA SERVICES](https://www.e-zest.com/enterprise-data-services)
- [GENERATIVE AI](https://www.e-zest.com/generative-ai)
- [Healthcare](https://healthcare.e-zest.com)
- [Contact Us](https://www.e-zest.com/contact-us)

- ![Elevating Product Engineering with AI and ML](https://blog.e-zest.com/hubfs/Elevating%20Product%20Engineering%20with%20AI%20and%20ML.jpg)

  [BLOGS](https://blog.e-zest.com)
  
  #### Elevating Product Engineering with AI and ML

  As technology evolves and customer choices broaden, there is an increasing ...

  [Read more](https://blog.e-zest.com/elevating-product-engineering-with-ai-and-ml)
- ![e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024](https://blog.e-zest.com/hubfs/e-Zest%20%E2%80%93%20An%20Accion%20Labs%20Company%20-%20Gets%20Recognition%20as%20a%20Contender%20in%20the%20ISG%20Provider%20LensTM%20Study%20on%20Digital%20Engineering%20Services%202024.jpg)

  [NEWS](https://blog.e-zest.com/news)
  
  #### e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024

  We are delighted to announce that e-Zest – An Accion Labs Company has been ...

  [Read more](https://blog.e-zest.com/news/e-zest-an-accion-labs-company-gets-recognition-as-a-contender-in-the-isg-provider-lens-study-on-digital-engineering-services-2024)
- ![e-Zest Solutions supports Digital Pune Mission](https://blog.e-zest.com/hubfs/blog-files/Digital%20Literacy%20Bus%20e-Zest.png)

  [CSR](https://blog.e-zest.com/csr)
  
  #### e-Zest Solutions supports Digital Pune Mission

  **Pune, India:** e-Zest Solutions, a leading digital technology innovation ...

  [Read more](https://blog.e-zest.com/csr/e-zest-solutions-supports-digital-pune-mission)

- [Work](https://www.e-zest.com/our-work)
- [Services](https://www.e-zest.com/our-services)
- [Insights](https://blog.e-zest.com)
- [Careers](https://www.e-zest.com/careers)
- [Enterprise Data](https://www.e-zest.com/enterprise-data-services)
- [Generative AI](https://www.e-zest.com/generative-ai)
- [Innovations](https://www.e-zest.com/innovations)
- [Healthcare](https://healthcare.e-zest.com)
- [About](https://www.e-zest.com/about-us)
- [Contact](https://www.e-zest.com/contact-us)

- [Blog](https://blog.e-zest.com/)
- [News](https://blog.e-zest.com/news)
- [CSR](https://blog.e-zest.com/csr)

- [![Linkedin Icon](https://blog.e-zest.com/hubfs/icons/linkedin_icon_white.svg)](https://www.linkedin.com/company/e-zest-solutions/)
- [![Twitter Icon](https://blog.e-zest.com/hubfs/twitter-logo-silhouette%20(5).svg)](https://twitter.com/ezest)
- [![Facebook Icon](https://blog.e-zest.com/hubfs/facebook-app-logo%20(4).svg)](https://www.facebook.com/61259256638)
- [![Instagram Icon](https://blog.e-zest.com/hubfs/instagram-logo%20(4).svg)](https://www.instagram.com/ezestsolutions/)
- [![Youtube Icon](https://blog.e-zest.com/hubfs/icons/youtube_icon_white.svg)](https://www.youtube.com/user/ezestcorporate)

[![Go to top icon](https://blog.e-zest.com/hubfs/AA%20Assets/top%20button.svg)](https://blog.e-zest.com/why-tdd-is-a-must-from-a-return-on-investment-roi-point-of-view#top)

Hit enter to search or ESC to close

Insights

e-Zest members share technology ideas to foster digital transformation.

- [Blog](https://blog.e-zest.com)
- [Whitepaper](https://blog.e-zest.com/whitepaper)
- [Playbook](https://blog.e-zest.com/playbook)
- [News](https://blog.e-zest.com/news)
- [CSR](https://blog.e-zest.com/csr)
- [Innovation](https://blog.e-zest.com/innovation)
- [Healthcare](https://blog.e-zest.com/healthcare)
- [Media Kit](https://www.e-zest.com/media-kit)

# Why TDD is a must from a Return on Investment (ROI) point of view

[Md Shahzad Adil](https://blog.e-zest.com/author/md-shahzad-adil)  May 14, 2020

[Unit Test](https://blog.e-zest.com/topic/unit-test) [TDD](https://blog.e-zest.com/topic/tdd) [Test Driven Development](https://blog.e-zest.com/topic/test-driven-development) [Integration Test](https://blog.e-zest.com/topic/integration-test)

- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/why-tdd-is-a-must-from-a-return-on-investment-roi-point-of-view&title=&summary=&source=>
- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/why-tdd-is-a-must-from-a-return-on-investment-roi-point-of-view&text=Why%20TDD%20is%20a%20must%20from%20a%20Return%20on%20Investment%20(ROI)%20point%20of%20view>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/why-tdd-is-a-must-from-a-return-on-investment-roi-point-of-view>
- <https://www.instagram.com/ezestsolutions/?u=https://blog.e-zest.com/why-tdd-is-a-must-from-a-return-on-investment-roi-point-of-view>

There has been a lot of discussion going around Test-Driven Development (TDD) lately and almost everyone is trying to jump on the bandwagon or following it or at least they claim to be! For people who are not aware, there are 2 concepts -

1. Automated tests
2. TDD

**Automated Tests**

Automated tests are written to test out portions of code in an automated manner. That means no human intervention is required – such as a QA opening up the application and running the test cases by following several manual steps, entering data, performing actions. Rather, automated tests are code in themselves. They are written to invoke certain components, pass some test data and test the results. All these are done through a test case that is purposely written in code. Thus to run the test case, no human intervention is required. One only needs to run the automated test case and it will test out the functionality.

**TDD**

TDD is a concept where developers write automated test cases that test out the source code implementation. It is not any tool or technology; rather a practice to be followed. The practice dictates that before writing your implementation, you should write automated test cases. The TDD process primarily goes through 3 steps:

**1. Red**

This phase is when we do not have any implementation and we write test cases before them. Once we write the automated tests, we run them. They will fail as we have not implemented anything yet.

**2. Green**

Once we have our set of automated test cases ready, we start writing our implementation and re-run our test cases. Based on whether the test cases pass or fail, we adjust our implementation so that all test cases and correct expectations pass.

**3. Refactor**

Once the implementation is ready and the test cases are passing, it means we have achieved the functionality we wanted to. We can now refactor the code. And we can easily run the test cases again in a few seconds. That would save a lot of time and make refactoring easier as we do not have to test the entire application manually every time we make a change.

**Concerns About TDD**

The concept seems amazing and it is. It has some amazing benefits when followed. But there are still some concerns in the minds of people as to why they should follow this. Some people do not find any value in this. One of the main reasons for the people to reject TDD is the time taken to write test cases is an additional overhead. And as the application will be tested anyway in the QA phase, some feel the writing of automated test cases and that too before development leads to additional cost as it takes additional time to write them. In this article, we will be addressing this specific scenario and see how these claims are baseless with the help of an example.

**The Example Setup and Premise**

As a myth buster, I have considered a very simple example with the simplest of use case for demonstration. I have an API that does not do anything, it just returns a simple error response with status code and messages as below. It could be any simple method that can be called from the automated tests. In reality, the method would contain some other business logic and operations too; but for simplicity, the code has been omitted and only relevant portions have been retained.

![Automated test case for testing the method and response data](https://blog.e-zest.com/hs-fs/hubfs/blog-files/internal-servver-error.png?width=600&name=internal-servver-error.png)*Figure 1: API method returning a response with code and message*

To test it, there is an automated test that calls this method and verifies the response data. The test ensures that the method behaves exactly as it is supposed to. As you can see below, the test just calls the method, receives the response and verifies that we have received the same data that we were supposed to. If not, the test case will fail.

![Automated test case for testing the method and response data](https://blog.e-zest.com/hs-fs/hubfs/blog-files/Test%20Method.png?width=618&name=Test%20Method.png)*Figure 2: Automated test case for testing the method and response data*

There are several other test cases in the system to test the entire app and are divided into 2 types

- **Unit tests** that test only one component at a time
- **Integration tests** that test the entire end-to-end flow across component boundaries

![The whole set of automated tests](https://blog.e-zest.com/hs-fs/hubfs/blog-files/The%20whole%20set%20of%20automated%20tests.png?width=573&name=The%20whole%20set%20of%20automated%20tests.png)

*Figure 3: The whole set of automated tests*

**The Test Premise**

For the test execution, a simple scenario is considered. The requirement is to just change the message returned - from “Internal Server Error” to something else when the method is executed. During that execution, the time taken to update and test the scenario will be compared with respect to

- Implementing and testing the changes through manual debugging
- Implementing and testing the changes through automated tests

At the end, the results will be compared to arrive at a conclusion through statistics.

**Implementation & Execution**

The changes were implemented using both the approaches and the timings were noted.

Below is a breakup of the observations -

![qq-7](https://blog.e-zest.com/hs-fs/hubfs/qq-7.png?width=620&name=qq-7.png)*Figure 4: Implementation and test manually without TDD*

![Implementation and test with TDD](https://blog.e-zest.com/hs-fs/hubfs/Implementation%20and%20test%20with%20TDD.png?width=604&name=Implementation%20and%20test%20with%20TDD.png)

*Figure 5: Implementation and test with TDD*

**Analysis of the Findings**

The timeline clearly shows that changing the same things manually took almost double the amount of time. And even in that, there are a lot of factors -

1. For the test, the changes were done in one go. But in reality, code has to be changed several times to get the implementation correct. In those cases, the difference has been much higher and manual approach will takes more time.
2. In the approach without TDD and automated tests, we haven’t even considered the scenarios for regression tests, i.e. testing all other functionalities. In real cases, that is an overhead and as you can see using TDD all the test cases took just 14 seconds to run whereas it could take hours to run the same without TDD and automation.
3. The test does not consider possible refactoring. In the case of automated tests, it is easier. In the other approach, every time refactoring is done, the whole cycle needs to be repeated resulting in more time.
4. The scenario considered in this test is really simple. In reality, it is way more complicated than that. Even in such simple scenarios, the difference is substantial. As the complexity and the size of the app grows, the manual approach would consume way more time as compared to TDD with automation.

**To Sum Up**

As per the statistics, it is quite clear that if the simplest scenarios like these can provide such huge benefits in terms of saving time and effort, real-world scenarios will lead to greater savings. Yes, there will always be difficulties with TDD like a learning curve but a little extra time at the start of development to establish TDD practices greatly outweighs the benefits in terms of Return on Investment (ROI).

- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/why-tdd-is-a-must-from-a-return-on-investment-roi-point-of-view&text=Why%20TDD%20is%20a%20must%20from%20a%20Return%20on%20Investment%20(ROI)%20point%20of%20view>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/why-tdd-is-a-must-from-a-return-on-investment-roi-point-of-view>
- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/why-tdd-is-a-must-from-a-return-on-investment-roi-point-of-view&title=&summary=&source=>

### Similar Blog

[![How to write/create Unit Test in Angularjs 2.0 using jasmine core](https://blog.e-zest.com/hubfs/Stock%20images/Business%20person%20working%20on%20computer%20against%20technology%20background.jpeg) How to write/create Unit Test in Angularjs 2.0 using jasmine core In this blog I have used Angular RC1 latest upgraded version to implement unit testing using jasmine core. By Aarti Shinde May 31, 2016](https://blog.e-zest.com/how-to-write-and-create-unit-test-in-angular-js-2.0-using-jasmine-core)

[![ASP.NET Core App using EF Core and SQLite database](https://blog.e-zest.com/hubfs/Basics%20of%20Stored%20Procedure%20in%20SQL%20Server%20Management%20Studio-191118.png) ASP.NET Core App using EF Core and SQLite database **INTRODUCTION**The tutorial covers a basic example of how to build a simple API in ASP.NET Core using Entity Framework Core and ... By Md Shahzad Adil Jun 19, 2018](https://blog.e-zest.com/asp.net-core-app-using-ef-core-and-sqlite-database)

[![Importing data from Excel to SQL database table directly](https://blog.e-zest.com/hubfs/Healthcare%20Microsite/Website%20Banners/What%20we%20do.png) Importing data from Excel to SQL database table directly There are many instances where you might be developing an application, but you want some seed data or business data to be ... By Md Shahzad Adil Nov 21, 2016](https://blog.e-zest.com/importing-data-from-excel-to-sql-database-table-directly)

[![Pass command line arguments from InstallShield/MSI installer to custom action EXE](https://blog.e-zest.com/hubfs/11.png) Pass command line arguments from InstallShield/MSI installer to custom action EXE With Visual Studio a lot of things have changed especially after they have dropped the support for setup projects and instead ... By Md Shahzad Adil May 10, 2016](https://blog.e-zest.com/pass-command-line-arguments-from-installshield-or-msi-installer-to-custom-action-exe)

## Helping Organizations Thrive in the Digital Age

[Contact Us](https://www.e-zest.com/contact-us)

- [About](https://www.e-zest.com/about-us)
- [Services](https://www.e-zest.com/our-services)
- [Work](https://www.e-zest.com/our-work)
- [Insights](https://blog.e-zest.com/)
- [Healthcare](https://healthcare.e-zest.com/)
- [Accion Labs](https://www.accionlabs.com/)

- <https://www.linkedin.com/company/e-zest-solutions/>
- <https://twitter.com/ezest>
- <https://www.facebook.com/eZest/>
- <https://www.instagram.com/ezestsolutions/>
- <https://www.youtube.com/user/ezestcorporate>

- Dallas
- Detroit
- Hannover
- Vienna
- London
- Pune

 © 2025 e-Zest Solutions

- [Privacy Policy](https://www.e-zest.com/privacypolicy)
- [Cookie Policy](https://www.e-zest.com/cookie-policy)

 Contact us

 Contact us

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.