php[architect] logo

Want to check out an issue? Sign up to receive a special offer.

Professional Programming: DTAP – Part 2 : Other moving Pieces

Posted by on July 27, 2009

Editor’s Note: This article is second in a three-part series on Development, Testing, Acceptance and Production (DTAP). You can read the first part here .

In the previous part of this series, we discussed the main pieces needed for a proper development environment. However, there are other, smaller pieces, scripts, subsystems and other very important components of a properly-configured development environment that don’t fit in the acronym.

Source Code Control

A well-configured source code control system and source code repository is very important to any development team. Open source
tools like Subversion and CVS are the gold standards in this area, while new tools like GIT are making inroads as well. Whichever tool you choose, make sure it is being used by all and that it is properly configured for your needs.

Unit Testing

If everybody knows that Unit testing is a good idea, why are there teams that still don’t do it? Your testing coverage will vary by client and project, but, at the very minimum, you should have unit tests in place that exercise the major components of your
system.

When and where unit testing is performed depends on what you are comfortable with. Some teams add hooks into their source code control system to run the appropriate checks and accept or deny code based on the success or failure of the unit tests. Other teams, schedule routine checkouts, run the tests for the entire system and publish the results internally for all to see and fix.

However you decide to deploy it, remember that unit testing has a powerful ROI in helping you find bugs early as opposed to late.
For PHP,   PHPUnit is widely accepted as the open-source tool of choice. There are other Unit testing
frameworks available, though.

Integration/regression Testing

I’m always surprised when I find teams that do not perform routine integration and regression testing. Whereas unit testing makes sure all the individual pieces all work properly, integration testing makes sure they all work together. Regression testing, a very important step
that many teams skip, makes sure that test plans from previous phases still work as new code is rolled in.

These tests can be as simple as manually executing a testing plan on a regular basis, to completely automated systems—open source tools like Selenium help automate this step. Setting testing systems up can be seen as burdensome and unnecessary, but the time they save by finding bugs or identifying areas of the code that new features may have affected, may make the difference between being on-time and under budget rather than late and over budget.

Refresh scripts

With the exception of production, all of your servers will need some type of automated “environment refresh” scripts:

  • In Development, these will primarily be scripts that refresh the developer’s local data store with sample data.
  • In Testing, these scripts will checkout the source code and refresh the database with sample data.
  • In Acceptance these scripts will check out the latest tagged code base (or a specific tag) and copy production data over from the production database.

Conclusion

Making sure your system has all the moving parts ready for your developers will make the difference between a system that works and a system that is largely ignored by your developers. In part 3, we will wrap it all up by discussing some of the downsides to implementing a full DTAP environment in your development shop.


Cal Evans is a veteran of the browser wars. (BW-I, the big one) He has been programming for more years than he likes to remember but for the past [redacted] years he's been working strictly with PHP, MySQL and their friends. Cal regularly speaks at PHP users groups and conferences, writes articles and wanders the net looking for trouble to cause. He blogs on an "as he feels like it" basis at Postcards from my life.
 

Responses and Pingbacks

I couldn’t agree more! Having worked in a number of development environments I refuse to work anywhere that doesn’t at lest have a Development/Testing/Production set up.

Can’t wait for the next installment.

Leave a comment

Use the form below to leave a comment: