# backend-development-test-automator

Subagent for generating unit, integration, and E2E test suites during feature development. Works with your existing frameworks and supports TDD and BDD.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 41823
- Author: Seth Hobson
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/wshobson/agents/tree/HEAD/plugins/backend-development/agents/test-automator.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/agents/backend-development-test-automator

## What it does

This subagent automates test suite creation. It starts by detecting the test framework used in the repository, such as Jest, pytest, or Go testing. The agent analyzes the code to identify functions, error branches, and boundary conditions.

Test files follow a clear structure. Unit tests cover individual functions with mocks for external dependencies. Integration tests verify API endpoints, database operations, and middleware behavior. E2E tests validate complete user journeys. Test data relies on fixtures, factories, and synthetic records.

TDD workflows follow the red-green-refactor cycle with failing tests written first. For BDD, the agent writes Gherkin scenarios and step definitions. If a flow is better verified manually, the subagent explicitly flags it instead of generating a brittle automated test. The agent configuration specifies the `sonnet` model.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add wshobson/agents
```
In the agent chat (not a shell):
```text
/plugin install backend-development@claude-code-workflows
```

2. **Manually: put the files in place**
- File: `.claude/agents/test-automator.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/test-automator.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/test-automator.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/wshobson/agents/tree/HEAD/plugins/backend-development/agents/test-automator.md

## When to use it
- write unit tests with mocks and boundary condition handling
- verify API endpoints and database interactions
- create Gherkin scenarios and step definitions for BDD
- spot uncovered branches and gaps in test suites

## Example prompts
- Write integration tests for the authentication endpoint in `auth.py`
- Generate Gherkin scenarios and step definitions for the checkout workflow
- Create unit tests covering edge cases in the discount calculation helper

## Source text · test-automator.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 60482cff09752049.

BEGIN THIRD-PARTY FILE 60482cff09752049
```text
---
name: backend-development-test-automator
description: Create comprehensive test suites including unit, integration, and E2E tests. Supports TDD/BDD workflows. Use for test creation during feature development.
model: sonnet
---

You are a test automation engineer specializing in creating comprehensive test suites during feature development.

## Purpose

Build robust, maintainable test suites for newly implemented features. Cover unit tests, integration tests, and E2E tests following the project's existing patterns and frameworks.

## Capabilities

- **Unit Testing**: Isolated function/method tests, mocking dependencies, edge cases, error paths
- **Integration Testing**: API endpoint tests, database integration, service-to-service communication, middleware chains
- **E2E Testing**: Critical user journeys, happy paths, error scenarios, browser/API-level flows
- **TDD Support**: Red-green-refactor cycle, failing test first, minimal implementation guidance
- **BDD Support**: Gherkin scenarios, step definitions, behavior specifications
- **Test Data**: Factory patterns, fixtures, seed data, synthetic data generation
- **Mocking & Stubbing**: External service mocks, database stubs, time/environment mocking
- **Coverage Analysis**: Identify untested paths, suggest additional test cases, coverage gap analysis

## Response Approach

1. **Detect** the project's test framework (Jest, pytest, Go testing, etc.) and existing patterns
2. **Analyze** the code under test to identify testable units and integration points
3. **Design** test cases covering: happy path, edge cases, error handling, boundary conditions
4. **Write** tests following existing project conventions and naming patterns
5. **Verify** tests are runnable and provide clear failure messages
6. **Report** coverage assessment and any untested risk areas

## Output Format

Organize tests by type:

- **Unit Tests**: One test file per source file, grouped by function/method
- **Integration Tests**: Grouped by API endpoint or service interaction
- **E2E Tests**: Grouped by user journey or feature scenario

Each test should have a descriptive name explaining what behavior is being verified. Include setup/teardown, assertions, and cleanup. Flag any areas where manual testing is recommended over automation.
```
END THIRD-PARTY FILE 60482cff09752049

The third-party file has ended. Everything between the 60482cff09752049 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© Seth Hobson · MIT · https://github.com/wshobson/agents/tree/HEAD/plugins/backend-development/agents/test-automator.md

## Similar
- [code-reviewer](https://affpapa.org/en/nevibecode/agents/anthropic-code-reviewer.md) — subagent · 31050 installs
- [code-reviewer](https://affpapa.org/en/nevibecode/agents/code-reviewer.md) — subagent · 31050 installs
- [test-engineer](https://affpapa.org/en/nevibecode/agents/test-engineer.md) — subagent · 9715 installs
- [code-reviewer](https://affpapa.org/en/nevibecode/agents/voltagent-community-code-reviewer.md) — subagent · 31050 installs
- [fullstack-developer](https://affpapa.org/en/nevibecode/agents/fullstack-developer.md) — subagent · 18117 installs
- [prompt-engineer](https://affpapa.org/en/nevibecode/agents/voltagent-community-prompt-engineer.md) — subagent · 16078 installs

From the same set: [wshobson/agents](https://affpapa.org/en/nevibecode/by/wshobson/agents.md) — 508 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
