performance-testing

英文版: 见技能 performance-testing-en 。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "performance-testing" with this command: npx skills add naodeng/awesome-qa-skills/naodeng-awesome-qa-skills-performance-testing

性能测试(中文版)

英文版: 见技能 performance-testing-en 。

提示词见本目录 prompts/performance-testing.md 。

何时使用

  • 用户提到「性能测试」「performance-testing」

  • 需要基于 Standard-version 执行该类测试或产出对应交付物

  • 触发示例:「根据以下内容生成/设计/编写…」

输出格式选项

默认 Markdown。若需 Excel / CSV / JSON,请在需求末尾说明,详见 output-formats.md。

如何使用

  • 打开本目录 prompts/ 下对应提示词文件,复制虚线以下内容。

  • 附加你的需求与上下文(业务流程、环境、约束、验收标准)。

  • 若需非 Markdown 输出,在末尾追加 output-formats.md 中的请求句。

代码示例

  1. K6 负载测试

完整的 K6 性能测试示例,包含负载测试、压力测试、尖峰测试和 API 测试。

位置: examples/k6-load-testing/

包含内容:

  • 负载测试脚本(Load Test)

  • 压力测试脚本(Stress Test)

  • 尖峰测试脚本(Spike Test)

  • API 性能测试脚本

  • 自动化运行脚本

  • 详细的 README 文档

快速开始:

cd examples/k6-load-testing chmod +x run-tests.sh ./run-tests.sh load

测试覆盖:

  • 负载测试(模拟正常业务量)

  • 压力测试(找出性能极限)

  • 尖峰测试(突发流量)

  • API 性能测试(REST API)

  • 自定义指标和阈值

详见:examples/k6-load-testing/README.md

最佳实践

性能测试设计原则

测试类型选择

  • 负载测试:验证系统在预期负载下的性能

  • 压力测试:找出系统的性能极限

  • 尖峰测试:测试突发流量处理能力

  • 浸泡测试:验证长时间运行的稳定性

测试场景设计

  • 基于真实用户行为

  • 合理的思考时间(Think Time)

  • 逐步增加负载

  • 包含预热和降温阶段

性能指标

  • 响应时间(Response Time)

  • 吞吐量(Throughput/RPS)

  • 错误率(Error Rate)

  • 并发用户数(Concurrent Users)

  • 资源使用率(CPU、内存、网络)

阈值设置

  • 基于业务需求定义

  • 使用百分位数(p95、p99)

  • 设置合理的错误率

  • 监控趋势变化

工具选择建议

工具 适用场景 优势

K6 现代化性能测试 脚本化、易用、云原生

JMeter 传统性能测试 功能丰富、GUI、插件多

Gatling Scala/Java 项目 高性能、报告美观

Locust Python 项目 易学、分布式

Artillery Node.js 项目 配置简单、CI/CD 友好

常见误区 | Common Pitfalls

  • ❌ 压测模型脱离真实业务流量 → ✅ 基于生产行为构建场景与负载配比

  • ❌ 只看平均响应时间 → ✅ 同时关注 p95/p99、错误率、吞吐与资源饱和

  • ❌ 跳过基线与预热阶段 → ✅ 先基线、后预热、再分阶段加压

  • ❌ 只看测试结果不看系统指标 → ✅ 关联 CPU/内存/IO/下游依赖做瓶颈定位

故障排除

详细排障步骤已迁移到 references/troubleshooting.md。 按需加载该文件,避免主技能文档过长。

参考文件

  • prompts/performance-testing.md — 性能测试 Standard-version 提示词

  • output-formats.md — Markdown / Excel / CSV / JSON 请求说明

  • examples/k6-load-testing/ — K6 完整示例

  • quick-start.md — 5 分钟快速上手指南

目标受众

  • 在真实项目中执行该测试域工作的 QA 与开发人员

  • 需要结构化、可复用测试交付物的测试负责人

  • 需要快速生成可落地测试产出的 AI 使用者

不适用场景

  • 无测试范围上下文的纯线上应急处置

  • 需要法律/合规最终裁定但缺少专家复核的决策

  • 缺少最小输入(范围、环境、期望行为)的请求

关键成功因素

  • 先明确范围、环境与验收标准,再生成测试内容

  • 生成结果必须结合真实系统约束做二次校验

  • 保持产物可追踪(需求 -> 测试点 -> 缺陷 -> 决策)

输出模板与解析脚本

  • 模板目录:output-templates/

  • template-word.md (Word 友好结构)

  • template-excel.tsv (Excel 可直接粘贴)

  • template-xmind.md (XMind 结构化大纲)

  • template-json.json

  • template-csv.csv

  • template-markdown.md

  • 解析脚本目录:scripts/

  • 解析通用:parse_output_formats.py

  • 解析按格式:parse_word.py 、parse_excel.py 、parse_xmind.py 、parse_json.py 、parse_csv.py 、parse_markdown.py

  • 转换通用:convert_output_formats.py

  • 转换按格式:convert_to_word.py 、convert_to_excel.py 、convert_to_xmind.py 、convert_to_json.py 、convert_to_csv.py 、convert_to_markdown.py

  • 批量转换:batch_convert_templates.py (批量输出到 artifacts/ )

示例:

python3 scripts/parse_json.py output-templates/template-json.json python3 scripts/parse_markdown.py output-templates/template-markdown.md python3 scripts/convert_to_json.py output-templates/template-markdown.md python3 scripts/convert_output_formats.py output-templates/template-json.json --to csv python3 scripts/batch_convert_templates.py --skip-same

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

test-case-writing

No summary provided by upstream source.

Repository SourceNeeds Review
General

test-reporting

No summary provided by upstream source.

Repository SourceNeeds Review
General

api-testing

No summary provided by upstream source.

Repository SourceNeeds Review
General

test-case-reviewer

No summary provided by upstream source.

Repository SourceNeeds Review