DEV.co
Open-Source Testing · haf

expecto

Expecto is a testing library for F# that emphasizes parallel, composable tests with built-in support for unit, property-based, stress, and performance testing. It treats tests as first-class values, enabling flexible composition and filtering.

Source: GitHub — github.com/haf/expecto
739
GitHub stars
98
Forks
F#
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryhaf/expecto
Ownerhaf
Primary languageF#
LicenseApache-2.0 — OSI-approved
Stars739
Forks98
Open issues59
Latest release10.2.1 (2024-03-15)
Last updated2026-06-17
Sourcehttps://github.com/haf/expecto

What expecto is

Expecto provides an F#-native testing DSL with async-first parallel test execution, integrated FsCheck property testing, BenchmarkDotNet performance analysis, and CLI-driven test filtering/shuffling. Tests compile as console applications with no separate test runner dependency.

Quickstart

Get the expecto source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/haf/expecto.gitcd expecto# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

F# Unit and Integration Testing

Primary use case: comprehensive unit and integration test suites for .NET/CLR applications written in F#. Parallel execution and composable test values reduce boilerplate.

Performance Regression Testing

Built-in Performance module enables statistically sound performance comparisons and BenchmarkDotNet integration for continuous performance monitoring in CI/CD.

Property-Based Testing and Stress Testing

FsCheck integration enables property-based test generation; parallel-by-default execution facilitates stress testing to surface threading and memory issues.

Implementation considerations

  • Tests are F# values and functions; requires F# language familiarity and functional programming patterns. Learning curve is moderate for imperative developers.
  • Parallel execution is default; careful design of test isolation, shared state, and teardown is critical to avoid race conditions and flaky tests.
  • CLI-driven configuration (filter, shuffle, stress-test parameters) via command-line args; no XML/YAML config files. Integration with CI/CD pipelines requires script wrapping.
  • Setup/teardown are simple functions, not attributes; reduces magic but requires explicit function composition for complex fixture scenarios.
  • Performance testing requires statistical understanding; misuse can lead to false positives. BenchmarkDotNet integration adds external dependency complexity.

When to avoid it — and what to weigh

  • C# or Non-F# Primary Codebase — Expecto is F#-first. While it runs on CLR, the API and documentation are optimized for F# syntax and idioms. C# teams should consider xUnit, NUnit, or MSTest.
  • Requires IDE Test Explorer Integration — VisualStudio.TestAdapter is available but adoption/support is unclear from data. Teams heavily reliant on Visual Studio Test Explorer may face friction.
  • Need for Cross-Language or Language-Agnostic Test Suite — Expecto tests are F# values compiled to console applications. Polyglot teams needing unified test reporting across languages should consider language-agnostic frameworks.
  • Minimal Dependencies or Offline-First Environments — Expecto pulls in FsCheck, BenchmarkDotNet, and Logary as optional dependencies. Air-gapped or dependency-minimalist teams may face supply chain constraints.

License & commercial use

Apache License 2.0 (Apache-2.0). Permissive OSI-compliant license.

Apache-2.0 permits commercial use, modification, and distribution without royalty. Attribution required; no warranty or liability. Safe for proprietary software development. Verify compliance with any internal policies.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No explicit security audit or vulnerability disclosures mentioned in data. Expecto is a test framework, not a runtime security boundary. Standard supply-chain considerations: vet FsCheck, BenchmarkDotNet, and Logary as transitive dependencies. No hardened secret-handling or cryptographic operations in scope.

Alternatives to consider

xUnit.net

Cross-language (.NET), mature, extensive IDE integration (Visual Studio, Rider, VSCode). Preferred for polyglot teams and C#-first shops.

NUnit

Long-standing .NET standard, attribute-based (familiar to many), strong documentation and tooling. Less functional-style; better for imperative teams.

Hedgehog (F#-native)

Alternative F# property-based testing library; lightweight composition model. Lacks integrated performance testing; less mature ecosystem than Expecto + FsCheck.

Software development agency

Build on expecto with DEV.co software developers

Expecto excels at functional testing with composable, parallel test execution. Confirm F# expertise on your team, validate IDE integration needs, and pilot with performance testing before full adoption.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

expecto FAQ

Can I use Expecto in a C# project?
Technically yes (CLR bytecode), but Expecto is designed for F#. Tests must be written in F#, and the API assumes F# syntax. Not recommended for C#-first teams.
Does Expecto support test discovery and IDE test runners?
Yes, via the VisualStudio.TestAdapter NuGet package. However, data does not clarify maturity or support level for non-Visual Studio IDEs (Rider, VSCode).
How do I integrate Expecto tests into CI/CD?
Compile tests as console applications and run via `dotnet run` or containerized execution. Use `--nunit-summary` or `--junit-summary` flags to export results for CI aggregation.
What are the performance testing capabilities?
Integrated Performance module for statistically sound comparisons; BenchmarkDotNet extension for detailed micro-benchmarking. Suitable for regression detection but requires statistical literacy.

Work with a software development agency

From first prototype to production, DEV.co delivers software development services around tools like expecto. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source testing and beyond.

Evaluating Expecto for your F# test suite?

Expecto excels at functional testing with composable, parallel test execution. Confirm F# expertise on your team, validate IDE integration needs, and pilot with performance testing before full adoption.