Speedy Tests

Live Fast, Die Young, and Leave Some Good Looking Code »
Jake Scruggs

Mocking: The cause of and solution to all your tests' problems
Big Set Up == Big Problem
Before :each {waste_my_time}
The extra tricky test suite
Use all your cores, damnit
Think about a test's speed as you write it
A test that needs lots of setup is telling you something: Your object sucks
Nick Gauthier - Grease your Suite
Slow Test Suites
Lead to aguments about fault
http://vimeo.com/12705404
fast_context - shoulda
Stub out the expensive stuff
Graph your system cpu/io perfomance over time when running tests - look for opportunities
Just say no to atime
Turn off Journal write back
Like a frog in a slowly boiling pot of water
Corosive to productivity and morale
Ruby Enterprise Edition
Mac: 
http://docwhat.org/2010/04/two-ways-to-improve-os-x/
Speedy Tests
Me
Physics Teacher
OM/TWorks/Obtiva
Backstop Solutions
MetricFu guy
Are Vampires that Drain your Team's Morale
Make you hate testing
The Adopt a Test Program
Solutions where you don't have to change your bad habits
parallel_tests - mulitDB, uneven split
tickle - Can use one DB, uneven split
specjour - MultiDB, Bojour, Rsync, uneven split
deep test - MultiDB, Big setup, Most mature, Split on Duration
hydra - One DB, SSH, Rsync, Split on Duration
In case of hard crash
Linux - can turn off
Mac - can not
Do not turn off in prod!
Use ridiculously wasteful GC settings
#REE GC perfomance tunning
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
http://grease-your-suite.heroku.com
create vs build
FactoryGirl is too 
Damn 
Awesome
We need to have a talk about your tests
OK, Silver bullet time is over
Leave the campsite better than you found it
Tests are supposed to lead to better design
Are yours?
Thanks
http://prezi.com/9b1k91tyt22d
http://jakescruggs.blogspot.com
@jakescruggs
http://backstopsolutions.com
http://spkr8.com/t/3759
Photo Creds
Vampire: http://www.flickr.com/photos/taylorswishphotography/3139911132/
Warning: Dog Attack: http://www.flickr.com/photos/r80o/5549288/
Cigarette Boxes: http://www.flickr.com/photos/blackbutterfly/3050646166/
Girl Wince: http://www.flickr.com/photos/andreweick/175300123/
Robots Attack: http://www.flickr.com/photos/dancoulter/21042744/
Soap Box: http://www.flickr.com/photos/monsieurlui/316350341/
Jake Scruggs
Linux: http://www.findmysoft.com/news/Disable-Atime-for-a-Faster-Running-Linux-OS/
http://github.com/lifo/fast_context

Loading comments...

Please log in to add your comment.

Report abuse

More presentations by Jake Scruggs