- Version: 2.0
Executes comprehensive automated QA test suite including unit, integration, browser, and performance tests before final validation.
/plugin marketplace add ninthspace/claude-code-marketplace/plugin install sdd@ninthspace-marketplacePurpose: Execute comprehensive automated QA test suite including unit, integration, browser, and performance tests before final validation.
Syntax: /sdd:story-qa [story_id]
| Parameter | Type | Required | Default | Description | Validation |
|---|---|---|---|---|---|
| story_id | string | No | current branch | Story ID (STORY-YYYY-NNN) | Must match format STORY-YYYY-NNN |
/docs/project-context/ directory/docs/stories/review/[story-id].md/docs/project-context/ directory exists/sdd:project-init first/docs/project-context/technical-stack.md - Testing tools and frameworks/docs/project-context/coding-standards.md - QA standards and thresholds/docs/project-context/development-process.md - QA stage requirementsIF story_id NOT provided:
feature/STORY-2025-001-auth → ID STORY-2025-001VALIDATE story exists:
/docs/stories/review/[story-id].md exists/docs/stories/qa//sdd:story-review [story-id]READ story file for:
ENSURE /docs/stories/qa/ directory exists
.gitkeep file if directory was createdMOVE story file:
/docs/stories/review/[story-id].md/docs/stories/qa/[story-id].mdUPDATE story metadata:
IDENTIFY unit test framework from technical-stack.md:
RUN unit tests with coverage:
# Example for Laravel Pest:
vendor/bin/pest --filter=Unit --coverage --min=80
# Example for Node.js Jest:
npm test -- --coverage --testPathPattern=unit
# Example for Python pytest:
pytest tests/unit/ --cov --cov-report=term-missing
CAPTURE results:
IDENTIFY integration test patterns from technical-stack.md:
RUN integration tests:
# Example for Laravel Pest:
vendor/bin/pest --filter=Feature --parallel
# Example for Node.js:
npm test -- --testPathPattern=integration
# Example for Python:
pytest tests/integration/ -v
VALIDATE integrations:
IDENTIFY browser testing framework from technical-stack.md:
LOCATE browser test files:
tests/Browser/[StoryId]Test.phptests/e2e/[story-id].spec.jstests/browser/test_[story_id].pysrc/test/java/**/[StoryId]Test.javaRUN browser tests:
# Example for Laravel Pest Browser:
vendor/bin/pest --filter=Browser
# Example for Playwright (Node.js):
npx playwright test tests/e2e/sdd:story-2025-001
# Example for Python Playwright:
pytest tests/browser/test_story_2025_001.py --headed
VALIDATE against Success Criteria:
TEST across environments (if specified in standards):
CHECK if performance requirements defined in story
IF performance criteria exist:
RUN performance benchmarks:
# Example for Laravel:
php artisan serve &
ab -n 1000 -c 10 http://localhost:8000/api/endpoint
# Example for Node.js k6:
k6 run performance/sdd:story-2025-001.js
VALIDATE performance targets:
RUN security validation:
# Example for Laravel:
composer audit
# Example for Node.js:
npm audit --production
VALIDATE security requirements:
APPLY quality gates from coding-standards.md:
CAPTURE test artifacts:
✅ AUTOMATED QA RESULTS
════════════════════════════════════════════════
Story: [STORY-ID] - [Title]
Stack: [Discovered Framework/Language/Tools]
QA Executed: [Timestamp]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 FUNCTIONAL TESTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Acceptance Criteria: 5/5 verified by browser tests
✓ User can toggle dark mode → tests/Browser/DarkModeTest.php::line 45
✓ Theme persists on refresh → tests/Browser/DarkModeTest.php::line 67
✓ All components support dark mode → tests/Browser/DarkModeTest.php::line 89
✓ Keyboard shortcut works → tests/Browser/DarkModeTest.php::line 112
✓ Preference syncs across tabs → tests/Browser/DarkModeTest.php::line 134
📸 Screenshots: /storage/screenshots/sdd:story-2025-003/
🎥 Videos: /storage/videos/sdd:story-2025-003/ (if applicable)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧪 UNIT TESTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Tests Passed: 45/45 (100%)
✅ Coverage: 87% (target: 80%)
⏱️ Execution Time: 2.34s
Top Coverage Files:
✓ DarkModeService.php: 95%
✓ ThemeController.php: 92%
✓ UserPreferenceRepository.php: 88%
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 INTEGRATION TESTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Feature Tests: 23/23 passed
✓ API endpoints: 8/8 passed
✓ Database operations: 10/10 passed
✓ Service integrations: 5/5 passed
Operations Tested:
✓ GET /api/user/theme → 200 OK (45ms)
✓ POST /api/user/theme → 200 OK (67ms)
✓ Theme preference persisted to database
✓ Cache invalidation on theme change
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌐 COMPATIBILITY TESTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Browsers: Chrome, Firefox, Safari (all passed)
✅ Devices: Desktop (1920x1080), Tablet (768x1024), Mobile (375x667)
✅ Viewports: All responsive breakpoints validated
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ PERFORMANCE TESTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Response Times: Within targets
✓ Theme toggle: 45ms (target: <100ms)
✓ Initial page load: 234ms (target: <500ms)
✅ Throughput: 250 req/sec (target: >100 req/sec)
✅ Memory: Stable (no leaks detected)
✅ Database Queries: Optimized (N+1 prevented)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔒 SECURITY TESTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Vulnerability Scan: No issues (composer audit)
✅ Authentication: All protected routes secure
✅ CSRF Protection: Enabled and functional
✅ XSS Prevention: Input sanitization verified
✅ Rate Limiting: 60 requests/minute enforced
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ ALL QUALITY GATES PASSED
Total Tests: 76/76 passed
Total Coverage: 87%
Total Execution Time: 45.67s
Browser Test Coverage: 100% of acceptance criteria
Performance: All targets met
Security: No vulnerabilities
UPDATE QA Checklist based on test results:
FUNCTIONAL TESTING:
[x] Each acceptance criterion validated by browser tests[x] All user workflows tested end-to-end[x] Error scenarios handled gracefully[x] Edge cases coveredINTEGRATION TESTING:
[x] API endpoints return correct responses[x] Database operations work correctly[x] Service integrations functional[x] External APIs integrated properlyCOMPATIBILITY TESTING:
[x] Works across target browsers[x] Responsive on all devices[x] Accessible via keyboard[x] Screen reader compatiblePERFORMANCE TESTING:
[x] Response times within targets[x] No memory leaks[x] Optimized database queries[x] Bundle size acceptableREGRESSION TESTING:
[x] Existing features still work[x] No unintended side effectsSECURITY TESTING:
[x] No vulnerabilities introduced[x] Authentication/Authorization working[x] Input validation functionalUPDATE Implementation Checklist remaining items:
[x] Browser tests (if now at 100% acceptance criteria coverage)[x] Documentation (if QA revealed complete docs)ADD to Progress Log:
- [Today]: Moved to QA stage
- [Today]: Executed comprehensive test suite
* Unit tests: 45/45 passed (87% coverage)
* Feature tests: 23/23 passed
* Browser tests: 8/8 passed (100% criteria coverage)
* Performance: All targets met
* Security: No vulnerabilities
- [Today]: All quality gates PASSED
RECORD test artifacts:
DETERMINE QA outcome:
/sdd:story-validate/sdd:story-refactorDISPLAY next actions:
💡 NEXT STEPS:
════════════════════════════════════════════════
[IF ALL PASSED:]
✅ All QA tests passed - Ready for validation
1. /sdd:story-validate [story-id] # Final validation before ship
2. /sdd:story-ship [story-id] # Deploy to production (after validation)
[IF FAILURES:]
⚠️ X test(s) failed
1. /sdd:story-refactor [story-id] # Return to development
2. Fix failing tests:
- [Test 1 that failed]
- [Test 2 that failed]
3. /sdd:story-review [story-id] # Re-run review
4. /sdd:story-qa [story-id] # Re-run QA after fixes
[ARTIFACT LOCATIONS:]
📸 Screenshots: /storage/screenshots/[story-id]/
🎥 Videos: /storage/videos/[story-id]/
📊 Coverage: /storage/coverage/[story-id]/
📈 Performance: /storage/benchmarks/[story-id]/
SHOW debugging commands for discovered stack:
# Laravel:
vendor/bin/pest --filter=Browser --parallel=false # Run browser tests sequentially
vendor/bin/pest --filter=Feature::testName # Run specific test
php artisan telescope:prune # Clear performance logs
# Node.js Playwright:
npx playwright test --debug # Debug mode
npx playwright show-report # View HTML report
npx playwright codegen # Generate new test code
# Python Pytest:
pytest tests/browser/ -v -s # Verbose with print output
pytest tests/browser/ --headed --slowmo=1000 # Visual debugging
/docs/stories/qa/[story-id].md - Updated story file with QA resultsINPUT:
/sdd:story-qa STORY-2025-003
OUTPUT:
→ Loading project context...
✓ technical-stack.md: Laravel + Pest + Playwright
✓ coding-standards.md: 80% coverage, all browsers
✓ development-process.md: QA requirements
→ Moving story to QA...
✓ Moved STORY-2025-003.md to /docs/stories/qa/
→ Executing test suite...
[Unit Tests] Running Pest...
✓ 45/45 passed (87% coverage) - 2.34s
[Feature Tests] Running Pest...
✓ 23/23 passed - 5.67s
[Browser Tests] Running Pest Browser...
✓ 8/8 passed - 34.21s
✓ All 5 acceptance criteria validated
📸 Screenshots saved to /storage/screenshots/STORY-2025-003/
[Performance] Running benchmarks...
✓ Theme toggle: 45ms (target: <100ms)
✓ Page load: 234ms (target: <500ms)
[Security] Running Composer audit...
✓ No vulnerabilities
✅ AUTOMATED QA RESULTS
════════════════════════════════════════════════
Story: STORY-2025-003 - Dark Mode Toggle
Stack: Laravel 12, Livewire 3, Pest 4, Playwright
QA Executed: 2025-10-01 16:45:23
✅ ALL QUALITY GATES PASSED
Total Tests: 76/76 passed
Total Coverage: 87%
Browser Test Coverage: 100% of acceptance criteria
Performance: All targets met
Security: No vulnerabilities
💡 NEXT STEPS:
════════════════════════════════════════════════
✅ All QA tests passed - Ready for validation
1. /sdd:story-validate STORY-2025-003 # Final validation before ship
2. /sdd:story-ship STORY-2025-003 # Deploy to production (after validation)
INPUT:
/sdd:story-qa
OUTPUT:
→ Detecting story from current branch...
✓ Current branch: feature/STORY-2025-004-notifications
✓ Story ID: STORY-2025-004
→ Loading project context...
✓ technical-stack.md loaded
→ Moving story to QA...
✓ Moved STORY-2025-004.md to /docs/stories/qa/
→ Executing test suite...
[Unit Tests] Running Pest...
✓ 32/32 passed (92% coverage) - 1.87s
[Feature Tests] Running Pest...
✓ 18/18 passed - 4.23s
[Browser Tests] Running Pest Browser...
✗ 2/5 passed - 3 failed
✗ Failed tests:
- NotificationTest::test_notification_appears
- NotificationTest::test_notification_dismisses
- NotificationTest::test_notification_persistence
✅ AUTOMATED QA RESULTS
════════════════════════════════════════════════
Story: STORY-2025-004 - Notification System
Stack: Laravel 12, Pest 4, Playwright
QA Executed: 2025-10-01 17:12:45
❌ QUALITY GATES FAILED
Unit Tests: ✅ 32/32 passed
Feature Tests: ✅ 18/18 passed
Browser Tests: ❌ 2/5 passed (3 failed)
Acceptance Criteria Coverage: 40% (2/5 criteria validated)
❌ BLOCKING ISSUES:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Browser Tests:
✗ NotificationTest::test_notification_appears
Element not found: [wire:id="notification-toast"]
✗ NotificationTest::test_notification_dismisses
Click failed: Element not visible
✗ NotificationTest::test_notification_persistence
Timeout waiting for element
💡 NEXT STEPS:
════════════════════════════════════════════════
⚠️ 3 browser tests failed
1. /sdd:story-refactor STORY-2025-004 # Return to development
2. Fix failing browser tests:
- Verify notification component is rendered
- Check Livewire component IDs are correct
- Ensure dismiss button is visible
3. /sdd:story-review STORY-2025-004 # Re-run review
4. /sdd:story-qa STORY-2025-004 # Re-run QA after fixes
[DEBUGGING COMMANDS:]
vendor/bin/pest --filter=Browser::NotificationTest # Run specific test
vendor/bin/pest --filter=Browser --parallel=false # Run sequentially
php artisan serve # Start server for manual testing
INPUT:
/sdd:story-qa STORY-2025-005
OUTPUT:
→ Loading project context...
✓ technical-stack.md: Laravel + Pest + k6
→ Moving story to QA...
✓ Moved STORY-2025-005.md to /docs/stories/qa/
→ Executing test suite...
[Unit Tests] ✓ 28/28 passed (85% coverage)
[Feature Tests] ✓ 15/15 passed
[Browser Tests] ✓ 6/6 passed
[Performance] Running k6 benchmarks...
⚠️ Search endpoint: 450ms (target: <200ms)
⚠️ Database queries: 15 queries (N+1 detected)
✅ AUTOMATED QA RESULTS
════════════════════════════════════════════════
Story: STORY-2025-005 - Advanced Search
Stack: Laravel 12, Pest 4, k6
QA Executed: 2025-10-01 18:34:12
⚠️ PERFORMANCE ISSUES DETECTED
All tests: ✅ PASSED
Performance: ⚠️ Below targets
❌ BLOCKING ISSUES:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Performance:
✗ Search response time: 450ms (target: <200ms)
✗ N+1 query problem detected in SearchController
🔧 SUGGESTED OPTIMIZATIONS:
→ Add eager loading: ->with(['category', 'user'])
→ Add database index on search_terms column
→ Implement search results caching
💡 NEXT STEPS:
════════════════════════════════════════════════
1. /sdd:story-refactor STORY-2025-005 # Optimize performance
2. Add eager loading and indexes
3. /sdd:story-qa STORY-2025-005 # Re-run QA with optimizations
/docs/project-context/ directory/sdd:project-init/docs/stories/development//sdd:story-review [story-id] first/docs/stories/qa/: ASK if user wants to re-run QA/sdd:project-init, exit gracefully/sdd:story-review [id] - Must pass before QA/sdd:story-validate [id] - Run after QA passes/sdd:story-refactor [id] - Return to development if QA fails/sdd:story-ship [id] - Deploy after validation/sdd:story-status [id] - Check current state