Skip to main content

Verified AI test synthesis — proves every generated test catches real bugs

Project description

quelltest

Auto-generate verified killing tests for survived mutants from mutmut and Stryker.

PyPI Python License: MIT

Quell reads your mutation testing results, generates pytest assertions that kill each surviving mutant, verifies them, and injects them directly into your test files — without touching your formatting.

How it works

  1. Scan — reads .mutmut-cache or Stryker JSON. Finds all survived mutants.
  2. Generate — deterministic rule-based generators handle 9 operator types. No LLM call needed for the common cases.
  3. Verify — every generated test runs against the live mutant in isolation. Tests that don't kill are discarded.
  4. Inject — verified tests are written using libcst, a lossless concrete syntax tree parser. Comments, spacing, and formatting are preserved exactly. Source files are backed up first.

Installation

pip install quelltest

Requires Python 3.11+.

Quick start

# Run your mutation tool first
mutmut run
# or
npx stryker run --reporters=json

# Scan survived mutants
quell scan --source mutmut

# Generate and inject killing tests
quell fix

# Preview without writing
quell fix --dry-run

# Auto-fix all without prompts
quell auto

Supported mutation operators

Nine operators have deterministic rule-based generators — no network call required:

Operator Example
BOUNDARY_SHIFT >>=
ARITHMETIC_OP +-
LOGICAL_OP andor
COMPARISON_OP ==!=
RETURN_VALUE return xreturn None
STATEMENT_DEL statement removed
CONSTANT_MUTATION 01
DECORATOR_REMOVAL decorator stripped
COLLECTION_OP appendremove

UNKNOWN operators fall back to an LLM if a provider is configured.

Configuration

quell init   # adds [tool.quell] to pyproject.toml
[tool.quell]
llm_provider = "anthropic"         # "anthropic" | "openai" | "ollama"
llm_model    = "claude-sonnet-4-6"
max_verification_attempts   = 3
verification_timeout_seconds = 30
auto_write = false

Set your LLM API key (only needed for UNKNOWN operators):

export ANTHROPIC_API_KEY=sk-ant-...
# or
export OPENAI_API_KEY=sk-...

For a fully local/offline setup, use Ollama:

quell fix --llm ollama   # requires ollama running locally

Privacy

  • Your code is never sent to any server unless you configure an LLM provider.
  • LLM is called only for UNKNOWN operators — the rule engine handles everything else.
  • All source file mutations are done locally in a subprocess and reverted afterwards.

Adapters

Tool Format Status
mutmut .mutmut-cache (SQLite) ✅ Supported
Stryker (JS/TS) reports/mutation/mutation.json ✅ Supported
PIT (Java) XML 🔜 Planned

Project structure

quell/
├── cli.py              # Typer CLI entry point
├── adapters/           # mutmut + Stryker result parsers
├── core/
│   ├── analyzer.py     # classifies mutation operators from AST diffs
│   ├── generator.py    # rule-based test generators for 9 operators
│   ├── verifier.py     # runs tests against live mutants in subprocess
│   └── writer.py       # libcst-based test file injection
├── llm/                # LLM client + Anthropic / OpenAI / Ollama providers
└── ui/                 # Rich terminal UI (progress, diffs, console)

Development

# Clone and install
git clone https://github.com/shashank7109/quelltest_lib.git
cd quelltest_lib
uv sync

# Run tests
uv run pytest tests/ -v

# Lint
uv run ruff check . --fix

Related

License

MIT — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quelltest-0.3.0.tar.gz (215.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quelltest-0.3.0-py3-none-any.whl (56.9 kB view details)

Uploaded Python 3

File details

Details for the file quelltest-0.3.0.tar.gz.

File metadata

  • Download URL: quelltest-0.3.0.tar.gz
  • Upload date:
  • Size: 215.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for quelltest-0.3.0.tar.gz
Algorithm Hash digest
SHA256 aa5d3feaa5258ec08d09420a2dcd84687d6cd306b164f07022c1dfe2a96d2c65
MD5 ed68c030f876c5fc0f00aac96a8a6606
BLAKE2b-256 34e4953923965e7bb8da0d1a3a8a66405b7e37bfb5c3794b3d72ca11f0aab60a

See more details on using hashes here.

File details

Details for the file quelltest-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: quelltest-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 56.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for quelltest-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd31b05ac62b04382e966fcb8c8c020157d9aa1484618e8dc076a754ef51c51a
MD5 6edaeb7fb6ef33070ab7be853b4a6b7d
BLAKE2b-256 e188059c7932021a42693879890c6d5169bb0e4fe5b1fb5120b5dfa6caee5d28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page