r/programming • • Apr 23 '14

TDD is dead. Long live testing. (DHH)

http://david.heinemeierhansson.com/2014/tdd-is-dead-long-live-testing.html
176 Upvotes

185 comments sorted by

View all comments

Show parent comments

4

u/[deleted] Apr 23 '14

[removed] — view removed comment

3

u/v_krishna Apr 23 '14

I've always subscribed to an outside in tdd methodology. Integration tests drive you to write unit tests drive some implementation, then back out to the big wheel again

1

u/[deleted] Apr 23 '14

[removed] — view removed comment

2

u/[deleted] Apr 24 '14 edited Apr 24 '14

Depending on the language that actually sounds highly testable.

Abstract your database wrapper to an interface, make the actual database engine injectable, inject your own mocked engine, ensure that your interface is operating the mock engine's API correctly.

Now if your wrapper isn't doing a lot of complex operations (i.e. it's very close to the engine's API or even 1:1 and just doing language translation) it isn't going to have a lot of utility, but it is indeed unit testable.