tencentblueking/bk-ci/unit-testing

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

为 BK-CI 代码编写单元测试时使用,例如 JUnit5、MockK、测试组织、依赖 Mock、异常校验和 TDD 场景。当用户要补测试或用测试驱动实现时优先使用。

Install

npx vskill@latest install tencentblueking/bk-ci/unit-testing

SKILL.md

单元测试

适用场景

  • 编写 Service / DAO / 工具类单元测试
  • Mock 外部依赖和边界条件
  • 验证正常路径、异常路径和回归场景
  • 采用 TDD 或补测试防回归

不适用场景

  • 集成测试、端到端测试
  • 只是实现业务逻辑,不准备补测试
  • 只是排查运行环境问题

快速指导

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

高信号规则

  • 正常路径和失败路径都要有代表性覆盖
  • Mock 应该服务于隔离边界,而不是掩盖设计问题
  • 测试命名要能直接表达行为和预期

关键陷阱

  • 只测 happy path
  • Mock 过度,导致测试几乎失去行为价值
  • 断言太弱,只证明代码跑过,没有证明结果正确

延伸阅读

  • 如果你在改后端服务:再看 backend-microservice-development

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
2,512
Repository forks
518
7-day trend score
39

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 14 Jul 2026, 3 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/tencentblueking/bk-ci/unit-testing/badge)](https://verified-skill.com/skills/tencentblueking/bk-ci/unit-testing)

Something wrong with this skill or its page? Tell us.