Stryker.NET
testcontainers-dotnet
Our great sponsors
Stryker.NET | testcontainers-dotnet | |
---|---|---|
14 | 16 | |
1,711 | 3,534 | |
1.8% | 3.2% | |
9.3 | 9.0 | |
2 days ago | 3 days ago | |
C# | C# | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stryker.NET
-
Stryker.NET alternatives - Testura.Mutation, visualmutator, fettle, and Faultify
5 projects | 9 Jun 2023
-
Do you guys mock everything in your Unit Tests?
Bogus - For creating fake data Verify - Snapshot testing for .NET MELT - For testing ILogger usage Stryker - Mutation Testing for .NET TestContainers - run docker programmatically in integration tests
-
Scope of unit testing (karma/Jas) Boss wants unreasonable testing?
This is called mutation testing btw.
-
Don't target 100% coverage
Let's try it on our small example using Stryker.
- PhD'ers, what are you working on? What CS topics excite you?
-
Killing mutants to improve your tests
There are tools that do this automatically, stryker[2] is one of them. When you run stryker, it will create many mutant versions of your production code, and run your tests for each mutant (that's how mutations are called in stryker's' documentation) version of the code. If your tests fail then the mutant is killed. If your tests passed, the mutant survived. Let's have a look at the the result of runnning stryker against reffects-store's code:
-
Not sure if popular opinion: Greenfield projects should have 100% test coverage.
Mutation testing is pretty solid. Better than code coverage for sure. Using Stryker personally.
-
Seriously what are they and why does everyone hate them?
A mutation testing tool (like Stryker) runs your unit tests to verify they all pass then makes a small change (mutation) to your code and reruns the tests. At least one test should fail because the modified code should behave differently.
-
Relesed v1.0.0 of my pet javasscript project yesterday after hitting 100% coverage- a gesture detection library
I haven't tried it yet, but last time I researched it, this is the library that looked most promising: https://stryker-mutator.io/
-
Mutation Testing in NodeJS
Website: https://stryker-mutator.io/
testcontainers-dotnet
-
Integration tests with AWS S3 buckets using Localstack and Testcontainers
Testcontainers
-
Integration Tests with In Memory DB vs Real DB on Docker
Like others said, it's better to test with an actual database. I recommend using Testcontainers (https://dotnet.testcontainers.org), you can even create multiple instances so your tests can run in parallel independently.
- Unit Testing
- Running untrusted (user-provided) Python code on ASP.NET/C# backend
-
Integration tests for AWS serverless solution
To launch a container in code we will use Testcontainers. Testcontainers is a library that is built on top of the .NET Docker remote API and provides a lightweight implementation to support your test environment in all circumstances. This library supports pre-defined packages for containers or you can use your .dockerfile. We will use a pre-defined package for LocalStak. LocalStack is a cloud service emulator that runs in a single container for AWS service. LocalStack supports a growing number of AWS services.
- If i want to do testing CRUD should I use in memory or just do integration test where I use a seperate database?
-
Do you guys mock everything in your Unit Tests?
Bogus - For creating fake data Verify - Snapshot testing for .NET MELT - For testing ILogger usage Stryker - Mutation Testing for .NET TestContainers - run docker programmatically in integration tests
- Testes de integração com containers
- What C# tools would you like to use that don't exist today?
-
Ask HN: How do you test SQL?
.NET Shop using SQL Server here, but I think something similar to what we do can apply to any stack. We use TestContainers [1] to spin up a container with SQL Server engine running on it. Then use FluentMigrator [2] to provision tables and test data to run XUnit integration tests against. This has worked remarkably well.
[1] https://dotnet.testcontainers.org/
What are some alternatives?
xUnit - xUnit.net is a free, open source, community-focused unit testing tool for .NET.
NUnit - NUnit Framework
sharpfuzz - AFL-based fuzz testing for .NET
SpecFlow - #1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
Moq - Repo for managing Moq 4.x [Moved to: https://github.com/moq/moq]
testcontainers-go - Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
MSTest - MSTest framework and adapter
testcontainers-python - Testcontainers is a Python library that providing a friendly API to run Docker container. It is designed to create runtime environment to use during your automatic tests.
Bogus - :card_index: A simple fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.
Docker.DotNet - :whale: .NET (C#) Client Library for Docker API
should - Should Assertion Library
ephemeral-mongo - EphemeralMongo is a set of three NuGet packages wrapping the binaries of MongoDB 4, 5 and 6 built for .NET Standard 2.0.