0Pricing
Elixir & Phoenix: Scalable Backend Development · Lesson

Property-Based Testing with StreamData

Go beyond example-based tests by generating hundreds of random inputs with StreamData to find edge cases ExUnit examples miss.

What is Property-Based Testing?

Traditional tests check specific examples. Property-based testing describes a rule that should hold for all inputs, then generates many random inputs to try to break it.

It excels at finding edge cases you never thought to write by hand.

Adding StreamData

StreamData is the Elixir library for generating test data. Add it to your dependencies.

defp deps do
  [{:stream_data, "~> 0.6", only: :test}]
end

All lessons in this course

  1. Unit Testing with ExUnit
  2. Integration Testing Phoenix Applications
  3. Mocking, Stubs, and Test Data
  4. Property-Based Testing with StreamData
← Back to Elixir & Phoenix: Scalable Backend Development