3 ms·
you're missing a unit test case for your division function -- the case of 0. That test will reveal the function's domain is non-zero numbers. And you know thi
by matt_sales 9y ago
you're missing a unit test case for your division function -- the case of 0. That test will reveal the function's domain is non-zero numbers. And you know this because you got the fast feedback from your unit test. No integration test using 0 necessary unless you want to test the failure scenario.
BTW, nobody is saying not to use integration tests. But unit tests are faster, more stable, and easier to maintain and execute.
- AstralStorm 9y agoHmm? The division function actually works as defined by throwing a floating point exception, returning one of infinities or other well defined behaviour It's the test of the user of the function that is incomplete.