Install
$ agentstack add skill-pvnarp-agent-skills-testing ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Testing Strategy
Know what to test automatically and what to test manually. Don't write flaky tests for inherently non-deterministic or subjective things.
What IS Unit Testable
Pure logic with no external dependencies:
- Business rules: Calculations, validation, state transitions, algorithms
- Data transformations: Parsing, formatting, mapping, serialization
- Edge cases: Boundary values, empty inputs, overflow, null handling
- Configuration: Feature flags, threshold values, constants that affect behavior
What Needs Integration Tests
- Database queries and migrations
- API request/response cycles
- Authentication and authorization flows
- File system operations
- Message queue producers/consumers
What is NOT Automatically Testable (Manual Only)
| Area | Why | How to Test | |------|-----|------------| | Visual appearance | Subjective quality | Eyes on screen | | UX flow | Subjective feel | User testing | | Performance feel | Hardware-dependent | Profiling + real usage | | Third-party integrations | External state | Staging environment |
Testing Rules
- Test logic, not framework. Don't test that the framework works. Test that your logic produces correct results.
- Every important constant gets a test. If someone accidentally changes a threshold, rate, or limit, a test should catch it.
- Boundary tests everywhere. Off-by-one errors are the most common bugs. Test both sides of every boundary.
- Tests run in CI. Every PR must pass tests before merge. No exceptions.
- No flaky tests. If a test sometimes fails, delete it and write a better one. Flaky tests are worse than no tests.
- Keep tests fast. Unit test suite should complete in seconds. No sleeps, no network, no unnecessary I/O.
- No mocking internals. Test the public interface. Mock external dependencies only.
- Test behavior, not implementation. Tests should pass even after refactoring internals.
Test Structure
src/
├── main/ # Production code
└── test/ # Tests mirror the source structure
├── unit/ # Fast, isolated, no external deps
├── integration/ # Requires running services
└── e2e/ # Full system tests
Utility Scripts
scripts/coverage_gaps.sh [dir]- Find source files that have no corresponding test file.
Coverage Targets
| Area | Target | Rationale | |------|--------|-----------| | Core business logic | > 90% | Bugs here directly impact users | | Data transformations | > 90% | Wrong data = wrong behavior | | API handlers | > 70% | Test happy path + key error paths | | UI components | ~30% | Test logic, verify manually | | Configuration/glue | ~0% | Low value, test indirectly |
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: pvnarp
- Source: pvnarp/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.