×
Eventil - Find Tech Events
Official mobile app
FREE - In Google Play
View
×
Eventil
Official mobile app
FREE - In App Store
View
Video not available

Send us an email to hello@eventil.com

Random Data Generation with Scalacheck

0 0

ScalaCheck is a well-known library for property-base testing. However, property-base testing is not always possible when side effects are involved, for example when writing an integration test that involves data being stored in a database. When writing non-property-base tests, we often need to initialise some data and then verify some assertions on it. However, manual data generation can make our data biased and preventing us from spotting bugs in our code. Having our data generated randomly not only it would make our test less biased, but it will also make it a lot more readable by highlighting what part of our data are actually relevant in our test. In this talk we will discuss how to reuse some of the existing ScalaCheck code to generate random instances of given types and how these can be combined to generate random case classes. We will analyse the properties of a ScalaCheck generator and provide examples of how we can manipulate existing generators to meet our needs.

SCALAR Conference 2017

Scalar jest, pierwszą w Środkowej Europie, konferencją całkowicie poświęconą językowi Scala. Wydarzenie odbywa się regularnie od 2014 roku, w Warszawie, łącząc programistów oraz pasjonatów tego fun...