DEV Community

Discussion on: What are your thoughts on testing and TDD?

Collapse
 
jamesmh profile image
James Hickey

The Pragmatic Programmer (book) nails it:

Thinking about writing a test for our method made us look at it from the outside, as if we were a client of the code, and not its author.

And:

...most of the benefit of testing comes from thinking about the tests and their impact on the code. And, after doing it for so long [30 years], I could do that thinking without actually writing tests. My code was still testable, it just wasn't tested.

Collapse
 
imforja profile image
João Forja 💭

Gotta love that book. It aged really well!

Collapse
 
bcbreeden profile image
Brian Breeden

I like this perspective.

Collapse
 
cullophid profile image
Andreas Møller

Indeed. But you really don't need to be doing TDD for 30 years (or at all) to get there