Benefits and Limitations of TDD (Test Driven Development)

Profile picture for user devraj

Test-driven development (TDD) is an evolutionary approach to development which combines test-first development where we write a test before we write code. It has following benefits or limitations:

TDD Benefits

  • Improve Productivity: Writing tests in TDD forces you to think about use cases, and improves productivity. Even considering that the amount of code based on writing unit tests, the total implementation will be shorter and less buggy.
  • Flexible & Extensive Development: If common TDD practices are followed, the code developed is flexible, extensible and easy to maintain.
  • Automatic Regression Detection: Automatic regression detection on every incremental update.
  • Easier documentation: unit tests are self-documenting, easier to read and understand.

TDD Limitations

  • Blind Spots: When developers themselves write the unit tests, the tests may share the same blind spots as the code.
  • False Sense of Security: At times, high numbers of passing tests can create a false sense of security, causing fewer testing activities during integration testing, potentially causing problems.
  • Maintenance Overhead: Tests become part of the maintenance overhead. Badly written tests can further cause more costs in maintenance or updating.