Skip to content

Add Arbitrary as Optional Dependency #397

Open
@jonathan-g-davis

Description

@jonathan-g-davis

High level description

To streamline fuzz testing in ANISE, we propose adding the arbitrary crate as an optional dependency, enabled via a feature flag. Currently, fuzz testing requires duplicating structure definitions to support random input generation, leading to maintenance overhead and potential inconsistencies.

By leveraging derive(Arbitrary), we can automatically generate random inputs for fuzz tests, reducing boilerplate code and ensuring that structure definitions remain consistent across the library. This change will simplify fuzz test setup while maintaining flexibility for users who do not need fuzz testing.

Requirements

  • Add arbitrary as an optional dependency
  • Introduce feature flag (e.g. fuzzing) to control its inclusion
  • Annotate structs in ANISE with controlled derive statements
  • Refactor fuzz targets to use ANISE structs
  • Remove redundant structure definitions

Test plans

  • Ensure that all fuzz targets can be compiled and run
  • Add a test build with cargo check –all-features to verify optional dependency correctness

Design

  • Feature flags ensure that arbitrary is only included when needed for fuzz testing.
  • Annotating ANISE structs reduces maintenance effort for fuzz testing and avoids code duplication
  • The feature flag will avoid code bloat and backward compatibility for normal library use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions