Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Randomness in Testing - Paul Grayson
Search
Las Vegas Ruby Group
September 25, 2013
0
57
Randomness in Testing - Paul Grayson
Las Vegas Ruby Group
September 25, 2013
Tweet
Share
More Decks by Las Vegas Ruby Group
See All by Las Vegas Ruby Group
Ruby ISO Standard - David Grayson
lvrug
0
140
Windows Automation - Howard Feldman
lvrug
0
78
Separating Your Application from Rails - Brian Hughes
lvrug
0
130
SWIG and Ruby - David Grayson
lvrug
0
85
Practical Object-Oriented Design in Ruby - Charles Jackson
lvrug
3
140
The Hamster Gem - Ryan Mulligan
lvrug
1
98
Varnish+Redis - Russ Smith
lvrug
1
110
Lambdas and Pops - Jan Hettich
lvrug
0
88
Making Good Use of Fonts - Russ Smith
lvrug
1
96
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
0
60
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Applied NLP in the Age of Generative AI
inesmontani
PRO
3
1.9k
Site-Speed That Sticks
csswizardry
13
1k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
36
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
310
ラッコキーワード サービス紹介資料
rakko
0
1.7M
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
1.9k
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