Testing & Evaluation¶
Testing strategy and evaluation framework for Echo Agent.
Test Framework¶
- Backend: pytest + pytest-asyncio + pytest-cov
- Frontend: Vitest + @testing-library/react
Running Tests¶
# All backend tests
python -m pytest tests/ -v --cov
# Specific module
python -m pytest tests/test_memory*.py -v
# Frontend
cd web && pnpm test --run
Coverage Requirement¶
fail_under = 75 in pyproject.toml. CI fails if coverage drops below threshold.
Evaluation Framework¶
Built-in behavioral evaluation:
Dataset Format (YAML)¶
- id: test_web_search
input: "Search today's news"
expected_tools: [web]
expected_contains: ["news"]
forbidden_tools: [shell]
max_iterations: 5
Metrics¶
contains_all— Output contains expected contenttool_usage_correctness— Correct tools usediteration_efficiency— Iterations within boundsresponse_quality— Response quality scoreforbidden_tools_check— Forbidden tools not invokedsemantic_quality— Semantic quality assessment