Leveraging Your Content for Website Publishing & Collaboration
Evan (Rabble) Henshaw-Plath, Hacker, Independent
Do legacy apps exist - rails < 3 years old!
"Who has time for tests?"
Testing == Health Food - good for you but not yummy
Testing == debugging!
Don't do it all at once - you won't pull it off.
Create test database
Use migrations
Scaffolded tests don't work... need to fix them first
Find a bug - write a test;
step by step Refactor a method - write a test
Test one thing at a time - short 3-5 line things (one assertion)
Running tests - rake or directly
GOOD IDEA: use development.log to build tests (has parameters, sql, etc.)
rake stats rcov - amazing tool, good graphs
other tools: heckel
autotest - great testing tool for immediate feedback
Fixtures, mocks, pull from database, all have pros and minuses
zentest..?
Kevin Clark, Powerset "
Mutation Tester"
Randomly permutates your code, then... runs your tests.
If tests don't fail, code is useless, or no tests are written.
heckle SomeController -> output is list of mutations that passed the tests.