Hacker News new | ask | show | jobs
by fsloth 4190 days ago
Boy, are we diverging :)

From my experience TDD is kinda newspeak in the sense that it does not help at least in the first stages of design. From what I've managed to gleam as valuable way of working is test driven implementation. I.e. when implementing something akin to a simple datastructure I can test the interface functions as I write them which verifies the interface is not silly and that it works.

Another place where implementing tests concurrently brings value is using the tests as a form of documentation.

I would not call TDD a design methodology beyond the fact that usually implementing interfaces (and verifying it works) is good practice while speccing it.

Tests bring lots of value to a codebase beyond the fact that it sounds impressive to have a 95% coverage. From what I understand of the pathologies of software development having the TDD tagged as methodology is to allow the programmers implement tests in peace, politically shielded from the more gung ho elements of the stakeholderkin.

Summary: IMO if production code has no tests something is wrong. But I would say the most value tests bring is in verifying the algebra of the interface, protecting against breaking commits and documenting the inteded usage through examples. I would not say writing unit tests is a particularly powerfull design methodology but playing with code is, and calling what the developer is doing as 'TDD' gives the developer the mental piece to do exactly this.

1 comments

Most of the advantages you list are about testing, not testing before coding, which is what I was curious about.