DEV Community

Discussion on: Why every developer should be using TDD

Collapse
 
siy profile image
Sergiy Yevtushenko

Despite claims, TDD is not a silver bullet. And just like any technique it works for some people but not for all. It heavily depends on way of thinking, habits and experience.

By the way: functional programming approaches are far more efficient than TDD in regards to reducing number of bugs and number of necessary tests. Where TDD reduces bugs by half, FP reduces them by at least an order of magnitude.

Collapse
 
starswan profile image
Stephen Dicks • Edited

Could you post some links to evidence that FP reduces programming errors by so much please?

Collapse
 
siy profile image
Sergiy Yevtushenko

I'm speaking from my own experience. Couple years ago I've switched to FP-inspired style which leverages monads to represent "special states" (missing value, value or error, not-yet-available value). This allowed me to eliminate whole classes of errors from my code and heavily reduced number of necessary tests. In vast majority of cases if code compiles - it works and tests are necessary only to check business-level requirements (for example, input value constraints).
You may find more details in my blog here, at dev.to.