The Cavisson Mutation Testing plugin for Visual Studio Code enables developers to measure the quality of their unit tests by injecting small bugs (mutations) into the code. This extension simplifies the setup and execution of mutation testing for .NET Core and JavaScript applications, automatically handling tool installation and uploading results to the Cavisson Dashboard.
Installation
Open Visual Studio Code.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of VS Code or by pressing Ctrl+Shift+X.
Search for Cavisson Mutation Testing.
Click Install on the extension titled Cavisson Mutation Testing.
Pre-Requisites
OS Support: Windows or Linux.
For .NET Projects
.NET SDK: Ensure .NET SDK (v6.0 or higher) is installed.
Test Project: A unit test project (e.g., xUnit, NUnit, MSTest) must be present in the solution.
For JavaScript Projects
Node.js: Node.js (v14+) and NPM must be installed.
Testing Framework: The project should use a supported test runner (e.g., Jest).
Build & Test Status: The project must be error-free. Ensure that dotnet build and dotnet test pass successfully (100% green) before running the extension.
For Cavisson Cloud Integration
Cavisson Server URL: A valid Cavisson Dashboard Server URL is required to upload reports.
Format: http://<IP>:<PORT> or http://<DOMAIN>:<PORT>
Example (IP): http://192.168.1.55:8080
Example (Domain): https://cavisson.com:443
How to Generate and Configure the Cavisson Auth Token
To authenticate your session, you need to generate a valid CavToken from the Cavisson Unified Dashboard.
Open User Profile: Log in to the Cavisson dashboard. In the top-right corner, click on the User Profile icon.
Select Generate Token: Scroll down within the profile menu to find and select the Generate Token option.
Set Token Duration: The "Generate Authentication Token" modal will appear.
Enter the desired duration in the HH : MM format (Hours : Minutes).
Tip: Set a longer duration (e.g., 24:00 for 24 hours) to avoid frequent re-authentication.
Generate the Token: Click the green Generate button.
Copy the Token: Click the Copy button at the bottom right of the token text box.
Important: This token is only valid for the duration specified in Step 3.
Configure the Application: Paste this string into the Cavisson Auth Token input field during the configuration step.
Walkthrough: Setting Up Your Workspace
Step 1: Open the Command Palette
Windows / Linux: Press Ctrl + Shift + P
Type "Cavisson Mutation" to see the available commands.
Build Success Required: The project must compile and run existing unit tests successfully before mutation testing can begin.