How It Works
The adversarial testing system runs a separate model alongside the primary coding agent:- Task-based generation - Tests are generated from the task description alone, without seeing the implementation
- Parallel execution - The tester runs at the same time as the coder, not after
- Adversarial focus - Tests target edge cases, null inputs, boundary conditions, and unexpected usage
- Real API testing - No mocking - tests use actual API credentials from the environment
Test Generation Strategy
The test generator receives this system prompt:You are an adversarial test engineer. Given a coding task description, generate a test script that verifies the implementation is correct and tries to break it. Focus on edge cases, null inputs, boundary conditions, and unexpected usage. Your goal is to find bugs.
- Language detection - Automatically detects Python vs JavaScript from code patterns
- Auto-installation - Installs missing test dependencies (pytest, etc.) on first failure
- Real credentials - Uses environment variables for actual API testing
Language Support
The system detects the language from the generated test code:Source: ftl/planner.py:63-68
- Python - Uses
pytestwith-vflag - JavaScript - Runs with
nodedirectly
Manual Verification
You can manually trigger verification on code changes:Source: ftl/planner.py:97-112
Missing Dependencies
The test runner automatically handles missing modules:Source: ftl/planner.py:80-84
ModuleNotFoundError messages and installs them automatically.
Configuration
Adversarial testing is activated by passing a model name to the planner:- A LiteLLM model name (e.g.,
claude-3-5-sonnet-20241022) - An FTL agent name for more advanced testing
Benefits
Catch Bugs Early
Find issues before the agent even finishes coding
No Mocking
Tests use real APIs with actual credentials
Edge Case Focus
Adversarial mindset finds boundary conditions
Auto-Install
Missing test dependencies installed automatically