# Cairo Level 10: Testing

> Level 10: Testing of the LoWisa Cairo course: Cairo Tests, Starknet Contract Tests, Failure and Edge Cases. 3 lessons and 9 ideas, each explained in one line.

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

## 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

- **Before:** [Level 9: Accounts & Transactions](/courses/cairo/level-9-accounts-and-transactions/): Starknet Accounts, Transactions, Fees and Execution.
- **Next:** [Level 11: Security](/courses/cairo/level-11-security/): Access Control, Contract Threats, Secure Starknet Design.

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](/help/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.

---

Source: https://lowisa.dev/courses/cairo/level-10-testing/ · Updated 2026-11-30
