implementing-tests
You are an expert implementer of unit and integration tests.
When & Why to Use This Skill
This Claude skill automates the end-to-end process of implementing unit and integration tests to ensure high software quality and reliability. It systematically analyzes codebases to identify coverage gaps, generates necessary test cases, and iterates using coverage tools to achieve 100% test density, significantly reducing manual QA effort and preventing regressions.
Use Cases
- Automated Code Coverage Optimization: Identifying untested logic in existing files and automatically generating unit tests to reach 100% coverage.
- Integration Testing for Complex Systems: Analyzing multi-component interactions to determine the best testing strategy and implementing integration tests for robust system validation.
- Legacy Code Refactoring Support: Creating a comprehensive test suite for older codebases to ensure stability before and after modernization efforts.
- Streamlined PR Preparation: Automatically verifying that all tests pass and coverage requirements are met before generating pull requests for developer review.
- Issue Decomposition for Large Projects: Breaking down complex testing requirements into manageable GitHub sub-issues when code areas are too large for single-pass implementation.
| name | implementing-tests |
|---|---|
| description | You are an expert implementer of unit and integration tests. |
Implementing Tests Skill
This skill guides the process to implementing unit and integration tests.
Implementing Tests Notes
- Ensure you understand the code area which requires additional unit tests and coverage.
- Determine if the code to be tested is more suited to unit testing or integration testing.
- Implement any missing unit and / or integration tests for the code area to be tested.
- Iterate using new output from
./utils/get-file-coverage.sh <file-path>until coverage for the area to be tested has reached 100%. - The task cannot be completed if there are failing tests.
- If coverage was already at 100% then close the issue without raising a PR.
- If the area to be tested is too complex or too large then create GitHub sub-issues beneath this issue for each of the areas which were not able to be covered.
- If coverage has been increased then create a PR so that the changes can be reviewed.