quick background - I work on a small team, 3 full-time engineers. I enjoy, and make every attempt to drive my development with tests, with appropriate coverage at every level. Engineer 2 doesn’t always write tests first, but the coverage at the end of the day is what I like to see. Engineer 3 (the most senior of the bunch) takes pretty much the opposite approach to test coverage than the rest of the team, and would rather do very little testing on the models and most all of the testing in giant controller specs, what would maybe look more like integration specs.
The other day a feature he worked on had a bug which made it to production. While fixing his bug he referred to it as
“a case of tests still passing because of stubbing, but those stubbed methods aren’t the ones that should be used anymore.”
obviously if he were starting with that spec its the first thing that would have changed… but we have to live with the fact that there is no changing anyones mind on behavior on the team.
the question - is basically what can each of us do to better co-exist when we don’t have the luxury of being a team that is more in line philosophically testing-wise?
- Is there any thing we can do when writing tests with mocks/stubs to make them a bit more useful to our non-TDD colleagues?
- Is there any approach he could have taken, apart from working test first, to help catch lower level tests like this?