unit-test-engineer
/unit-test-engineer
Designs and writes fast, deterministic unit tests that assert behaviour, cover boundaries and negative cases, and fail when the code is wrong. Use when adding or improving unit tests for existing or new code.
- Author
- arijeetganguli ↗
- Repository
- ai-kaarkhana ↗
- Licence
- MIT
- Last repository change
- 02.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 02.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Designs and writes fast, deterministic unit tests that assert behaviour, cover boundaries and negative cases, and fail when the code is wrong. Use when adding or improving unit tests for existing or new code.
Original author description
Designs and writes fast, deterministic unit tests that assert behaviour, cover boundaries and negative cases, and fail when the code is wrong. Use when adding or improving unit tests for existing or new code.
How it works
- Purpose
- When to invoke
- Required input
- Execution instructions
- Expected output
- Validation checklist
- Example usage
- Sample prompts
- Common mistakes
- Related skills
SKILL.md preview
--- name: unit-test-engineer description: "Designs and writes fast, deterministic unit tests that assert behaviour, cover boundaries and negative cases, and fail when the code is wrong. Use when adding or improving unit tests for existing or new code." license: MIT metadata: activity: testing difficulty: beginner frameworks: "JUnit 5, Mockito, pytest, Vitest" version: "1.0" --- # Unit Test Engineer ## Purpose Produce unit tests that catch defects, not tests that merely execute lines. Strong assertions, minimal mocking and clear naming. ## When to invoke - Existing code has little or no unit test coverage. - Tests pass but mutation or review shows weak assertions. - New code needs tests in the style of the project. ## Required input - Code under test and its documented behaviour. - Existing test files for style and fixtures. - Scenario matrix, if available. If a required input is missing, ask for it. Do not guess. ## Execution instructions 1. Read the code and list its observable behaviours: return values, state changes, thrown errors, calls to collaborators. 2. Name each test after the behaviour, for example `rejects_negative_quantity` rather than `test1`. 3. Structure tests as arrange, act, assert. One behaviour per test. 4. Cover boundaries (below, at, above), negative inputs, empty and null inputs, and each branch. 5. Assert on specific values and error types, never only `is not None` or `no exception`. 6. Mock only true boundaries (network, clock, randomness, database). Prefer real collaborators or fakes for pure logic. 7. Use parameterised tests for input tables. Keep test data minimal and meaningful. 8. Run the tests, report results. Check that at least one assertion would fail if the logic were inverted. ## Expected output - Test file(s) in the project style. - Table mapping behaviours and scenarios to tests. - Executed test run output. - Behaviours deliberately not tested, with reasons. ## Validation checklist - [ ] Tests are deterministic: no sleeping, real clock or network. - [ ] Each assertion checks an exact expected value or error. - [ ] Boundary values appear on both sides of each limit. - [ ] Mocks are limited to external boundaries. - [ ] Deliberately breaking the code (invert a condition) makes a test fail. ## Example usage Input: > Function: `discount_for_tier(tier)` returns 0.0, 0.05, 0.10 for BASIC, SILVER, GOLD. Illustrative output (abridged, hand-written for this guide, not captured from a model run): ```text Parameterised test: BASIC -> 0.0, SILVER -> 0.05, GOLD -> 0.10 (exact values). `unknown_tier_is_rejected`: asserts `ValueError` with the tier in the message. `none_tier_is_rejected`. Not tested: formatting of the log line (no behaviour contract). ``` ## Sample prompts ```text Write unit tests for the code below using [framework]. Follow the style of [EXISTING TEST FILE]. Cover each branch, boundary values below/at/above each limit, null/empty inputs and error cases. Assert exact values. Mock only [BOUNDARIES]. Run them and report the output. Code: [CODE] ``` ```text Review these tests for weak assertions and missing boundaries. For each weakness show a mutation of the code that the test would not catch, then propose a stronger assertion: [TESTS] ``` ## Common mistakes - Asserting that a mock was called with the arguments the code already passes (tests the implementation, not behaviour). - Mocking the class under test or pure logic. - Chasing coverage percentage with assertion-free tests. - Sharing mutable fixtures across tests. ## Related skills - [TDD Engineer](../tdd-engineer/SKILL.md) - [Mutation Testing Specialist](../mutation-testing-specialist/SKILL.md) - [Integration Test Engineer](../integration-test-engineer/SKILL.md) ## Related resources Handbook: - [Chapter 5: Test Driven Development](../../../handbook/05_test_driven_development/README.md) Prompts: - [Unit Test Generation](../../../prompts/testing/unit-test-generation.md) - [Boundary Testing](../../../prompts/testing/boundary-testing.md) - [Negative Testing](../../../prompts/testing/negative-testing.md) - [Test Data Builder Design](../../../prompts/testing/test-data-builder-design.md) Workflows: - [Write unit and integration tests](../../../workflows/07_unit_and_integration_testing.md) - [Build a new feature](../../../workflows/01_feature_development.md) Examples: - [examples/python/README.md](../../../examples/python/README.md) scenario S7 (weak assertions)
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · arijeetganguli/ai-kaarkhana | 100 | MIT |
| arijeetganguli/ai-kaarkhana | 100 | MIT |
Database snapshot: 13.11.2026 · package version e9180a2e987c (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90unit-testing
Writes unit tests for code that already exists — choosing what deserves a test, what the cases are, and how to assert without welding the test to the implementation. Use this whenever the user asks for tests, unit tests, more coverage, or tests for a specific function or module,… - 86unit-test
Writes isolated unit tests for a named file using Arrange-Act-Assert. Use when user requests unit tests, test coverage, or missing test cases for a file. - 100writing-unit-tests
Writes and reviews focused, deterministic unit tests that verify behavior through public interfaces instead of implementation details. Use whenever tests are added to code that already exists, and when the request mentions unit tests, test coverage, edge cases, mocks or test… - 100test-strategy
Decides what to test and at which level, then writes fast, deterministic tests that check behavior rather than implementation details. Use when planning how a feature or system should be tested, choosing between unit, integration, contract and end-to-end tests, deciding what to… - 95write-tests
Write high-quality unit tests (Vitest) and E2E tests (Playwright) following senior test-engineering practices. Use this skill whenever asked to write tests, add test coverage, create test cases, fix failing tests, add missing assertions, test a new feature, write specs, or cover… - 100unit-test-writer
Write focused unit tests for a function, class or module: one behaviour per test, Arrange-Act-Assert, descriptive names, boundary and error cases, no I/O, fast and deterministic; in the project's existing framework (pytest, JUnit 5, xUnit/NUnit, Jest/Vitest, PHPUnit, Go…