Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Summary
Enhance /qa to evaluate test meaningfulness, not just existence or coverage. Catch tests that pass but don't actually validate behavior.
Problem
Common test quality issues that slip through:
-
Testing implementation, not behavior
// Bad: breaks if refactored, even if behavior unchanged expect(component.state.isLoading).toBe(true) // Good: tests observable behavior expect(screen.getByRole('progressbar')).toBeInTheDocument()
-
Happy path only
- No null/undefined handling
- No error path testing
- No boundary conditions
-
Over-mocking
// Mocking so much that you're testing mocks, not code jest.mock('./database') jest.mock('./auth') jest.mock('./api') jest.mock('./utils') // What's left to test?
-
Snapshot abuse
- Giant snapshots that nobody reviews
- Snapshots of implementation details
-
Flaky tests
- Timing-dependent assertions
- Order-dependent tests
- Tests that pass in isolation but fail in suite
Proposed Solution
Add test quality evaluation to /qa checklist:
## Test Quality Review
### Behavior vs Implementation
- [ ] Tests assert on observable outputs, not internal state
- [ ] Tests would break if behavior breaks (not just if code changes)
- [ ] Refactoring internals shouldn't require test changes
### Coverage Depth
- [ ] Error paths tested (what happens when things fail?)
- [ ] Boundary conditions tested (empty, null, max values)
- [ ] Edge cases for the specific domain
### Mock Hygiene
- [ ] Mocks are minimal (only external dependencies)
- [ ] Integration points have at least one integration test
- [ ] Not mocking the thing being tested
### Test Reliability
- [ ] No timing-dependent assertions (use waitFor, not setTimeout)
- [ ] Tests are deterministic (same result every run)
- [ ] Tests are independent (no shared mutable state)Acceptance Criteria
- /qa skill includes test quality checklist
- Checklist adapted per test type (unit, integration, e2e)
- Common anti-patterns flagged with suggested fixes
- Test quality section in QA output
Examples
Good QA Feedback
### Test Quality: ⚠️ Needs Attention
**Over-mocking detected in `auth.test.ts`:**
- 4 of 5 modules mocked, leaving little to actually test
- Consider: Test with real implementations, mock only external APIs
**Missing error paths in `checkout.test.ts`:**
- No tests for payment failure scenario
- No tests for network timeout
- Add: `it('handles payment decline gracefully')`
**Implementation testing in `UserCard.test.tsx`:**
- Line 45: Testing internal state `isExpanded`
- Refactor: Test the rendered output insteadMetadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
admarble commentedon Jan 21, 2026
Consolidated into #147 (Comprehensive QA improvements)
feat(#147): add comprehensive QA improvements
feat(#147): add comprehensive QA improvements (#148)