Unit Test Generation

IntermediatestingContexto mínimo: 32K

Generates comprehensive unit tests for existing code, covering happy paths, edge cases, error conditions, and boundary values. Follows testing best practices including the test pyramid, DAMP over DRY, and the Arrange-Act-Assert pattern. Adapts to the project's existing test framework and conventions.

Casos de uso

  • Generating tests for untested legacy code
  • Achieving coverage targets for CI gates
  • TDD red-green-refactor workflow
  • Regression test creation after bug fixes
  • Testing edge cases and error paths

Prompt de ejemplo

Generate comprehensive unit tests for the following function.
Include tests for:
- Happy path with typical inputs
- Edge cases (empty inputs, null values, boundary values)
- Error conditions and exception handling
- Type coercion or unexpected input types

Use the project's existing test framework. Follow Arrange-Act-Assert pattern.
Each test should have a descriptive name explaining what it verifies.

Function to test:
```
[paste function here]
```

Modelos recomendados

Herramientas compatibles

claude-codecursorgithub-copilotkiroany

Modalidades

Entrada: code, text
Salida: code, text

Skills relacionadas

Autor

OpenModels Community

@openmodelsrun