{"id":15060955,"url":"https://github.com/hedgehogqa/fsharp-hedgehog","last_synced_at":"2025-05-14T21:08:08.742Z","repository":{"id":12246842,"uuid":"70032233","full_name":"hedgehogqa/fsharp-hedgehog","owner":"hedgehogqa","description":"Release with confidence, state-of-the-art property testing for .NET.","archived":false,"fork":false,"pushed_at":"2025-04-11T03:56:35.000Z","size":3914,"stargazers_count":276,"open_issues_count":43,"forks_count":30,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-11T04:30:02.843Z","etag":null,"topics":["csharp","dotnet","fsharp","property-based-testing","property-testing","quickcheck","test","testing","testing-tools"],"latest_commit_sha":null,"homepage":"https://hedgehogqa.github.io/fsharp-hedgehog/","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hedgehogqa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-10-05T05:20:06.000Z","updated_at":"2025-04-11T03:56:39.000Z","dependencies_parsed_at":"2024-01-06T23:55:24.495Z","dependency_job_id":"13672288-647d-444d-899c-3c64a9a93688","html_url":"https://github.com/hedgehogqa/fsharp-hedgehog","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedgehogqa%2Ffsharp-hedgehog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedgehogqa%2Ffsharp-hedgehog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedgehogqa%2Ffsharp-hedgehog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedgehogqa%2Ffsharp-hedgehog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hedgehogqa","download_url":"https://codeload.github.com/hedgehogqa/fsharp-hedgehog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345258,"owners_count":21088231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","fsharp","property-based-testing","property-testing","quickcheck","test","testing","testing-tools"],"created_at":"2024-09-24T23:07:19.438Z","updated_at":"2025-04-12T06:11:16.339Z","avatar_url":"https://github.com/hedgehogqa.png","language":"F#","readme":"fsharp-hedgehog [![NuGet][nuget-shield]][nuget] ![](https://github.com/hedgehogqa/fsharp-hedgehog/workflows/master/badge.svg)\n========\n\n\u003e Hedgehog will eat all your bugs.\n\n\u003cimg src=\"https://github.com/hedgehogqa/fsharp-hedgehog/raw/master/img/hedgehog-logo.png\" width=\"307\" align=\"right\"/\u003e\n\n[Hedgehog](http://hedgehog.qa/) is a modern property-based testing\nsystem, in the spirit of QuickCheck. Hedgehog uses integrated shrinking,\nso shrinks obey the invariants of generated values by construction.\n\n## Features\n\n- Integrated shrinking, shrinks obey invariants by construction.\n- Convenient syntax for generators and properties with `gen` and `property` expressions.\n- Range combinators for full control over the scope of generated numbers and collections.\n\n## Example\n\nThe root namespace, `Hedgehog`, includes almost\neverything you need to get started writing property tests with Hedgehog.\n\n```fsharp\nopen Hedgehog\n```\n\nOnce you have your import declaration set up, you can write a simple property:\n\n```fsharp\nlet propReverse : Property\u003cbool\u003e =\n    property {\n        let! xs = Gen.list (Range.linear 0 100) Gen.alpha\n        return xs |\u003e List.rev |\u003e List.rev = xs\n        }\n```\n\nYou can then load the module in F# Interactive, and run it:\n\n```\n\u003e Property.render propReverse |\u003e printfn \"%s\"\n+++ OK, passed 100 tests.\n```\n\nMore examples can be found in the [tutorial](https://hedgehogqa.github.io/fsharp-hedgehog/index.html).\n\n👉 For auto-generators (à la AutoFixture) and other convenience generators, check out [fsharp-hedgehog-experimental](https://github.com/cmeeren/fsharp-hedgehog-experimental/).\n\n## C#/LINQ Example\n\nHedgehog provides an alternative namespace, meant to provide compatibility with other .NET languages. To use this, simply import the `Hedgehog.Linq` namespace. The base `Hedgehog` namespace isn't necessary in this scenario.\n\nGenerators are then built with a more comfortable fluent API.\n\n```csharp\nusing Hedgehog.Linq;\n\nclass Generators\n{\n    static void Example()\n    {\n        // This creates a generator for 10 character strings, with only alphabetical characters.\n        var stringLength = 10;\n        var stringGen = Gen.Alpha.String(Range.FromValue(stringLength));\n\n        // This creates a property..\n        var property =\n            from str in Property.ForAll(stringGen)\n            select str.Length == stringLength;\n\n        // ..that can be checked, rechecked or rendered.\n        property.Check();\n    }\n}\n```\n\n## Building from source\n\nTo build Hedgehog from source, you will need either the\n[.NET Core SDK or Visual Studio][net-core-sdk].\n\n### Building \u0026 running tests\n\nWith Visual Studio you can build Hedgehog and run the tests\nfrom inside the IDE, otherwise with the `dotnet` command-line\ntool you can execute:\n\n```shell\ndotnet build\n```\n\nTo run the tests, you can execute:\n\n```shell\ndotnet test tests/Hedgehog.Tests/Hedgehog.Tests.fsproj\ndotnet test tests/Hedgehog.Linq.Tests/Hedgehog.Linq.Tests.csproj\n```\n\n### Building the NuGet package\n\nAs of https://github.com/hedgehogqa/fsharp-hedgehog/pull/253/ a NuGet package is created automatically during build.\n\nIf you want to manually create a NuGet package you can run:\n\n```shell\ndotnet pack src/Hedgehog/Hedgehog.fsproj -c Release\n```\n\nThis will produce `Hedgehog-x.y.z.nupkg` in `src/Hedgehog/bin/Release`.\n\n[nuget]: https://www.nuget.org/packages/Hedgehog/\n[nuget-shield]: https://img.shields.io/nuget/dt/Hedgehog.svg?style=flat\n\n[travis]: https://travis-ci.org/hedgehogqa/fsharp-hedgehog\n[travis-shield]: https://travis-ci.org/hedgehogqa/fsharp-hedgehog.svg?branch=master\n\n[net-core-sdk]: https://www.microsoft.com/net/download/\n[ubuntu-steps]: https://github.com/hedgehogqa/fsharp-hedgehog/pull/153#issuecomment-364325504\n\n\n## Development Environments\n\n### Visual Studio\n\nHedgehog can be developed in Visual Studio, once these requirements are met:\n\n- .NET Core (2.1+) and .NET Framework (4.5.1+) are installed.\n\n### Visual Studio Code\n\nHedgehog can be developed in Visual Studio Code, with a couple of scenarios supported.\n\n#### Bare Metal\n\nDeveloping on bare metal is essentially the same as developing in Visual Studio, install the appropriate .NET SDK then open the project folder.\n\n#### Remote Containers\n\nDevelopment can also be done using [Remote Development][remote-containers-doc].\n\nThe steps to get this up and running are as follows:\n\n1. Install [Docker][docker-install].\n2. Install the [Remote Containers][remote-containers-ext] extension.\n3. Open the project folder, then run the `Remote-Containers: Reopen in Container` command.\n\n[remote-containers-doc]: https://code.visualstudio.com/docs/remote/containers\n[remote-containers-ext]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers\n[docker-install]: https://docs.docker.com/get-docker/\n","funding_links":[],"categories":["Testing"],"sub_categories":["Performance Analysis"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedgehogqa%2Ffsharp-hedgehog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhedgehogqa%2Ffsharp-hedgehog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedgehogqa%2Ffsharp-hedgehog/lists"}