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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Las Vegas Ruby Group
September 25, 2013
79
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
Transcript
12 slides
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
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
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
Accessibility Awareness
sabderemane
1
310
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
620
Building Flexible Design Systems
yeseniaperezcruz
330
41k
The Curse of the Amulet
leimatthew05
4
17k
SEO for Brand Visibility & Recognition
aleyda
0
4.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Well, that’s weird…
csswizardry
3
240
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Scaling GitHub
holman
464
140k
Embracing the Ebb and Flow
colly
88
5.2k
Building Adaptive Systems
keathley
44
3.3k