---
title: "Coverage analysis: review, setup & limitations · Undominated.ai"
canonical: https://undominated.ai/skills/trailofbits-coverage-analysis/
description: "Turns an uncovered region into the next harness or seed change, instead of treating a long run as done."
---

# Coverage analysis: review, setup & limitations · Undominated.ai

> Turns an uncovered region into the next harness or seed change, instead of treating a long run as done.

[← Explore all skills](/skills/)

TESTING / Trail of Bits

# Coverage analysis

Turns an uncovered region into the next harness or seed change, instead of treating a long run as done.

 [See setup guidance ↓](#setup)[Original source ↗](https://github.com/trailofbits/skills/tree/82fe8226252622fa807643bdca1710901198553a/plugins/testing-handbook-skills/skills/coverage-analysis)

SOURCE REVIEW

 Reviewed 2026-10-14
 Evidence 2 linked sources
 Publisher Trail of Bits
 Licence [CC-BY-SA-4.0 ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/LICENSE)
 Revision 82fe82262526
 [Read what was—and wasn’t—checked ↓](#review)

“Measures and interprets what a fuzzing campaign actually reaches, using llvm-cov, lcov, or a fuzzer's own coverage output. Covers baselining a new campaign, reading coverage reports, and turning uncovered regions into harness, seed, or dictionary work. Use when a fuzzer plateaus, when judging whether a harness is effective, after changing a harness, or when asking why some code is never reached.”

 [Trail of Bits · upstream description ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/plugins/testing-handbook-skills/skills/coverage-analysis/SKILL.md) Our analysis follows below.

01 / THE REASONING

## Why this made the selection.

 - The description says to use it when a fuzzer plateaus.
- The workflow heading is a step-by-step, not a single coverage percentage.

### A good fit for

 - Judging whether a fuzz harness is finished
- Turning an uncovered path into a seed or dictionary change
- Compare corpus reach before and after a harness or seed change

### Weigh up before choosing

 - CC-BY-SA-4.0 applies to an adaptation you redistribute.
- No coverage report was generated in this review.
- Coverage is a reachability proxy, not a vulnerability score. A crashing corpus replay can prevent profile output and leave an incomplete denominator.

02 / THE REVIEW RECORD

## What we actually inspected.

Source review has boundaries. A clear record is more useful than a “safe” badge.

### Material inspected

 - plugins/testing-handbook-skills/skills/coverage-analysis/SKILL.md
- LICENSE

### Our findings

 - Headings include Ideal Coverage Workflow and Step-by-Step.
- The definition prefers post-campaign corpus replay over live fuzzer counters and includes handling for crashing corpus entries and baseline comparison.
- A magic-value example shows an uncovered ELF-header compare and tells the reader to put those bytes in a dictionary.

### Not established by this review

 - The skill was not executed inside a host agent.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

## Add a skill to your workflow.

[Upstream setup instructions ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/README.md)

DOCUMENTED COMMAND

 /plugin marketplace add trailofbits/skills Copy command ↗

Copying does not execute this command. It may retrieve a newer version than the reviewed source.

 - Add the marketplace, then install the testing-handbook-skills plugin, which contains coverage-analysis.
- Do not treat a campaign length as coverage.
- Download the complete bundle from https://undominated.ai/resources/skills/trailofbits-coverage-analysis/bundle.zip and extract it into a new directory. It holds SKILL.md and agents/openai.yaml unchanged at revision 82fe8226, the upstream licence and an attribution file.
- Place the extracted directory in your host's documented skills directory, named coverage-analysis. Keep SKILL.md and the licence together.

### Before you start

 - A fuzzing campaign and its coverage output
- Clang and LLVM tools, or GCC with gcovr; nightly Rust with llvm-tools-preview for cargo-fuzz

### Compatibility

Claude Code plugin marketplace · llvm-cov or lcov

### Local Markdown instructions

 - Read the installed skill files
- Compile coverage-instrumented targets, execute corpus inputs and write raw/merged profiles plus HTML reports.

### Cost model

Source is free to read under the stated licence. A host agent may charge for use.

THE COMPLETE REVIEWED DEFINITION

## Read it before you reuse it.

Original source bytes, with attribution. Review the host-specific setup notes above.

 Copy definition ↗ [Download complete resource + licence ↗](/resources/skills/trailofbits-coverage-analysis/bundle.zip)[Raw Markdown ↗](/resources/skills/trailofbits-coverage-analysis/definition.md)
 ---
name: coverage-analysis
type: technique
description: "Measures and interprets what a fuzzing campaign actually reaches, using llvm-cov, lcov, or a fuzzer's own coverage output. Covers baselining a new campaign, reading coverage reports, and turning uncovered regions into harness, seed, or dictionary work. Use when a fuzzer plateaus, when judging whether a harness is effective, after changing a harness, or when asking why some code is never reached."
---

# Coverage Analysis

Coverage analysis is essential for understanding which parts of your code are exercised during fuzzing. It helps identify fuzzing blockers like magic value checks and tracks the effectiveness of harness improvements over time.

## Overview

Code coverage during fuzzing serves two critical purposes:

1. **Assessing harness effectiveness**: Understand which parts of your application are actually executed by your fuzzing harnesses
2. **Tracking fuzzing progress**: Monitor how coverage changes when updating harnesses, fuzzers, or the system under test (SUT)

Coverage is a proxy for fuzzer capability and performance. While coverage [is not ideal for measuring fuzzer performance](https://arxiv.org/abs/1808.09700) in absolute terms, it reliably indicates whether your harness works effectively in a given setup.

### Key Concepts

| Concept | Description |
|---------|-------------|
| **Coverage instrumentation** | Compiler flags that track which code paths are executed |
| **Corpus coverage** | Coverage achieved by running all test cases in a fuzzing corpus |
| **Magic value checks** | Hard-to-discover conditional checks that block fuzzer progress |
| **Coverage-guided fuzzing** | Fuzzing strategy that prioritizes inputs that discover new code paths |
| **Coverage report** | Visual or textual representation of executed vs. unexecuted code |

## When to Apply

**Apply this technique when:**
- Starting a new fuzzing campaign to establish a baseline
- Fuzzer appears to plateau without finding new paths
- After harness modifications to verify improvements
- When migrating between different fuzzers
- Identifying areas requiring dictionary entries or seed inputs
- Debugging why certain code paths aren't reached

**Skip this technique when:**
- Fuzzing campaign is actively finding crashes
- Coverage infrastructure isn't set up yet
- Working with extremely large codebases where full coverage reports are impractical
- Fuzzer's internal coverage metrics are sufficient for your needs

## Quick Reference

| Task | Command/Pattern |
|------|-----------------|
| LLVM coverage instrumentation (C/C++) | `-fprofile-instr-generate -fcoverage-mapping` |
| GCC coverage instrumentation | `-ftest-coverage -fprofile-arcs` |
| cargo-fuzz coverage (Rust) | `cargo +nightly fuzz coverage <target>` |
| Generate LLVM profile data | `llvm-profdata merge -sparse file.profraw -o file.profdata` |
| LLVM coverage report | `llvm-cov report ./binary -instr-profile=file.profdata` |
| LLVM HTML report | `llvm-cov show ./binary -instr-profile=file.profdata -format=html -output-dir html/` |
| gcovr HTML report | `gcovr --html-details -o coverage.html` |

## Ideal Coverage Workflow

The following workflow represents best practices for integrating coverage analysis into your fuzzing campaigns:

```
[Fuzzing Campaign]
 |
 v
[Generate Corpus]
 |
 v
[Coverage Analysis]
 |
 +---> Coverage Increased? --> Continue fuzzing with larger corpus
 |
 +---> Coverage Decreased? --> Fix harness or investigate SUT changes
 |
 +---> Coverage Plateaued? --> Add dictionary entries or seed inputs
```

**Key principle**: Use the corpus generated *after* each fuzzing campaign to calculate coverage, rather than real-time fuzzer statistics. This approach provides reproducible, comparable measurements across different fuzzing tools.

## Step-by-Step

### Step 1: Build with Coverage Instrumentation

Choose your instrumentation method based on toolchain:

**LLVM/Clang (C/C++):**
```bash
clang++ -fprofile-instr-generate -fcoverage-mapping \
 -O2 -DNO_MAIN \
 main.cc harness.cc execute-rt.cc -o fuzz_exec
```

**GCC (C/C++):**
```bash
g++ -ftest-coverage -fprofile-arcs \
 -O2 -DNO_MAIN \
 main.cc harness.cc execute-rt.cc -o fuzz_exec_gcov
```

**Rust:**
```bash
rustup toolchain install nightly --component llvm-tools-preview
cargo +nightly fuzz coverage fuzz_target_1
```

### Step 2: Create Execution Runtime (C/C++ only)

For C/C++ projects, create a runtime that executes your corpus:

```cpp
// execute-rt.cc
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <stdint.h>

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);

void load_file_and_test(const char *filename) {
 FILE *file = fopen(filename, "rb");
 if (file == NULL) {
 printf("Failed to open file: %s\n", filename);
 return;
 }

 fseek(file, 0, SEEK_END);
 long filesize = ftell(file);
 rewind(file);

 uint8_t *buffer = (uint8_t*) malloc(filesize);
 if (buffer == NULL) {
 printf("Failed to allocate memory for file: %s\n", filename);
 fclose(file);
 return;
 }

 long read_size = (long) fread(buffer, 1, filesize, file);
 if (read_size != filesize) {
 printf("Failed to read file: %s\n", filename);
 free(buffer);
 fclose(file);
 return;
 }

 LLVMFuzzerTestOneInput(buffer, filesize);

 free(buffer);
 fclose(file);
}

int main(int argc, char **argv) {
 if (argc != 2) {
 printf("Usage: %s <directory>\n", argv[0]);
 return 1;
 }

 DIR *dir = opendir(argv[1]);
 if (dir == NULL) {
 printf("Failed to open directory: %s\n", argv[1]);
 return 1;
 }

 struct dirent *entry;
 while ((entry = readdir(dir)) != NULL) {
 if (entry->d_type == DT_REG) {
 char filepath[1024];
 snprintf(filepath, sizeof(filepath), "%s/%s", argv[1], entry->d_name);
 load_file_and_test(filepath);
 }
 }

 closedir(dir);
 return 0;
}
```

### Step 3: Execute on Corpus

**LLVM (C/C++):**
```bash
LLVM_PROFILE_FILE=fuzz.profraw ./fuzz_exec corpus/
```

**GCC (C/C++):**
```bash
./fuzz_exec_gcov corpus/
```

**Rust:**
Coverage data is automatically generated when running `cargo fuzz coverage`.

### Step 4: Process Coverage Data

**LLVM:**
```bash
# Merge raw profile data
llvm-profdata merge -sparse fuzz.profraw -o fuzz.profdata

# Generate text report
llvm-cov report ./fuzz_exec \
 -instr-profile=fuzz.profdata \
 -ignore-filename-regex='harness.cc|execute-rt.cc'

# Generate HTML report
llvm-cov show ./fuzz_exec \
 -instr-profile=fuzz.profdata \
 -ignore-filename-regex='harness.cc|execute-rt.cc' \
 -format=html -output-dir fuzz_html/
```

**GCC with gcovr:**
```bash
# Install gcovr (uv manages the isolated environment)
uv tool install gcovr
export PATH="$HOME/.local/bin:$PATH" # uv's tool bin, if not already present

# Generate report
gcovr --gcov-executable "llvm-cov gcov" \
 --exclude harness.cc --exclude execute-rt.cc \
 --root . --html-details -o coverage.html
```

**Rust:**
```bash
# Install required tools
cargo install cargo-binutils rustfilt

# Create HTML generation script
cat <<'EOF' > ./generate_html
#!/bin/sh
if [ $# -lt 1 ]; then
 echo "Error: Name of fuzz target is required."
 echo "Usage: $0 fuzz_target [sources...]"
 exit 1
fi
FUZZ_TARGET="$1"
shift
SRC_FILTER="$@"
TARGET=$(rustc -vV | sed -n 's|host: ||p')
cargo +nightly cov -- show -Xdemangler=rustfilt \
 "target/$TARGET/coverage/$TARGET/release/$FUZZ_TARGET" \
 -instr-profile="fuzz/coverage/$FUZZ_TARGET/coverage.profdata" \
 -show-line-counts-or-regions -show-instantiations \
 -format=html -o fuzz_html/ $SRC_FILTER
EOF
chmod +x ./generate_html

# Generate HTML report
./generate_html fuzz_target_1 src/lib.rs
```

### Step 5: Analyze Results

Review the coverage report to identify:

- **Uncovered code blocks**: Areas that may need better seed inputs or dictionary entries
- **Magic value checks**: Conditional statements with hardcoded values that block progress
- **Dead code**: Functions that may not be reachable through your harness
- **Coverage changes**: Compare against baseline to track improvements or regressions

## Common Patterns

### Pattern: Identifying Magic Values

**Problem**: Fuzzer cannot discover paths guarded by magic value checks.

**Coverage reveals:**
```cpp
// Coverage shows this block is never executed
if (buf == 0x7F454C46) { // ELF magic number
 // start parsing buf
}
```

**Solution**: Add magic values to dictionary file:
```
# magic.dict
"\x7F\x45\x4C\x46"
```

### Pattern: Handling Crashing Inputs

**Problem**: Coverage generation fails when corpus contains crashing inputs.

**Before:**
```bash
./fuzz_exec corpus/ # Crashes on bad input, no coverage generated
```

**After:**
```cpp
// Fork before executing to isolate crashes
int main(int argc, char **argv) {
 // ... directory opening code ...

 while ((entry = readdir(dir)) != NULL) {
 if (entry->d_type == DT_REG) {
 pid_t pid = fork();
 if (pid == 0) {
 // Child process - crash won't affect parent
 char filepath[1024];
 snprintf(filepath, sizeof(filepath), "%s/%s", argv[1], entry->d_name);
 load_file_and_test(filepath);
 exit(0);
 } else {
 // Parent waits for child
 waitpid(pid, NULL, 0);
 }
 }
 }
}
```

### Pattern: CMake Integration

**Use Case**: Adding coverage builds to CMake projects.

```cmake
project(FuzzingProject)
cmake_minimum_required(VERSION 3.0)

# Main binary
add_executable(program main.cc)

# Fuzzing binary
add_executable(fuzz main.cc harness.cc)
target_compile_definitions(fuzz PRIVATE NO_MAIN=1)
target_compile_options(fuzz PRIVATE -g -O2 -fsanitize=fuzzer)
target_link_libraries(fuzz -fsanitize=fuzzer)

# Coverage execution binary
add_executable(fuzz_exec main.cc harness.cc execute-rt.cc)
target_compile_definitions(fuzz_exec PRIVATE NO_MAIN)
target_compile_options(fuzz_exec PRIVATE -O2 -fprofile-instr-generate -fcoverage-mapping)
target_link_libraries(fuzz_exec -fprofile-instr-generate)
```

Build:
```bash
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .
cmake --build . --target fuzz_exec
```

## Advanced Usage

### Tips and Tricks

| Tip | Why It Helps |
|-----|--------------|
| Use LLVM 18+ with `-show-directory-coverage` | Organizes large reports by directory structure instead of flat file list |
| Export to lcov format for better HTML | `llvm-cov export -format=lcov` + `genhtml` provides cleaner per-file reports |
| Compare coverage across campaigns | Store `.profdata` files with timestamps to track progress over time |
| Filter harness code from reports | Use `-ignore-filename-regex` to focus on SUT coverage only |
| Automate coverage in CI/CD | Generate coverage reports automatically after scheduled fuzzing runs |
| Use gcovr 5.1+ for Clang 14+ | Older gcovr versions have compatibility issues with recent LLVM |

### Incremental Coverage Updates

GCC's gcov instrumentation incrementally updates `.gcda` files across multiple runs. This is useful for tracking coverage as you add test cases:

```bash
# First run
./fuzz_exec_gcov corpus_batch_1/
gcovr --html coverage_v1.html

# Second run (adds to existing coverage)
./fuzz_exec_gcov corpus_batch_2/
gcovr --html coverage_v2.html

# Start fresh
gcovr --delete # Remove .gcda files
./fuzz_exec_gcov corpus/
```

### Handling Large Codebases

For projects with hundreds of source files:

1. **Filter by prefix**: Only generate reports for relevant directories
 ```bash
 llvm-cov show ./fuzz_exec -instr-profile=fuzz.profdata /path/to/src/
 ```

2. **Use directory coverage**: Group by directory to reduce clutter (LLVM 18+)
 ```bash
 llvm-cov show -show-directory-coverage -format=html -output-dir html/
 ```

3. **Generate JSON for programmatic analysis**:
 ```bash
 llvm-cov export -format=lcov > coverage.json
 ```

### Differential Coverage

Compare coverage between two fuzzing campaigns:

```bash
# Campaign 1
LLVM_PROFILE_FILE=campaign1.profraw ./fuzz_exec corpus1/
llvm-profdata merge -sparse campaign1.profraw -o campaign1.profdata

# Campaign 2
LLVM_PROFILE_FILE=campaign2.profraw ./fuzz_exec corpus2/
llvm-profdata merge -sparse campaign2.profraw -o campaign2.profdata

# Compare
llvm-cov show ./fuzz_exec \
 -instr-profile=campaign2.profdata \
 -instr-profile=campaign1.profdata \
 -show-line-counts-or-regions
```

## Anti-Patterns

| Anti-Pattern | Problem | Correct Approach |
|--------------|---------|------------------|
| Using fuzzer-reported coverage for comparisons | Different fuzzers calculate coverage differently, making cross-tool comparison meaningless | Use dedicated coverage tools (llvm-cov, gcovr) for reproducible measurements |
| Generating coverage with optimizations | `-O3` optimizations can eliminate code, making coverage misleading | Use `-O2` or `-O0` for coverage builds |
| Not filtering harness code | Harness coverage inflates numbers and obscures SUT coverage | Use `-ignore-filename-regex` or `--exclude` to filter harness files |
| Mixing LLVM and GCC instrumentation | Incompatible formats cause parsing failures | Stick to one toolchain for coverage builds |
| Ignoring crashing inputs | Crashes prevent coverage generation, hiding real coverage data | Fix crashes first, or use process forking to isolate them |
| Not tracking coverage over time | One-time coverage checks miss regressions and improvements | Store coverage data with timestamps and track trends |

## Tool-Specific Guidance

### libFuzzer

libFuzzer uses LLVM's SanitizerCoverage by default for guiding fuzzing, but you need separate instrumentation for generating reports.

**Build for coverage:**
```bash
clang++ -fprofile-instr-generate -fcoverage-mapping \
 -O2 -DNO_MAIN \
 main.cc harness.cc execute-rt.cc -o fuzz_exec
```

**Execute corpus and generate report:**
```bash
LLVM_PROFILE_FILE=fuzz.profraw ./fuzz_exec corpus/
llvm-profdata merge -sparse fuzz.profraw -o fuzz.profdata
llvm-cov show ./fuzz_exec -instr-profile=fuzz.profdata -format=html -output-dir html/
```

**Integration tips:**
- Don't use `-fsanitize=fuzzer` for coverage builds (it conflicts with profile instrumentation)
- Reuse the same harness function (`LLVMFuzzerTestOneInput`) with a different main function
- Use the `-ignore-filename-regex` flag to exclude harness code from coverage reports
- Consider using llvm-cov's `-show-instantiation` flag for template-heavy C++ code

### AFL++

AFL++ provides its own coverage feedback mechanism, but for detailed reports use standard LLVM/GCC tools.

**Build for coverage with LLVM:**
```bash
clang++ -fprofile-instr-generate -fcoverage-mapping \
 -O2 main.cc harness.cc execute-rt.cc -o fuzz_exec
```

**Build for coverage with GCC:**
```bash
AFL_USE_ASAN=0 afl-gcc -ftest-coverage -fprofile-arcs \
 main.cc harness.cc execute-rt.cc -o fuzz_exec_gcov
```

**Execute and generate report:**
```bash
# LLVM approach
LLVM_PROFILE_FILE=fuzz.profraw ./fuzz_exec afl_output/queue/
llvm-profdata merge -sparse fuzz.profraw -o fuzz.profdata
llvm-cov report ./fuzz_exec -instr-profile=fuzz.profdata

# GCC approach
./fuzz_exec_gcov afl_output/queue/
gcovr --html-details -o coverage.html
```

**Integration tips:**
- Don't use AFL++'s instrumentation (`afl-clang-fast`) for coverage builds
- Use standard compilers with coverage flags instead
- AFL++'s `queue/` directory contains your corpus
- AFL++'s built-in coverage statistics are useful for real-time monitoring but not for detailed analysis

### cargo-fuzz (Rust)

cargo-fuzz provides built-in coverage generation using LLVM tools.

**Install prerequisites:**
```bash
rustup toolchain install nightly --component llvm-tools-preview
cargo install cargo-binutils rustfilt
```

**Generate coverage data:**
```bash
cargo +nightly fuzz coverage fuzz_target_1
```

**Create HTML report script:**
```bash
cat <<'EOF' > ./generate_html
#!/bin/sh
FUZZ_TARGET="$1"
shift
SRC_FILTER="$@"
TARGET=$(rustc -vV | sed -n 's|host: ||p')
cargo +nightly cov -- show -Xdemangler=rustfilt \
 "target/$TARGET/coverage/$TARGET/release/$FUZZ_TARGET" \
 -instr-profile="fuzz/coverage/$FUZZ_TARGET/coverage.profdata" \
 -show-line-counts-or-regions -show-instantiations \
 -format=html -o fuzz_html/ $SRC_FILTER
EOF
chmod +x ./generate_html
```

**Generate report:**
```bash
./generate_html fuzz_target_1 src/lib.rs
```

**Integration tips:**
- Always use the nightly toolchain for coverage
- The `-Xdemangler=rustfilt` flag makes function names readable
- Filter by source files (e.g., `src/lib.rs`) to focus on crate code
- Use `-show-line-counts-or-regions` and `-show-instantiations` for better Rust-specific output
- Corpus is located in `fuzz/corpus/<target>/`

### honggfuzz

honggfuzz works with standard LLVM/GCC coverage instrumentation.

**Build for coverage:**
```bash
# Use standard compiler, not honggfuzz compiler
clang -fprofile-instr-generate -fcoverage-mapping \
 -O2 harness.c execute-rt.c -o fuzz_exec
```

**Execute corpus:**
```bash
LLVM_PROFILE_FILE=fuzz.profraw ./fuzz_exec honggfuzz_workspace/
```

**Integration tips:**
- Don't use `hfuzz-clang` for coverage builds
- honggfuzz corpus is typically in a workspace directory
- Use the same LLVM workflow as libFuzzer

## Troubleshooting

| Issue | Cause | Solution |
|-------|-------|----------|
| `error: no profile data available` | Profile wasn't generated or wrong path | Verify `LLVM_PROFILE_FILE` was set and `.profraw` file exists |
| `Failed to load coverage` | Mismatch between binary and profile data | Rebuild binary with same flags used during execution |
| Coverage reports show 0% | Wrong binary used for report generation | Use the instrumented binary, not the fuzzing binary |
| `no_working_dir_found` error (gcovr) | `.gcda` files in unexpected location | Add `--gcov-ignore-errors=no_working_dir_found` flag |
| Crashes prevent coverage generation | Corpus contains crashing inputs | Filter crashes or use forking approach to isolate failures |
| Coverage decreases after harness change | Harness now skips certain code paths | Review harness logic; may need to support more input formats |
| HTML report is flat file list | Using older LLVM version | Upgrade to LLVM 18+ and use `-show-directory-coverage` |
| `incompatible instrumentation` | Mixing LLVM and GCC coverage | Rebuild everything with same toolchain |

## Related Skills

### Tools That Use This Technique

| Skill | How It Applies |
|-------|----------------|
| **libfuzzer** | Uses SanitizerCoverage for feedback; coverage analysis evaluates harness effectiveness |
| **aflpp** | Uses edge coverage for feedback; detailed analysis requires separate instrumentation |
| **cargo-fuzz** | Built-in `cargo fuzz coverage` command for Rust projects |
| **honggfuzz** | Uses edge coverage; analyze with standard LLVM/GCC tools |

### Related Techniques

| Skill | Relationship |
|-------|--------------|
| **fuzz-harness-writing** | Coverage reveals which code paths harness reaches; guides harness improvements |
| **fuzzing-dictionaries** | Coverage identifies magic value checks that need dictionary entries |
| **corpus-management** | Coverage analysis helps curate corpora by identifying redundant test cases |
| **sanitizers** | Coverage helps verify sanitizer-instrumented code is actually executed |

## Resources

### Key External Resources

**[LLVM Source-Based Code Coverage](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html)**
Comprehensive guide to LLVM's profile instrumentation, including advanced features like branch coverage, region coverage, and integration with existing build systems. Covers compiler flags, runtime behavior, and profile data formats.

**[llvm-cov Command Guide](https://llvm.org/docs/CommandGuide/llvm-cov.html)**
Detailed CLI reference for llvm-cov commands including `show`, `report`, and `export`. Documents all filtering options, output formats, and integration with llvm-profdata.

**[gcovr Documentation](https://gcovr.com/)**
Complete guide to gcovr tool for generating coverage reports from gcov data. Covers HTML themes, filtering options, multi-directory projects, and CI/CD integration patterns.

**[SanitizerCoverage Documentation](https://clang.llvm.org/docs/SanitizerCoverage.html)**
Low-level documentation for LLVM's SanitizerCoverage instrumentation. Explains inline 8-bit counters, PC tables, and how fuzzers use coverage feedback for guidance.

**[On the Evaluation of Fuzzer Performance](https://arxiv.org/abs/1808.09700)**
Research paper examining limitations of coverage as a fuzzing performance metric. Argues for more nuanced evaluation methods beyond simple code coverage percentages.

### Video Resources

Not applicable - coverage analysis is primarily a tooling and workflow topic best learned through documentation and hands-on practice.

The download contains SKILL.md . Extract the whole bundle; the supporting files are required. Inspect the included MANIFEST.json for file hashes.

By **Trail of Bits**. [Exact upstream source ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/plugins/testing-handbook-skills/skills/coverage-analysis/SKILL.md) · [Licence](/resources/skills/trailofbits-coverage-analysis/LICENSE.txt) · [Attribution](/resources/skills/trailofbits-coverage-analysis/ATTRIBUTION.txt)

SHA-256 9f71cfaffec44f159aa333924a25cdbe3eebd221cc7c0b0175fb93794d3ecacc

 Read the applicable licence Attribution-ShareAlike 4.0 International

=======================================================================

Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.

Using Creative Commons Public Licenses

Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.

 Considerations for licensors: Our public licenses are
 intended for use by those authorized to give the public
 permission to use material in ways otherwise restricted by
 copyright and certain other rights. Our licenses are
 irrevocable. Licensors should read and understand the terms
 and conditions of the license they choose before applying it.
 Licensors should also secure all rights necessary before
 applying our licenses so that the public can reuse the
 material as expected. Licensors should clearly mark any
 material not subject to the license. This includes other CC-
 licensed material, or material used under an exception or
 limitation to copyright. More considerations for licensors:
	wiki.creativecommons.org/Considerations_for_licensors

 Considerations for the public: By using one of our public
 licenses, a licensor grants the public permission to use the
 licensed material under specified terms and conditions. If
 the licensor's permission is not necessary for any reason--for
 example, because of any applicable exception or limitation to
 copyright--then that use is not regulated by the license. Our
 licenses grant only permissions under copyright and certain
 other rights that a licensor has authority to grant. Use of
 the licensed material may still be restricted for other
 reasons, including because others have copyright or other
 rights in the material. A licensor may make special requests,
 such as asking that all changes be marked or described.
 Although not required by our licenses, you are encouraged to
 respect those requests where reasonable. More_considerations
 for the public:
	wiki.creativecommons.org/Considerations_for_licensees

=======================================================================

Creative Commons Attribution-ShareAlike 4.0 International Public
License

By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.

Section 1 -- Definitions.

 a. Adapted Material means material subject to Copyright and Similar
 Rights that is derived from or based upon the Licensed Material
 and in which the Licensed Material is translated, altered,
 arranged, transformed, or otherwise modified in a manner requiring
 permission under the Copyright and Similar Rights held by the
 Licensor. For purposes of this Public License, where the Licensed
 Material is a musical work, performance, or sound recording,
 Adapted Material is always produced where the Licensed Material is
 synched in timed relation with a moving image.

 b. Adapter's License means the license You apply to Your Copyright
 and Similar Rights in Your contributions to Adapted Material in
 accordance with the terms and conditions of this Public License.

 c. BY-SA Compatible License means a license listed at
 creativecommons.org/compatiblelicenses, approved by Creative
 Commons as essentially the equivalent of this Public License.

 d. Copyright and Similar Rights means copyright and/or similar rights
 closely related to copyright including, without limitation,
 performance, broadcast, sound recording, and Sui Generis Database
 Rights, without regard to how the rights are labeled or
 categorized. For purposes of this Public License, the rights
 specified in Section 2(b)(1)-(2) are not Copyright and Similar
 Rights.

 e. Effective Technological Measures means those measures that, in the
 absence of proper authority, may not be circumvented under laws
 fulfilling obligations under Article 11 of the WIPO Copyright
 Treaty adopted on December 20, 1996, and/or similar international
 agreements.

 f. Exceptions and Limitations means fair use, fair dealing, and/or
 any other exception or limitation to Copyright and Similar Rights
 that applies to Your use of the Licensed Material.

 g. License Elements means the license attributes listed in the name
 of a Creative Commons Public License. The License Elements of this
 Public License are Attribution and ShareAlike.

 h. Licensed Material means the artistic or literary work, database,
 or other material to which the Licensor applied this Public
 License.

 i. Licensed Rights means the rights granted to You subject to the
 terms and conditions of this Public License, which are limited to
 all Copyright and Similar Rights that apply to Your use of the
 Licensed Material and that the Licensor has authority to license.

 j. Licensor means the individual(s) or entity(ies) granting rights
 under this Public License.

 k. Share means to provide material to the public by any means or
 process that requires permission under the Licensed Rights, such
 as reproduction, public display, public performance, distribution,
 dissemination, communication, or importation, and to make material
 available to the public including in ways that members of the
 public may access the material from a place and at a time
 individually chosen by them.

 l. Sui Generis Database Rights means rights other than copyright
 resulting from Directive 96/9/EC of the European Parliament and of
 the Council of 11 March 1996 on the legal protection of databases,
 as amended and/or succeeded, as well as other essentially
 equivalent rights anywhere in the world.

 m. You means the individual or entity exercising the Licensed Rights
 under this Public License. Your has a corresponding meaning.

Section 2 -- Scope.

 a. License grant.

 1. Subject to the terms and conditions of this Public License,
 the Licensor hereby grants You a worldwide, royalty-free,
 non-sublicensable, non-exclusive, irrevocable license to
 exercise the Licensed Rights in the Licensed Material to:

 a. reproduce and Share the Licensed Material, in whole or
 in part; and

 b. produce, reproduce, and Share Adapted Material.

 2. Exceptions and Limitations. For the avoidance of doubt, where
 Exceptions and Limitations apply to Your use, this Public
 License does not apply, and You do not need to comply with
 its terms and conditions.

 3. Term. The term of this Public License is specified in Section
 6(a).

 4. Media and formats; technical modifications allowed. The
 Licensor authorizes You to exercise the Licensed Rights in
 all media and formats whether now known or hereafter created,
 and to make technical modifications necessary to do so. The
 Licensor waives and/or agrees not to assert any right or
 authority to forbid You from making technical modifications
 necessary to exercise the Licensed Rights, including
 technical modifications necessary to circumvent Effective
 Technological Measures. For purposes of this Public License,
 simply making modifications authorized by this Section 2(a)
 (4) never produces Adapted Material.

 5. Downstream recipients.

 a. Offer from the Licensor -- Licensed Material. Every
 recipient of the Licensed Material automatically
 receives an offer from the Licensor to exercise the
 Licensed Rights under the terms and conditions of this
 Public License.

 b. Additional offer from the Licensor -- Adapted Material.
 Every recipient of Adapted Material from You
 automatically receives an offer from the Licensor to
 exercise the Licensed Rights in the Adapted Material
 under the conditions of the Adapter's License You apply.

 c. No downstream restrictions. You may not offer or impose
 any additional or different terms or conditions on, or
 apply any Effective Technological Measures to, the
 Licensed Material if doing so restricts exercise of the
 Licensed Rights by any recipient of the Licensed
 Material.

 6. No endorsement. Nothing in this Public License constitutes or
 may be construed as permission to assert or imply that You
 are, or that Your use of the Licensed Material is, connected
 with, or sponsored, endorsed, or granted official status by,
 the Licensor or others designated to receive attribution as
 provided in Section 3(a)(1)(A)(i).

 b. Other rights.

 1. Moral rights, such as the right of integrity, are not
 licensed under this Public License, nor are publicity,
 privacy, and/or other similar personality rights; however, to
 the extent possible, the Licensor waives and/or agrees not to
 assert any such rights held by the Licensor to the limited
 extent necessary to allow You to exercise the Licensed
 Rights, but not otherwise.

 2. Patent and trademark rights are not licensed under this
 Public License.

 3. To the extent possible, the Licensor waives any right to
 collect royalties from You for the exercise of the Licensed
 Rights, whether directly or through a collecting society
 under any voluntary or waivable statutory or compulsory
 licensing scheme. In all other cases the Licensor expressly
 reserves any right to collect such royalties.

Section 3 -- License Conditions.

Your exercise of the Licensed Rights is expressly made subject to the
following conditions.

 a. Attribution.

 1. If You Share the Licensed Material (including in modified
 form), You must:

 a. retain the following if it is supplied by the Licensor
 with the Licensed Material:

 i. identification of the creator(s) of the Licensed
 Material and any others designated to receive
 attribution, in any reasonable manner requested by
 the Licensor (including by pseudonym if
 designated);

 ii. a copyright notice;

 iii. a notice that refers to this Public License;

 iv. a notice that refers to the disclaimer of
 warranties;

 v. a URI or hyperlink to the Licensed Material to the
 extent reasonably practicable;

 b. indicate if You modified the Licensed Material and
 retain an indication of any previous modifications; and

 c. indicate the Licensed Material is licensed under this
 Public License, and include the text of, or the URI or
 hyperlink to, this Public License.

 2. You may satisfy the conditions in Section 3(a)(1) in any
 reasonable manner based on the medium, means, and context in
 which You Share the Licensed Material. For example, it may be
 reasonable to satisfy the conditions by providing a URI or
 hyperlink to a resource that includes the required
 information.

 3. If requested by the Licensor, You must remove any of the
 information required by Section 3(a)(1)(A) to the extent
 reasonably practicable.

 b. ShareAlike.

 In addition to the conditions in Section 3(a), if You Share
 Adapted Material You produce, the following conditions also apply.

 1. The Adapter's License You apply must be a Creative Commons
 license with the same License Elements, this version or
 later, or a BY-SA Compatible License.

 2. You must include the text of, or the URI or hyperlink to, the
 Adapter's License You apply. You may satisfy this condition
 in any reasonable manner based on the medium, means, and
 context in which You Share Adapted Material.

 3. You may not offer or impose any additional or different terms
 or conditions on, or apply any Effective Technological
 Measures to, Adapted Material that restrict exercise of the
 rights granted under the Adapter's License You apply.

Section 4 -- Sui Generis Database Rights.

Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:

 a. for the avoidance of doubt, Section 2(a)(1) grants You the right
 to extract, reuse, reproduce, and Share all or a substantial
 portion of the contents of the database;

 b. if You include all or a substantial portion of the database
 contents in a database in which You have Sui Generis Database
 Rights, then the database in which You have Sui Generis Database
 Rights (but not its individual contents) is Adapted Material,

 including for purposes of Section 3(b); and
 c. You must comply with the conditions in Section 3(a) if You Share
 all or a substantial portion of the contents of the database.

For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.

Section 5 -- Disclaimer of Warranties and Limitation of Liability.

 a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
 EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
 AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
 ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
 IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
 WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
 PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
 ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
 KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
 ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.

 b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
 TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
 NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
 INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
 COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
 USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
 ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
 DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
 IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.

 c. The disclaimer of warranties and limitation of liability provided
 above shall be interpreted in a manner that, to the extent
 possible, most closely approximates an absolute disclaimer and
 waiver of all liability.

Section 6 -- Term and Termination.

 a. This Public License applies for the term of the Copyright and
 Similar Rights licensed here. However, if You fail to comply with
 this Public License, then Your rights under this Public License
 terminate automatically.

 b. Where Your right to use the Licensed Material has terminated under
 Section 6(a), it reinstates:

 1. automatically as of the date the violation is cured, provided
 it is cured within 30 days of Your discovery of the
 violation; or

 2. upon express reinstatement by the Licensor.

 For the avoidance of doubt, this Section 6(b) does not affect any
 right the Licensor may have to seek remedies for Your violations
 of this Public License.

 c. For the avoidance of doubt, the Licensor may also offer the
 Licensed Material under separate terms or conditions or stop
 distributing the Licensed Material at any time; however, doing so
 will not terminate this Public License.

 d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
 License.

Section 7 -- Other Terms and Conditions.

 a. The Licensor shall not be bound by any additional or different
 terms or conditions communicated by You unless expressly agreed.

 b. Any arrangements, understandings, or agreements regarding the
 Licensed Material not stated herein are separate from and
 independent of the terms and conditions of this Public License.

Section 8 -- Interpretation.

 a. For the avoidance of doubt, this Public License does not, and
 shall not be interpreted to, reduce, limit, restrict, or impose
 conditions on any use of the Licensed Material that could lawfully
 be made without permission under this Public License.

 b. To the extent possible, if any provision of this Public License is
 deemed unenforceable, it shall be automatically reformed to the
 minimum extent necessary to make it enforceable. If the provision
 cannot be reformed, it shall be severed from this Public License
 without affecting the enforceability of the remaining terms and
 conditions.

 c. No term or condition of this Public License will be waived and no
 failure to comply consented to unless expressly agreed to by the
 Licensor.

 d. Nothing in this Public License constitutes or may be interpreted
 as a limitation upon, or waiver of, any privileges and immunities
 that apply to the Licensor or You, including from the legal
 processes of any jurisdiction or authority.

=======================================================================

Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.

Creative Commons may be contacted at creativecommons.org.

04 / FOLLOW THE EVIDENCE

## The source trail.

Our notes are separate from the original resource. Check upstream before adopting a new version.

 - [Skill definition ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/plugins/testing-handbook-skills/skills/coverage-analysis/SKILL.md) Checked 2026-10-14 https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/plugins/testing-handbook-skills/skills/coverage-analysis/SKILL.md Supports: Workflow and stated scope
- [Repository licence ↗](https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/LICENSE) Checked 2026-10-07 https://github.com/trailofbits/skills/blob/82fe8226252622fa807643bdca1710901198553a/LICENSE Supports: Redistribution terms

KEEP COMPARING

## Other approaches to consider.

Related by category or shared topics. These are alternatives to inspect, not a measured quality order.

 [### AFL++ ↗ Runs AFL++ as a multi-core campaign and forbids afl-system-config on a production or development machine because that script needs root and turns OS protections off.](/skills/trailofbits-aflpp/)[### Atheris ↗ Sets up a Python fuzz harness, including C extensions, instead of treating a unit test as a fuzzer.](/skills/trailofbits-atheris/)[### cargo-fuzz ↗ Requires the nightly toolchain and a fuzz_target harness before a Rust fuzz run counts.](/skills/trailofbits-cargo-fuzz/)

 [AI Tools ↗](/tools/)[Skills ↗](/skills/)[Agents ↗](/agents/)[MCP Servers ↗](/mcp-servers/)[Workflows ↗](/workflows/)

## Continue your investigation

 - [Choose a toolkit](/tools/)
- [Inspect execution hosts](/agents/)
- [Check tool access](/mcp-servers/)
- [Check project dependencies](/check-repo/)
