CheckOps home

Tools directory

S

CheckOps

StreamData

StreamData is an Apache-2.0 Elixir library for data generation and property-based testing, with composable generators, shrinking and ExUnit integration.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

StreamData is an Elixir library for data generation and property-based testing, created by Andrea Leopardi and announced on the Elixir website in 2017. It is usually added only to the test environment and provides two things: generators that produce streams of random data, and ExUnitProperties, which integrates property-based tests into ExUnit.

Generators such as integer(), binary(), string(:alphanumeric), list_of(...), map_of(...) and one_of(...) compose with map, filter, bind and the gen all syntax to build complex data. Properties are written with property "..." do check all x <- integer() do ... end end, and when a property fails StreamData shrinks the input to a simpler failing case. Generators are also useful outside tests for seeding data. The README explains how to import its formatter configuration. The repository had commits in September 2026; versions are published on Hex.

The source code is at whatyouhide/stream_data on GitHub under the Apache-2.0 licence, with about 952 stars; the most recent commit was on 8 September 2026.

Features

  1. Composable generators: Build complex data with gen all.
  2. Shrinking: Simplifies failing inputs automatically.
  3. ExUnit integration: property and check all macros.
  4. Data generation: Generators usable beyond tests.

Pros

  1. Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
  2. Actively maintained: The repository had commits as recent as 8 September 2026.

Cons

  1. Properties need thought: Good invariants take practice.
  2. Slower than examples: Many generated runs per property.
# mix.exs
{:stream_data, "~> 1.0", only: :test}
defmodule Shop.PricingPropertyTest do
  use ExUnit.Case, async: true
  use ExUnitProperties

  property "discount never increases price" do
    check all price <- integer(0..1_000_000),
              pct <- integer(0..100) do
      assert Shop.Pricing.apply(price, pct) <= price
    end
  end
end

Resources:

Pricing

StreamData is free and open source under the Apache-2.0 licence.

  1. Elixir developers wanting property-based tests in ExUnit.
  2. Teams generating realistic test data.

Conclusion

StreamData is the standard property-based testing library for Elixir, well integrated with ExUnit.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with StreamData side by side.