Jay gave a talk on testing in the Ruby/Rails world.
Common test mistakes
- forgetting tests
- testing everything
- custom test cases
- slow test suites
- 100% test coverage – that is not the goal
I asked Jay what he thought of autotest, and he said unequivocally that he hates it. “If your tests take less than a second, why do you need it? Just click the button.” I think I disagree, because I don’t remember to click the button, and because i don’t always remember that i just changed something that could have broken something else. I’m often surprised when growl pops up a notification that something is broken.
Jay covered problems and benefits of current testing tools:
Selenium
- 15 different ways to drive it
- soo slow
- large test suites become unmaintainable
- selenium – best tool for cross browser testing
- runs against the full stack
- focus on the five most important selenium tests
Test::Unit
- no mocking infrastructure built in
- syntax is ugly. argument with chad fowler on this.
- extremely developer friendly
- However, granular defect localization
- Easy to write
Rspec
- too much magic
- false positives/negatives
- too based on english
- consistent to mancrest, not ‘principle of least surprise’
- encourages behavorial testing
- built in mocking
- no testing facility is complete without a mocking framework
Two Bleeding Edge Ideas
Synthesis written by George Malamedis
Expectations Gem – gives you a recorder
Solutions for slow tests
- nulldb
- unitrecord
- arbs