Testing Solana programs
Run the default test suite
anchor test starts a local validator, deploys your program and runs the tests in tests/.
anchor testFaster in-process tests
For quicker feedback, Rust-based harnesses such as LiteSVM and Mollusk run programs in-process without a validator. Check each project's README for current APIs.
Test the failure paths
For each constraint, write a test that passes the wrong account (wrong owner, wrong signer, wrong PDA) and asserts that it fails. Most exploits live in missing checks, not in the happy path.
Fuzz
Trident is a fuzzing framework for Anchor programs.
Commands and APIs change, so the official Solana docs and Anchor docs are the source of truth.