4

Property-based testing by Magda Stozek

 2 years ago
source link: https://www.signifytechnology.com/blog/2021/04/property-based-testing-by-magda-stozek
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Don’t ask what you can do for your testing library, ask what it can do for you!

See what it can do for you with this awesome talk by Magda Stozek from Scala Love in the City Conference.

Property-based testing - let your testing library work for you

Don’t ask what you can do for your testing library, ask what it can do for you! So what can it do?

It turns out that much more than displaying a nice green and red report. What if we make the library generate the test data? And while we’re at it, maybe it could also think of the edge cases for which our code is wrong? Oh, and when it finds them, it should simplify them a bit before returning to us, so that we can quickly identify the root cause of the problem. And repeat that a thousand times, just to be sure. Sounds good? That’s exactly what property-based testing has to offer.

I’ll show how to get started with this kind of testing in Scala, using ScalaTest and ScalaCheck. But isn’t it all too good to be true, surely there’s some fine print? Of course there is. I’ll cover that as well.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK