/net10-testing:assertion-qualityfrom net10-testing
Analyze weak, shallow, trivial, self-referential, assertion-free, or presence-only assertions; Contains fragments or totals replacing predictable generated code, JSON, CLI, report, or protocol output. Supports MSTest, Jest, pytest, and Go. DO NOT USE for direct assertion fixes (writing-mstest-tests for MSTest, code-testing for other frameworks), new cases (code-testing), missing scenarios or identified production changes (test-gap-analysis), or general severity-ranked audits (test-anti-patterns).
Ships in net10-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyze whether assertions reject wrong observable outcomes, not merely whether they use varied APIs. Prioritize incomplete checks of predictable output, then assertion-free and vacuous tests. A single exact comparison can fully protect a contract; many fragment checks can leave most of it unprotected. Report diversity metrics only when they help explain a behavioral gap or the caller requests them.
Language-specific guidance: Read the caller-provided or runtime-listed
test-analysis-extensionscatalog, then its matching language file (dotnet.md,python.md,typescript.md,go.md, etc.).test-analysis-extensionsis reference-only; do not invoke it as a skill. If the bundle is absent, use the pinned framework and this skill's rules, report the missing reference, and do not search installation directories.
test-engineer agent (or any test-generation workflow) calls this skill as a pre-completion self-review step on freshly generated tests, before declaring the run finishedcode-testing for any language, or writing-mstest-tests for MSTest specifically)test-anti-patterns)writing-mstest-tests for MSTest or code-testing for other frameworks)| Input | Required | Description |
|---|---|---|
| Test code | Yes | One or more test files or a test project directory to analyze |
| Production code | No | Discover the relevant producer, fixtures, and assertion helpers in the requested scope to establish what output is predictable |
Identify the language and test framework. Read the corresponding file in
extensions/ relative to the supplied test-analysis-extensions catalog.
Use that catalog for other language filenames. Check only that known
directory when necessary; an unavailable reference changes the evidence limit,
not the workspace root or the requested review.
Read all test files the user provides. If the user points to a directory or project, scan for all test files using the markers in the language extension file (e.g., [TestMethod] for MSTest, def test_* for pytest, it() / test() for Jest, func TestXxx for Go).
Inventory every in-scope method before triage. For supplied files, account for each method as weak, meaningful, intentionally partial, or unassessed with a reason. Do not silently drop diagnostic or summary tests because the request's area label emphasizes another output. An exact check of a test-local literal or collection is not production verification; trace the asserted value to the producer before crediting it.
For output-focused tests, read the full body, setup/input, producer, and assertion
helpers before counting assertion categories. Inspect nearby tests for existing
exact-output or parsing helpers, but never credit their assertions to the weak
test. Treat searches for Contains, substring membership, regexes, Any, or
totals as candidates, not findings.
Establish the test's claimed contract and independently expected output. Ask whether a wrong output can preserve every checked fragment or aggregate while breaking that contract. Check content, cardinality, duplicates, ordering when promised, and association with the correct test/provider/stream. A count plus membership checks is not enough if duplicates or substituted records still pass.
| Output under test | Defect fragment/aggregate checks can miss | Focused repair |
|---|---|---|
| Generated source or registry | Extra/duplicate registrations, missing surrounding syntax, wrong registration target | Compare the complete expected generated source, preferably a raw string or existing approved snapshot. Assert the full generated-file set when claimed; compilation/diagnostics complement but do not replace content checks. |
| JSON embedded in HTML or a report | A matching fragment inside unrelated text; correct totals with results assigned to the wrong test | Extract the intended payload with the repository helper, parse JSON, and compare the complete stable structure: result identities, outcomes, counts, and unexpected entries. Do not substring-search JSON or depend on property order. |
CLI --info or provider listings | Correct lines under the wrong provider, extra lines, duplicates, reordered sections | Compare the complete expected line sequence, using the repository's sequence assertion. Include section/provider boundaries. |
| Markdown summaries and deterministic error messages | One correct row/token while the heading, other rows, punctuation, parameter context, or totals are wrong | Compare the full predictable text with an independent raw-string expectation or existing exact-text helper. Exception type alone may suffice when message formatting is not the claimed contract. |
| Terminal events and protocol records | Expected text occurs, but belongs to another test or stream; duplicate/missing/reordered records | Compare complete record tuples including test ID, stream, kind, and payload. Require sequence equality only for promised ordering; otherwise compare multisets that preserve multiplicity. |
| Acceptance run output | Totals match while different tests ran; " total: 3" also matches " total: 30" | Pin selected test identities, outcomes, and complete stable summary lines. Prefer an existing AssertOutputMatchesLines helper after checking its semantics, rather than adding more fragments or a totals-only regex. |
Reuse the framework version and repository conventions: for example,
Assert.AreEqual(expected, actual) for exact MSTest text and an existing
Assert.AreSequenceEqual/CollectionAssert.AreEqual for ordered lines.
Do not prescribe an unavailable API or introduce a snapshot dependency solely
for this review.
Do not force byte equality on nondeterministic output. Normalize only documented variable fields (timestamps, absolute paths, durations, newline conventions), validate their required shape separately, and retain all stable fields and record associations. Never sort away contractual ordering, deduplicate actual records, or strip stable lines just to make an exact comparison pass. Legitimate substring contracts (e.g. a log must include a warning amid unrelated events), partial object contracts, and focused count-only tests are not defects merely because broader equality is possible. Exact output equality also does not need extra assertion types for diversity.
For each test method, identify all assertions and classify them into these language-neutral categories:
| Category | What it verifies | Examples across languages |
|---|---|---|
| Equality | Return value matches expected | Assert.AreEqual (MSTest), Assert.Equal (xUnit), assert x == y (pytest), expect(x).toBe(y) (Jest), assertEquals (JUnit), if got != want { t.Error... } / assert.Equal(t, want, got) (Go), x shouldBe y (Kotest), Should -Be (Pester), EXPECT_EQ (GoogleTest) |
| Boolean | Condition holds | Assert.IsTrue, assert flag (Python), expect(x).toBeTruthy() (Jest), assertTrue (JUnit), assert.True(t, ok) (testify), x.shouldBeTrue() (Kotest), Should -BeTrue (Pester), EXPECT_TRUE |
| Null / None / Nil | Presence/absence of value | Assert.IsNull (.NET), assert x is None (pytest), expect(x).toBeNull() (Jest), assertNull (JUnit), assert.Nil(t, v) (testify), XCTAssertNil (XCTest), Should -BeNullOrEmpty (Pester) |
| Exception / Error | Error handling behavior | Assert.Throws<T>(), pytest.raises(E), expect(fn).toThrow(E), assertThrows<E>, assert.Error(t, err) / assert.ErrorIs, #[should_panic] (Rust), XCTAssertThrowsError, Should -Throw, EXPECT_THROW |
| Type checks | Runtime type correctness | Assert.IsInstanceOfType, assert isinstance(x, T), expect(x).toBeInstanceOf(T), assertInstanceOf, assert.IsType(t, T{}, v), assert!(matches!(value, Pattern)) (Rust), Should -BeOfType |
| String | Text content and format | StringAssert.Contains, assert sub in s, expect(s).toMatch(/x/), assertTrue(s.contains(...)), assert.Contains(t, s, sub), s shouldContain sub, Should -Match, EXPECT_THAT(s, HasSubstr(...)) |
| Collection | Collection contents and structure | CollectionAssert.Contains, assert item in collection, expect(arr).toContain(x), assertIterableEquals, assert.Contains(t, slice, item), col shouldContainExactly listOf(...), Should -Contain, EXPECT_THAT(c, ElementsAre(...)) |
| Comparison | Ordering and magnitude | Assert.IsTrue(x > y), Is.GreaterThan, assert x > y, expect(x).toBeGreaterThan(y), assertTrue(x > y), assert.Greater(t, x, y) (testify) |
| Approximate | Floating-point or tolerance-based | Assert.AreEqual(expected, actual, delta), pytest.approx(y), expect(x).toBeCloseTo(y), assertEquals(x, y, delta), assert.InDelta(t, x, y, delta), EXPECT_NEAR, EXPECT_DOUBLE_EQ |
| Negative | What should NOT happen | Assert.AreNotEqual, assert x != y, expect(x).not.toBe(y), assertNotEquals, assert.NotEqual(t, x, y), refute (Minitest / Ruby), Should -Not -Be |
| State / Side-effect | State transitions and side effects | Assertions on object properties after mutation; mock-call verifications: mock.Verify(...) (Moq), mock_method.assert_called_with(...) (Python unittest.mock), expect(mock).toHaveBeenCalledWith(...) (Jest), verify(mock).method(...) (Mockito), Should -Invoke (Pester), expect { code }.to change(obj, :attr) (RSpec) |
| Structural / Deep | Deep object correctness | Assert.AreEqual with rich-equality types, assertThat(obj).usingRecursiveComparison() (AssertJ), .toEqual({...}) (Jest deep equality), cmp.Diff (Go go-cmp), snapshot tests (.toMatchSnapshot(), syrupy, SnapshotTesting), assertThat(col).extracting(...) (AssertJ chains) |
A single assertion can belong to multiple categories (e.g., Assert.AreNotEqual is both Equality and Negative; expect(mock).toHaveBeenCalledWith(...) is both State/Side-effect and a specific-call assertion).
Read the loaded language extension file for the exact framework-specific list of assertion APIs.
Count test methods exactly from the inventory, then count tests that are assertion-free, trivial-only, self-referential, or incomplete for predictable output. A lone null check is weak only when the contract promises a value; it can fully verify an expected absence. Self-referential means the expected value derives from the actual value or the input cannot distinguish the claimed transformation from a no-op; a round-trip check is valid when preservation is the contract and the input exercises a real transformation.
Category counts describe syntax, not strength. Report them only when the caller asks for metrics, and define every number shown. Never present a category "spread" score or a target percentage, and never recommend negative, exception, or other assertion types to meet a quota. Every count must agree with the per-test findings (for example, do not claim "no state checks" after crediting an equality on a post-action count as a state check).
Before reporting, calibrate findings:
catch, except: pass, catch-and-return) or un-awaited async work
let a throwing operation pass. Never claim a thrown error would pass a test
unless the code shows such a path.IsNotNull is weak when the test promises a particular result but never verifies it. A lone IsNull can completely verify a promised absence, and toBeDefined() can verify a contract that excludes undefined. A null guard before further checks does not make the overall test trivial.toBeDefined() rejects only undefined;
null does satisfy it, but mention that only when null is a realistic
contract-breaking result. toMatchObject(expected) verifies the expected
subset structurally; it neither proves object identity nor full-object
equality. Never claim that it does.Assert.IsTrue(result.IsValid) / assert result.is_valid / expect(result.isValid).toBe(true) check a specific property — these are Boolean assertions, not trivial ones. Always-true assertions (Assert.IsTrue(true), assert True, expect(true).toBe(true)) are trivial.Assert.ThrowsException<T>(() => ...) / with pytest.raises(E): ... / expect(fn).toThrow(E) / #[should_panic] may be the only assertion — that's fine for exception-focused tests. Don't penalize them for low assertion count.verify(mock).method(...) (Mockito), expect(mock).toHaveBeenCalledWith(...) (Jest), Should -Invoke (Pester), bare assert (pytest), if got != want { t.Errorf(...) } (Go) all as real assertions of the appropriate category. Do not treat them as missing-framework-API smells..toMatchSnapshot(), syrupy, SnapshotTesting) count as Structural/Deep assertions. Flag stale or never-updated snapshots separately.@given Hypothesis, proptest!, forAll Kotest) generate assertions implicitly through generated cases — count the inner assertion logic, not the outer scaffold.Scale the report to the request. Lead with the behavioral verdict and concrete findings. Account for every in-scope test, distinguishing deliberate smoke checks from correctness tests. State only counterexamples supported by the assertion predicate and available production behavior.
For predictable-output findings use:
| Test / location | Claimed output and actual check | Wrong output that still passes (static unless executed) | Repair |
|---|
Name each affected method and line range, the accepted defective output, and the
exact comparison, sequence, or parsed fields that reject it. Rank by the size
and consequence of the unchecked contract, not the number of Contains calls.
Keep strong controls and legitimate partial contracts credited. Distinguish
confirmed inspected tests from search-only candidates or unavailable producer
context; do not report an exhaustive count from a grep scan. A static review
does not require editing tests or running mutations.
Otherwise use one compact table:
| Test | Verdict (weak / meaningful / intentional smoke / unassessed) | What it pins, or a wrong result it accepts | Concrete repair |
|---|
Then list repairs in priority order. Each repair names the test and the exact assertion to add or replace; do not recommend assertion types in the abstract. When the caller requests metrics, add a short table of the Step 4 counts with their definitions; omit category breakdowns otherwise.
If the suite is sound, say so first, count its tests exactly, and do not invent findings to fill the report. A mention of an optional improvement must be labelled optional and must not be framed as a defect.
When the user forbids running commands, use only file read/search tools: no shell, build, test, or script execution, even to list files. Report results as static analysis.
toBeDefined versus undefined;
toMatchObject subset matching versus identity/full equality)| Pitfall | Solution |
|---|---|
| Penalizing exception tests for low assertion count | Exception assertions are complete on their own — skip count warnings for these |
| Calling every null/None/nil-only test trivial | Check whether presence or absence is itself the promised outcome |
| Counting any Boolean assertion as trivial | Only always-true assertions (Assert.IsTrue(true), assert True, expect(true).toBe(true)) are trivial |
| Ignoring framework differences | Each framework has distinct assertion APIs — always read the matching language extension first. MSTest's Assert.AreEqual, xUnit's Assert.Equal, NUnit's Is.EqualTo, pytest's bare assert ==, Jest's expect().toBe(), Go's if … { t.Error… } all map to the Equality category |
| Treating bare assertion forms as missing-framework | Bare assert (pytest), if got != want { t.Error... } (Go), and assert!() (Rust) are canonical — count them in the right category |
| Treating mock-call verifications as assertion-free | verify(mock).method(...), expect(mock).toHaveBeenCalledWith(...), Should -Invoke are State/Side-effect assertions |
| Recommending diversity for diversity's sake | Only suggest adding assertion types that would catch real bugs in the code under test |
| Missing implicit assertions | Exception assertions are both Exception and Negative; snapshot/property-based tests are real assertions with implicit structure |
| Async tests with unawaited assertions | TUnit, Jest with .resolves/.rejects, pytest-asyncio, Swift Testing, and Kotest all silently pass tests where assertions are not awaited — treat as assertion-free even when assertion calls are present |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub codehepta/net10-skills --plugin net10-testing20 skills in this plugin
/code-testingALWAYS USE for test work that requires changes: write, add, generate, repair, or strengthen tests for existing code in xUnit, MSTest, NUnit, pytest, Vitest/Jest, Go, or another framework. Includes regression cases, failing or flaky tests, coverage-driven additions, and audit-then-fix requests. Focused work stays direct; broad or multi-stage work invokes test-engineer. DO NOT USE for only running tests, analysis-only audits, framework/platform migrations, a test blocked on a missing production seam (testability-obstacle), or MSTest API/configuration corrections that do not design new cases (writing-mstest-tests). Within an active test-engineer pipeline, reuse supplied guidance and do not re-enter this skill./code-testing-extensionsProvides file paths to language-specific extension files for the code-testing pipeline. Read this reference-only catalog for extension guidance files (e.g., dotnet.md for .NET, cpp.md for C++). Agents and skills read its bundled files directly; do not invoke this catalog through the model's skill tool.Other plugins' skills for the same job
/coverage-analysisActivation requires either supplied .NET coverage reports/percentages/line, branch, or condition metrics, or an explicit request to collect .NET coverage for analysis. USE FOR: interpreting that evidence, including Cobertura data, partial conditions, plateaus, target arithmetic, project-wide coverage-backed CRAP, and coverage-backed refactoring safety. Analyze supplied reports directly without rerunning tests or installing tools. DO NOT USE FOR: requests with neither coverage evidence nor explicit coverage-collection intent, including hypothetical change-survival questions (use test-gap-analysis); CRAP or refactoring safety for one named target (use crap-score); or requests owned by test-tagging, find-untested-sources, test-anti-patterns, run-tests, or code-testing.