I DREAM OF GEN’NING SCALACHECK IS BLACK MAGICK
Kelsey Gilmore-Innis (@kelseyinnis) + Stew O’Connor (@StewOConnor)
PROPERTY-BASED TESTING
BACKGROUND
GENERATES • RUNS • SHRINKS
GENERATORS
OUT OF THE BOTTLE• Boolean, Byte, Char, String, Int, Double, Long
• Throwable, Date
• Option, Either, Tuple2-Tuple9, Function1-Function5
• Array, List, ArrayList, Stream, Set, Map
• alphaChar, alphaNumChar, alphaLowerChar, alphaUpperChar
• alphaStr, numStr, identifier
EDGE CASE BIAS
FANCY GENS
.choose, .oneOf, .someOf
COMPOSING GENS
map • flatMap • filter/suchThat
.suchThat
http://etorreborre.blogspot.com/2011/02/scalacheck-generator-for-json.html
FREQUENCY
P1 BUG: BEYONCÉ NOT FOUND
PERFORMANCE TESTING
ROUND-TRIP PROPERTIES
ROUND-TRIP PROPERTIES
NEGATIVE TESTING
RUNNING SCALACHECK TESTS
INTEGRATION
PARAMS
SCALACHECK + SELENIUMhttps://github.com/jessitron/js-with-scalacheck
COMMANDS
TESTING SERVER NETWORKShttp://scalacheck.org/files/scaladays2014/index.html
SIMULATION TESTING
SHRINKING
MAKING IT LOOK EASY
BYE!
Top Related