CheckOps
StreamData
StreamData is an Apache-2.0 Elixir library for data generation and property-based testing, with composable generators, shrinking and ExUnit integration.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
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
- Composable generators: Build complex data with
gen all. - Shrinking: Simplifies failing inputs automatically.
- ExUnit integration:
propertyandcheck allmacros. - Data generation: Generators usable beyond tests.
Pros
- Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 8 September 2026.
Cons
- Properties need thought: Good invariants take practice.
- Slower than examples: Many generated runs per property.
Usage and Links (Example)
# 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.
Recommended for?
- Elixir developers wanting property-based tests in ExUnit.
- 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.
EExUnitExUnit is Elixir's built-in unit testing framework, with concurrent async tests, describe blocks, setup callbacks, tags, doctests and rich assertion diffs, run with mix test.Compare with StreamData
MMoxMox is an Apache-2.0 Elixir library from Dashbit for defining concurrent, behaviour-based mocks that follow the "mocks as explicit contracts" principles and work with async tests.Compare with StreamData
HHypothesisHypothesis is the MPL-2.0 property-based testing library for Python: describe the range of inputs, let it generate cases including edge cases, and get the simplest failing example when a property breaks.Compare with StreamData
Pproptestproptest is a Hypothesis-inspired property-based testing framework for Rust, with composable strategies, automatic shrinking and persisted regression files.Compare with StreamData
Ffast-checkfast-check is an MIT-licensed property-based testing framework for JavaScript and TypeScript, with rich arbitraries, shrinking, replayable seeds, model-based testing and race-condition detection.Compare with StreamData
SScalaCheckScalaCheck is a BSD-3-Clause property-based testing library for Scala and Java, inspired by Haskell's QuickCheck, with generators, shrinking and stateful testing, used by ScalaTest, specs2 and MUnit.Compare with StreamData