microsoft.coyote

Coyote is a library and tool for testing concurrent C# code and deterministically reproducing bugs.

https://github.com/microsoft/coyote

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.1%) to scientific vocabulary

Keywords

coyote dotnet fuzzing software-reliability systematic-testing testing testing-tools

Keywords from Contributors

pdes networks simulations optim mesh sequences interactive hacking
Last synced: 6 months ago · JSON representation ·

Repository

Coyote is a library and tool for testing concurrent C# code and deterministically reproducing bugs.

Basic Info
Statistics
  • Stars: 1,565
  • Watchers: 36
  • Forks: 81
  • Open Issues: 45
  • Releases: 0
Topics
coyote dotnet fuzzing software-reliability systematic-testing testing testing-tools
Created over 6 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License Citation Security

README.md

Coyote

NuGet Nuget Build and Test CI CodeQL

Coyote is a cross-platform library and tool for testing concurrent C# code and deterministically reproducing bugs.

Using Coyote, you can easily test the concurrency and other nondeterminism in your C# code, by writing what we call a concurrency unit test. These look like your regular unit tests, but can reliably test concurrent workloads (such as actors, tasks, or concurrent requests to ASP.NET controllers). In regular unit tests, you would typically avoid concurrency due to flakiness, but with Coyote you are encouraged to embrace concurrency in your tests to find bugs.

Coyote is used by many teams in Azure to test their distributed systems and services, and has found hundreds of concurrency-related bugs before deploying code in production and affecting users. In the words of an Azure service architect:

Coyote found several issues early in the dev process, this sort of issues that would usually bleed through into production and become very expensive to fix later.

Coyote is made with :heart: by Microsoft Research.

How it works

Consider the following simple test: ```csharp [Fact] public async Task TestTask() { int value = 0; Task task = Task.Run(() => { value = 1; });

Assert.Equal(0, value); await task; } ```

This test will pass most of the time because the assertion will typically execute before the task starts, but there is one schedule where the task starts fast enough to set value to 1 causing the assertion to fail. Of course, this is a very naive example and the bug is obvious, but you could imagine much more complicated race conditions that are hidden in complex execution paths.

The way Coyote works, is that you first convert the above test to a concurrency unit test using the Coyote TestingEngine API: ```csharp using Microsoft.Coyote.SystematicTesting;

[Fact] public async Task CoyoteTestTask() { var configuration = Configuration.Create().WithTestingIterations(10); var engine = TestingEngine.Create(configuration, TestTask); engine.Run(); } ```

Next, you run the coyote rewrite command from the CLI (typically as a post-build task) to automatically rewrite the IL of your test and production binaries. This allows Coyote to inject hooks that take control of the concurrent execution during testing.

You can then run the concurrent unit test from your favorite unit testing framework (such as xUnit). Coyote will take over and repeatedly execute the test from beginning to the end for N iterations (in the above example N was configured to 10). Under the hood, Coyote uses intelligent search strategies to explore all kinds of execution paths that might hide a bug in each iteration.

The awesome thing is that once a bug is found, Coyote gives you a trace through the engine.TestReport API that you can use to reliably reproduce the bug as many times as you want, making debugging and fixing the issue significantly easier.

Get started

Getting started with Coyote is easy! First, follow this guide to install the coyote command-line tool from NuGet. You are now ready to check out the Coyote website for tutorials, documentation, how-tos, samples and more information about the project. Enjoy!

Upgrading your coyote dependencies? Check the changelog here.

Support

Note that Coyote is an open-source project that is provided "as-is". We are not able to provide any formal support. For Microsoft employees we have the Friends of Coyote Teams channel, which is an internal community that can help answer questions and learn from each other.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Owner

  • Name: Microsoft
  • Login: microsoft
  • Kind: organization
  • Email: opensource@microsoft.com
  • Location: Redmond, WA

Open source projects and samples from Microsoft

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Deligiannis"
  given-names: "Pantazis"
  orcid: "https://orcid.org/0000-0001-7582-4520"
- family-names: "Lovett"
  given-names: "Chris"
- family-names: "Lal"
  given-names: "Akash"
title: "Coyote"
version: 1.7.11
date-released: 2020-02-28
url: "https://github.com/microsoft/coyote"
preferred-citation:
  type: article
  authors:
  - family-names: "Deligiannis"
    given-names: "Pantazis"
    orcid: "https://orcid.org/0000-0001-7582-4520"
  - family-names: "Senthilnathan"
    given-names: "Aditya"
  - family-names: "Nayyar"
    given-names: "Fahad"
  - family-names: "Lovett"
    given-names: "Chris"
  - family-names: "Lal"
    given-names: "Akash"
  doi: "10.1007/978-3-031-30820-8_26"
  journal: "International Conference on Tools and Algorithms for the Construction and Analysis of Systems"
  start: 433
  end: 452
  title: "Industrial-Strength Controlled Concurrency Testing for Programs With Coyote"
  year: 2023

GitHub Events

Total
  • Issues event: 5
  • Watch event: 83
  • Delete event: 3
  • Push event: 6
  • Pull request review event: 1
  • Pull request event: 5
  • Fork event: 4
  • Create event: 2
Last Year
  • Issues event: 5
  • Watch event: 83
  • Delete event: 3
  • Push event: 6
  • Pull request review event: 1
  • Pull request event: 5
  • Fork event: 4
  • Create event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 661
  • Total Committers: 20
  • Avg Commits per committer: 33.05
  • Development Distribution Score (DDS): 0.334
Past Year
  • Commits: 5
  • Committers: 3
  • Avg Commits per committer: 1.667
  • Development Distribution Score (DDS): 0.4
Top Committers
Name Email Commits
Pantazis Deligiannis p****a@m****m 440
Chris Lovett c****t@m****m 181
Shrey Tiwari s****t@g****m 6
Akash Lal a****1@g****m 6
Damon Kiley v****e@m****m 4
Dimitre Novatchev v****o@m****m 4
dependabot[bot] 4****] 4
Christopher Watford c****d@g****m 2
Immad i****r@g****m 2
Udit kumar agarwal 1****7 2
Aditya Senthilnathan a****9@g****m 1
Ao Li 5****l 1
Brian Chavez b****z@b****m 1
GitWizard123 1****3 1
Laurent Kempé l****e@t****m 1
Martin m****t@t****o 1
Salman Muin Kayser Chishti 1****i@g****m 1
The Gitter Badger b****r@g****m 1
dan2468 1****8 1
timbo t****w 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 32
  • Total pull requests: 75
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 1 day
  • Total issue authors: 22
  • Total pull request authors: 11
  • Average comments per issue: 3.84
  • Average comments per pull request: 0.52
  • Merged pull requests: 66
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 2
  • Average time to close issues: about 23 hours
  • Average time to close pull requests: 8 minutes
  • Issue authors: 5
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ankushdesai (5)
  • fleed (3)
  • arunt1204 (2)
  • tbertenshaw (2)
  • muwaqar (2)
  • yunpengxiao (2)
  • msftph (1)
  • mikocot (1)
  • jamescarter-le (1)
  • wanton7 (1)
  • Kielek (1)
  • aoli-al (1)
  • yahorsi (1)
  • gabthau (1)
  • dharmaturtle (1)
Pull Request Authors
  • pdeligia (58)
  • lovettchris (13)
  • salmanmkc (4)
  • akashlal (4)
  • kzdev-net (2)
  • JamieMagee (1)
  • bchavez (1)
  • gitter-badger (1)
  • Youssef1313 (1)
  • WeihanLi (1)
  • tbertenshaw (1)
  • dependabot[bot] (1)
  • uditagarwal97 (1)
  • dan2468 (1)
  • aoli-al (1)
Top Labels
Issue Labels
Pull Request Labels
area-documentation (4) area-nuget-package (3) area-systematic-testing (1) dependencies (1) github_actions (1)

Packages

  • Total packages: 6
  • Total downloads:
    • nuget 1,997,410 total
  • Total dependent packages: 8
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 232
  • Total maintainers: 2
nuget.org: microsoft.coyote

Coyote is a library and tool for testing concurrent C# code and deterministically reproducing bugs.

  • Versions: 78
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 1,250,119 Total
Rankings
Downloads: 1.0%
Average: 11.2%
Dependent repos count: 13.8%
Dependent packages count: 18.8%
Maintainers (2)
Last synced: 6 months ago
nuget.org: microsoft.coyote.test

The Coyote systematic testing engine.

  • Versions: 57
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 254,336 Total
Rankings
Downloads: 3.8%
Average: 12.2%
Dependent repos count: 13.8%
Dependent packages count: 18.8%
Maintainers (2)
Last synced: 6 months ago
nuget.org: microsoft.coyote.cli

The Coyote .NET command-line tool.

  • Versions: 61
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 110,785 Total
Rankings
Downloads: 5.8%
Average: 12.8%
Dependent repos count: 13.8%
Dependent packages count: 18.8%
Maintainers (2)
Last synced: 6 months ago
nuget.org: microsoft.coyote.core

The Coyote core libraries and runtime.

  • Versions: 12
  • Dependent Packages: 3
  • Dependent Repositories: 0
  • Downloads: 176,510 Total
Rankings
Downloads: 6.1%
Average: 12.9%
Dependent repos count: 13.8%
Dependent packages count: 18.8%
Maintainers (2)
Last synced: 6 months ago
nuget.org: microsoft.coyote.actors

The Coyote actor runtime and library.

  • Versions: 12
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 174,868 Total
Rankings
Downloads: 6.2%
Average: 13.0%
Dependent repos count: 13.8%
Dependent packages count: 18.8%
Maintainers (2)
Last synced: 6 months ago
nuget.org: microsoft.coyote.tool

The self-contained Coyote command-line tool.

  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 30,792 Total
Rankings
Downloads: 11.2%
Dependent repos count: 13.8%
Average: 14.6%
Dependent packages count: 18.8%
Maintainers (2)
Last synced: 6 months ago

Dependencies

Samples/WebApps/ImageGalleryAspNet/ImageGallery/bower.json bower
  • bootstrap 3.4.0
  • jquery 3.5.1
  • jquery-validation 1.14.0
  • jquery-validation-unobtrusive 3.2.6
Samples/AccountManager/AccountManager/AccountManager.csproj nuget
  • xunit.assert 2.4.1
Samples/AccountManager/AccountManager.ETags/AccountManager.ETags.csproj nuget
  • System.Text.Json 6.0.0
  • xunit.assert 2.4.1
Samples/CloudMessaging/Raft/Raft.csproj nuget
  • Newtonsoft.Json 13.0.1
Samples/CloudMessaging/Raft.Azure/Raft.Azure.csproj nuget
  • Microsoft.Azure.ServiceBus 4.1.1
  • Newtonsoft.Json 13.0.1
Samples/CoffeeMachineActors/CoffeeMachineActors.csproj nuget
  • System.Collections 4.3.0
Samples/CoffeeMachineTasks/CoffeeMachineTasks.csproj nuget
  • System.Collections 4.3.0
Samples/DrinksServingRobotActors/DrinksServingRobotActors.csproj nuget
  • System.Collections 4.3.0
Samples/HelloWorldActors/HelloWorldActors.csproj nuget
  • System.Collections 4.3.0
Samples/WebApps/ImageGalleryAspNet/ImageGalleryClient/ImageGalleryClient.csproj nuget
  • Microsoft.AspNet.WebApi.Client 5.2.7
  • System.Net.Http.Json 3.2.1
Samples/WebApps/ImageGalleryAspNet/ImageGalleryService/ImageGalleryService.csproj nuget
  • Azure.Storage.Blobs 12.6.0
  • Microsoft.Azure.Cosmos 3.12.0
Samples/WebApps/ImageGalleryAspNet/Tests/Tests.csproj nuget
  • MSTest.TestAdapter 2.2.8
  • MSTest.TestFramework 2.2.8
  • Microsoft.AspNet.WebApi.Client 5.2.7
  • Microsoft.Azure.Cosmos.Direct 3.13.0
  • Microsoft.NET.Test.Sdk 17.1.0
Samples/WebApps/ImageGalleryAspNet/Tests.Coyote/Tests.Coyote.csproj nuget
  • MSTest.TestAdapter 2.2.8
  • MSTest.TestFramework 2.2.8
  • Microsoft.NET.Test.Sdk 17.1.0
Samples/WebApps/PetImagesAspNet/PetImages.Tests/PetImages.Tests.csproj nuget
  • Microsoft.AspNetCore.Mvc.Testing 6.0.3
  • Microsoft.AspNetCore.TestHost 6.0.3
  • Microsoft.NET.Test.Sdk 17.1.0
  • xunit 2.4.1
  • xunit.runner.visualstudio 2.4.3
Source/Core/Core.csproj nuget
  • System.Threading.Tasks.Extensions 4.5.4
  • System.ValueTuple 4.5.0
Source/Test/Test.csproj nuget
  • Microsoft.ApplicationInsights 2.20.0
  • Microsoft.AspNetCore.Http.Abstractions 2.2.0
  • Microsoft.Extensions.DependencyModel 6.0.0
  • Mono.Cecil 0.11.4
  • System.Text.Json 6.0.0
Tests/Tests.Actors/Tests.Actors.csproj nuget
  • Microsoft.NET.Test.Sdk 17.1.0
  • xunit 2.4.1
  • xunit.runner.visualstudio 2.4.3
Tests/Tests.Actors.BugFinding/Tests.Actors.BugFinding.csproj nuget
  • Microsoft.NET.Test.Sdk 17.1.0
  • xunit 2.4.1
  • xunit.runner.visualstudio 2.4.3
Tests/Tests.Actors.Performance/Tests.Actors.Performance.csproj nuget
  • BenchmarkDotNet 0.12.1
Tests/Tests.BugFinding/Tests.BugFinding.csproj nuget
  • Microsoft.NET.Test.Sdk 17.1.0
  • xunit 2.4.1
  • xunit.runner.visualstudio 2.4.3
Tests/Tests.Common/Tests.Common.csproj nuget
  • xunit 2.4.1
Tests/Tests.Performance/Tests.Performance.csproj nuget
  • BenchmarkDotNet 0.12.1
Tests/Tests.Rewriting/Tests.Rewriting.csproj nuget
  • Microsoft.NET.Test.Sdk 17.1.0
  • Mono.Reflection 2.0.0
  • xunit 2.4.1
  • xunit.runner.visualstudio 2.4.3
Tools/BenchmarkRunner/BenchmarkRunner.csproj nuget
  • BenchmarkDotNet 0.13.1
  • Microsoft.Azure.Cosmos 3.10.1
  • Newtonsoft.Json 13.0.1
Tools/Coyote/Coyote.csproj nuget
  • System.CommandLine 2.0.0-beta3.22114.1
  • System.Configuration.ConfigurationManager 4.7.0
Tools/GenDoc/GenDoc.csproj nuget
  • System.CommandLine 2.0.0-beta3.22114.1
  • XmlDocMarkdown.Core 2.8.0
  • YamlDotNet 11.2.1
Scripts/Notebooks/requirements.txt pypi
  • azure-cosmos *
docs/requirements.txt pypi
  • mkdocs *
  • mkdocs-macros-plugin *
.github/workflows/codeql-analysis.yml actions
  • NuGet/setup-nuget v1 composite
  • actions/checkout v2 composite
  • actions/setup-dotnet v1 composite
  • github/codeql-action/analyze v1 composite
  • github/codeql-action/init v1 composite
.github/workflows/publish-docs.yml actions
  • actions/checkout v2 composite
.github/workflows/test-coyote.yml actions
  • NuGet/setup-nuget v1 composite
  • actions/checkout v2 composite
  • actions/download-artifact v3 composite
  • actions/setup-dotnet v1 composite
  • actions/upload-artifact v3 composite
.github/workflows/test-performance.yml actions
  • NuGet/setup-nuget v1 composite
  • actions/checkout v2 composite
  • actions/setup-dotnet v1 composite
Tests/Tests.Runtime/Tests.Runtime.csproj nuget
  • Microsoft.NET.Test.Sdk 17.4.0
  • xunit 2.4.2
  • xunit.runner.visualstudio 2.4.5
Tools/CLI/Coyote.CLI.csproj nuget
  • System.CommandLine 2.0.0-beta4.22272.1
  • System.Configuration.ConfigurationManager 7.0.0