> ## Documentation Index
> Fetch the complete documentation index at: https://docs.state.space/llms.txt
> Use this file to discover all available pages before exploring further.

# How it works

<Steps titleSize="h2">
  <Step title="Deploy & upload your codebase">
    * Upload your code using the Workbench UI interface, or the State Space CLI.
    * Leverage your deployment script to mimic real-world deployment.
    * State Space compiles your code and automatically converts callable functions into visual interactive components.
    * Invite collaborators or auditors to participate.
  </Step>

  <Step title="Design a test scenario">
    * Use the interactive components to design a <Tooltip tip="A test scenario is a sequence of function calls that mimic a user flow (e.g. unit, integration, end-to-end test)">test scenario</Tooltip> via drag-and-drop onto the canvas.
    * Configure transaction parameters and function arguments to behave as symbolic or concrete inputs (e.g. `to`, `from`, `function(..) aruguments`, etc).
    * Unless specified input values default to symbolic to maximize state space and path exploration.
  </Step>

  <Step title="Generate the state space">
    * Autonomously discovers every critical execution path based on your test sequence.
    * Uses symbolic execution to reason about bytecode under a full EVM semantics model.
    * Generates [structured dynamic inputs](/docs/overview/concepts#structured-dynamic-inputs) that trigger each discovered execution path.
    * Monitors, tracks and records contract state and transitions for each transaction, for all discovered paths.
    * Results are cross-referenced with multiple reference EVM implementations.
    * Results dynamically appear during state space exploration process.
  </Step>

  <Step title="Analyze and validate behavior">
    * Analyze coverage metrics (line and branch) at global, contract, and function levels.
    * Improve coverage by iterating or adding test scenarios to your sequence diagrams by viewing highlited covered/uncovered code.
    * Analyze and validate contract state, account values, storage, balances, emitted events, and state changes for correctness.
    * Keep a history log for bug tracking and team code/security reviews & collaboration.
    * Generate attestation documentation from a fully verified state space.
  </Step>

  <Step title="Export to Hardhat and/or Foundry">
    * Export complete, executable test cases to Hardhat or Foundry.
    * Leverage the test cases with symbolic testing or fuzzing tools for further analysis (you'll need to add invariant conditions or assert statements).
    * With every code change, run the same test scenarios again using State Space for regression testing, without needing to manually update test cases.
  </Step>

  <Step title="Invite stakeholders and auditors to participate">
    * Invite non-technical peers (product management, compliance, risk, etc) to review behavior for correctness and compliance.
    * Invite auditors to participate reviewing the test suite and certifying/validating each test case and state change.
  </Step>
</Steps>
