JitTest 1.0.1
dotnet tool install --global JitTest --version 1.0.1
dotnet new tool-manifest
dotnet tool install --local JitTest --version 1.0.1
#tool dotnet:?package=JitTest&version=1.0.1
nuke :add-package JitTest --version 1.0.1
JitTest — Catching Test Generator
LLM-driven ephemeral mutation testing for .NET projects. Automatically generates "catching tests" that are designed to fail on realistic mutants, helping detect regressions before code lands in production.
Inspired by Meta's Catching JiTTest research.
Features
- 🔍 Automatic diff extraction from git (staged, uncommitted, or branch comparison)
- 🤖 LLM-powered intent inference to understand code changes
- 🧬 Realistic mutant generation using domain-specific knowledge
- ✅ Self-correcting test generation with compiler feedback
- 🎯 False positive filtering with LLM-based assessment
- 📊 Console and markdown reporting
- 🏠 Local or cloud — runs on Ollama (local) or GitHub Models (cloud)
Prerequisites
Option 1: Local Ollama (Recommended for Development)
- .NET 10.0 SDK or later
- Ollama running locally with the model:
ollama pull qwen2.5-coder:32b-instruct-q4_K_M
Option 2: GitHub Models (Cloud-based)
- .NET 10.0 SDK or later
- GitHub Personal Access Token with
models:readpermission- Generate a fine-grained PAT at: https://github.com/settings/tokens
- Enable the
models:readpermission - Set as environment variable:
export GITHUB_TOKEN="your_token_here" - Or configure in
jittest-config.json(see Configuration section)
Installation
Install from NuGet (Recommended)
# Install globally
dotnet tool install --global JitTest
# Or install as local tool in your project
dotnet new tool-manifest # if you don't have one yet
dotnet tool install --local JitTest
Install from Source (Development)
# Clone the repository
git clone https://github.com/moonolgerd/jittest.git
cd jittest/JiTTest
# Build and install
dotnet pack -c Release
dotnet tool install --global --add-source ./bin/Release JitTest
Usage
Navigate to your git repository and run:
# Test uncommitted changes
jittest --diff-source uncommitted
# Test staged changes
jittest --diff-source staged
# Compare against a branch
jittest --diff-source branch:main
# With verbose output (shows full test code and LLM details)
jittest --diff-source uncommitted --verbose
# Dry run (intent inference only)
jittest --diff-source uncommitted --dry-run
Configuration
Create a jittest-config.json in your repository root:
For Local Ollama:
{
"jittest-config": {
"ollama-endpoint": "http://localhost:11434/v1",
"model": "qwen2.5-coder:32b-instruct-q4_K_M",
"diff-source": "uncommitted",
"mutate-targets": [
"**/*.cs"
],
"exclude": [
"**/Program.cs",
"**/obj/**",
"**/bin/**"
],
"max-mutants-per-change": 5,
"max-retries": 2,
"confidence-threshold": "MEDIUM",
"reporters": ["console"],
"temp-directory": ".jittest-temp"
}
}
For GitHub Models:
{
"jittest-config": {
"llm-endpoint": "https://models.github.ai/inference/chat/completions",
"model": "openai/gpt-4o",
"diff-source": "uncommitted",
"mutate-targets": [
"**/*.cs"
],
"exclude": [
"**/Program.cs",
"**/obj/**",
"**/bin/**"
],
"max-mutants-per-change": 5,
"max-retries": 2,
"confidence-threshold": "MEDIUM",
"reporters": ["console"],
"temp-directory": ".jittest-temp"
}
}
Authentication: Set GITHUB_TOKEN environment variable with your GitHub Personal Access Token (must have models:read permission). Alternatively, you can add "github-token": "your_token_here" to the config file (not recommended for security reasons).
Notes:
- For GitHub Models, you can omit
"github-token"from the config file and use theGITHUB_TOKENenvironment variable instead - Model names must be in
publisher/modelformat (e.g.,openai/gpt-4o,openai/gpt-4o-mini) - Available models: Check https://github.com/marketplace/models
- GitHub Models offers free tier for development and testing
How It Works
- Extracts code changes from your git repository
- Infers intent using the LLM to understand what changed and why
- Generates realistic mutants representing plausible bugs
- Creates tests that pass on original code but fail on mutants
- Executes tests to find "candidate catches"
- Assesses catches to filter false positives
- Reports results in console or markdown
All generated tests are ephemeral and stored in .jittest-temp/ — never checked into source control.
Exit Codes
0— No regressions detected1— Potential regressions found (candidate catches)2— Configuration or connectivity error
Uninstall
# Global tool
dotnet tool uninstall --global JitTest
# Local tool
dotnet tool uninstall JitTest
Publishing (for maintainers)
The package is automatically published to NuGet when a release branch is created:
- Update version in
JiTTest/JiTTest.csproj - Create a release branch:
git checkout -b release/v1.0.1 git push origin release/v1.0.1 - GitHub Actions will automatically:
- Build the project
- Pack the NuGet package
- Publish to NuGet.org
Setup (one-time)
Add your NuGet API key as a GitHub secret:
- Go to https://www.nuget.org/account/apikeys and create a new API key
- In your GitHub repository, go to Settings → Secrets and variables → Actions
- Add a new secret named
NUGET_API_KEYwith your API key value
Alternatively, you can tag a commit to trigger publishing:
git tag v1.0.1
git push origin v1.0.1
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.