Token导航 LogoToken导航

Agent Skill · 前端设计

testing(测试)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

testing 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 4,321。

总安装 921周安装 38GitHub Stars 16下载 301核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:testing(测试)
来源仓库:https://github.com/krzysztofsurdy/code-virtuoso
仓库路径:skills/testing
安装命令:
npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill testing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill testing

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

testing 用于辅助测试设计、自动化测试、用例整理和回归验证。适合让 Agent 编写单元测试、 端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据, 避免为了通过测试而改坏真实逻辑。testing 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/testing

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill testing;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

testing 怎么安装?

在终端执行 npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill testing。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

testing 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

testing 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

testing 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

testing 用的人多吗?

公开数据是累计安装 921 次,近一周安装 38 次,下载 301 次,GitHub 16 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

testing 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
testing

测试 · 本页

92116需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Testing

A disciplined approach to verifying that software behaves correctly, remains stable under change, and communicates intent to future developers. Good tests act as living documentation, a safety net for refactoring, and a design feedback mechanism.

This skill covers universal testing concepts that apply regardless of language, framework, or tooling.

When to Use

  • Designing a test strategy for a new project or feature
  • Deciding what level of testing (unit, integration, e2e) a piece of code needs
  • Evaluating whether existing tests are providing value or creating drag
  • Applying TDD to drive design decisions
  • Debugging a flaky or brittle test suite
  • Reviewing test code for quality and maintainability

Testing Pyramid

The testing pyramid describes the ideal distribution of tests across three levels. More tests at the base, fewer at the top.

        /  E2E  \           Few, slow, expensive
       /----------\
      / Integration \       Moderate number, moderate speed
     /----------------\
    /    Unit Tests     \   Many, fast, cheap
   /____________________\

Unit Tests (Base)

  • Test a single unit of behavior in isolation (a function, a method, a small class)
  • No I/O, no database, no network, no file system
  • Execute in milliseconds
  • Should form the majority of your test suite (roughly 70%)
  • Fast feedback loop enables rapid iteration

Integration Tests (Middle)

  • Test how multiple units collaborate, or how code interacts with external systems
  • May involve a real database, message queue, or HTTP endpoint
  • Execute in seconds
  • Verify that wiring, configuration, and contracts between components work
  • Roughly 20% of your test suite

End-to-End Tests (Top)

  • Test complete user journeys through the full system
  • Interact with the application as a user would
  • Slowest, most brittle, most expensive to maintain
  • Reserve for critical business paths only
  • Roughly 10% of your test suite

The Ice Cream Cone Antipattern

The inverted pyramid: many e2e tests, few unit tests. Symptoms:

  • Test suite takes hours to run
  • Tests break constantly due to UI changes or timing issues
  • Developers stop running tests locally
  • Feedback loop is too slow to support continuous delivery

Fix: Identify what each e2e test is actually verifying. Push that verification down to the lowest possible level. Most business logic can be tested at the unit level.

Test Design Principles

Arrange-Act-Assert (AAA)

Every test should follow three distinct phases:

  1. Arrange — set up the preconditions and inputs
  2. Act — execute the behavior under test
  3. Assert — verify the expected outcome

Keep each phase clearly separated. If Arrange dominates the test, extract a builder or factory. If Act requires multiple steps, you may be testing too much at once.

One Assertion per Concept

A test should verify one logical concept. This does not mean literally one assert call — asserting multiple properties of a single result is fine. What matters is that the test fails for exactly one reason.

// Good: one concept — "completed order has correct totals"
assert order.subtotal == 100
assert order.tax == 21
assert order.total == 121

// Bad: two unrelated concepts in one test
assert order.total == 121
assert emailService.wasCalled()

Test Naming

Test names should describe the behavior, not the implementation. A good test name answers: "What scenario is being tested, and what is the expected outcome?"

Patterns that work across languages:

  • should_return_zero_when_cart_is_empty
  • rejects_negative_quantities
  • applies_discount_for_premium_customers

Avoid names like testCalculate, test1, or testGetterSetter.

Test Independence and Isolation

Each test must be completely independent of every other test:

  • No shared mutable state between tests
  • No required execution order
  • Each test sets up its own preconditions and cleans up after itself
  • A single failing test should not cascade into other failures

Deterministic Tests

A test must produce the same result every time it runs, regardless of:

  • The current time or date
  • The order of test execution
  • The machine it runs on
  • Network availability
  • Other tests running in parallel

Non-deterministic tests (flaky tests) destroy trust in the test suite and are worse than no tests at all.

FIRST Principles

PrincipleMeaning
FastTests should run in seconds, not minutes. Slow tests don't get run.
IndependentNo test relies on the output of another test.
RepeatableSame result in any environment — local, CI, staging.
Self-validatingPass or fail with no human interpretation required.
TimelyWritten at the right time — ideally before or alongside the production code.

Test-Driven Development (TDD)

TDD is a design discipline where tests are written before production code, following a tight feedback loop.

Red-Green-Refactor Cycle

  1. Red — Write a failing test that describes the desired behavior
  2. Green — Write the simplest production code that makes the test pass
  3. Refactor — Improve the code structure while keeping all tests green

Rules:

  • Never write production code without a failing test
  • Write only enough test to fail (compilation failure counts)
  • Write only enough production code to pass the current failing test

Two Schools of TDD

AspectChicago (Classical)London (Mockist)
VerificationState-basedInteraction-based
DirectionInside-outOutside-in
CollaboratorsReal objectsMocks/stubs
StrengthRefactoring-resilient testsDrives interface design
RiskComplex setup for deep graphsTests coupled to implementation

See TDD Schools reference for detailed comparison and guidance.

When TDD Helps Most

  • Business logic with clear rules and edge cases
  • Algorithm design
  • API contract definition
  • Bug reproduction and fixing (write the failing test first)

When TDD May Not Apply

  • Exploratory prototyping (write tests after you understand the shape)
  • UI layout and styling
  • One-off scripts

Test Doubles

Test doubles replace real dependencies during testing. Each type serves a different purpose.

DoublePurposeVerifies?
DummyFill parameter lists. Never actually used.No
StubProvide canned responses to method calls.No
SpyRecord interactions for later assertion.Yes (after the fact)
MockPre-programmed with expectations. Fails if not called correctly.Yes (inline)
FakeSimplified working implementation (e.g., in-memory repository).No

See Test Doubles reference for detailed guidance on when to use each type.

Key Principle: Mock at Boundaries

Use test doubles at architectural boundaries (ports, external services), not between internal collaborators. Mocking internal classes couples your tests to implementation details and makes refactoring painful.

What to Test / What Not to Test

High Value — Always Test

  • Business rules and domain logic
  • Edge cases, boundary conditions, error paths
  • State transitions and workflows
  • Input validation and sanitization
  • Security-critical paths (authentication, authorization)
  • Data transformations and calculations

Low Value — Usually Skip

  • Trivial getters/setters with no logic
  • Framework-generated code (ORM mappings, routing config)
  • Third-party library internals (test your integration, not their code)
  • Private methods (test through the public API)
  • Logging and telemetry (unless business-critical)

Testing Implementation vs Behavior

Test behavior, not implementation. A good test describes *what* the system does, not *how* it does it internally.

Signs you are testing implementation:

  • Test breaks when you refactor without changing behavior
  • Test asserts the order of internal method calls
  • Test verifies private state rather than public output
  • Renaming an internal class breaks tests for unrelated features

Signs you are testing behavior:

  • Test describes a user-meaningful scenario
  • Test remains green after internal refactoring
  • Test asserts on outputs, side effects, or state changes visible through the public API

Testing Strategies by Layer

Different architectural layers call for different testing approaches. See Testing Strategies reference for detailed guidance.

LayerPrimary Test TypeKey Technique
Domain/Business LogicUnit testsState-based verification, no I/O
Application ServicesUnit + IntegrationTest doubles for infrastructure ports
Data AccessIntegrationReal database (test containers, in-memory)
API EndpointsIntegration + ContractRequest/response validation
UI ComponentsComponent testsInteraction simulation
Full SystemE2E (selective)Critical paths only

Common Antipatterns

AntipatternSymptomsFix
Brittle testsTests break on every refactor even when behavior is unchangedTest behavior through public API, not internal structure
Testing implementationAsserting on method call order, private state, internal wiringAssert on outputs and observable side effects
Slow test suiteTest suite takes 10+ minutes; developers skip running testsPush tests down the pyramid; use test doubles for I/O
Flaky testsTests pass/fail randomly without code changesRemove time dependencies, shared state, and ordering assumptions
Excessive mockingMore mock setup than actual test logic; tests are unreadableUse real collaborators where possible; mock only at boundaries
Test data couplingTests share fixtures and break when shared data changesEach test creates its own data; use builders/factories
Missing error pathsOnly happy path tested; failures discovered in productionExplicitly test error cases, edge cases, and boundary conditions
Commented-out testsFailing tests are disabled rather than fixed or deletedFix the test, or delete it if the behavior changed intentionally
Giant test methodsTests are 50+ lines with multiple acts and assertsSplit into focused tests; extract setup into helpers
No assertionTest executes code but never asserts anythingEvery test must have at least one meaningful assertion

Quality Checklist

Use this checklist when writing or reviewing tests:

  • Behavior-focused: tests describe *what* the system does, not *how*
  • Independent: no test depends on another test's execution or state
  • Deterministic: same result every time, on every machine
  • Fast: unit tests in milliseconds, full suite in under 5 minutes
  • Readable: a new team member can understand the test without reading the implementation
  • Arranged clearly: AAA structure with obvious separation of phases
  • Named descriptively: test name explains the scenario and expected outcome
  • Error paths covered: not just happy path — edge cases and failures are tested
  • Minimal setup: no unnecessary dependencies or fixtures; builders/factories where needed
  • No flakiness: no time-dependent, order-dependent, or environment-dependent tests
  • Appropriate level: tested at the lowest pyramid level that provides confidence
  • Doubles at boundaries: mocks/stubs used at architectural ports, not internal classes

平台分布

Codex

32.36%
按下载量换算97

Claude

28.67%
按下载量换算86

Cursor

19.85%
按下载量换算60

Gemini CLI

10.17%
按下载量换算31

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills