Other than the Flow mainnet network, there are two other independent Flow networks - testnet and sandboxnet, that can be used to test applications and contracts before deployment to mainnet.
During a round of network upgrade, Flow testnet is updated first. Hence, testnet can be used to test against the latest node software, Cadence and core contract changes which will eventually be available to mainnet. Sandboxnet is upgraded roughly at the same time the Flow mainnet is upgraded and always closely resembles the Flow mainnet. Sandboxnet can be used as a testbed before deploying your changes to mainnet.