Skip to content

Mutation testing on CollateralManager and wallet_auth #294

Description

@YaronZaki
  • Difficulty: advanced · Effort: L · Priority: P2
  • Impact: protocol math, auth invariants
  • Problem Statement
    Coverage tests tests/test_collateral_manager_props.py prove the
    tests ran but not that they caught a bug. Mutation testing
    introduces deliberate bugs and measures how many the test suite
    catches (mutation score).
  • Why It Matters
    A calculate_health_ratio mutation that swaps <= with < will
    pass a coverage test but kill a liquidatable user. A signature
    mutation that skips nonce expiry will pass coverage tests and
    open replay attacks.
  • Expected Outcome
    mutmut or cosmic-ray runs in a separate CI matrix on a curated
    subset of files: quantara/soroban/adapters/CollateralManager.py and
    quantara/web_app/api/wallet_auth.py. Mutation score > 80% enforced.
  • Acceptance Criteria
    • Mutation score report in tests/mutation/<date>.html.
    • New mutants introduced by hand (operator swaps <= for <,
      == for is) are caught by the existing test suite.
  • Implementation Notes
    mutmut run --paths-to-mutate quantara/soroban/adapters/CollateralManager.py
    mutmut html
  • Files / Modules Affected
    • quantara/soroban/adapters/CollateralManager.py
    • quantara/web_app/api/wallet_auth.py
    • new .github/workflows/mutation.yml
  • Dependencies: standalone; pairs with #69 (property-based).

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26ciImported from PRODUCTION_ISSUES.mdpriority/P2Imported from PRODUCTION_ISSUES.mdtesting

Type

No type

Fields

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