3 ms·
> Those tests tend to be the most brittle While true, it's far more likely that they will help you during a refactor. If you use TDD and have a test for every
by jniedrauer 7y ago
> Those tests tend to be the most brittle
While true, it's far more likely that they will help you during a refactor. If you use TDD and have a test for every function, you will more often than not throw entire functions and their tests away. A million tests that test immutable functions are all useless. But tests that fall in between TDD style test-per-function and integration tests, tend to be re-used post refactor, and give certainty that the refactor worked as expected.
- eyelidlessness 7y agoI think the size of a test shouldn't be defined by the size of the functionality you're testing, but rather a unit of "user intent", as expressed at whatever layer you're testing.