# maxbrunsfeld/counterfeiter

A tool for generating self-contained, type-safe test doubles in go

Repository: https://github.com/maxbrunsfeld/counterfeiter
Canonical: https://ross.abutalabs.com/products/counterfeiter
Language: Go
License: MIT
License Family: permissive
Last push: 2026-08-17T21:15:08+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 65, longevity 100
- inputs: {"age_days": 4488, "days_push": 16, "days_rel": 153, "gap_med": 63, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1140, forks 101 (observed 2026-08-28T04:03:44.338386+00:00)

## What it is
counterfeiter is a Go code generation tool that creates self-contained, type-safe fake implementations (test doubles) of interfaces. It integrates with go generate to keep generated fakes in sync with interface definitions.

## Use cases
- generate fake implementations of Go interfaces for unit tests
- create type-safe test doubles without writing them by hand
- keep generated mocks up to date with go generate
- mock collaborators when unit testing Go objects
- generate fakes for interfaces in a Go module

## When to choose
- you write Go unit tests and need fakes for interface dependencies
- you want type-safe, compile-time-checked mocks rather than runtime reflection mocks
- you prefer generated code committed to your repo via go generate

## When to avoid
- you need dynamic runtime mocking without code generation
- your project is not using Go modules
- you prefer hand-written or behavior-driven mock libraries

## Facets
- artifact type: cli-tool
- maturity: active
- function: testing, mocking, cli
- domain: testing, developer-tools
- platform: cli, go, cross-platform
- tags: test-doubles, fakes, go-generate, type-safe, unit-testing, code-generation, go

## Member repositories
- maxbrunsfeld/counterfeiter (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:44.338386+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:35:43.472434+00:00, confidence not recorded.
  - readme: https://github.com/maxbrunsfeld/counterfeiter (fetched 2026-08-28T04:03:44.338386+00:00, sha f73c11690762)
- Data as of 2026-08-30T08:39:29.467469+00:00.
