Hacker News new | ask | show | jobs
by pjmlp 4572 days ago
> Test-first TDD is even less popular

I never bought into TDD, although I do write unit tests for most of the code where it makes sense.

No one has been able to show me an usable way to do TDD when coding native UIs, mobile OS, embedded systems or when using third party libraries not built with testing in mind.

Plus TDD makes very hard to properly design algorithms and data structures, that should beforehand be done at the whiteboard.

3 comments

"No one has been able to show me an usable way to do TDD when coding native UIs, mobile OS, embedded systems or when using third party libraries not built with testing in mind."

I agree. However, I do not consider this a strike against testing; I consider it a strike against native UIs, mobile OSs, embedded systems, and third party libraries that don't support testing. You may not do TDD (I generally don't), you may not strive for 100% coverage, but testing is a fundamental aspect of serious software engineering, and anything that actively fights your attempts to test it is a big strike against that tech. I only use the ones that fight you that hard because there's unfortunately no competition, but it's still a disgrace. In 2013, testing ought to be a fundamental first-class concern of any new UI library, yet here we are.

Have a look at test driven development for embedded C by James Grenning for a viewpoint of how TDD might work in the embedded world. I found it to be a great resource.

http://pragprog.com/book/jgade/test-driven-development-for-e...

This is a fantastic book!
Thanks, I know that book.
Why do you think that TDD prohibits you from using a whiteboard to design your algorithms and data structures beforehand? As far as I can tell, doing that work, then writing your first test is just TDD done well.
Because that is what TDD advocates sell at agile conferences, design by coding.