Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There're already people speaking about the limits of a too strict TDD:

http://david.heinemeierhansson.com/2014/tdd-is-dead-long-liv...

And yes, it may be stupid to test before a design emerges - but only if you start with a very fine-grained test. Usually when I'm coding from scratch I write a very, very, VERY coarse-grained test that "tests something", and when I reach the point of passing it (which may involved creating and designing multiple classes) I probably have a working design and I may begin creating other, smaller unit tests for individual components. The initial test may disappear or become an integration or acceptance test.

By the way there's little content in the article. It's just a rant. And the article about not writing test cases at all is simply ridiculous - since an error can exist in a test, we shouldn't write test cases?!?



>Usually when I'm coding from scratch I write a very, very, VERY coarse-grained test that "tests something", and when I reach the point of passing it (which may involved creating and designing multiple classes) I probably have a working design and I may begin creating other, smaller unit tests for individual components. The initial test may disappear or become an integration or acceptance test.

This reads pretty much how I work too.I don't think it is unusual. Start coarse, outside in. Write the finer grained 'unit' tests where appropriate. Focus on where you need the crutch (design and confidence) not on clambering to test all the things.


This is my view as well.

More generally, it's about not 'coding too far into the future', even (especially) with tests.

But I like to code a little ways into the future.

'README driven development' is also interesting.


> Usually when I'm coding from scratch I write a very, very, VERY coarse-grained test that "tests something", and when I reach the point of passing it (which may involved creating and designing multiple classes) I probably have a working design and I may begin creating other, smaller unit tests for individual components.

That is exactly how I start coding something from scratch, except I don't have that initial test. I don't think such a vague starting test adds anything real.


It offers the value of having an initial target, otherwise you risk coding too much without stopping.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: