?

Log in

No account? Create an account
current entries friends' entries archives about me Previous Previous Next Next
Technical Life - cellophane — LiveJournal
the story of an invisible girl
renniekins
renniekins
Technical Life
read 16 comments | talk to me!
Comments
specialagentm From: specialagentm Date: April 1st, 2008 01:40 pm (UTC) (Link)
No, I can't imagine TDD without some sort of implementation-hiding, and using interfaces or writing TDD-centric subclasses seems like the simplest route.

If you can't change the run-time behaviors of the code chunk, you need to mock out some other piece of the architecture -- so if you can't isolate a database dependency (and use an in-memory data set or something), maybe what you can do is point to a local database that you can reload with fake data suitable to each test.

To me, interfaces / subclasses aren't overhead -- they fall out of the object design anyway, I already had lots of other reasons to want to have that sort of flexibility. I try not to go overhead, though -- usually, other aspects of agile (constant refactoring, pairing) helps me adjust the object model to hit that sweet spot of "just right".
read 16 comments | talk to me!