Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Randomness in Testing - Paul Grayson
Search
Las Vegas Ruby Group
September 25, 2013
78
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Randomness in Testing - Paul Grayson
Las Vegas Ruby Group
September 25, 2013
More Decks by Las Vegas Ruby Group
See All by Las Vegas Ruby Group
Ruby ISO Standard - David Grayson
lvrug
0
190
Windows Automation - Howard Feldman
lvrug
0
130
Separating Your Application from Rails - Brian Hughes
lvrug
0
180
SWIG and Ruby - David Grayson
lvrug
0
120
Practical Object-Oriented Design in Ruby - Charles Jackson
lvrug
3
160
The Hamster Gem - Ryan Mulligan
lvrug
1
150
Varnish+Redis - Russ Smith
lvrug
1
160
Lambdas and Pops - Jan Hettich
lvrug
0
130
Making Good Use of Fonts - Russ Smith
lvrug
1
130
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
290
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
Evolving SEO for Evolving Search Engines
ryanjones
0
360
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
550
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
300
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
510
GitHub's CSS Performance
jonrohan
1033
470k
The SEO Collaboration Effect
kristinabergwall1
1
620
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Making the Leap to Tech Lead
cromwellryan
135
10k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
240
Transcript
Randomness in Testing Paul Grayson 2013-09-25
Normal testing: try edge cases • Easy when you have
a geometric picture:
“Fuzz testing” for difficult edges • What are the “edge
cases” here?
Fuzz testing kata example
Note: fuzz tests generally more simple-minded Things to Fuzz test
for: • exceptions or other bad behavior • outputs consistent with inputs • exact answer for a simplified domain (hard!)
Fuzz Testing: NOT part of RSpec • Just use rand
in your tests.
Test order dependence • Ideal: tests are independent • DO
NOT use objects created out of the context • DO NOT break when other objects exist
Test order kata example
When a test fails... • Write a test that always
fails, or fix the tests • Re-use the seed to debug rspec --seed 1234
Using RSpec seed with rand srand RSpec.configuration.seed + 1
Putting it together • Automatically re-use the seed
Other random examples • Code mutation • Unavoidable randomness (network,
threads) • Testing random code