The best solution is to use build scripts (.bat and .vbs files) to automatically create a setup package that can be used to deploy to testing and production environments. For backend changes, you can either include the change scripts with the setup package (if it's a localised database), or run those scripts as part of your deployment process.
Read more about setup packages at SSW's Wise Standard for Products.
Now make each environment clear.
Whenever an application has a database, have a visual indicator. I recommend a different background color for each environment
- Red for the Development database
- Yellow for the Test database
- Grey (no colour) for the Production database
Note: The Yellow might have been Orange (kind of like traffic lights) but the color palette in Word doesn't give Orange.
Figure: colors in Word color palette
This prevents testers from accidentally entering test data into the production version.
Windows Forms Tip: Implement in the base form in the header
ASP.NET (at least version 2.0) Tip: Implement in the master form in the header
Figure: Spice up your environments with different colors
An application of this rule is how we identify our CRM servers - see rule Do you identify Development, Test and Production CRM Web Servers by colors?