I've recently watched Integration Tests are a Scam by J. B. Rainsberger and am now looking for more material on the subject. I have to say, I'm shocked by how much we're doing wrong, (i.e. integration testing when we should unit test), intrigued by the concepts described by Rainsberger but also confused about how to apply them. I would like to have more of the described collaboration tests and contract tests but I don't know where to start.
The only things that got stuck in my mind are the 4 questions the tests need to ask:
Side A:
Do I ask the right question?
Can I deal with the answer?
Side B:
Can I answer a question?
Do I answer correctly?
But how do I apply this to some random method in my application stack?
Is there a book or a tutorial or example out there that takes a real world example and applies these ideas of isolated micro tests? Ideally the example uses Java, C# or C++.
Any literature that deals with these concepts in general and helps me understand them better would be appreciated.
Also if there are forums out there where I can ask more detailed questions about how to go about correctly unit testing and maybe even refactoring existing code and post examples would be nice.
Thanks!