test-writer
Generates comprehensive, best-practice unit tests for functions and classes, supporting multiple frameworks like pytest, unittest, and jest.
Introduction
The test-writer is a specialized engineering skill designed to accelerate the creation of robust unit tests for software projects. It analyzes source code—specifically function signatures, classes, and logic flows—to generate structured, readable test files. It is intended for software engineers and developers who seek to maintain high code coverage and reliability without the overhead of manual test boilerplate generation. Whether you are working with Python or JavaScript, the agent applies the AAA (Arrange-Act-Assert) pattern to ensure that every test is isolated, readable, and maintainable.
-
Automatically identifies critical test scenarios including happy paths, boundary values, empty collections, null inputs, and complex edge cases.
-
Supports multi-framework generation including pytest and unittest for Python, and jest or mocha for JavaScript environments.
-
Implements advanced testing strategies such as mocking dependencies, using fixtures for state setup, and creating parametrized tests for data-driven validation.
-
Follows strict architectural principles to ensure tests remain independent and follow consistent naming conventions for better debugging.
-
Provides documentation and module docstrings, including setup instructions to help teams maintain a test-first or test-driven development (TDD) workflow.
-
Users should provide the function or class definition as input to the agent to receive a tailored test file structure.
-
The agent is capable of handling complex scenarios including asynchronous code (async/await), database interactions, and API calls via specialized mocking strategies.
-
Ideal for use after completing a module to ensure regression testing is established immediately.
-
Respects existing project patterns by adhering to established file naming conventions and directory structures (e.g., tests/ folders).
-
Constraints include a requirement for clear, descriptive function logic to allow the agent to accurately infer required test cases and mock injection points.
Repository Stats
- Stars
- 2
- Forks
- 0
- Open Issues
- 0
- Language
- Not provided
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 04:22 PM