3 ms·
does TDD not dictate that you write tests first, before you write the code under test? then you write only enough code to make the test pass, as I recall. yea
by naikrovek 5y ago
does TDD not dictate that you write tests first, before you write the code under test? then you write only enough code to make the test pass, as I recall.
yeah TDD is a mess
- imiric 5y agoWhy does a practice have to "dictate" anything? TDD is a workflow suggestion, not gospel that must be strictly followed. Writing and maintaining a test before any experiments have been done with the design would indeed be frustrating and lead to a lot of rewriting. If you first explore the design and allow it to settle into a usable interface and then write the test for it as assurance that it's stable, you'd have the benefit of being able to safely refactor the feature and quickly add more tests for it. As long as the deliverable includes tests with decent coverage, who cares whether you wrote a test first without writing a single line of the implementation?
- naikrovek 5y ago> TDD is a workflow suggestion, not gospel that must be strictly followed. you haven't been talking to the same people I've been talking to, I guess. TDD is sacred and must be strictly adhered to, according to them. "anything less is just plain testing and is useless." and people sometimes ask why I have such strong opinions against things like this. it's because people who don't write software come up with these things, and their lack of experience hides the realities of software development from them. they mean well, and they cause harm.