Automatically generates table-driven Go test boilerplate from source code, with optional AI-powered test case generation.
gotests is a command-line tool that automatically generates table-driven test scaffolding for Go code. It analyzes function and method signatures to create comprehensive test structures, saving developers time by automating repetitive boilerplate and ensuring consistency across test suites.
Go developers and teams who want to improve test coverage and maintainability by automating the creation of table-driven test scaffolding, particularly those working on projects with many functions or complex logic.
Developers choose gotests for its zero-configuration setup, full support for Go generics, and the unique AI-powered test generation feature that uses local LLMs via Ollama to create intelligent test cases with realistic values and edge cases.
Automatically generate Go test boilerplate from your source code.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works out of the box with any Go project without needing setup files, as stated in the README's key features for quick adoption.
Handles Go 1.18+ type parameters seamlessly, generating appropriate test code for generic functions with intelligent type constraint mapping, as detailed in the Go Generics Support section.
Uses local LLMs via Ollama to create intelligent test cases with realistic values and edge cases, automating meaningful test logic beyond basic scaffolding, as demonstrated in the AI examples.
Allows precise test generation for specific functions, exported functions, or entire packages using regex patterns and flags like -only and -excl, shown in the usage examples.
Requires installing and managing Ollama with models for AI features, adding setup steps and dependency on external tools beyond basic Go tooling.
Function bodies, including sensitive code and comments, are sent to the LLM for analysis, posing risks for proprietary projects, as warned in the privacy considerations section.
Only generates table-driven test structures, which may not suit projects preferring alternative testing styles like BDD or mock-heavy frameworks.