Stryker Mutator VSCode extension is a plugin for Visual Studio Code (& friends) that enables developers to use the Stryker Mutator mutation testing framework directly within their code editor. Mutation testing is a technique used to improve the quality of software by introducing faults (or "mutations") into the codebase and checking if the tests catch them. The Stryker Mutator framework automates this process by generating many variations of the code (with different mutations) and running the tests against each variation to see which mutations are caught and which ones slip through undetected.
This extension provides an easy-to-use interface for configuring and running the Stryker Mutator framework within your project. It allows you to customize the mutation testing process by specifying which selection, file, folder to launch the mutants against. It provides feedback on the progress and results of the mutation testing run. With the Stryker Mutator
, you can easily improve the test coverage and overall quality of your codebase.
๐ Note ๐
It's an unofficial extension for
Stryker Mutator
It only supports
.NET (C#)
for Now.If you are using
JavaScript/TypeScript
for your project, we suggest the use of pixabelle.stryker-runner
Mutation testing is a powerful technique for improving the quality and reliability of your software. By automatically introducing faults into your codebase and checking if the tests catch them, you can identify weaknesses in your test suite and improve its effectiveness. However, setting up and running mutation testing manually can be time-consuming and error-prone. The Stryker Mutator
streamlines the mutation testing process by providing an easy-to-use interface for configuring and running the Stryker Mutator framework within your code editor.
With Stryker Mutator
, you can:
- Improve the quality and reliability of your code by identifying weaknesses in your test suite and addressing them.
- Catch bugs and issues that might otherwise go unnoticed.
- Increase your confidence in your codebase by ensuring that your tests are effective at catching faults.
- Save time and effort by automating the mutation testing process.
- Customize the mutation testing process to fit your specific needs and requirements.
- Easily integrate mutation testing into your development workflow by using the extension directly within your code editor.
Overall, Stryker Mutator
is a powerful tool for any developer looking to improve the quality and reliability of their codebase.
Mutation testing can be resource-intensive and may significantly slow down your build process.
Stryker Mutator
may consume a considerable amount of system resources and may require careful configuration to ensure optimal performance. We recommend that you test the extension on a selection on code, on a file or a small-scale project. Carefully review the Stryker Mutator's documentation to ensure that your configuration settings are appropriate for your project's needs. We are not responsible for any issues or damages that may arise from the use of this extension, and use of this extension is at your own risk.
- .NET SDK is require, [ at least we tested it with .NET 6 & 7 ]
- VS Code ๐คฏ Obviously!!! & Friends (e.g.: VSCodium)
If you didn't have Stryker.Net installed and a configuration file, you should start with these steps while using the command Palette:
Install the Stryker.NET tool
. It may take time to install.Create [a basic] Stryker configuration file
Afterward, right-click on a file, on a folder or over a selection of your best (or worst ๐ฌ) code and choose the Trigger mutation tests
action that you want to perform.
Here is the list of all available (โ๏ธ) and upcoming (โ) features that will help you hunt mutants hiding in place sight:
Stryker.NET: Trigger mutation tests on file
: Will run Stryker to mutate one specific file. Available in the:- Context Menu (โ๏ธ)
- Command Palette (โ๏ธ)
Stryker.NET: Trigger mutation tests on selection
: will run Stryker to mutate a selected block of code within the editor. Available in the:- Context Menu (โ๏ธ)
- Command Palette (โ๏ธ)
Stryker.NET: Trigger mutation tests on solution
: Will run Stryker to mutate files within the solution. Available, with a disclaimer (โ๏ธ), in the:- Context Menu (โ๏ธ)
- Command Palette (โ๏ธ)
Stryker.NET: Trigger mutation tests on project
: Will run Stryker to mutate files within the project. Available, with a disclaimer (โ๏ธ), in the:- Context Menu (โ๏ธ)
- Command Palette (โ๏ธ)
Stryker.NET: Trigger mutation tests on folder
: Will run Stryker to mutate files under one specific folder. Available, with a disclaimer (โ๏ธ), in the:- Command Palette (โ๏ธ)
- [โป๏ธ Deprecated, please use
Stryker.NET: Trigger mutation tests on solution
instead]Stryker.NET: Trigger mutation tests on workspace
: Will run Stryker to mutate all files. Available, with a disclaimer (โ๏ธ), from the:- Command Palette (โ๏ธ)
Stryker.NET: Create Stryker.NET configuration file
: Will create a default stryker configuration file in the chosen folder. Available from the:- Command Palette (โ๏ธ)
Stryker.NET: Install Stryker.NET Tool
: Will install the latest version of stryker dotnet tool. It will use the settings to determine the Global or Local Installation. Available from the:- Command Palette (โ๏ธ)
Stryker.NET: Update Stryker.NET Tool
: Will update the latest version of stryker dotnet tool. It will use the settings to determine the Global or Local Installation. Available from the:- Command Palette (โ๏ธ)
Stryker.NET: Uninstall Stryker.NET Tool
: Will uninstall the stryker dotnet tool. It will use the settings to determine the Global or Local Installation. Available from the:- Command Palette (โ๏ธ)
Stryker.NET: Show the Report
: Will display the latest generated mutation report. Available from the:- Command Palette (โ Alternatively, you could use
--open-report:html
in the optionalParameters setting)
- Command Palette (โ Alternatively, you could use
Even though the extension Stryker Mutator will work without any specific settings, there are some settings that you could take advantage of:
โ๏ธAvailable โUpcoming |
Settings | Description |
---|---|---|
โ๏ธ | strykerMutatorNet.dotnet.commandPath | The command/path to invoke dotnet , if different than the default path/exe (default:dotnet ) |
โ๏ธ | strykerMutatorNet.dotnet.solutionFolder | Folder path to the dotnet solution file, if different than the workspace. The Path must be relative to the actual workspace |
โ๏ธ | strykerMutatorNet.stryker.configFile | Path to a stryker config file, if different than the default name/workspace path |
โ๏ธ | strykerMutatorNet.stryker.optionalParameters | Optional parameters to add with the command line. See the Configuration for more details (e.g. --verbosity info , --concurrency 2 , --output . ...) |
โ๏ธ | strykerMutatorNet.tool.installationLocation | Installation location of the dotnet-stryker tool (default: global ) |
โ | strykerMutatorNet.show-report | Enable/Disable the browser opening the report. It requires the reporter html (default: false /disable). Alternatively, you could use --open-report:html in the optionalParameters setting |
- You are using a mono-repo style
- And the workspace is not the root of the dotnet project
- And you have manually installed stryker locally in the project instead of globally
Since we're using a "custom" terminal, named Stryker
, to run the dotnet stryker
command from the root workspace, it won't be able to access the dotnet tool manifest in a child folder.
Starting with version 0.6.0, you can specify the relative path to the .NET solution folder in settings.json
, using the strykerMutatorNet.dotnet.solutionFolder
config.
Itโs advisable to use workspace settings to accommodate varying .NET solution folder locations across different projects.
- โค๏ธ Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
- ๐ Take a look at the support document on guidelines for tips on how to ask the right questions.
- ๐ For all features/bugs/issues/questions/etc., head over here.
- โค๏ธ Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
- ๐ Please review the Contributing document for submitting issues/a guide on submitting pull requests and helping out.
Thanks to:
- the hard work done by slcp behind his VSCode extension pixabelle.stryker-runner and it's repo GitHub stryker-runner which integrates the Stryker-JS. This extension,
vscode-stryker-mutator
, was build upon his work and would not have been available so soon without it. - Manuel Sagra for the image of TMNT on Flickr that inspired the logo mixed with the Stryker Mutator logo.
- @lrstanley, for his repository documentation templates which I use nearly as is.
- @Bibz87, whom inspired my ReadMe
If you think this code/project is useful to you, I encourage you to make a donation to one of these foundations that I hold dear: Foundation for Prader-Willi Research Canada or International Prader-Willi Syndrome Organisation.
Prader-Willi syndrome (PWS) is a rare genetic disorder characterized at birth by severe hypotonia, growth disorders, learning disabilities and the appearance of hyperphagia (i.e. always being hungry) during childhood (usually appears between 2 and 8 years of age). Without adequate care (and sometimes despite care) this can lead to the development of morbid obesity. You can learn more about it on Wikipedia, on the Foundation for Prader-Willi Research website or on the International Prader-Willi Syndrome Organisation website.
This VSCode extension and source code is licensed under the terms of the GPL-3.0 license.
The modified "logo" used in this project is licensed under CC-BY-4.0. The original image can be found on Flickr and was distributed under CC-BY-2.0.