- You mean, if you write the test second, then you might write a different test because of sunk costs in the implementation?
- I'm aiming for 100% branch coverage in the unit tests. I don't find that daunting because I tend to otherwise do code-walkthroughs and we're skipping that. Just PRs. So, it feels like I'm doing my own code-review, that I can rerun again and again.
- Stubs can't fail a test, though, right? Isnt't that what differentiates them from a mock?
- No. I just use the implementation, I don't recreate it. I do thinly recreate some things that are outside of the repo, tho, to fake an interface.
- I think this is actually going to reduce the number/complexity of tests I do, or at least, front-load the testing. I usually don't develop anything and most developers refuse to write unit or integration tests, so I'm always stuck trying to figure out ways to test everything through the user interface, which is often really difficult or even impossible. So, I think the tests for this system will be more pyramidal, with 100% coverage at the unit level, 50% at the integration level, 25% at the system level, or so. It's so satisfyingly easy to test things at the lowest level.