Cairo course

Cairo Level 10: Testing

Testing is level 10 of 14 of the LoWisa Cairo course. It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

Updated 2026-11-30

Cairo Tests

  • Test functions. Tests are #[test] functions: assertions running under Scarb’s test runner.
  • should_panic. The should_panic attribute pins failure paths: guards proven to fire.
  • Pure-core testing. Pure library logic tests off-chain fast: the contract shell kept thin around it.

Starknet Contract Tests

  • Foundry for Starknet. Contract suites run on Starknet Foundry: deploy, call and assert against a local network.
  • Cheatcodes. Cheatcodes bend the world: caller addresses, timestamps, block numbers: scenarios scripted.
  • Fork testing. Fork tests run against real network state: integrations proven against live protocols.

Failure and Edge Cases

  • Panic-path coverage. Every assert and panic is exercised: the security surface is the failure paths.
  • Fuzzing. Fuzz tests hammer entry points with random inputs: edge cases surfaced nightly.
  • Invariants. Invariant thinking holds here too: supply conserved across any call sequence, tested.

Before and after this level

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.

Frequently asked questions

What does Cairo Level 10: Testing cover?

Cairo Tests, Starknet Contract Tests, Failure and Edge Cases: 3 lessons and 9 ideas.

What should I know before this level?

The level before it, Level 9: Accounts & Transactions, which covers Starknet Accounts, Transactions, Fees and Execution.

Learn Cairo on your phone

The first level is free. LoWisa is on Google Play and the App Store.