Agent test generation
Skill Amey-Thakur/AI-SKILLS/skills/ai-coding-tools/agent-test-generation
Use an agent to write tests that check behaviour rather than restate the implementation, and verify they can actually fail. Use when adding coverage to existing code.From its SKILL.md
npx -y skills add Amey-Thakur/AI-SKILLS --skill agent-test-generationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.8 KB, as published. Nobody here has run it
Agent test generation
Agents produce tests quickly and default to tests that mirror the implementation, which pass regardless of whether the code is correct. The work is directing them toward behaviour and verifying the tests are capable of failing.
Method
- Ask for behaviour tests, not coverage. Given this input, expect this output, rather than exercising every branch for its own sake (see unit-test-design).
- Specify the cases you care about. Edge cases, boundaries, and error paths, since agents over-produce happy-path tests.
- Verify each test can fail. Break the implementation deliberately and confirm the test catches it, which is the only proof it tests anything (see mutation-testing).
- Reject tests that assert the implementation. Tests reproducing internal calls break on every refactor and prove nothing (see test-doubles).
- Keep tests readable. Clear names and obvious arrangement, because a generated test nobody understands is deleted at the first failure.
- Do not let it change code to make tests pass. That inverts the relationship, and any implementation change must be a deliberate separate decision.
- Review generated assertions carefully. An agent can assert current behaviour that is itself the bug, freezing it in place.
Boundaries
Generated tests encode current behaviour, which is only correct if current behaviour is. Coverage is a weak proxy for quality (see coverage-strategy). Tests for complex integration and concurrency need human design (see concurrency-testing).