This document provides guidance for AI agents, such as GitHub Copilot, when working with the Stryker.NET repository.
Reference these instruction files when applicable:
- Always: Taming Copilot
- Always: Conventional Commit Guidelines
- Always: Security Best Practices
- Always: Self-Explanatory Code Commenting
- When writing documentation: Markdown Instructions
- When writing C#: C# Instructions
- When working with Azure Pipelines: Azure DevOps Pipelines
- When working with GitHub Actions: GitHub Actions
Reference these skill files when applicable:
- When running stryker on a project: Running Stryker
- When parsing a json stryker report: Parsing Stryker Report
Stryker.NET is a mutation testing framework for .NET projects. It allows you to test your tests by temporarily inserting bugs (mutations) in your source code to verify that tests catch them.
- Follow the repository's
.editorconfigand Microsoft C# coding guidelines - Create or edit unit tests or integration tests for all changes
- Update documentation when adding features
When creating or updating pull requests, always use Angular-style conventional commit format for PR titles:
- Format:
<type>(<scope>): <subject> - Types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert - Scope: The file or group of files affected (optional but recommended)
- Subject: A short, imperative description (present tense)
- Example:
feat(mutators): add string mutator support - Example:
fix(cli): resolve configuration parsing issue - Example:
docs: update contributor guidelines
Why: The project uses squash merging, so the PR title becomes the commit message in the main branch history.
- Unit tests: Run
dotnet testin the/srcdirectory or use your IDE's test runner - Integration tests:
- On Windows: Run
.\integration-tests.ps1in the root of the repo (PowerShell 7 recommended) - On macOS/Linux: Run
pwsh ./integration-tests.ps1in the root of the repo (requires PowerShell 7)
- On Windows: Run
- Always run unit tests and integration tests after making a change to ensure nothing is broken
To test Stryker.NET on a project:
- In
Stryker.CLI, openproperties > Debug - Create a new Debug profile
- Set
LaunchasProject - Set
WorkingDirectoryto a unit test project directory - You can use projects in
.\integrationtest\TargetProjectsfor testing - Run with
Stryker.CLIas the startup project
Note: Running Stryker on itself doesn't work as assemblies will be in use. To run Stryker on the stryker codebase, use the official nuget release via dotnet tool install dotnet-stryker and then dotnet stryker.
See the full guide in adding_a_mutator.md.