🎛️
UXDProgram (Solana)
  • 💾Welcome
    • Purpose and philosophy
    • Testing
    • Audits
  • 📚Useful Informations
    • Glossary
      • 🪙Depository
      • 🪙Controller
      • 📘CPI
    • ✨Visualisations
  • On-chain Accounts
    • Controller
    • MercurialVaultDepository
    • IdentityDepository
  • Instructions
    • 🟢initialize_controller
    • 🔐register_mercurial_vault_depository
    • 🔐initialize_identity_depository
    • 🔐edit_controller
    • 🔐edit_identity_depository
    • 🔐edit_mercurial_vault_depository
    • 🟢mint_with_identity_depository
    • 🟢redeem_from_identity_depository
    • mercurial
      • 🟢mint_with_mercurial_vault_depository
      • 🟢redeem_from_mercurial_vault_depository
Powered by GitBook
On this page
  • E2E
  • Unit Tests
  • Note

Was this helpful?

  1. Welcome

Testing

There are currently 2 sets of tests in the UXDProgram:

  • End to End (E2E) testing done in Javascript using the uxd-client

  • Unit Testing done in Rust directly in the program source code

E2E

The goal of the E2E tests is to ensure that the program instructions behave as expected, with a variety of input and in different contexts.

There are should fail test that expect a KO, wrong context tests that expect KO, stress tests with intensive calls and sanity tests for accounts and on-chain account states.

These tests are located in the test folder of the uxd-program codebase, they are divided in cases, suites and scenarios.

Case are about unitary instruction calls, with check about this singular logic.

Suites are clusters of Cases put together to form coherent business logic and tests their interactions.

Scenario are the file containing the full groupement of suites for a given collateral for instance.

Unit Tests

Unit tests are aiming at validating and preventing regression on very small logical blocks in the contract, mostly calculation logic.

Note

In a perfect world, there would be a full testing suite, deterministic and reproducible doing E2E like test in rust, as what Serum does. But that is a titan task that hasn't been tackled yet, and that will probably never be.

PreviousPurpose and philosophyNextAudits

Last updated 2 years ago

Was this helpful?

💾