by solraph · 3y ago · 0 comments
Types however, are not a substitute for unit tests. No type system is going to tell me if my income tax calculator covers all the edge cases.
All tests should be on business logic - code logic might not fit the business case at all and so that should be a fail.
That said, I don't follow what you mean by "to test is business logic, not code logic." To me, that is a distinction without difference.
An income tax calculator in a (sane) tax system is essentially a set of pure of functions or classes. This is a perfect place for a unit test. I might have additional unit tests for sub components of the hairy bits, but it's still unit tests all the way.