Skip to content

Add property-based testing for finance demurrage calculations #3

@Tristan-Stoltz-ERC

Description

@Tristan-Stoltz-ERC

The finance cluster has 3 fuzz targets in mycelix-finance/types/fuzz/ but could benefit from proptest coverage for demurrage (time-based currency decay).

Properties to test

  • Demurrage is monotonically decreasing
  • Zero time = zero decay
  • Composition of periods equals single long period
  • Currency never goes negative

The fuzz targets already found an f64 rounding bug, demonstrating the value of this approach. Proptest would provide more structured exploration of the input space.

Getting started

  • Look at mycelix-finance/types/fuzz/ for existing fuzz targets
  • Add proptest to mycelix-finance/types/ dev-dependencies
  • Model the demurrage function properties as proptest strategies

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions