# cweill/gotests

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/cweill-gotests).**

5,315 stars · 352 forks · Go · Apache-2.0

## Links

- GitHub: https://github.com/cweill/gotests
- awesome-repositories: https://awesome-repositories.com/repository/cweill-gotests.md

## Topics

`code-generator` `commandline` `go` `go-test` `go-testing` `golang` `golang-application` `golang-testing` `golang-tools` `gotests` `table-driven-test` `table-driven-testing` `test-driven-development` `test-generation` `testing` `testing-golang` `testing-tools`

## Description

gotests is a static analysis tool and boilerplate generator for Go that automatically creates structured test suites from source code. It functions as a table-driven test framework that handles type resolution for functions and methods, including the mapping of generic type constraints to concrete implementation types.

The tool integrates with large language models to synthesize realistic input values and edge cases based on function logic. It uses a template-driven generation system, allowing the structure and format of the resulting test code to be customized through external templates and parameters.

The project provides command-line utilities for recursive package scanning and directory tree processing. It includes scope control mechanisms to filter function selection using regular expressions and visibility modifiers.

## Tags

### Development Tools & Productivity

- [Test Scaffolding Generators](https://awesome-repositories.com/f/development-tools-productivity/code-generators/boilerplate-generators/test-scaffolding-generators.md) — Automatically creates the initial structure and repetitive code for Go test suites to save development time.
- [Code Generation Templates](https://awesome-repositories.com/f/development-tools-productivity/code-generation-templates.md) — Renders output files by injecting extracted source metadata into customizable text templates for consistent formatting.
- [Template-Based Code Customizers](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/code-generation/workflow-to-code-generators/template-based-code-customizers.md) — Renders test code using user-provided templates to integrate specific assertion libraries and coding styles. ([source](https://github.com/cweill/gotests/blob/develop/README.md))
- [Package Source Scanning](https://awesome-repositories.com/f/development-tools-productivity/package-managers/dependency/sbom-generators/filesystem-scanning/package-source-scanning.md) — Scans directory trees to automatically generate tests for all matching source files across multiple subpackages. ([source](https://github.com/cweill/gotests/blob/develop/README.md))

### Data & Databases

- [Template-Based Code Customizers](https://awesome-repositories.com/f/data-databases/custom-data-types/custom-data-type-providers/code-generators/template-based-code-customizers.md) — Provides mechanisms to modify the structure and format of generated test code using custom templates. ([source](https://github.com/cweill/gotests#readme))

### Programming Languages & Runtimes

- [AST Structural Extraction](https://awesome-repositories.com/f/programming-languages-runtimes/function-signature-analysis/ast-structural-extraction.md) — Analyzes source code structures to extract function signatures and type constraints for generating test boilerplate.
- [Generic Type Constraints](https://awesome-repositories.com/f/programming-languages-runtimes/generic-types/generic-type-constraints.md) — Resolves Go generic type constraints into concrete implementation types for table-driven tests.
- [Test Boilerplate Generators](https://awesome-repositories.com/f/programming-languages-runtimes/go-code-generators/test-boilerplate-generators.md) — Automatically creates structured table-driven test files and function stubs from Go source code.
- [Static Analysis Tools](https://awesome-repositories.com/f/programming-languages-runtimes/language-ecosystems-tooling/programming-environments-tooling/go-environments/static-analysis-tools.md) — Scans Go packages recursively to identify functions and generate corresponding test suites using static analysis.

### Software Engineering & Architecture

- [AI-Synthesized Edge Cases](https://awesome-repositories.com/f/software-engineering-architecture/edge-case-analysis/algorithmic-edge-cases/ai-synthesized-edge-cases.md) — Generates realistic input values and edge cases by passing function logic to a large language model.

### Testing & Quality Assurance

- [Go Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/go-testing-frameworks.md) — Provides a framework for rendering customizable Go test templates with automatic type handling for generics.
- [AI-Driven Case Generation](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/test-execution-orchestration/test-case-generators/ai-driven-case-generation.md) — Uses large language models to automatically produce realistic input values and edge cases for Go functions.
- [AI-Driven Test Generation](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/unit-testing/ai-driven-test-generation.md) — Uses local large language models to produce realistic input values and error conditions based on function logic. ([source](https://github.com/cweill/gotests/blob/develop/gotests.go))
- [Table-Driven Tests](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/unit-testing/table-driven-tests.md) — Builds structured test tables with automatic type handling for functions and methods.
- [Boilerplate Generators](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/unit-testing/table-driven-tests/boilerplate-generators.md) — Provides automatic generation of structured table-driven test files and function stubs from source code. ([source](https://github.com/cweill/gotests/blob/develop/README.md))
- [Generic](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/unit-testing/table-driven-tests/generic.md) — Creates table-driven boilerplate for generic functions by mapping type constraints to concrete implementation types. ([source](https://github.com/cweill/gotests/blob/develop/CHANGELOG.md))
- [Package-Wide Test Generation](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/test-execution-orchestration/test-case-generators/automated-test-code-generation/package-wide-test-generation.md) — Scans entire directory trees to automatically generate test files for all functions across multiple subpackages.

### Part of an Awesome List

- [Code Generation Tools](https://awesome-repositories.com/f/awesome-lists/devtools/code-generation-tools.md) — Generates table-driven unit tests from source code.
- [Testing Frameworks](https://awesome-repositories.com/f/awesome-lists/devtools/testing-frameworks.md) — Generates test files from source.
