Alpha preview. Not for production use.
Working anonymously. to save your work permanently.
New

Testing

Test your smart contracts without deploying to the blockchain using Ghost testing and simulation.

Overview

AVM Studio provides powerful testing tools that let you verify your contracts work correctly before spending any ALGO on deployment.

Ghost Testing

Full contract simulation without blockchain

Simulation

Simulate transactions on deployed contracts

Ghost Testing

Ghost testing lets you test your contract's logic in a sandboxed environment without deploying to any network. It's the fastest way to verify your code works correctly.

Key Features

  • No deployment needed - Test directly from your source code
  • State tracking - See exactly how state changes with each call
  • Execution traces - Step through execution opcode by opcode
  • Cost analysis - See opcode usage and budget consumption
  • Save test suites - Rerun tests after code changes

Creating a Test

  1. Build your contract successfully
  2. Open the Ghost panel (right sidebar)
  3. Click New Test
  4. Configure initial state (if needed)
  5. Add method calls in sequence
  6. Click Run Test
Tip
You can configure initial state values, box storage, and account balances before running your test to simulate different scenarios.

Full Ghost Testing Guide →

Simulation

Simulation lets you test transactions against deployed contracts without actually submitting them to the blockchain.

Use Cases

  • Preview transaction results before signing
  • Test method calls on live contracts
  • Debug failing transactions
  • Estimate execution costs

How It Works

  1. Build a transaction (or transaction group)
  2. Click Simulate instead of Sign & Submit
  3. Review the simulated results
  4. If satisfied, submit the real transaction

Learn more about Simulation →

Understanding Test Results

After running a test, you'll see detailed results:

State Diff

Shows exactly what state changed:

  • Added - New state keys created
  • Modified - Existing values changed
  • Removed - State keys deleted

Return Values

Each method call shows its return value (if any), decoded according to the ABI.

Execution Trace

For debugging, expand the execution trace to see each opcode executed, stack values, and scratch space.

Cost Breakdown

See how many opcodes each operation consumed and how close you are to the budget limit.

Testing Best Practices

  • Test early, test often - Run Ghost tests after every significant change
  • Test edge cases - Verify error handling and boundary conditions
  • Test access control - Ensure unauthorized calls fail appropriately
  • Save test suites - Build up a library of tests you can rerun
  • Test on Testnet - Before Mainnet, always verify on Testnet
Don't Skip Testing
Smart contracts are immutable once deployed. Testing thoroughly before deployment saves you from costly mistakes and redeployments.