Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Software Tests Are for Millionaires. Parent comment
That said, mathematical algorithms:
1. Rarely need refactoring. If you often refactor your math, you probably mixed it with something else (unless your business is math).
2. Rarely have state. You're always dealing with values, not entities.
3. Rarely have dependencies. There's nothing to mock, so the boundary between unit tests and integration tests is very blurry.
4. Usually have a formal oracle of correctness.
So yeah, math is a place where unit tests might be ok (if you truly have a lot of complex math).
There are no comments on this comment yet.
That said, mathematical algorithms:
1. Rarely need refactoring. If you often refactor your math, you probably mixed it with something else (unless your business is math).
2. Rarely have state. You're always dealing with values, not entities.
3. Rarely have dependencies. There's nothing to mock, so the boundary between unit tests and integration tests is very blurry.
4. Usually have a formal oracle of correctness.
So yeah, math is a place where unit tests might be ok (if you truly have a lot of complex math).