AI-powered developer tooling

Unit tests,
generated where
your code lives

testgen is a local-first AI test generation tool. It reads your React components through static analysis and produces ready-to-run React Testing Library suites - entirely on-premises, with zero source code leaving your environment.

100% local inference VS Code + CLI RTL + Jest Zero data egress
1
Parse

ts-morph extracts props, hooks, and JSX structure into a component profile.

2
Generate

A LoRA-tuned local model writes an RTL suite from the profile via Ollama.

3
AccountsSummary.test.tsx

renders balance for the user

expect(screen.getByText(...))
Suite passes - reviewed by developer
100%Local inference, zero egress
4Step pipeline to test suite
75%+Coverage uplift target
Phase 3Pilot validation, in progress
Overview

Built for teams that can't send code outside

Fully local, zero egress. The AST and the TypeScript compiler drive generation — no source code, no user data, no proprietary logic ever leaves your environment. A local model via Ollama is optional and only engages when the compiler cannot resolve a failure.

Code-aware analysis

Parses each component with ts-morph to understand props, hooks, context usage, and rendered output.

Optional local model

An Ollama-hosted model runs on local hardware and is only invoked when the deterministic pass cannot resolve a failure — never by default.

Zero data egress

Every stage - parsing, prompting, generation - executes on-premises, built for strict compliance environments.

How it works

From component to test suite in four steps

Static analysis does the heavy lifting up front, so the model's job is focused: write meaningful assertions for behavior already mapped by the analyzer.

1

Parse

The target file is loaded into a ts-morph project. Props, exports, hooks, and JSX structure are extracted into a structured component profile.

2

Contextualize

The profile is enriched with repo conventions - test file placement, naming patterns, and the providers a component renders under.

3

Generate

The fine-tuned model produces a React Testing Library suite from the profile, covering render paths, interactions, and edge states.

4

Deliver

The suite is written alongside the component, ready for the developer to run, review, and commit - developer always stays in the loop.

1 - Input

CLI / VS Code

Developer targets a component file or folder - single file or batch.

2 - Parse

ts-morph AST

Props, hooks, context, and JSX extracted into a component profile.

3 - Generate

Ollama - LoRA model

Fine-tuned DeepSeek-Coder writes assertions from the profile - 100% local.

4 - Output

Test suite written

Delivered next to the component - developer reviews, runs, commits.

Dual-provider architecture - Ollama runs local by default; the provider layer is pluggable, so a future remote model can slot in without touching the CLI or the analysis stage.
Features

What you get

CLI-first generation

Run testgen against any component file or folder. Batch mode generates suites across an entire feature set in one command.

Dual-provider architecture

A configurable provider layer supports local Ollama inference by default, with a pluggable design for evolving model strategy.

Coverage uplift

Targets lifting unit test coverage toward the 75%+ range, without writing boilerplate by hand.

Reusable skill packaging

Repo-specific conventions are captured in a portable testgen.skill package, benefiting every team that adopts the tool.

Coverage uplift
42%baseline75%+target

Typical pilot repo before adoption vs. the target range testgen is built to close, without hand-written boilerplate.

Manual vs. testgen
Manual
~45 min
testgen
~5 min

Per-component effort to reach a reviewed, passing test suite - writing assertions by hand vs. generating and reviewing.

Usage

Quick start

CLI
# Single component
$ testgen generate src/components/Button.tsx

# Batch - entire feature folder
$ testgen generate src/features --recursive

# Output written next to each component
✓ Button.test.tsx    generated
✓ Modal.test.tsx     generated
✓ Form.test.tsx      generated

The CLI writes test files next to their components, following each repository's existing naming and folder conventions.

LayerTechnologyRuns where
Static analysists-morph (TypeScript AST)Local
Generation modelDeepSeek-Coder-1.3B - LoRA via OllamaLocal
Test frameworkJest + React Testing LibraryLocal
InterfaceCLILocal
Roadmap

Development phases

testgen follows a phased delivery model - each phase validated on real repositories before the next begins. We are currently in Phase 3.

Phase 1 - done

Foundation & AST engine

Built the core static analysis pipeline using ts-morph to extract component structure into a reliable intermediate profile. CLI interface established.

Phase 2 - done

LoRA fine-tune & local inference

Fine-tuned DeepSeek-Coder-1.3B via LoRA on curated codebase examples. Integrated Ollama for on-premises inference. Dual-provider architecture built for flexibility.

Phase 3 - now

Pilot validation across repositories

testgen has produced passing test suites across a growing set of pilot repositories. Each run tightens provider detection, environment setup, and convention alignment.

Phase 4 - planned

Layered orchestrator

A decision-tree orchestration layer that routes each component through the optimal analysis depth and prompting approach, automatically.

Phase 5 - planned

CI/CD integration & coverage dashboards

Pipeline hooks that detect coverage gaps and propose candidate tests during pull requests, plus per-repo dashboards tracking uplift over time.