3 ms·
I write some test when starting, with the full acceptance most, if not all, will be abandoned. Maybe comment out all the ones I don't need anymore or just are t
by mamcx 8y ago
I write some test when starting, with the full acceptance most, if not all, will be abandoned. Maybe comment out all the ones I don't need anymore or just are too broken (because are invalid). So tests are just another way to do exploratory programming...
Most are related to DBs. I NEVER mockup. NEVER.
NEVER.
I just rebuild the DB each time the tests start (and is PostgreSQL. I found that DROP/REBUILD the SCHEMA is fast than drop the database and rebuild, so is ok).
This always leave me with all the data in the DB, no matter it fail or not. This is the main reason to never mock. Mock data get lost after the tests end. The db instead persist the data and allow to inspect after the fact.
Plus, fill me with the data necessary to let the UI run without re-create again here.
This simple rule is what help me most. If I wanna the test to run faster, I can't do anything else that write a good database layer and not call the DB when not needed...
- marcosdumay 8y agoOnce you abandon the idea of unit testing everything, plenty of possibilities open up. I have a mail server that I test by cloning a root (that's in git) and chrooting there. I also have created a language for testing network protocols once.