Search⌘ K
AI Features

What’s a Property?

Explore the concept of property-based testing to improve unit and integration tests in Scala. Understand how to define properties, leverage automatic input generation, and use ScalaCheck for more effective testing. Learn the trade-offs between property-based and example-based testing and discover how this approach helps ensure code behaves as expected across a wide input domain.

You can make an argument against testing every last bit of code you write. Tests are useful, but they come at a cost. Tests are code that needs to be maintained, aligned with the rest of the codebase, and refactored. The more tests we run, the more time it takes for them to run and for us to make sure our code behaves as expected. Moreover, there’s no guarantee that our code is bulletproof just ...

Ask