Unit Test Generation

OrtatestingEn az 32K bağlam

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.

Kullanım alanları

  • 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

Örnek prompt

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]
```

Önerilen modeller

Uyumlu araçlar

claude-codecursorgithub-copilotkiroany

Modaliteler

Giriş: code, text
Çıkış: code, text

İlgili Skills

Yazar

OpenModels Community

@openmodelsrun