home/glossary/Test Generation
Agentic Coding Tools

Test Generation

definition

Agents can generate unit tests, integration tests, and test fixtures by analyzing your code's behavior, edge cases, and type signatures, dramatically increasing test coverage especially for legacy codebases that lack tests. However, generated tests require careful review because agents may encode current behavior rather than intended behavior, potentially locking in bugs as passing tests — a subtle but dangerous form of false confidence.

Agents can generate unit tests, integration tests, and test fixtures by analyzing your code's behavior, edge cases, and type signatures, dramatically increasing test coverage especially for legacy codebases that lack tests. However, generated tests require careful review because agents may encode current behavior rather than intended behavior, potentially locking in bugs as passing tests — a subtle but dangerous form of false confidence. The most effective pattern is test-driven agentic development (TDAD), where humans write the test specifications that define correctness and agents write the implementation to satisfy them, ensuring tests reflect intent rather than implementation artifacts. This concept connects to refactoring agents which need tests for verification, eval-driven development for measuring test quality, and regression testing for ensuring ongoing correctness.