4 ms·
As well has helping with verification, I find unit tests help with design. I write less code, and that code is simpler and with looser coupling when I write te
by rahoulb 13y ago
As well has helping with verification, I find unit tests help with design. I write less code, and that code is simpler and with looser coupling when I write tests first.
- njharman 13y agoThis is mostly what unittesting is about. Not actual "testing".
- kcorbitt 13y agoThis has been my experience as well. And I actually like the rspec style of testing that the author dismisses because it allows you to group tests by functionality covered. This goes a long ways towards making your tests more approachable and maintainable. When I contribute to a Ruby gem with good rspec-style tests it's generally trivial for me to see how to format and where to put my tests covering the new functionality.
- rahoulb 13y agoI agree. I've always said that RSpec is about documentation, not testing (hence the name - it's a specification for your code). However, recently, I've been using Minitest-spec; not quite as readable but less magic and it feels faster.