3 ms·
so every test you write verifies the file system is in tact afterwards? Have you covered the edge case where the function spawns a sentient AI who interprets th
by BWStearns 10y ago
so every test you write verifies the file system is in tact afterwards? Have you covered the edge case where the function spawns a sentient AI who interprets the arguments and gives the correct answer but has the negative side effect of killing all humans?
If your code is pathological it's not your tests' fault.
- toolslive 10y agoThis is where a decent static type system helps. The compiler knows if the function is pure or not, and impure functions are more suspect than pure functions. "Python Unit tests are a poor man's compiler" is a quote that comes to mind.
- Sharlin 10y agoI guess that's the beauty of a pure functional language - the type system simply disallows side effects unless you play by its rules. You don't even need unit tests to ensure purity!