Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

the-standard-testing标准测试

Agent Skill

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

总安装

13,789

周安装

559

GitHub Stars

17

下载量

3,305
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/hassanhabib/the-standard-skills --skill 'The Standard Testing'

简介

the-standard-testing 用于辅助测试设计、自动化测试、用例整理和回归验证,适合让 Agent 编写测试或分析失败日志。

  • 适用于单元测试、端到端测试、测试计划生成和问题定位等场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 使用时需确认项目测试框架、运行命令和夹具数据,避免误改真实逻辑。
  • 涉及浏览器或外部服务时,应区分本地模拟与生产环境。

SKILL.md

The Standard Testing

What this skill is

This skill governs how The Standard is tested, verified, and proven. It covers test-driven development, validation strategies, exception mapping, unit test structure, controller tests, and UI component tests.

Explicit coverage map

This skill explicitly covers:

  • Foundation-service implementation and validation/testing patterns from the Services chapter
  • Structural, logical, external, and dependency validation testing
  • Exception mapping and category testing
  • Processing-service testing responsibilities
  • Orchestration-service call-order testing
  • Aggregation-service testing restrictions
  • REST controller unit and acceptance tests
  • UI component testing for bases, core components, and pages
  • The supplied implementation specification sections on unit testing, partial test organization, conventions, AAA, and test order
  • TDD FAIL/PASS discipline relevant to test creation and implementation verification

When to use

Use this skill whenever writing, reviewing, expanding, fixing, or sequencing tests. Use it whenever deciding what to test first, how to map exceptions in tests, or how to prove a Standard-compliant flow.

Core testing doctrine

  1. Follow TDD.
  2. Write the failing test first.
  3. Verify the test actually fails.
  4. Write the minimum implementation required to pass.
  5. Verify the full relevant suite passes.
  6. Refactor without changing behavior.
  7. Repeat.

Validation testing rules

Validation Source of Truth

  1. Validation rules MUST be inferred from all authoritative sources:

- Foundation service business rules - Storage-layer configuration (StorageBroker.[Entity].Configurations.cs) - Domain expectations implied by usage

  1. The storage configuration represents minimum enforced constraints:

- Required vs optional - Maximum length - Minimum length (if configured) - Precision / scale / format where applicable

  1. Foundation services represent the enforcement boundary:

- All constraints that can cause persistence failure MUST be validated before reaching storage - Validation must prevent database exceptions where deterministically possible

Validation Alignment Rules

  1. Foundation validation MUST be equal to or stricter than storage constraints.
  2. The following are ALLOWED (strengthening rules):

- Storage: optional → Foundation: required - Storage: optional → Foundation: constrained (min/max length) - Storage: max length → Foundation: smaller max length

  1. The following are NOT ALLOWED (weakening or missing rules):

- Storage: required → Foundation: not validated as required - Storage: max length → Foundation: no length validation

  1. Violations of alignment MUST be treated as:

- A design defect - A test failure condition - A review blocker

Validation Responsibility Rule

  1. The database MUST NOT be relied upon to enforce:

- Required field validation - Length validation - Format validation

  1. The ONLY acceptable database-enforced constraints without prior validation are:

- Foreign key constraints - Uniqueness / duplicate key constraints - Concurrency constraints

  1. Any validation that can be performed deterministically in the foundation service MUST be performed there

Validation Test Derivation from Storage Configuration

  1. Storage configuration (StorageBroker.[Entity].Configurations.cs) defines constraints, not validation behavior.
  2. For every constraint defined in storage configuration, there MUST exist a corresponding validation rule in the foundation service:

- Required fields - Length constraints (min/max) - Precision / format constraints where applicable

  1. Validation tests MUST:

- Target the foundation service validation methods only - NOT directly test storage configuration behavior - Prove that each storage-defined constraint is enforced at the foundation layer

  1. For each property constraint, validation tests MUST focus on constraint violations and boundary breaches:

- Invalid case (violates constraint) → FAIL - Required field missing / null - Value exceeding maximum length - Value below minimum length (if applicable) - Boundary violation cases: - Just above maximum → FAIL - Just below minimum → FAIL (if applicable)

  1. Valid scenarios (within acceptable range) are covered by logic tests and MUST NOT be redundantly tested in validation tests.
  2. Missing alignment between storage configuration and foundation validation MUST be treated as:

- A design defect - A test failure condition - A review blocker

  1. Automation MAY assist in identifying constraints (e.g., via EF metadata), but:

- Generated tests MUST still validate foundation behavior - Automation MUST NOT result in tests that validate the database layer directly

  1. All validation tests MUST:

- Follow Standard naming conventions - Be explicit and intention-revealing

Validation order

  1. Structural validations first.
  2. Logical validations second.
  3. External validations third.
  4. Dependency validations when the external resource is the source of the failure.

Circuit-breaking validations

  1. Null checks and other hard-stop guards must break immediately.
  2. If continuing would create invalid dereference or meaningless work, stop immediately.

Continuous validations

  1. When multiple fields can be invalid independently, collect them before throwing.
  2. Use upsertable exception data.
  3. Use dynamic rules with condition + message.
  4. Use a validations collector routine.
  5. Throw once the collector contains errors.

Hybrid continuous validations

  1. Validate parent objects before validating child properties.
  2. Split nested validation into levels to avoid unintended null-reference failures.

Foundation-service test rules

  1. Test the happy path first.
  2. Then test structural validations.
  3. Then test logical validations.
  4. Then test external validations.
  5. Then test dependency validations.
  6. Then test dependency exceptions.
  7. Then test service exceptions.
  8. Always verify logging and broker calls.
  9. Always verify no unwanted calls occurred.
  10. Always keep validation and exception behaviors local and explicit.

Processing-service test rules

  1. Test higher-order logic, not primitive broker details.
  2. Validate only what the processing service uses.
  3. Test shifters.

- Example: object -> bool or object -> count.

  1. Test combinations.

- Example: retrieve + add, retrieve + modify, ensure-exists, upsert.

  1. Test processing exception mapping from foundation exceptions.

Orchestration-service test rules

  1. Test multi-entity flow combinations.
  2. Test mapping/branching between contracts when present.
  3. Test call order when the flow depends on order.
  4. Prefer natural order when inputs/outputs force sequencing.
  5. Use explicit order verification when sequencing is not naturally encoded.
  6. Verify orchestration-level exception wrapping and unwrapping.
  7. Test normalization outcomes indirectly through dependency shape and resulting behavior.

Aggregation-service test rules

  1. Do not test dependency call order in aggregation services.
  2. Do not use mock-sequence style order assertions for aggregation services.
  3. Test only basic structural validations and exposure-level aggregation behavior.
  4. Aggregation services may multi-call or pass-through; test the contract and exposure abstraction, not orchestration logic.

Controller and protocol test rules

  1. Controllers require unit tests for mapping logic.
  2. Unit-test success code mappings.
  3. Unit-test validation / dependency / service error mappings.
  4. Unit-test security i.e authorization / authentication failure mappings.
  5. Acceptance-test every endpoint.
  6. Clean up test data after acceptance tests.
  7. Emulate external resources not owned by the microservice when running acceptance tests.
  8. Integration and end-to-end testing are valid beyond unit + acceptance.

UI component test rules

Base components

  1. Treat bases as thin wrappers.
  2. Test their exposed APIs and wrapper behavior when needed.
  3. Do not put business logic into bases.

Core components

  1. Core components are test-driven.
  2. Test elements.

- Existence - Properties - Actions

  1. Existence may be tested by property assignment, searching by id, or general search.
  2. Test styles when styles are part of the component contract.
  3. Test actions that mutate state, create components, or trigger service calls.
  4. Core components should integrate with one and only one view service.

Pages / containers

  1. Pages are simpler route containers.
  2. They generally do not require unit tests.
  3. They should not contain business logic.

Unit-test conventions from the supplied implementation profile

  1. Mirror partial-class split in tests.
  2. Use setup/helpers in the root test file.
  3. Split tests into logic, validations, and exceptions files.
  4. Use GWT: Given / When / Then.
  5. Mock all dependencies.
  6. Use readable assertions.
  7. Use deep cloning to protect expectation identity.
  8. Use randomized data by default.
  9. Verify exact dependency calls.
  10. End with VerifyNoOtherCalls.
  11. Keep naming explicit and scenario-driven.

Exact test implementation order for foundation-service add routines

When implementing an Add{Entity}Async routine under the implementation profile, follow this order:

  1. ShouldAdd{Entity}Async
  2. ShouldThrowValidationExceptionOnAddIf{Entity}IsNullAndLogItAsync
  3. ShouldThrowValidationExceptionOnAddIf{Entity}IsInvalidAndLogItAsync
  4. ShouldThrowDependencyValidationExceptionOnAddIfBadRequestErrorOccursAndLogItAsync
  5. ShouldThrowDependencyValidationExceptionOnAddIfConflictErrorOccursAndLogItAsync
  6. ShouldThrowCriticalDependencyExceptionOnAddIfUnauthorizedErrorOccursAndLogItAsync
  7. ShouldThrowCriticalDependencyExceptionOnAddIfForbiddenErrorOccursAndLogItAsync
  8. ShouldThrowCriticalDependencyExceptionOnAddIfNotFoundErrorOccursAndLogItAsync
  9. ShouldThrowCriticalDependencyExceptionOnAddIfUrlNotFoundErrorOccursAndLogItAsync
  10. ShouldThrowDependencyExceptionOnAddIfInternalServerErrorOccursAndLogItAsync
  11. ShouldThrowDependencyExceptionOnAddIfServiceUnavailableErrorOccursAndLogItAsync
  12. ShouldThrowCriticalDependencyExceptionOnAddIfHttpRequestErrorOccursAndLogItAsync
  13. ShouldThrowServiceExceptionOnAddIfServiceErrorOccursAndLogItAsync

For storage-based services, substitute the storage equivalents such as duplicate-key, DbUpdate, and SQL exceptions.

Testing and exception/localization addendum from the supplied implementation profile

8. Unit Testing

Unit tests follow The Standard's partial-class + three-axis approach.

8.1 Test Class Structure

Each entity's tests mirror the same partial-class split as the service:

Partial fileTests
{Entity}ServiceTests.csSetup, mocks, helpers (CreateRandom{Entity}, etc.)
{Entity}ServiceTests.Logic.{Method}.csHappy-path / success-case tests
{Entity}ServiceTests.Validations.{Method}.csValidation failure tests
{Entity}ServiceTests.Exceptions.{Method}.csDependency & service exception tests

8.2 Conventions

ConventionDetail
MockingMoqMock<IStorageBroker>, Mock<IModernApiBroker>, Mock<ILoggingBroker>
AssertionsFluentAssertionsShould().BeEquivalentTo()
Deep cloningDeepCloner — to isolate input/expected/actual objects
Data generationTynamix.ObjectFillerFiller<{Entity}> with custom property setup
Exception comparisonXeption.SameExceptionAs() via SameExceptionAs expression helper
Test namingShould{Action}Async / ShouldThrow{Exception}On{Action}If{Condition}AndLogItAsync
Verify callsEvery test verifies broker calls (Times.Once / Times.Never) and ends with VerifyNoOtherCalls()
Test frameworkxUnit[Fact] for single cases, [Theory] [InlineData] for parameterised cases

8.3 Test Pattern — GWT (Given / When / Then)

// given  — build input, configure mocks, construct expected exception
// when   — invoke the service method
// then   — assert result / exception, verify broker interactions

8.4 Test Implementation Order

Tests must be written and committed in the following strict order. This ordering ensures each category builds upon the prior one:

  1. Happy PathShouldAdd{Entity}Async
  2. Structural Validations — null entity check (ShouldThrowValidationExceptionOnAddIf{Entity}IsNullAndLogItAsync)
  3. Logical Validations — property-level checks using [Theory] [InlineData] (ShouldThrowValidationExceptionOnAddIf{Entity}IsInvalidAndLogItAsync)
  4. External Dependency Validation ExceptionsBadRequestConflict
  5. External Critical Dependency ExceptionsUnauthorizedForbiddenNotFoundUrlNotFound
  6. External Non-Critical Dependency ExceptionsInternalServerErrorServiceUnavailable
  7. Transport-Level ExceptionHttpRequestException
  8. Catch-All Service ExceptionException

For storage-based services, steps 4–7 are replaced with the corresponding SQL/EF exceptions (DuplicateKeyException, DbUpdateException, SqlException).

Rule — Test Verification Before Commit: Each FAIL commit must have the test actually running and failing. Each PASS commit must have all tests running and passing. Never commit a FAIL without verifying the test runner reports a genuine failure. See Section 12.1.3 — Commits for details.

9. Key Libraries

PackagePurpose
XeptionEnhanced exceptions with data aggregation
EFxceptionsEF Core wrapper that throws meaningful exceptions
RESTFulSenseHTTP client wrapper for external API brokers
MoqMock framework for unit tests
FluentAssertionsReadable assertion syntax
DeepClonerValue-based deep cloning of test objects
Tynamix.ObjectFillerRandom test data generation
xunitUnit test framework

Exception Handling Principles

0. Scope

These rules govern exception design, localisation, categorisation, propagation, and testing across all service layers.


1. Localisation (MANDATORY)

  1. External (non-local) exceptions MUST be localised at the boundary (Foundation).
  2. Native exceptions (SQL, HTTP, SDK) MUST NOT cross service boundaries.
  3. Localisation MUST convert native exceptions into domain-specific exceptions.

Data Preservation (MANDATORY)

  1. ALL relevant data from the external exception MUST be copied to the local exception:

- Data dictionary - Constraint / validation metadata - Identifiers / keys

  1. The localised exception MUST carry this data so that:

- The immediate inner exception contains full validation detail after categorisation.


2. Categorisation

  1. All exceptions MUST be categorised into one of:

- Validation - DependencyValidation - Dependency - Service

  1. Categorisation defines upstream handling and exposer mapping.

3. Propagation (Unwrap / Rewrap)

Each service layer MUST:

  1. Catch downstream exceptions
  2. UNWRAP the categorical exception
  3. PRESERVE the LOCAL exception
  4. REWRAP into its OWN categorical exception

This prevents leakage of lower-layer concerns and enforces layer contracts.


4. Inner Exception Preservation (MANDATORY)

  1. The original local exception MUST always be preserved as the inner exception.
  2. No layer may discard or replace the local exception.

This guarantees:

  • Traceability
  • Correct exposer mapping (e.g. HTTP Conflict / FailedDependency)
  • Retention of validation data

5. Layer Responsibilities

Foundation

  1. Localise external exceptions
  2. Populate local exception data
  3. Categorise into Validation / DependencyValidation / Dependency / Service

Processing

  1. MUST ONLY handle categorised exceptions
  2. MUST NOT depend on foundation exception types
  3. MUST rewrap into processing-level exceptions

Orchestration

  1. MUST handle exceptions from all dependencies
  2. MUST unify into a single categorical exception per type
  3. MUST unwrap and preserve inner exceptions

6. Catch-All (MANDATORY)

  1. Every service MUST implement:

- catch (Exception)

  1. MUST map to ServiceException

This prevents leakage of unknown failures.


7. Logging

  1. Each layer MUST log BEFORE rethrowing
  2. MUST log the categorised exception only

8. Testing

Orchestration Exception Tests

  1. SHOULD use [Theory]
  2. MUST cover multiple dependency exception types in a single test
  3. MUST avoid duplication

9. Design Intent

These rules ensure:

  1. Full abstraction from external systems
  2. Stable layer contracts
  3. Simplified exposer logic
  4. Complete validation visibility at the local exception level

Exception Handling Cross-References (Enforcement)

Validation Testing Alignment

  1. All validation tests MUST align with Exception Handling Principles:

- Localisation MUST be verified (no native exceptions exposed) - Data preservation MUST be verified on local exceptions - Validation exceptions MUST contain full error details in inner exception - From processing service layer upwards, validation exceptions and dependency validation exceptions from its dependencies rewrap to [Entity][Layer]DependencyValidationExceptions - From processing service layer upwards, dependency exceptions and service exceptions from its dependencies rewrap to [Entity][Layer]DependencyExceptions

  1. Validation tests MUST assert:

- Correct local exception type - Correct categorised exception type - Inner exception contains validation data (Data dictionary populated)


Foundation Exception Tests (Enforcement)

  1. Tests MUST verify localisation:

- Native exception → Local exception → Categorised exception

  1. Tests MUST verify:

- External exception data is copied to local exception - Local exception is preserved as inner exception

  1. Tests MUST NOT allow:

- Native exception leakage - Missing Data dictionary propagation


Processing Exception Tests (Enforcement)

  1. Tests MUST assert:

- Rewrapping into processing-level exception - Inner exception preservation

  1. Tests SHOULD:

- Use [Theory] to test multiple dependency validation exceptions of the same type in one test - Use [Theory] to test multiple dependency exceptions of the same type in one test - Avoid duplication by testing multiple cases in a single test method


Orchestration Exception Tests (Enforcement)

  1. Tests MUST assert:

- Rewrapping into orchestration-level exception - Inner exception is preserved (local exception) - Categorical exception is replaced at orchestration level

  1. Tests SHOULD:

- Use [Theory] to test multiple dependency validation exceptions of the same type in one test - Use [Theory] to test multiple dependency exceptions of the same type in one test - Avoid duplication by testing multiple cases in a single test method


Catch-All Enforcement

  1. Tests MUST verify:

- Unknown exceptions are mapped to ServiceException - No raw Exception escapes any service layer


Logging Enforcement

  1. Tests MUST verify:

- Logging occurs before exception is thrown - Logged exception is the categorised exception


Design Integrity Rule

  1. Any violation of exception handling principles MUST be treated as:

- A design defect - A test failure - A review blocker

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.29%
按下载量换算1,199

Claude

29.27%
按下载量换算967

Cursor

16.62%
按下载量换算549

Gemini CLI

9.33%
按下载量换算308

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills