I have added a visualforce page, an Apex class and a test class in my developer org, I need to deploy these to sandbox org and subsequently to production org. What are the best practices to do that?
There are two main ways to deploy changes from one sandbox to another (or to production).
- Change Sets
- Ant based deployment
In your case, you'd be best to use Change Sets.
A Change Set is good for small tactical changes, or when you don't have the infrastructure or knowledge to perform ant based deployment. It's easy to select the components you want to deploy, and easy to set the target org. You don't need to bring code on to your local machine, so using Change Sets mean you can stay 100% in the cloud.
Ant based deployment
And based deployments tend to have a much higher set up time/cost and it's usually central to a different development process. You'd use an Ant based deployment in a larger team or longer term project.
Typically you'd be storing your code on your local machine and pushing changes to a git (or similar) repo. The Ant tools then use this code to deploy to your target org. A benefit of doing it this way is you can automate your deployments and include a CI sandbox/process. It can also make it easier to deploy to multiple sandboxes.