At the JRubyConf in Columbus, Ohio last October, Jim Weirich presented "Testing – Why Don't We Do It Like This?". At the end of the presentation he suggested asking two questions to ensure our tests are specifying behaviour rather than implementation:
- If I wanted to use this software in my project, what behaviours are important to me?
- Could I write this software from scratch using only the tests/specs as guidance?
These are definitely useful questions to ask, rather than blindly writing specs to simply get 100% test coverage. Check the entire presentation below:
Testing – Why Don't We Do It Like This? – Jim Weirich from Engine Yard on Vimeo.