You need to understand the differences between test Ethereum networks, public Ethereum networks and private Ethereum networks first. Read more about Ethereum public, test and private networks here. Also, each test network has its own compatibility with different Ethereum clients.
So, you are supposed to test your code using Ethereum private networks or test networks like Rinkeby and then deploy it to Mainnet.