3 ms·
> I've never heard TDD being that you write all of your tests up front, before you've written any code. That's the only way I've ever heard it described. I tho
by andybak 9y ago
> I've never heard TDD being that you write all of your tests up front, before you've written any code.
That's the only way I've ever heard it described. I thought that's why it's called "Test Driven"
- skookum 9y agoCan you provide a reference? I'm not a big proponent of TDD but have read up on it and experimented with it some, and none of the TDD literature I've read suggests writing all the tests up front. Virtually all the mainstream TDD literature and talks advocate for the "write a test, make it pass, lather, rinse, repeat" model of development.
- taeric 9y agoI think this is a case of two ways to hear "write all the tests first." If you read that as "write every single one of your tests, then write the code", then you see it as a strawman and not the point of TDD. If you read that as "before you write any specific line of code, you write the test for it first", then you are likely to see that as the same as TDD. I intended the second reading. I can see how both are accurate ways to read it, though. Apologies for the confusion.
- andybak 9y agoAh. Exactly the misunderstanding I was labouring under. Turns out we are all in agreement after all.
- deleted 9y ago[deleted]
- s73ver 9y agoI mean before you've written any code at all. Like, you have to have the tests for all units created before you start writing the code for any unit. That's what the person I responded to made it sound like. Writing tests before you work on the unit you're working on shouldn't be a problem because you should know what that unit is supposed to do. If you don't, then it doesn't matter if you do TDD, Agile, BDD, or whatever. You're not going to be able to do it right. Go have a conversation with someone to find out what that is supposed to do.
- deleted 9y ago[deleted]