AI-Powered Test Gap Finder
Scans your codebase with tree-sitter, identifies untested functions, and uses Claude to suggest what tests to write.
$ cat features.md
Static analysis, AI insights, CI-ready output
Tree-sitter Parsing
Extracts every function from your codebase using tree-sitter grammars. No runtime needed — works on raw source files.
Severity Classification
Critical: public + complex + untested. Warning: public + untested. Info: private + untested. Prioritize what matters.
AI Risk Assessment
Optionally send gaps to Claude AI for risk analysis and test suggestions. Use --ai-severity to control API costs.
Parallel Parsing
Uses rayon for multi-core file parsing. Respects .gitignore rules automatically. Fast even on large codebases.
CI Integration
JSON output, SARIF format, --fail-on-critical exit codes. Drop into any CI pipeline as a quality gate.
5 Languages
Rust, TypeScript, JavaScript, Python, Go. Detects test functions by language-specific patterns and conventions.
$ testgap --explain-severity
pub fn process_payment(order: &Order) → Result<Receipt>High complexity public APIs are most likely to contain bugs and most impactful when they fail.
pub fn parse_config(path: &str) → ConfigPublic functions are part of your API contract. Regressions here break consumers.
fn normalize_key(key: &str) → StringPrivate helpers are lower risk — they're only called by tested public functions.
$ testgap --explain-pipeline
Scan
Walk the project and classify source vs test files
Extract
Parse functions from source files using tree-sitter
Map
Match tests to functions by name, file convention, and body
Detect
Identify untested functions and classify severity
Analyze
Optional: send gaps to Claude AI for risk assessment
$ testgap --list-languages
| Language | Extensions | Test Detection |
|---|---|---|
| Rust | .rs | #[test], #[cfg(test)] |
| TypeScript | .ts, .tsx | test(), it(), describe() |
| JavaScript | .js, .jsx | test(), it(), describe() |
| Python | .py | test_ prefix, test dirs |
| Go | .go | Test prefix, *testing.T |
$ cat quickstart.sh
# Install
cargo install testgap
# Run analysis (no AI, no API key needed)
testgap analyze --no-ai
# Run with AI suggestions (needs ANTHROPIC_API_KEY)
export ANTHROPIC_API_KEY="sk-ant-..."
testgap analyze
# Create a config file
testgap init
# CI mode — fail on critical gaps
testgap analyze --format json --fail-on-critical --no-ai