code-test
Skill1 starsChanged 10 months agoMITView on GitHub
当用户需要为生成的代码或改动代码时激活此技能。根据代码语言和项目上下文,生成单元测试、系统功能测试、系统压力测试和系统破坏性测试,确保测试覆盖全面且符合最佳实践。
2 other projects use a version of this.
Adopted by
Most recently taken up by
- dmlguq456/heartingtheir own version, first seen Nov 8, 2026
- LNSD/lorecrafttheir own version, first seen Oct 27, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- dmlguq456/hearting★ 9same name
- LNSD/lorecraft★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- canvas-designSkill
- code-architectureSkill
- code-conventionSkill
- code-docsSkill
- frontend-designSkill
- mr-checkSkill
- mysql-operatorSkill
- pdfSkill
- pptxSkill
- qa-caseSkill
- skill-creatorSkill
- xlsxSkill
The file
Files
Code Test - 代码测试生成
角色定位
作为专业的测试工程师和测试架构师,负责为代码生成全面的测试用例。
工作流程
1. 识别代码语言和类型
首先识别用户正在处理的代码语言和类型:
- 编程语言:Go、Shell、JavaScript 等
- 代码类型:函数、接口、API、消息队列等
- 测试类型:单元测试、系统功能测试、系统压力测试、系统破坏性测试
2. 选择相应测试规范
根据代码语言选择对应的测试规范文件:
Go 语言测试
- Go 代码测试:使用 references/go.md
Shell 脚本测试
- Shell 脚本测试:使用 references/shell.md
JavaScript 测试
- JavaScript 代码测试:使用 references/js.md
3. 生成测试用例
根据代码语言规范生成测试用例:
单元测试
- 对于每次代码生成和代码改动,都需要按语言规范生成相关的单元测试用例
- 测试用例除了基本的功能测试参数,还要包括破坏性参数的传入传出
- 需要结合项目函数上下文
系统功能测试
- 对于每次代码生成和代码改动,都需要按语言规范生成相关的系统自动化测试用例
- 系统测试要覆盖所有单元测试
- 对于网络 API、消息队列等网络中间件,要实现接口的功能测试
系统压力测试
- 压力测试只针对外部网络 API 生成,如 HTTP、gRPC、NSQ 等外部接口
- 压力测试要支持多梯度,从而最大程度了解接口的性能
系统破坏性测试
- 破坏性测试针对外部网络接口,测试异常情况下的系统表现
- 包括超时、断网、错误响应等场景
4. 输出测试用例
将生成的测试用例保存到项目相应位置:
- Go 语言:
*_test.go文件 - JavaScript:
*.{test,spec}.{js,ts}文件 - Shell:
*_test.sh文件
测试覆盖要求
单元测试覆盖
- 正常功能测试
- 边界条件测试
- 异常输入测试(根据项目上下文判断)
- 错误处理测试
- 并发安全测试(如适用)
系统功能测试覆盖
- API 接口功能测试
- 消息队列功能测试
- 数据库操作测试
- 文件操作测试
- 端到端流程测试
系统压力测试覆盖
- 不同并发级别下的性能表现
- 响应时间和吞吐量
- 资源使用情况
系统破坏性测试覆盖
- 网络异常(超时、断网)
- 服务异常(错误响应、服务不可用)
- 数据异常(非法数据、空数据)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

