Bonus : Mutation testing

Mutation testing involves making small changes to your code (mutants) and then running your test suite to see if the tests catch these changes. This helps to evaluate the quality of your tests. Here are some frameworks for mutation testing in C#, PHP, and TypeScript:

C# Stryker.NET

  • Description: Stryker.NET is a mutation testing framework for .NET Core and .NET Framework projects.

PHP Infection

  • Description: Infection is a powerful and configurable mutation testing framework for PHP.

TypeScript StrykerJS

  • Description: StrykerJS is a mutation testing framework for JavaScript and TypeScript projects.

Steps to get started:

  1. C# (Stryker.NET)

    • Installation: Install the Stryker.NET tool using the .NET CLI:

      dotnet tool install -g dotnet-stryker
    • Running: Navigate to your project directory and run:

      dotnet stryker
  2. PHP (Infection)

    • Installation: Install Infection via Composer:

      composer require --dev infection/infection
    • Running: Run Infection using the following command:

      vendor/bin/infection
  3. TypeScript (StrykerJS)

    • Installation: Install StrykerJS globally using npm:

      npm install -g stryker-cli
    • Configuration: Initialize Stryker in your project:

      stryker init
    • Running: Start mutation testing:

      stryker run

These frameworks will help you implement mutation testing in your C#, PHP, and TypeScript projects

Last updated