3 ms·
A few things I've noticed: Developers should not be paid to write tests, only code. If the tests are worthwhile, then they'll get written anyway. I've seen s
by grandalf 16y ago
A few things I've noticed:
Developers should not be paid to write tests, only code. If the tests are worthwhile, then they'll get written anyway.
I've seen some developers who write lots and lots of pointless tests... hmm does Model.find(:all) return all the items in the test db? Ok one passing test, does :first return one? Ok, another passing test. I'm not exaggerating.
If your test codebase is full of stupid tests that are actually testing your framework, and if your test suite takes 5 minutes to run, maybe that's why your team has so much time to read HN.
Good, useful tests will test the most critical 10% of the codebase at most. The "money" paths that are critical to your core business. Things like credit card processing, account signups, password resets.
Many of the critical 10% of tests may very well be integration tests, not unit tests. There is no reason to write unit tests if the big problems would be caught by an integration test before a deploy.
If your testing ideology makes all this sound like hogwash, then you probably work in a cubicle where it does make sense to do test your codebase more broadly.
- bdclimber14 16y agoI know you're not exaggerating because I know a lot of them. They live hard, die hard by "if you code it, test it" -- which includes these trivially simple statements. Maybe not Model.find(:all) because that isn't new code, still framework, but definitely testing all the attributes of a AR model based on the DB schema.