built-in test framework
Target scenarios:
Error handling and exceptions
Boundary conditions
Null/undefined/empty inputs
Concurrent/async edge cases
4. Verify Improvement
Run coverage again and confirm measurable increase. Report:
Before/after coverage percentages
Number of new test cases added
Files with the biggest coverage gains
Error Handling
No test framework detected
Solution:
Check
package.json
,
pyproject.toml
,
Cargo.toml
, or
go.mod
for test dependencies. If none found, ask the user which framework to use and install it.
Coverage tool not installed
Solution:
Install the appropriate coverage tool (
nyc
,
pytest-cov
, etc.) and retry.
Existing tests failing
Solution:
Do not add new tests until existing failures are resolved. Report failing tests to the user first.
Guidelines
Follow existing test patterns and naming conventions
Place test files alongside source or in the project's existing test directory
Group related test cases logically
Use descriptive test names that explain the scenario
Do not mock what you do not own — prefer integration tests for external boundaries