Writing tests first (TDD) is a tradeoff


Writing tests first (TDD) is a tradeoff.

Writing tests first:
✅Assures my code is testable
✅Assures each feature is covered
✅Avoids regressions during development

But, writing tests later:
✅Avoids the overhead of rewriting my tests as my design evolves during development
Thus, my approach:

When I'm experimenting with different APIs, I write tests later.

When I'm confident in my initial design, I write tests first.

View original on X