bytecodealliance / bytecodealliance/wit-bindgen

Test Suggestion: Add Fuzzing Tests

オープン
#780 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
help wanted
主要言語
Rust
スター
1.5k
フォーク
286
平均マージ
6時間 32分
マージ済み PR(30日)
19

説明

Fuzz testing is testing mechanism that involves providing pseudo-random data as input into the generators to find correctness issues. There are multiple Bytecode Alliance projects that heavily leverage fuzz testing to improve code quality and find security and correctness issues (e.g. `wasmtime` and `wasm-tools`). So far, there is no fuzz testing existing in this repo. Part of the reasons applying fuzz testing against `wit-bindgen` repo is to raise the bar for generator code quality across multiple languages.

The goal of this issue is to suggest a fuzz framework adding to this repo. It could be as simply as feeding generated valid WIT packages to each `wit-bindgen` generator and check if the generated code are buildable. As the `wit-bindgen-go` maintainer, I hope there is a continuous fuzzing running in the background and invokes `TinyGo` compiler to compile generated WIT bindings. It could go as difficult as making sure the generated code is "correct" - the compiled Wasm modules / components are correct to our expectations.

To get started, I propose to use [`wit-smith`](https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-smith) and [`libfuzzer-sys`](https://github.com/rust-fuzz/libfuzzer) crate and `cargo-fuzz` tool for fuzz testing.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、提案されている wit-smith、libfuzzer-sys、cargo-fuzz のアプローチを確認し、次にこのリポジトリが各 wit-bindgen ジェネレーターをどのように実行しているか、また既存のビルドチェックを調査します。たとえば、有効な WIT パッケージを生成し、生成された bindings を TinyGo でコンパイルするなど、焦点を絞った初期スコープを定義します。完了条件には、再現可能な fuzz target と継続的な実行を含める必要があります。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
go, rust
領域
compilers, testing-qa
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。