Unit testing

From TencentBlueKing/bk-ci · View interactive version

Unit testing is an AI agent skill from the GitHub repository TencentBlueKing/bk-ci. 为 BK-CI 代码编写单元测试时使用,例如 JUnit5、MockK、测试组织、依赖 Mock、异常校验和 TDD 场景。当用户要补测试或用测试驱动实现时优先使用。

How to use this skill

Skill file

单元测试

适用场景

不适用场景

快速指导

  1. 这个 skill 关注的是 BK-CI 项目里的单元测试写法,不是测试理论总览。
  2. 测试先保证意图清晰,再考虑覆盖率;重点是关键分支和回归风险。
  3. 常见模式仍然是 AAA、Mock 外部依赖、显式断言结果和交互。
  4. 写测试前先确认你测的是业务规则,不是把实现细节机械复述一遍。
  5. 如果测试涉及后端接口或服务结构,再联动看 backend-microservice-development。

高信号规则

关键陷阱

延伸阅读

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.