मुख्य सामग्री पर जाएँ
Skillpedia
टेस्टिंग5.8k · #14637

test-anti-patterns

यह क्या करती है

यह स्किल टेस्ट कोड में आम समस्याएँ जाँचती है, जो टेस्ट को भरोसे लायक नहीं रहने देतीं या उन्हें संभालना मुश्किल बनातीं। यह उन डेवलपर्स के लिए है जो जानना चाहते हैं कि उनके टेस्ट पर भरोसा किया जा सकता है या नहीं।

कब इस्तेमाल करें

  • ✓जब लगता है कि टेस्ट बिना कुछ जाँचे पास हो रहे हैं।
  • ✓जब टेस्ट फ़्लेकी हों, क्रम पर निर्भर हों या एक्सेप्शन दबा रहे हों।
  • ✓जब आप किसी टेस्ट फ़ाइल या सूट पर भरोसा करने से पहले गंभीरता के क्रम वाली समीक्षा चाहते हैं।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/test-anti-patterns/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरी टेस्ट फ़ाइल देखकर बताइए कि कौन-से टेस्ट भरोसे लायक नहीं हैं या कुछ नहीं जाँचते, और गंभीरता के हिसाब से क्रम दीजिए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट टेस्ट पढ़ता है, उन्हें भाषा और फ़्रेमवर्क की जानी-पहचानी गड़बड़ियों से मिलाता है, और नतीजे सबसे गंभीर से कम गंभीर के क्रम में बताता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Test Anti-Pattern Detection

Quick, pragmatic analysis of test code in any supported language for anti-patterns and quality issues that undermine test reliability, maintainability, and diagnostic value.

Language-specific guidance: Read the caller-provided or runtime-listed test-analysis-extensions catalog and its matching language file when needed. Do not invoke the reference-only helper. If its files are absent, use the built-in framework rules below.

When to Use

  • User asks to review test quality or find test smells
  • User wants to know why tests are flaky or unreliable
  • User asks "are my tests good?" or "what's wrong with my tests?"
  • User requests a test audit or test code review
  • User wants diagnostic findings before deciding what to improve

When Not to Use

  • User wants to write new tests from scratch (use code-testing)
  • User wants direct implementation fixes rather than a diagnostic review (use the relevant write/edit skill)
  • User asks to fix swapped Assert.AreEqual argument order in MSTest (use writing-mstest-tests)
  • User asks to convert MSTest DynamicData from IEnumerable<object[]> to ValueTuple (use writing-mstest-tests)
  • User wants to run or execute tests (use run-tests for .NET)
  • User wants to migrate between test frameworks or versions (use migration skills)
  • User wants raw .NET coverage collection (use run-tests), non-.NET coverage collection or analysis (use native tooling), project-wide .NET coverage/CRAP metrics (use coverage-analysis), or named-target .NET CRAP (use crap-score)
  • User asks whether tests would catch a bug or wants behavioral/pseudo-mutation gaps (use test-gap-analysis)
  • User wants test-mix or happy-vs-error-path classification, standardized tagging, or trait/category distributions (use test-tagging)
  • User wants a deep formal test smell audit with academic taxonomy and extended catalog (use test-smell-detection)

Inputs

Input Required Description
Test scope No Test files, classes, directory, or project to analyze. Discover from the current workspace when omitted.
Production code No The code under test, for context on what tests should verify
Specific concern No A focused area like "flakiness" or "naming" to narrow the review

Workflow

Step 1: Detect language and load extension

Resolve the named test path from the current workspace before asking for input. When no path is supplied, discover test files under the current directory using the repository manifests and conventional test markers. The skill context's Base directory is documentation storage, not the user's workspace; never resolve target files relative to it.

If one reader says a path is missing but a workspace glob/search finds it, normalize that exact path and retry. Use a shell text reader (sed/cat on Unix, Get-Content on PowerShell) only for a confirmed reader availability, transport, or path-normalization failure and only after verifying the canonical path remains inside the current workspace. Stop on content-exclusion, permission/policy, workspace-boundary, or unknown failures. Audit any discovered file that a permitted reader can access; never ask the user to paste it. If every permitted reader fails, report the exact blocker without bypassing security boundaries.

Identify the language and framework. Read the matching bundled reference when needed, resolving its filename relative to the supplied catalog. Check only that known reference directory, never installation directories. If unavailable, use the catalog below and report the reference limitation.

Step 2: Gather the test code

Inventory the resolved scope before reading bodies. For one file or class, read that scope directly. For a project or suite, discover test files once, batch independent reads where tools allow, and stop when every discovered test and class-level fixture has a ledger disposition.

Use extension discovery markers when loaded; otherwise use the built-in markers in this skill (attributes such as [TestClass]/[Fact]/[Test], test_*.py, *.test.*, *_test.go, *_spec.rb, #[test], *.Tests.ps1, TEST(...), and TEST_CASE(...)).

Do not read unrelated production code wholesale. Open the production symbol corresponding to every suspicious test needed to decide whether an assertion, transformation, identity contract, or adjacent gap is real. For a systematic facade/surface-area patter

अक्सर पूछे जाने वाले सवाल

क्या यह टेस्ट ठीक भी करती है?

नहीं। यह केवल जाँच रिपोर्ट करती है। सीधे बदलाव करना दूसरी स्किल्स का काम है।

यह किन भाषाओं को कवर करती है?

यह कई भाषाओं और फ़्रेमवर्क को कवर करती है, और उपलब्ध होने पर हर एक के लिए अतिरिक्त गाइड भी इस्तेमाल करती है।

क्या यह टेस्ट चलाती है?

नहीं। यह टेस्ट कोड की समीक्षा करती है और उसे चलाती नहीं।

जानकारी

लेखक का मूल विवरण

Audit a test file or suite; produce a severity-ranked diagnostic report. ALWAYS USE for tests that verify nothing, missing/tautological assertions, swallowed/broad exceptions, flaky/order-dependent tests, duplication, or magic values. Polyglot. DO NOT USE for direct edits: writing-mstest-tests owns supplied MSTest assertions/attributes/lifecycle; code-testing owns new tests. Exclude running tests, migration, assertion metrics (assertion-quality), raw .NET coverage collection (run-tests), non-.NET coverage collection/analysis (native tooling), project-wide .NET coverage/CRAP (coverage-analysis)

repo: dotnet/skills

लोकप्रियता

GitHub स्टार
5.8k
रैंकिंग में स्थान
#14637
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills