Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
72
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
180
Windows Automation - Howard Feldman
lvrug
0
120
Separating Your Application from Rails - Brian Hughes
lvrug
0
170
SWIG and Ruby - David Grayson
lvrug
0
110
Practical Object-Oriented Design in Ruby - Charles Jackson
lvrug
3
150
The Hamster Gem - Ryan Mulligan
lvrug
1
130
Varnish+Redis - Russ Smith
lvrug
1
150
Lambdas and Pops - Jan Hettich
lvrug
0
120
Making Good Use of Fonts - Russ Smith
lvrug
1
120
Featured
See All Featured
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
480
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
180
Un-Boring Meetings
codingconduct
0
330
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
320
The Invisible Side of Design
smashingmag
301
52k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Prompt Engineering for Job Search
mfonobong
0
360
Music & Morning Musume
bryan
47
7.3k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.6k
Code Review Best Practice
trishagee
74
20k
Odyssey Design
rkendrick25
PRO
2
720
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