What is TestGen?
TestGen is a Go command-line engine, packaged as an agent skill, command files for several agents and an MCP server, that has a coding agent draft unit tests matching the repository's existing runner and conventions. It scans source files, detects the test framework, reads nearby tests for style, estimates cost, and produces the generated tests as a reviewable patch before anything is written; `--validate` then runs them through the project's own toolchain. It lists JavaScript and TypeScript, Python, Go, Rust, Java, C#, PHP, Ruby, C++ and Kotlin.
The code was written by Prince Pal from December 2025 and now sits under the opentoolsorg organisation, created in October 2026. The repository has 93 commits and no published releases.
Is TestGen worth it?
TestGen's design is sound. Instead of asking an agent for tests in one loose prompt, it puts an engine in between: `doctor` checks the repo and provider keys, `cost` estimates spend before any API call, `generate` produces a dry-run patch the agent must inspect, and only an explicit write flag lets files change, after which `--validate` runs the project's own test runner. It reads nearby test files to copy the existing framework, fixtures and naming. The MCP server keeps the same rule: `testgen_generate` stays in dry-run unless the caller sets `write_files: true`.
The breadth runs ahead of the depth. Ten languages are listed, but source scanning is regular expressions throughout; Kotlin, C++ and PHP are each an 18-line set of patterns. That finds most top-level functions and misses what regexes always miss, such as nested or multi-line signatures. The project's own quality file sets the CI coverage floor at 15%, a low bar for a tool whose job is tests.
Note where your code goes. TestGen does not use your agent's subscription; it calls Anthropic, OpenAI, Gemini or Groq directly with an API key from your environment, so the source files under test go to that provider and are billed to that key.
The catch: as of 22 November 2026, the README's curl installers, its agent-skill script and its `npx skills add` command all point to princepal9120/testgen, which returns 404, and the installer in the new repository still fetches releases from there. `go install` resolves through the Go module cache to v0.1.12 from 30 April, months behind the current code. Building from a clone is the only way to the latest version. The repository has 2 stars, and its last commit was on 30 October.
Our take: the dry-run, patch-then-validate pattern is the right one, and worth copying into your own agent instructions. As a dependency, TestGen is not ready until the install path matches the repository it lives in.
Where it earns its place
A backend developer inheriting an untested Python service
Get a first pass of unit tests that match the pytest style already in the repo
Have the agent run `testgen cost` on ./src, then `testgen generate --dry-run --emit-patch` folder by folder; review each patch, then rerun with `--validate` so pytest runs the new tests. The cost is provider tokens on your own key.
A platform team at a 30-person company whose engineers use different agents
Keep test generation consistent whether people use Claude Code, Codex or Cursor
Repo-local wrappers in .claude/commands, .codex/skills, .cursor/rules and others all call the same engine, so dry-run defaults and style detection do not depend on which agent someone prefers.
Before you commit
- Setup
- The README's curl installers and `npx skills add` point to princepal9120/testgen, which returns 404; `go install github.com/princepal9120/testgen-cli@latest` resolves to v0.1.12 of 30 April 2026 via the Go module proxy. Current code means cloning opentoolsorg/testgen and building with Go 1.24.
- Integrations
- Wrappers for Codex, Claude Code, OpenCode, Cursor, Cline, Continue, Roo Code and Gemini CLI; a stdio MCP server with three tools (`testgen_generate`, `testgen_analyze`, `testgen_validate`); providers Anthropic, OpenAI, Gemini and Groq.
- Data and privacy
- Runs locally but sends the source under test to the chosen model provider on your API key; nothing is written to the repo unless writes are explicitly enabled. Apache-2.0 licence.
- Limits
- Regex parsing misses nested and multi-line signatures; no releases in this repository; 2 stars and a last commit on 30 October 2026; CI coverage floor of 15%.
What’s good
- Dry-run patches by default; files change only on an explicit flag
- Cost estimate before any API call
- Copies the framework, fixtures and naming of nearby tests
- Same workflow through the skill, command wrappers and MCP server
What’s not
- README install scripts point to a repository that returns 404
- go install fetches a cached v0.1.12 from April 2026
- Regex-based parsing for all ten languages
- Sends source to a model provider on a separate API key
Best for
Developers willing to build a Go tool from source who want a dry-run-first test generator their agent can call, and who accept an early, thinly maintained project.
TestGen alternatives
TestGen: common questions
- Is TestGen worth it?
- A sensible review-first workflow for agent-written tests, undermined by install instructions that point to a repository that no longer exists and by regex parsing where the pitch implies more. We rate it 2.8 out of 5.
- How much does TestGen cost?
- Free and open source (Apache-2.0). Generation calls Anthropic, OpenAI, Gemini or Groq on your own API key, billed by that provider.
- What are the downsides of TestGen?
- README install scripts point to a repository that returns 404; go install fetches a cached v0.1.12 from April 2026; regex-based parsing for all ten languages; sends source to a model provider on a separate API key.
- Who is TestGen best for?
- Developers willing to build a Go tool from source who want a dry-run-first test generator their agent can call, and who accept an early, thinly maintained project.
- Is TestGen safe for company data?
- Runs locally but sends the source under test to the chosen model provider on your API key; nothing is written to the repo unless writes are explicitly enabled. Apache-2.0 licence.
- What are the best TestGen alternatives?
- The closest alternatives we have reviewed are Playwright Test Agents.
Answers checked Nov 22, 2026.