Skip to content

test(analyzers): add package branch coverage tests and benchmark - #174

Merged
e128 merged 1 commit into
mainfrom
ai-sdlc-readier/setup
Nov 16, 2026
Merged

e128 merged 1 commit into
mainfrom
ai-sdlc-readier/setup

Conversation

@e128

@e128 e128 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Executive Summary

The E128.Analyzers package left a large share of its branches without a test. The new test classes drive those branches through the analyzer and code-fix harnesses. Measured with the repository coverage collection, the package branch surface moves from about 87 to about 91 percent.

The same change adds PackageAnalyzerBenchmarks. It finds every analyzer in the assembly by reflection and runs the set over one sample service, so a rule added later joins the run without an edit to the benchmark.

Code Changes

  • tests/E128.Analyzers.Tests: 136 new test classes cover the remaining branches on the analyzer and code-fixer surface. Each class targets one analyzer or code-fix provider and asserts the observable diagnostic or fix behavior.
  • benchmarks/E128.Benchmarks/PackageAnalyzerBenchmarks.cs: measures the consumer build path over the whole analyzer set. GlobalSetup throws when the assembly yields no analyzer, and the run throws when the set reports no diagnostic. The code fixers are not measured.
  • lode/dotnet/benchmarks.md records the benchmark class, the in-process toolchain, and the E128227 suppression the benchmark relies on.
  • lode/dotnet/analyzers/testing.md records the new coverage figure.

Tests and Tooling

  • scripts/check.sh --all: shell lint, format check, build, and test all pass.
  • scripts/test.sh --all --verbose: 5781 passed, 2 skipped. Both skips predate this change.
  • scripts/internal/analyzer-release-check.sh --json: clean. No rule row is missing, duplicated, or orphaned.
  • scripts/readme-table-diff.sh --analyzer --json: no drift.
  • No analyzer source changed, so no version bump and no release promotion ran.

Review Guide

  • PackageAnalyzerBenchmarks reflection lookup and its GlobalSetup guards: confirm the throw conditions match the intent of AnalyzerBenchmarks.
  • Test naming: the coverage classes follow the existing <Subject>BranchCoverage<Kind>Tests convention.
  • The coverage figure in lode/dotnet/analyzers/testing.md is a rounded snapshot and carries the date it was measured.

Rollback

Revert this commit. The change adds tests, one benchmark class, and documentation. It does not touch analyzer source, so no shipped rule changes behavior.

🤖 Generated with Claude Code

Cover the branches left open on the E128.Analyzers and
E128.Analyzers.CodeFixers surface. The new test classes raise package
branch coverage from about 87 to about 91 percent.

Add PackageAnalyzerBenchmarks. It finds every analyzer in the assembly
by reflection and runs the set over one sample service, so a new rule
joins the run without an edit.

Update lode/dotnet/analyzers/testing.md and lode/dotnet/benchmarks.md
to match the new coverage figure and the new benchmark class.

Co-Authored-By: Claude
@e128
e128 merged commit 0e29f62 into main Nov 16, 2026
2 checks passed
@e128
e128 deleted the ai-sdlc-readier/setup branch November 16, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant