本文へ移動
cccskills
無料GitHub で公開

coverage-investigation

Investigate and improve code coverage for the wado-compiler crate. Use for any question about what the tests do and do not reach, dead code included.

日本語の概要は準備中です。原文の説明を表示しています。

wado-lang/wadoスター 119(GitHub 119 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Coverage Investigation Methodology

Step 1: Collect Coverage Data

Use cargo-llvm-cov to generate line-level coverage. The tool must be installed via cargo install cargo-llvm-cov.

Each cargo llvm-cov that is not report runs the whole test suite again, so run the tests once and read every report from that run:

cargo llvm-cov clean --workspace   # a stale profile would merge into this run
cargo llvm-cov --no-report -p wado-compiler -p wado-compiler-tests
cargo llvm-cov report --html                                   # target/llvm-cov/html/
cargo llvm-cov report --json --output-path scratchpad/cov.json
jq '.data[0].totals.lines' scratchpad/cov.json                  # overall

Step 2: Identify Low-Coverage Files

Sort files by uncovered line count to find the biggest improvement opportunities:

jq -r '.data[0].files[] | "\(.summary.lines.count - .summary.lines.covered)\t\(.summary.lines.percent | round)%\t\(.filename)"' \
  scratchpad/cov.json | sort -rn | head -30

Focus on files with:

  • High absolute uncovered lines (biggest bang for buck)
  • Low percentage but meaningful code (not just error paths)

Step 3: Classify Coverage Gaps

For each low-coverage file, classify gaps into categories:

CategoryActionCoverage Impact
Dead codeDelete itImmediate improvement, no test needed
Untested language featuresAdd e2e test fixturesMedium effort, high impact
Error handling pathsAdd compile_error test fixturesLow effort
Optimizer-specific pathsAdd wir_expect/wir_not_expect testsMedium effort
Edge cases in codegenAdd targeted e2e testsVaries

Step 4: Analyze a Specific File

To see exactly which lines are uncovered in a file:

# lcov from the same run
cargo llvm-cov report --lcov --output-path scratchpad/lcov.info

# Or read the HTML report from Step 1:
# target/llvm-cov/html/src/synthesis/inspect.rs.html etc.

To find dead code (functions never called):

# Check if a function has any callers
rg 'function_name' wado-compiler/src/ --type rust

Step 5: Add E2E Tests

E2E tests are .wado files in wado-compiler/tests/fixtures/. Each file has a __DATA__ section with JSON expectations.

Guidelines for test files:

  • Name files based on language features, not compiler components (e.g., closure_nested.wado not codegen_closure.wado)
  • Prefer adding test cases to existing fixture files when the feature group matches
  • Each fixture group shares a filename prefix (e.g., closure_*, global_*, match_*)
  • After adding new files: touch wado-compiler/tests/e2e.rs to trigger rediscovery

Test patterns that maximize coverage:

  • test "..." { ... } with {"test": {}} — exercises codegen without needing stdout
  • compile_error tests — exercise error reporting paths
  • wir_expect:O2 / wir_not_expect:O2 — exercise optimizer paths
  • Template strings with {expr:?} — exercise inspect/display synthesis

Step 6: Verify Improvement

After changes, run Step 1 again and compare jq '.data[0].totals.lines.percent' scratchpad/cov.json with the earlier total.

Key Insights from Past Investigations

  • synthesis/inspect.rs (~1400 lines) has dead code for type variants that never appear in practice (e.g., Never type inspect). Deleting dead code directly improves coverage.
  • codegen.rs and emit.rs are the largest files but have relatively high coverage. Incremental improvements here require many targeted tests.
  • The compiler's test suite is driven by datatest_mini which discovers .wado fixtures at compile time — new files need touch wado-compiler/tests/e2e.rs.
  • wado test runs test-world fixtures; wado run runs CLI-world fixtures. Choose the right world for your test.
  • Coverage runs all optimization levels by default in CI; locally only O0 and O2 run unless WADO_FULL_TEST=1.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

benchmark

無料

Measure Wado's performance or the size of the Wasm it generates, and refresh the benchmark/ and wasm-size/ README files. Use for any benchmarking or size-measurement request, whichever benchmark it names.

日本語の概要は準備中です。原文の説明を表示しています。

wado-lang/wado1192026年10月26日 更新

ci-timing

無料

Measure how long GitHub Actions jobs and steps took across past runs, and find the pull request that made CI slower. Use for any question about CI duration, a slow job, or when CI got slow.

日本語の概要は準備中です。原文の説明を表示しています。

wado-lang/wado1192026年10月26日 更新

How to answer code review feedback — a human reviewer, CodeRabbit, or any review bot. Verify the findings, report the classes they are instances of to the user before fixing, then fix the class rather than the sites named. Put design decisions to the user, then run /distill. Invoke when responding to review comments on a pull request, or to the findings of a /code-review run.

日本語の概要は準備中です。原文の説明を表示しています。

wado-lang/wado1192026年10月26日 更新

cr

無料

Review the branch with /code-review at high, then answer the findings with /code-review-response.

日本語の概要は準備中です。原文の説明を表示しています。

wado-lang/wado1192026年10月26日 更新

debugger

無料

Use rust-gdb to inspect variables and step through code without modifying it. Prefer it over print debugging for any investigation into what the compiler is actually doing (lldb is unavailable on Claude Code Web).

日本語の概要は準備中です。原文の説明を表示しています。

wado-lang/wado1192026年10月26日 更新

distill

無料

Cut the branch down to what the code cannot say: reuse what exists, remove duplication, dead code, and wasted work, turn invariants into asserts, and delete the comments the code already speaks. Run it after answering review feedback too — a fix written to satisfy a reviewer is the least distilled code on the branch.

日本語の概要は準備中です。原文の説明を表示しています。

wado-lang/wado1192026年10月26日 更新

wado-lang のスキルをすべて見る

このスキルの問題を報告する