ab-testing
FreeA/B 测试设计与分析时使用。适用于产品实验、功能验证、转化率优化。融合假设驱动 + 样本量计算 + 置信度判断。
The English summary is being prepared. Showing the original description.
测试覆盖率收集和报告时使用。适用于覆盖率目标设定、CI 集成、PR 评论、趋势跟踪。
The English summary is being prepared. Showing the original description.
See how to installReview the instructions the agent will receive before you install.
1. 覆盖率是基线不是目标
80% 覆盖率 ≠ 80% 质量
2. 关注增量覆盖率
新代码 ≥ 80%,比总覆盖率更有意义
3. 不追求 100%
getter / setter / 配置不需要测
4. 分层看
业务逻辑 ≥ 90%
Controller ≥ 60%
工具函数 ≥ 80%
5. 趋势比绝对值重要
覆盖率不能下降
| 工具 | 语言 | 用途 |
|---|---|---|
| Codecov | 多语言 | SaaS 报告 + PR 评论 |
| Coveralls | 多语言 | SaaS 报告 |
| SonarQube | 多语言 | 自建 + 质量门禁 |
| Istanbul / c8 | JS/TS | 收集器 |
| JaCoCo | Java | 收集器 |
| coverage.py | Python | 收集器 |
| go test -cover | Go | 内置 |
| 层 | 目标 | 说明 |
|---|---|---|
| Domain / Service | ≥ 90% | 核心业务 |
| Controller | ≥ 60% | 集成测试覆盖 |
| Utils | ≥ 80% | 工具函数 |
| 总体 | ≥ 70% | 基线 |
| 增量(新代码) | ≥ 80% | PR 门禁 |
# Vitest 覆盖率
- run: pnpm test:coverage
- uses: codecov/codecov-action@v4
with:
files: coverage/lcov.info
fail_ci_if_error: true
# 门禁:覆盖率不能下降
- name: Coverage check
run: |
COVERAGE=$(cat coverage/coverage-summary.json | jq '.total.lines.pct')
if (( $(echo "$COVERAGE < 70" | bc -l) )); then
echo "Coverage below threshold: $COVERAGE%"
exit 1
fi
templates/coverage-config-template.md — 覆盖率配置 + 目标 + CI□ 覆盖率目标设定
□ CI 自动收集
□ PR 评论(增量)
□ 门禁(不能下降)
□ 趋势跟踪
□ 分层目标
□ 不追求 100%
上游:
unit/integration/e2e → 测试代码产生覆盖率
下游:
ci-test-integration → CI 收集
qa-engineer quality-gate → 门禁条件
No reviews yet. Tell others what you thought.
No login needed. Share how it worked for you, ask a question, or note where it did not run.
No comments yet. Be the first to write one.
A/B 测试设计与分析时使用。适用于产品实验、功能验证、转化率优化。融合假设驱动 + 样本量计算 + 置信度判断。
The English summary is being prepared. Showing the original description.
上线前业务方/产品方验收时使用。适用于功能交付确认、UAT、发布会签。融合 BDD Given-When-Then、Specification by Example、ATDD。
The English summary is being prepared. Showing the original description.
设计无障碍可访问的界面时使用。适用于满足 WCAG 标准、键盘导航、屏幕阅读器支持。优先使用 WCAG 2.2 AA 级标准 + 键盘 + 焦点 + 对比度 + ARIA。
The English summary is being prepared. Showing the original description.
实现可访问性(无障碍)时使用。覆盖 WCAG 2.2 AA / ARIA / 键盘导航 / 屏幕阅读器 / 颜色对比 / 焦点管理。融合 React Aria / Radix UI / Headless UI 实践 + axe-core 自动化测试。
The English summary is being prepared. Showing the original description.
AI 模型部署时使用。适用于推理服务 / GPU / TensorRT / 监控 / 扩缩容。
The English summary is being prepared. Showing the original description.
数据分析报告输出时使用。适用于业务分析报告、周报、专项分析、决策支持。融合洞察 + 建议 + 行动项。
The English summary is being prepared. Showing the original description.