Skip to main content

Documentation Index

Fetch the complete documentation index at: https://gump.build/docs/llms.txt

Use this file to discover all available pages before exploring further.

Test Backfill

Add tests to existing untested code.
Community pattern — copy this YAML and adapt the gates to your project. Not available as a built-in via gump run.

When to use

When you have working code with poor test coverage. The inverse of TDD — the code exists, the tests are missing.

The workflow

name: test-backfill
max_budget: 5.00

steps:
  - name: analyze
    type: split
    get:
      context:
        - bash: "go test ./... -cover 2>&1 | grep -E 'ok|FAIL|coverage'"
      prompt: |
        Identify packages with coverage below 60%.
        For each, produce a task with the package name and key functions to test.
    run:
      agent: claude-sonnet
    gate: [schema]
    each:
      - name: write-tests
        type: code
        get:
          prompt: |
            Write comprehensive tests for: {task.description}
            Only create test files. Do not modify implementation code.
        run:
          agent: claude-haiku
          guard:
            max_turns: 40
        gate:
          - compile
          - test
          - "touched: *_test.*"
          - "untouched: *.go"
        retry:
          - attempt: 2
            agent: claude-sonnet
          - exit: 3

  - name: quality
    gate: [compile, test]

How it works

The untouched: "*.go" gate (combined with touched: "*_test.*") ensures only test files are created — implementation code stays untouched. The analyze step injects live coverage data as context.

Customize

Modify the bash: context to filter specific paths.
Add coverage: 80 to the quality gate.