3 ms·
I personnally use tests for two things : - in tdd, to make sure my code works in expected scenarios - in CI to make sure new code don't break old features. In
by bsaul 5y ago
I personnally use tests for two things :
- in tdd, to make sure my code works in expected scenarios
- in CI to make sure new code don't break old features.
In both case, i need to control my testing environment.
Randomizing inputs could be used in a third scenario for extensive testing, a bit like fuzzing. But it's yet another different usage.
- ryanbrunner 5y agoI guess the disconnect is that I don't think of the state of the database as inputs, per se, but more the environment the test is running in. I wouldn't for instance necessarily need to set my clock to a fixed time (provided I'm not specifically testing code where that is relevant), or wipe out the hard drive that the code is running on for a test.
- deleted 5y ago[deleted]