Skip to content

Add Fuzz or Property Tests for Numeric Inputs #109

@Baskarayelu

Description

@Baskarayelu

Description:

Property-based or fuzz testing can uncover integer overflow, unexpected rounding, or invalid-state edge cases that hand-written tests miss. For example: calculate_split with very large total_amount or odd percentages; add_to_goal with amounts that could overflow current_amount; create_bill with boundary amounts or dates. This issue asks the team to evaluate adding property/fuzz tests (e.g. with proptest or quickcheck) for at least one contract and its numeric operations, or to document why it is not feasible (e.g. Soroban test env limitations, no_std, or seed stability) so that future contributors know the tradeoff.

Requirements

Evaluation: Determine whether proptest, quickcheck, or another property-test crate works in the Soroban test environment (no_std, custom env). If yes: add at least one property test (e.g. for calculate_split: for any total_amount and valid split percentages, the sum of returned amounts equals total_amount; or for add_to_goal: adding positive amounts never decreases balance). If no: add a short note in the test module or docs explaining that property tests are not run and that edge cases are covered by unit tests.

Scope: Focus on numeric-heavy functions: remittance_split calculate_split, savings_goals add_to_goal / withdraw_from_goal, bill_payments create_bill amounts, insurance create_policy amounts.

Acceptance Criteria

  • At least one contract has a property or fuzz test for numeric behavior; or a documented explanation of why such tests are not included.
  • No regression in existing unit tests; CI still passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions