- If you want to prove the 'basic correctness' of your code with true unit tests, then when you use a test double (mock/stub) in a 'collaboration' test, write a 'contract' test that some class in your code really behaves the way you've said your mock does.
- This approach is actually more likely to throughly test the basic correctness of your code than the corresponding integration tests, because integration tests are hard to write and slow to run, so nobody writes enough of them to actually exercise all the possible paths of execution in your code.
He said it would be nice to have a tool that helps you automate this correspondence. Sandi Metz mentioned some tools intended to help with this in her talk 'The magic tricks of testing' (
https://www.youtube.com/watch?v=URSWYvyc42M), but they seem to have largely fallen by the wayside. Have a look at the README if you're interested in how I'm trying to approach the problem. It'd be great if anyone who's interested in this approach to testing had any feedback that could help mould this into something that is actually useful.