Being quite used to TDD in a Java environment I was wondering if TDD was also used when building SQL queries, creating views, etc.
If it is also used, how do people do it? You would need to create a lot of tiny DBs (for each unit test basically)?
I don’t know if my question makes much sense but still: TDD is considered by quite some as the thing that changed the way they develop software and there definitely is development going on at the “SQL” level. So how does TDD and DB / SQL mix?
In the Rails world, you have a dedicated test database which you build each time you run your test suite through migrations, and fixtures for prepopulating your database prior to running tests.
This makes TDD against a database entirely possible.
I think the main reason TDD is not used by database developers is more cultural than anything else.