I sometimes see the claim that with a sufficiently strong type system applied properly, there’s almost no need for unit tests and less need for automated testing in general: if the code compiles, there’s little opportunity for it to be incorrect.
That’s appealing and I can see how it’s true in some cases. But I struggle to see how it’d really apply to some of the projects I’ve worked on. I’m curious to hear stories from people who’ve become convinced of the truth of that claim. Were there any resources that helped you get there? Anything that finally made it click for you?
Here are some examples of styles of tests in my current code base’s test suite that I can’t see how I’d represent as compile-time type checks no matter how sophisticated the type system was. For context, this particular code base uses a CQRS-style, event-sourcing architecture, and it’s part of a payment service.