品质保证
- 作者仓库星标 672
- 许可证 MIT
- 作者仓库 kiro
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @jasonkneen · MIT
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# Quality Assurance
Ensure quality throughout the spec-driven development process with validation techniques, quality gates, and testing strategies.
## When to Use This Skill
Use quality assurance practices when:
- Completing any spec phase (requirements, design, tasks)
- Transitioning between phases
- Implementing features from specs
- Reviewing completed work
- Establishing team quality standards
## Core Principles
1. **Requirements-Driven Testing:** Every test traces to a requirement
2. **Phase-Appropriate Validation:** Different techniques for each phase
3. **Continuous Quality:** Checks throughout development
4. **Automated Where Possible:** Reduce manual effort
5. **Fast Feedback:** Catch issues early
## Phase-Specific Validation
### Requirements Phase Validation
**Quality Checklist:**
- [ ] All user stories have acceptance criteria
- [ ] Requirements are unambiguous and specific
- [ ] Each requirement can be validated/tested
- [ ] EARS format used consistently
- [ ] Requirements link to business objectives
- [ ] No conflicting requirements
**Review Process:**
1. **Self Review:** Author checks completeness
2. **Stakeholder Review:** Business validates requirements
3. **Technical Review:** Team assesses feasibility
4. **Approval:** Formal sign-off before design
**Validation Techniques:**
- **Scenario Walkthroughs:** Step through user journeys
- **Edge Case Analysis:** Identify boundary conditions
- **Conflict Detection:** Check for contradictions
- **Completeness Analysis:** Ensure all needs covered
### Design Phase Validation
**Quality Checklist:**
- [ ] Design addresses all requirements
- [ ] Scalability considerations documented
- [ ] Maintainability assessed
- [ ] Security addressed
- [ ] Performance requirements considered
- [ ] External integrations defined
**Review Process:**
1. **Architecture Review:** Senior team validates design
2. **Security Review:** Security implications assessed
3. **Performance Review:** Performance characteristics evaluated
4. **Integration Review:** External dependencies validated
**Validation Techniques:**
- **Design Walkthroughs:** Step through system interactions
- **Threat Modeling:** Identify security vulnerabilities
- **Performance Modeling:** Estimate system performance
- **Dependency Analysis:** Map external requirements
### Tasks Phase Validation
**Quality Checklist:**
- [ ] Each task has clear deliverables
- [ ] Task sequence is logical
- [ ] All design elements covered
- [ ] Each task can be validated
- [ ] Tasks appropriately sized (2-4 hours)
- [ ] Dependencies clearly defined
**Review Process:**
1. **Completeness Review:** All design elements have tasks
2. **Sequencing Review:** Task order is logical
3. **Scope Review:** Tasks are appropriately sized
4. **Dependency Review:** Dependencies clear
## Quality Gates
### Requirements Phase Exit Criteria
- [ ] All user stories follow proper format
- [ ] Acceptance criteria use EARS format
- [ ] Requirements are testable and measurable
- [ ] No conflicting requirements
- [ ] Stakeholders have approved
- [ ] Edge cases documented
### Design Phase Exit Criteria
- [ ] Architecture addresses all requirements
- [ ] Non-functional requirements addressed
- [ ] External dependencies identified
- [ ] Data models clearly defined
- [ ] Error handling documented
- [ ] Security considerations addressed
- [ ] Technical review completed
### Tasks Phase Exit Criteria
- [ ] All design elements have tasks
- [ ] Tasks properly sequenced
- [ ] Each task is actionable
- [ ] Requirements references included
- [ ] Test approach defined
- [ ] Task breakdown reviewed
### Task-Level Quality Gates
**Before Starting:**
- [ ] Task requirements understood
- [ ] Test strategy defined
- [ ] Dependencies available
- [ ] Environment ready
**During Implementation:**
- [ ] Code follows standards
- [ ] Tests written alongside code
- [ ] Coverage meets thresholds (80%+)
- [ ] No critical vulnerabilities
**Before Marking Complete:**
- [ ] All tests pass
- [ ] Code review completed
- [ ] Documentation updated
- [ ] Requirements validated
## Testing Strategies
### Test Pyramid
```
/\
/ \ E2E Tests (10%)
/____\ Integration Tests (20%)
/ \
/________\ Unit Tests (70%)
```
### Unit Testing
- Fast execution (< 1 second per test)
- Test individual functions/classes
- Mock external dependencies
- Target 80%+ coverage
### Integration Testing
- Test component interactions
- Use real dependencies where practical
- Validate API contracts
- Test critical workflows
### End-to-End Testing
- Test complete user journeys
- Production-like environment
- Focus on critical business flows
- Minimal but comprehensive
### Test-Driven Development
For each task:
1. **Write tests first** based on acceptance criteria
2. **Run tests** - verify they fail (red)
3. **Write code** - minimal to pass tests (green)
4. **Refactor** - improve while keeping tests green
5. **Validate** - ensure requirements satisfied
## Quality Metrics
### Code Quality
- **Line Coverage:** % of code lines executed
- **Branch Coverage:** % of code branches tested
- **Cyclomatic Complexity:** Code complexity
- **Technical Debt:** Accumulated issues
### Testing Effectiveness
- **Test Pass Rate:** % of tests passing
- **Execution Time:** Time to run tests
- **Defect Detection Rate:** Bugs found by tests vs production
- **Test Maintenance:** Time spent maintaining tests
## Common Quality Issues
### Flaky Tests
**Symptoms:** Tests pass/fail inconsistently
**Solutions:**
- Identify timing dependencies
- Use proper wait conditions
- Isolate test data
- Fix race conditions
### Slow Test Suites
**Symptoms:** Tests take too long
**Solutions:**
- Parallelize execution
- Optimize database operations
- Use test doubles for external services
- Profile and optimize slow tests
### Low Coverage
**Symptoms:** Insufficient code coverage
**Solutions:**
- Add tests for uncovered paths
- Focus on critical business logic
- Use mutation testing
- Set coverage gates in CI
### Test Maintenance Burden
**Symptoms:** Tests require frequent updates
**Solutions:**
- Improve test design
- Use page object patterns for UI
- Reduce coupling to implementation
- Regular test refactoring
## Validation Checklists
### Requirements Validation
```markdown
## Requirements Review
**Completeness:**
- [ ] All user roles addressed
- [ ] Happy path scenarios covered
- [ ] Edge cases documented
- [ ] Error cases handled
- [ ] Business rules captured
**Clarity:**
- [ ] Precise language used
- [ ] No ambiguous terms
- [ ] Technical jargon avoided
- [ ] Behaviors are specific
**Testability:**
- [ ] Each requirement verifiable
- [ ] Success criteria observable
- [ ] Inputs/outputs specified
```
### Design Validation
```markdown
## Design Review
**Architecture:**
- [ ] Requirements addressed
- [ ] Components well-defined
- [ ] Interfaces specified
- [ ] Data flow documented
**Quality Attributes:**
- [ ] Performance considered
- [ ] Security addressed
- [ ] Scalability planned
- [ ] Maintainability assessed
**Risks:**
- [ ] Single points of failure identified
- [ ] Bottlenecks documented
- [ ] Mitigations planned
```
### Implementation Validation
```markdown
## Implementation Review
**Code Quality:**
- [ ] Follows standards
- [ ] Well-documented
- [ ] Tests included
- [ ] No security issues
**Requirements:**
- [ ] All criteria met
- [ ] Edge cases handled
- [ ] Error handling complete
**Integration:**
- [ ] Works with existing code
- [ ] APIs functioning
- [ ] Performance acceptable
```
## Best Practices
### Testing Best Practices
1. Write tests first when possible
2. Each test verifies one thing
3. Use descriptive test names
4. Maintain test independence
5. Keep tests up-to-date
### Quality Assurance Best Practices
1. Find issues early (shift left)
2. Automate everything possible
3. Use metrics to drive improvements
4. Make quality everyone's responsibility
5. Continuous learning and improvement
### Process Integration
1. Link tests to requirements
2. Provide quick feedback
3. Focus testing on high-risk areas
4. Keep documentation current
5. Integrate tools with workflow
## Quick Reference
**Phase Transition Questions:**
- Requirements → Design: "Does design address all requirements?"
- Design → Tasks: "Do tasks cover all design elements?"
- Tasks → Implementation: "Does code satisfy task specifications?"
**Quality Gate Questions:**
- "Is this testable and measurable?"
- "Have we considered what could go wrong?"
- "Would another developer understand this?"
- "Does this meet our standards?"
章节与文件索引
按说明文件中的顺序排列。
何时使用此技能
核心原则
需求阶段验证
设计阶段验证
任务阶段验证
文件/命令 -> validated/tested · functions/classes · pass/fail · Inputs/outputs
内容校验值 -> 56432aa1b9e9
当前原文的自动摘译,尚未人工审校。
何时使用此技能
在以下情况下使用质量保证实践: 完成任何规范阶段(需求、设计、任务) 在阶段之间转换 实施规范中的功能 审查已完成的工作
核心原则
需求驱动的测试:每个测试都跟踪需求 阶段适当的验证:每个阶段采用不同的技术 持续质量:在整个开发过程中进行检查 尽可能自动化:减少手动工作 快速反馈:及早发现问题
需求阶段验证
质量检查表: [ ] 所有用户故事都有验收标准 [ ] 要求明确且具体 [ ] 每个要求都可以验证/测试 [ ] 一致使用 EARS 格式
设计阶段验证
质量检查表: [ ] 设计满足所有要求 [ ] 记录可扩展性考虑因素 [ ] 评估可维护性 [ ] 解决安全性
任务阶段验证
质量检查表: [ ] 每项任务都有明确的可交付成果 [ ] 任务顺序符合逻辑 [ ] 涵盖所有设计元素 [ ] 每项任务都可以验证