Having properly complete and segregated application system environments is essential when writing and maintaining software in a corporate environment. These environments can make a significant difference in the reliability of the applications systems being developed. In the past, it was not uncommon to have development, testing and production sharing the same environment. With reduced hardware cost and improved server and network technology, it became more common to use safer techniques involving multiple environments.
Developing or testing software in the production environment creates the risk of introducing unstable and untried code, database changes, or data to the systems that keep the business running. At best this practice will steal valuable resources from the production environment, at worst it can cause catastrophic failure of the application and possible data loss.
At minimum there should be two environments in use. One for development and testing and the other for production. This setup is not ideal, but is easier to administer and easier on the pocketbook. When developing in a dual environment setup, the development and testing environment can be set up on machines that are less powerful than those in production.
Ideally, there should be six environments:
The R&D Environment - The R&D environment is a playground for the developers; and is where experiments, "Proof of Concept" projects or prototypes should be developed. Coding is usually based on a designated branch of the code that is used for that specific R&D project. Given the proper hardware and resources, the entire environment should be virtualized; from the development machine to the client machine, to the db server. This virtualization keeps the experimental elements from affecting any of the other environments. If the resources are not available, R&D can be done in the development environment, but more care must be taken to make sure that projects are not affected. Updates should be done to the R&D environments as needed in order to keep the environment as close to production as possible.
The Development Environment - The development environment is where developers do their project work. The code base is usually as much like production code as possible, with the exception of the currently active projects. The development environment can be virtualized, which lends more flexibility to the developer for reworking objects and code that he or she is not happy with. This environment should be as complete as possible, and as close to production in hardware and network setup as possible. In addition to development machines, there should be all needed client machines, file servers, database servers, etc. Updates should be done to the development environment as needed in order to keep the environment as close to production as possible.
The Test Environment - The test environment is where user acceptance testing for a project is done. Any objects moved into the test environment should have already passed internal validation and testing by the development team. From this point on, no new objects or code should be introduced into the environment that has not passed all tests in the previous environment. The test environment should be complete, and as much like the production environment as possible. Ideally it will be an EXACT duplicate of the production environment, but with fewer client machines. The test environment should be refreshed before any updates for user acceptance testing are done. This allows an initial deployment test for the new objects, as well as providing "fresh" data for testing.
The Pre-Production Environment - The pre-production environment exists solely for final deployment testing. Objects should only be introduced into the pre-production environment as part of a "refresh" from production, or a deployment test. The test environment should be an EXACT duplicate of the production environment. The pre-production environment should be refreshed before each attempted deployment test, so the test is as accurate a simulation of the final rollout as possible.
The Training Environment - The training environment is a second production environment. It should be an EXACT copy of the production environment to provide the trainers and their students an accurate representation of the work that the user will actually be doing. All updates to this environment should be the results of a "refresh" from production, and should only be done to keep the environment or the data in the environment up to date.
The Production Environment - The production environment is where business is done, and should only be updated by a thoroughly tested, planned and scheduled deployment. Deployments should include contingency and rollback plans in order to minimize the risk to the environment and the business.
Environments can make or break a development team. Done poorly, the team spends more time dealing with issues or mitigating risks than working on projects. Done properly, complete and segregated environments can help the team develop and maintain reliable systems with minimal defects.