For a personal project I don't think it's all that helpful.
Ask HN: I'm less productive with TDD. Am I doing it wrong?
21–24 of 24 posts
Re: Ask HN: I'm less productive with TDD. Am I doing it wrong?
#22Earlier quoted context omitted.
You nailed it. Mocking data while testing is such a pain. Takes the fun out of writng tests.
Not sure what you mean by mocking data. Do you mean creating test data? If I can crank out tests by just tweaking test data, that's actually a good thing. That means that my test spec is as compact as possible. Mocking the database system is what I was referring to. Any two database systems have enough difference in datatypes, precise transaction semantics, default behaviors, and language dialect that it just isn't w…
Re: Ask HN: I'm less productive with TDD. Am I doing it wrong?
#23Earlier quoted context omitted.
> which depends on fast setup and teardown In postgres at least, Wouldn't your framework create a db transaction that then is rolled back at the end of the test?
That only works if the code you are testing does everything in auto-commit mode. Which is often a terrible idea. If your code uses transactions, then no, the framework cannot rely on rollback to do setup and teardown.
Re: Ask HN: I'm less productive with TDD. Am I doing it wrong?
#24Earlier quoted context omitted.
> which depends on fast setup and teardown In postgres at least, Wouldn't your framework create a db transaction that then is rolled back at the end of the test?
That only works if the code you are testing does everything in auto-commit mode. Which is often a terrible idea. If your code uses transactions, then no, the framework cannot rely on rollback to do setup and teardown.