跳到正文
Skillpedia
测试5.8k · #14640

test-tagging

它能做什么

这项技能为现有测试添加称为特征(traits)的标准分类标签,并报告测试套件如何划分。适合希望了解测试构成的团队,例如正常路径测试与错误路径测试的比例。

适用场景

  • ✓当你希望套件中的每个测试都带有标准分类特性时。
  • ✓当你希望获得正常路径和错误路径测试划分情况的摘要时。
  • ✓当你想检查关键路径在测试构成中是否有足够的测试的时候。

技能链接

https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/test-tagging/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/test-tagging/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用标准分类为我所有的测试加上标签,并告诉我正常路径和错误路径各有多少个。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会阅读测试名称和测试体,根据特征对每个测试进行分类,在分类清晰时应用标准特性,并报告分布情况。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Test Trait Tagging

Analyze an existing test suite in any supported language and apply a standardized set of trait tags to each test method, giving teams visibility into their test distribution (positive vs. negative, critical-path coverage, smoke tests, etc.).

Language-specific guidance: Read the caller-provided or runtime-listed test-analysis-extensions catalog and its matching language file. The helper is reference-only, not an invocable skill. If absent, continue with the built-in framework table below and report the limitation.

When to Use

  • Auditing a test project to understand the mix of test types
  • Adding trait attributes to untagged tests
  • Generating a summary report of trait distribution across a test suite
  • Reviewing whether critical paths have sufficient coverage

When Not to Use

  • Writing new tests from scratch (use code-testing for any language, or writing-mstest-tests for MSTest)
  • Running or filtering tests (use run-tests for .NET; equivalent native runners elsewhere)
  • Migrating between test frameworks
  • General quality, smell, flakiness, or assertion audits (use test-anti-patterns or the matching analysis skill)
  • Diagnostic .NET executed line/branch/Cobertura interpretation or project-wide CRAP risk (use coverage-analysis); raw coverage collection (use run-tests for .NET, native tooling otherwise)
  • CRAP analysis for a named method, class, or file (use crap-score)
  • Behavioral gaps where a test would survive broken production logic (use test-gap-analysis)

Inputs

Input Required Description
Test project or files No Path to the test project, folder, or specific test files. Discover from the current workspace when omitted.
Scope No Infer from the verb: tag/apply edits, audit/classify/report is report-only, and both applies only when both are requested. If ambiguous, default to audit to avoid unrequested edits. Frameworks declared report-only always emit a report; convention-based frameworks edit only after the user confirms the convention.
Framework No Auto-detected. Override when detection fails.

Trait Taxonomy

Use exactly these trait names and values. Do not invent new trait values outside this table.

Trait Value Meaning Heuristics
positive Verifies expected behavior under normal/valid conditions Asserts success, valid output, expected state, no exceptions for valid input
negative Verifies correct handling of invalid input, errors, or edge cases Asserts exceptions, error codes, validation failures, rejects bad input
boundary Tests limits, thresholds, empty/null/None/nil inputs, min/max values Operates on 0, -1, int.MaxValue / sys.maxsize / Number.MAX_SAFE_INTEGER / math.MaxInt64 / i32::MAX, empty string, null/None/nil/undefined, empty collection, boundary of valid range
critical-path Core workflow that must never break; breakage blocks users Tests the primary success scenario of a key public API or user-facing feature
smoke Quick sanity check that the system is operational Fast, no complex setup, verifies basic wiring (e.g., service resolves, endpoint returns 200)
regression Reproduces a specific previously-reported bug References a bug ID, issue number, or describes a fix in its name or comments
integration Crosses process, network, or persistence boundaries Uses real database, HTTP client, file system, external service, or multi-component setup
end-to-end Full user workflow spanning the entire application stack Exercises a complete scenario from entry point to final result, distinct from single-boundary integration
performance Validates timing, throughput, or resource consumption Asserts on elapsed time, memory, allocations, or uses benchmark harness (BenchmarkDotNet, pytest-benchmark, benchmark.js, JMH, go test -bench, criterion.rs, XCTMetric, kotlinx-benchmark, Google Benchmark)
security Verifies authentication, authorization, input sanitization, or secrets handling Tests for SQL injection, XSS, CSRF, unauthorized access, token validation, permission checks
concurrency Validates thread safety, parallelism, or async correctness Uses Task.WhenAll / Parallel.ForEach / SemaphoreSlim (.NET); asyncio.gather / threading.Lock / multiprocessing (Python); Promise.all / worker threads
常见问题

它会修改我的测试吗?

只在分类清晰的地方应用标准特性;否则只报告分类结果。

它会运行测试吗?

不会。它负责分类和报告。运行测试由另一项技能负责。

这和代码覆盖率有关吗?

不完全相关。它描述的是测试类型的构成,而覆盖率分析涉及被执行的行和分支。

详情

作者的原始描述

Classifies existing tests by standard traits and reports their distribution. USE FOR: tagging all tests with category attributes, categorizing/tagging/ labeling each test, compare happy vs error paths, audit the test mix, describe coverage shape by test type, or tag then verify the project builds. Read bodies when names mislead. Apply canonical attributes; otherwise report only. DO NOT USE FOR: requests owned by test-anti-patterns, coverage-analysis, crap-score, test-gap-analysis, code-testing, or migration skills.

repo: dotnet/skills

热度

GitHub 星标
5.8k
排名
#14640
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能