Token导航 LogoToken导航

Agent Skill · 研究检索

testing(测试)

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

testing 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 39,878。

总安装 1,354周安装 57GitHub Stars 公开资料未说明下载 474核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

AgentSkills.tonpx skills
npx skills add cosmix/loom --skill "testing"

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助测试设计、自动化测试、用例整理和回归验证。适合让 Agent 编写单元测试、端到端测试或根据失败日志定位问题。通过 github 安装,支持 Codex、Claude、Cursor、Gemini CLI 宿主环境。使用时需确认项目测试框架、运行命令和夹具数据,避免误改真实逻辑。

涉及浏览器或外部服务时,应区分本地模拟与生产环境。

来源仓库内路径:skills/testing

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add cosmix/loom --skill "testing";命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

testing 怎么安装?

在终端执行 npx skills add cosmix/loom --skill "testing"。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

testing 支持哪些 AI 工具?

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

testing 需要什么权限?

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

testing 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

testing 用的人多吗?

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

testing 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
testing

测试 · 本页

1,354—需要联网MIT未收录

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

SKILL.md 原文

name
testing
description
Comprehensive test implementation across all domains including unit, integration, e2e, security, infrastructure, data pipelines, and ML models. Covers TDD/BDD workflows, test architecture, flaky test debugging, and coverage analysis.
allowed-tools
Read, Grep, Glob, Edit, Write, Bash
trigger-keywords
test, testing, spec, assert, expect, mock, stub, spy, fixture, snapshot, coverage, TDD, BDD, red-green, regression, unit test, integration test, e2e, end-to-end, test suite, test case, pytest, jest, vitest, mocha, junit, testify, test framework

Testing

Overview

This skill provides comprehensive testing expertise across all domains and test types. Whether writing unit tests, debugging flaky tests, designing test architecture, or testing specialized systems like data pipelines and ML models, this skill guides test implementation following industry best practices.

When to Use

  • Implementing tests for any codebase (unit, integration, e2e)
  • Debugging flaky or failing tests
  • Improving test coverage
  • Setting up test infrastructure and frameworks
  • Following TDD/BDD workflows
  • Testing specialized domains (data, ML, infrastructure, security)
  • Designing test architecture and strategy

Core Instructions

1. Analyze Code to Test

  • Identify public interfaces and APIs
  • Map out dependencies and side effects
  • Find edge cases and boundary conditions
  • Understand expected behaviors and invariants
  • Review error handling paths
  • Document assumptions and preconditions

2. Design Test Strategy

Test Pyramid Approach:

  • Unit tests (70%): Fast, isolated, test single units
  • Integration tests (20%): Test component interactions
  • E2E tests (10%): Test full user workflows

Planning:

  • Determine appropriate test types for each component
  • Set coverage targets (aim for 80%+ line coverage, 100% critical paths)
  • Identify mocking requirements and boundaries
  • Plan test fixtures and data management
  • Consider performance and flakiness risks

3. Write Tests Following AAA Pattern

Arrange-Act-Assert:

  • Arrange: Set up test data, mocks, and conditions
  • Act: Execute the code under test
  • Assert: Verify expected outcomes with clear failure messages

Naming Convention:

test_<unit>_<scenario>_<expected_outcome>

Example: test_shopping_cart_add_duplicate_item_increases_quantity

4. Handle Special Cases

Async Operations:

  • Use proper async test utilities (async/await, done callbacks)
  • Set appropriate timeouts
  • Test race conditions and timing issues

Error Conditions:

  • Test all error paths explicitly
  • Verify error messages and types
  • Test recovery mechanisms

External Dependencies:

  • Mock HTTP clients, databases, file systems
  • Use test doubles (mocks, stubs, fakes)
  • Consider contract testing for APIs

Database Testing:

  • Use transactions with rollback for isolation
  • Use in-memory databases for speed
  • Seed test data consistently

Domain-Specific Testing

Data Pipeline Testing

Data Quality Tests:

  • Schema validation (column types, nullability, constraints)
  • Data completeness (row counts, null checks)
  • Data accuracy (statistical checks, business rule validation)
  • Data freshness (timestamp checks)

Pipeline Tests:

  • Idempotency: Running twice produces same result
  • Incremental processing: Only new data is processed
  • Failure recovery: Handles partial failures gracefully
  • Performance: Processing time within SLAs

Example:

def test_etl_pipeline_preserves_row_count():
    # Arrange
    input_data = load_fixture("sales_data_1000_rows.csv")

    # Act
    result = etl_pipeline.transform(input_data)

    # Assert
    assert len(result) == 1000, "ETL should not drop rows"
    assert result['customer_id'].notna().all(), "customer_id required"

ML Model Testing

Model Behavior Tests:

  • Invariance tests: Predictions stable under irrelevant changes
  • Directional expectation: Feature changes affect predictions correctly
  • Minimum functionality: Model beats baseline on key examples

Data Tests:

  • Training/validation split integrity
  • Feature distribution alignment
  • Label balance and quality

Performance Tests:

  • Accuracy/precision/recall on test set
  • Inference latency requirements
  • Resource usage (memory, CPU)

Example:

def test_sentiment_model_invariance_to_punctuation():
    model = load_model("sentiment_classifier")

    text_base = "This product is amazing"
    text_with_punct = "This product is amazing!!!"

    pred_base = model.predict(text_base)
    pred_punct = model.predict(text_with_punct)

    assert abs(pred_base - pred_punct) < 0.1, \
        "Punctuation should not significantly change sentiment"

Infrastructure Testing

Infrastructure as Code Tests:

  • Syntax validation (terraform validate, yaml lint)
  • Policy compliance (security groups, IAM policies)
  • Resource tagging and naming conventions
  • Cost estimation thresholds

Integration Tests:

  • Deployment smoke tests
  • Health check endpoints
  • Service connectivity
  • Configuration validation

Example:

def test_terraform_no_public_s3_buckets():
    tf_plan = load_terraform_plan("main.tfplan.json")

    for resource in tf_plan.get_resources("aws_s3_bucket"):
        acl = resource.get("acl", "private")
        assert acl != "public-read", \
            f"S3 bucket {resource['name']} must not be public"

Best Practices

Test Quality

  1. Test One Thing: Each test verifies a single behavior or condition
  2. Descriptive Names: Test names describe scenario and expected outcome
  3. Independent Tests: No shared state between tests, any order execution
  4. Fast Execution: Unit tests < 100ms, integration tests < 5s
  5. Deterministic: Same input always produces same result (no random data)
  6. Avoid Test Logic: Tests should be simple assertions, not algorithms
  7. Test Edge Cases: Boundary conditions, empty inputs, max values, nulls
  8. Readable Assertions: Use clear assertion messages for debugging

Test Coverage

  • Aim for 80%+ line coverage, 100% for critical paths
  • Focus on behavior coverage, not just line coverage
  • Use coverage tools to find untested code
  • Prioritize testing business logic and error paths

Debugging Flaky Tests

Common Causes:

  • Race conditions and timing dependencies
  • Shared mutable state between tests
  • External service dependencies
  • Non-deterministic inputs (timestamps, random values)
  • Test execution order dependencies

Solutions:

  • Add explicit waits instead of sleep
  • Reset state in setup/teardown
  • Mock external dependencies
  • Use fixed seeds for random generation
  • Run tests in isolation to identify order dependencies

TDD Workflow

Red-Green-Refactor Cycle:

  1. Red: Write failing test for desired behavior
  2. Green: Write minimal code to make test pass
  3. Refactor: Improve code while keeping tests passing

Benefits:

  • Forces thinking about design before implementation
  • Ensures tests actually catch failures
  • Provides fast feedback loop
  • Creates comprehensive test suite

Framework-Specific Patterns

Python (pytest)

import pytest
from unittest.mock import Mock, patch

@pytest.fixture
def database():
    db = Database()
    db.connect()
    yield db
    db.disconnect()

@pytest.mark.parametrize("input,expected", [
    (0, 0),
    (1, 1),
    (5, 120),
])
def test_factorial(input, expected):
    assert factorial(input) == expected

@patch('requests.get')
def test_api_client(mock_get):
    mock_get.return_value.json.return_value = {"status": "ok"}
    result = fetch_status()
    assert result == "ok"

JavaScript (Vitest/Jest)

import { describe, it, expect, vi, beforeEach } from 'vitest'

describe('UserService', () => {
  let mockDb

  beforeEach(() => {
    mockDb = {
      query: vi.fn()
    }
  })

  it('finds user by email', async () => {
    mockDb.query.mockResolvedValue([{ id: 1, email: ' [email protected] ' }])

    const service = new UserService(mockDb)
    const user = await service.findByEmail(' [email protected] ')

    expect(user.id).toBe(1)
    expect(mockDb.query).toHaveBeenCalledWith(
      'SELECT * FROM users WHERE email = ?',
      [' [email protected] ']
    )
  })
})

Rust (built-in + mockall)

#[cfg(test)]
mod tests {
    use super::*;
    use mockall::predicate::*;
    use mockall::mock;

    mock! {
        Database {}
        impl DatabaseTrait for Database {
            fn get_user(&self, id: i64) -> Result<User, Error>;
        }
    }

    #[test]
    fn test_user_service_fetches_from_db() {
        let mut mock_db = MockDatabase::new();
        mock_db
            .expect_get_user()
            .with(eq(1))
            .return_once(|_| Ok(User { id: 1, name: "Alice".into() }));

        let service = UserService::new(mock_db);
        let user = service.get_user(1).unwrap();

        assert_eq!(user.name, "Alice");
    }
}

Anti-Patterns to Avoid

  1. Test Interdependence: Tests that must run in specific order
  2. Testing Implementation: Testing private methods or internal state
  3. Excessive Mocking: Mocking everything makes tests brittle
  4. Assertion Roulette: Multiple unrelated assertions in one test
  5. Hidden Dependencies: Tests that rely on external files or services
  6. Slow Tests: Tests that take seconds to run due to real I/O
  7. Brittle Tests: Tests that break with minor refactoring
  8. Duplicate Logic: Copying production code into tests

Test Architecture

Test Organization

tests/
├── unit/              # Fast, isolated unit tests
│   ├── models/
│   ├── services/
│   └── utils/
├── integration/       # Component interaction tests
│   ├── api/
│   ├── database/
│   └── external_services/
├── e2e/              # Full workflow tests
│   └── user_scenarios/
├── fixtures/         # Shared test data
└── helpers/          # Test utilities

Continuous Integration

  • Run unit tests on every commit
  • Run integration tests on PRs
  • Run e2e tests before deployment
  • Fail builds on coverage decrease
  • Parallelize test execution
  • Report flaky tests for investigation

Examples

Example 1: Unit Test with Mocking

from unittest.mock import Mock, patch
import pytest
from payment_processor import PaymentProcessor

class TestPaymentProcessor:
    @patch('payment_processor.stripe')
    def test_successful_payment_creates_charge(self, mock_stripe):
        # Arrange
        mock_stripe.Charge.create.return_value = Mock(
            id='ch_123',
            status='succeeded'
        )
        processor = PaymentProcessor(api_key='test_key')

        # Act
        result = processor.charge(amount=1000, token='tok_visa')

        # Assert
        assert result.success is True
        assert result.charge_id == 'ch_123'
        mock_stripe.Charge.create.assert_called_once_with(
            amount=1000,
            currency='usd',
            source='tok_visa'
        )

    @patch('payment_processor.stripe')
    def test_declined_payment_raises_payment_error(self, mock_stripe):
        # Arrange
        mock_stripe.Charge.create.side_effect = Exception("Card declined")
        processor = PaymentProcessor(api_key='test_key')

        # Act & Assert
        with pytest.raises(PaymentError) as exc_info:
            processor.charge(amount=1000, token='tok_declined')

        assert "Card declined" in str(exc_info.value)

Example 2: Integration Test with Database

import { describe, it, expect, beforeEach, afterEach } from 'vitest'
import { createServer } from '../server'
import { db } from '../database'

describe('User API Integration', () => {
  let server

  beforeEach(async () => {
    server = await createServer()
    await db.migrate.latest()
    await db.seed.run()
  })

  afterEach(async () => {
    await db.migrate.rollback()
    await server.close()
  })

  it('creates user and returns 201 with user data', async () => {
    const response = await server.inject({
      method: 'POST',
      url: '/api/users',
      payload: {
        email: ' [email protected] ',
        name: 'New User'
      }
    })

    expect(response.statusCode).toBe(201)
    expect(response.json()).toMatchObject({
      email: ' [email protected] ',
      name: 'New User'
    })

    // Verify database state
    const user = await db('users').where({ email: ' [email protected] ' }).first()
    expect(user).toBeDefined()
  })

  it('returns 400 for invalid email format', async () => {
    const response = await server.inject({
      method: 'POST',
      url: '/api/users',
      payload: {
        email: 'invalid-email',
        name: 'Test User'
      }
    })

    expect(response.statusCode).toBe(400)
    expect(response.json().error).toContain('email')
  })
})

Example 3: Snapshot Testing

import { render } from '@testing-library/react'
import { UserCard } from './UserCard'

it('renders user card correctly', () => {
  const user = {
    id: 1,
    name: 'Alice',
    email: ' [email protected] ',
    avatar: '/avatars/alice.jpg'
  }

  const { container } = render(<UserCard user={user} />)

  // Snapshot testing for UI components
  expect(container.firstChild).toMatchSnapshot()
})

Summary

This skill provides comprehensive testing expertise across:

  • All test types (unit, integration, e2e)
  • All domains (backend, frontend, data, ML, infrastructure)
  • Test architecture and strategy
  • Debugging and maintenance
  • TDD/BDD workflows

The goal is production-quality tests that catch bugs, document behavior, and enable confident refactoring.

平台分布

Claude Code

24.89%
按下载量换算118

OpenCode

24.58%
按下载量换算117

Codex

18.35%
按下载量换算87

Antigravity

11.77%
按下载量换算56

Gemini CLI

7.24%
按下载量换算34

Cursor

3.1%
按下载量换算15

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills