harness-writing

Design fuzzing harnesses for C++, Rust, and Go with FuzzedDataProvider.

9|4|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/marduk191/qwen3_mcp --skill harness-writing-marduk191
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: harness-writing
Source: https://github.com/marduk191/qwen3_mcp/tree/main/skills/testing-handbook-skills/skills/harness-writing
Command: npx skills add https://github.com/marduk191/qwen3_mcp --skill harness-writing-marduk191

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlines the creation of robust fuzzing harnesses across multiple languages, reducing setup time and increasing test coverage.

Core Features & Use Cases

  • Guidelines for building minimal, portable fuzzing harnesses for C++, Rust, Go, and other ecosystems.
  • Structured input techniques and best-practices (e.g., FuzzedDataProvider, determinism, and global-state resets) to ensure repeatable crashes.
  • Use Case: When integrating fuzzing into a multi-language project, this skill guides targets, templates, and evaluation of harness effectiveness.

Quick Start

Create a minimal LLVMFuzzerTestOneInput harness in C++ for a new target and show how to integrate FuzzedDataProvider.

Frequently Asked Questions about harness-writing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a fuzzing harness for C++ using libFuzzer?

A fuzzing harness for libFuzzer in C++ requires a minimal LLVMFuzzerTestOneInput function that feeds structured input to your target API, ensuring deterministic behavior and global-state resets to produce repeatable crashes.

What is FuzzedDataProvider and when should I use it in a fuzzing harness?

FuzzedDataProvider is a structure-aware input technique used in fuzzing harnesses to generate structured test data. Use it when fuzzing APIs or parsers that require specific data formats, ensuring inputs are valid and maximize test coverage.

Can I use the same fuzzing harness design for Rust and Go projects?

Yes, you can design portable fuzzing harnesses across Rust and Go by applying shared principles like determinism and global-state resets, while adapting the implementation to specific workflows like cargo-fuzz for Rust or go-fuzz for Go.

Why does my fuzzing harness crash non-deterministically across multiple runs?

Non-deterministic fuzzing harness crashes usually occur because of unreset global state between test iterations. Designing your harness to explicitly reset global state and avoid hidden dependencies ensures that crashes are repeatable and actionable.

Does AFL++ require a different fuzzing harness structure than libFuzzer?

AFL++ and libFuzzer both utilize the LLVMFuzzerTestOneInput harness structure, but AFL++ benefits from structure-aware fuzzing techniques and specific instrumentation setups to maximize code coverage when testing complex parsers and data structures.

What is the best way to fuzz test a parser API across multiple languages?

The best way to fuzz test a parser API across multiple languages is to build minimal, portable fuzzing harnesses that rely on structured input via FuzzedDataProvider, ensuring deterministic behavior and global-state resets for reliable crash detection.