As a full-stack engineer, I'm a huge proponent of TDD in certain situations. Specifically, when given a very well defined problem-set (e.g. "create a report, which, given X, returns Y"), but less when given a far broader task (which, in my experience, I find much more with front-end tasks).
The cognitive load required up-front is big, and I think that puts many off who've never felt the benefits. But it's very rewarding to be able to define a clear set of tests and then have the confidence that when the lights go green that your mission is accomplished (less refactoring). In being forced to write tests first (and endure the cognitive load), I regularly find edge-cases and requirements not originally spelt out, and so avoid having to later re-write having discovered them later.
Much like many things (including "Agile" at the OP mentions), when applied pragmatically I think TDD is an awesome principle to adopt.
I despise TDD. It just does not fit with the way I think about solving problems. I will do what is needed of me but I just hate thinking this way about writing software. I enjoy imagining how the whole system would be in mind's eye and then just code it asap, then refactor as needed.
>Specifically, when given a very well defined problem-set
Agree. My most successful implementation of TDD was for a project where a front end was developed by a third party and I developed the API that the front end would consume. As part of the project, I had to define the API behaviors and data structures anyway. It was the easiest integration I've ever worked on.
The cognitive load required up-front is big, and I think that puts many off who've never felt the benefits. But it's very rewarding to be able to define a clear set of tests and then have the confidence that when the lights go green that your mission is accomplished (less refactoring). In being forced to write tests first (and endure the cognitive load), I regularly find edge-cases and requirements not originally spelt out, and so avoid having to later re-write having discovered them later.
Much like many things (including "Agile" at the OP mentions), when applied pragmatically I think TDD is an awesome principle to adopt.