Borrowing it
Nothing to install: this file belongs to Awesome-Embedded-Learning-Studio/CFDesktop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Awesome-Embedded-Learning-Studio/CFDesktop/main/.claude/commands/testing.mdgit clone --depth 1 https://github.com/Awesome-Embedded-Learning-Studio/CFDesktopWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/awesome-embedded-learning-studio/cfdesktop/testing)<a href="https://agentmods.dev/commands/awesome-embedded-learning-studio/cfdesktop/testing"><img src="https://agentmods.dev/badge/commands/awesome-embedded-learning-studio/cfdesktop/testing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/awesome-embedded-learning-studio/cfdesktop/testing"><img src="https://agentmods.dev/badge/commands/awesome-embedded-learning-studio/cfdesktop/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00924 |
| Opus 5.5 | $0.00000 | $0.00370 |
| Sonnet 5.5 | $0.00000 | $0.00185 |
| Haiku 4.5 | $0.00000 | $0.00092 |
Grade A, and why
testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/testing — 测试覆盖建议
为新增或修改的代码建议测试用例,参考现有测试模式。
触发方式
/testing <模块路径>— 建议测试用例/next-step或/optimize衔接
工作流程
Step 1: 分析目标代码
-
读取源文件,识别公共 API 接口:
- 公共方法(public methods)
- 信号和槽(signals/slots)
- 枚举和常量
- 模板函数/类
-
识别边界情况:
- 空输入、零值、最大值
- 无效输入、越界访问
- 资源限制(内存、文件句柄)
-
识别线程安全问题:
- 锁自由数据结构
- 异步操作
- 共享状态访问
Step 2: 检查现有测试覆盖
- 在
test/<module>/<component>/查找已有测试文件 - 读取已有测试,理解当前覆盖范围
- 识别未覆盖的代码路径
Step 3: 参考现有测试模式
文件模式 (test/<module>/<component>/<component>_test.cpp):
/**
* @file <component>_test.cpp
* @brief Test coverage for <Component>.
*/
#include <gtest/gtest.h>
#include "<component>.h"
TEST(<Component>Suite, BasicFunctionality) {
// Arrange
// Act
// Assert
}
CMake 模式 (test/<module>/CMakeLists.txt):
add_gtest_executable(<component>_test
<component>/<component>_test.cpp
LINK_LIBRARIES <target> GTest::gtest GTest::gtest_main
LABELS "module;unit;component"
)
Step 4: 测试建议分级
P0 — 必须有 (Critical Path)
- 构造函数/析构函数基本功能
- 主要用例(happy path)
- 错误处理(无效输入)
P1 — 应该有 (Boundary)
- 空输入、零值、最大值
- Off-by-one 边界
- 资源限制
P2 — 可选有 (Integration/Regression)
- Qt 框架交互(Signal/Slot)
- 跨组件交互
- 线程安全测试
- 性能回归测试
Step 5: 输出格式 (中文)
# 测试建议: <module/component>
## 现有测试状态
- 已有测试文件: (列出或 "无")
- 覆盖率评估: X%
- 未覆盖的关键路径: ...
## 建议新增测试
### P0 — 必须
```cpp
// TEST(<Component>Suite, ConstructorInitializesCorrectly)
TEST(<Component>Suite, ConstructorInitializesCorrectly) {
// Arrange & Act
<Component> obj{/* params */};
// Assert
EXPECT_EQ(obj.<getter>(), expected);
}
P1 — 应该
(测试用例骨架)
P2 — 可选
(测试用例骨架)
测试文件位置
- 建议路径:
test/<module>/<component>/<component>_test.cpp - CMakeLists.txt 修改:
add_gtest_executable(<component>_test ...)
预估工作量
- P0 测试数量: N
- P1 测试数量: N
- P2 测试数量: N
- 预估耗时: X minutes
## 模块特定注意事项
- **base/ 工具库**: header-only,链接 `cfbase_headers` + `GTest`
- **ui/ 控件**: 需要 `QApplication`,链接 `cfui` + `Qt6::Widgets` + `Qt6::Gui`
- **desktop/**: 需要完整 `CFDesktop_shared` + `Qt6::Widgets`
- **Signal/Slot 测试**: 需要 `Qt6::Test`,使用 `QSignalSpy`
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 130 lines · 0 tokens per session scan A 349b5a8ac3c4
testing is a command published in the GitHub repository Awesome-Embedded-Learning-Studio/CFDesktop (11 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 924 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
embedded-test
Generate Unity tests, CMock mocks, a hardware-in-the-loop scaffold, or a coverage report.
python-scaffold
Generate a fresh project skeleton, tests and lint config included. TRIGGER WHEN: the user asks to start a new Python project, bootstrap FastAPI/Django/CLI/library structure, or set up uv+pytest+ruff from scratch. DO NOT TRIGGER WHEN: adding to an existing project (use python-engineer).
comprehensive-unit-testing-with-pytest
Aims for high test coverage using pytest, testing both common and edge cases.
CLAUDE_CODE_F090_SDK_ONLY
A software-maintenance task covering JavaScript and Python software development kits, or SDKs. An SDK is a package that helps developers use a service from their own code.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.