News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Andrew Podner:
Make it Testable-No Matter how Painful it is
April 04, 2013 @ 09:39:27

In a new post Andrew Podner recommends that, as you're doing your day to day development, you try your hardest to create testable code, no matter how painful it is.

I look at the situation we have gotten into by having this problem [of replacing a large legacy application], and frankly, it is like the tech version of 'Scared Straight'. The paranoia of such a far reaching application within the enterprise that absolutely has to deploy successfully and also be very flexible to meet the needs of the future have driven me to the point of near madness in trying to make sure this thing is bulletproof, enter Test Driven Development.

He includes an example situation he recently was faced with in his code...and opted for the "easy" way out (difficult to test). He talks some about the issues, dependencies and coupled code this has created. He does, however, show a solution to the issue - passing in the dependencies as they're needed, not defining them in the method.

For me, writing custom apps in an enterprise environment is not about rapid deployment and looking like a hero. It is about deploying software with a design life of 7-10 years, because the change management involved in deployment is not something you want be be doing over and over again. Testable code with 100% coverage of unit tests, well developed integration testing, and prolific use of tools like PHPUnit & Selenium are part of the development culture because while speed is important, durability is even more critical to business.
0 comments voice your opinion now!
testable code unittest tdd testdriven refactor dependencies

Link: http://unassumingphp.com/make-it-testable-no-matter-how-painful-it-is/

blog comments powered by Disqus

Similar Posts

Richard McIntyre's Blog: Weaving Lithium #li3 into a legacy PHP application incrementally

PHPMaster.com: Inattention Blindess - Missing the Obvious

Felix Geisendorfer's Blog: Two Tutorials - Title to Slug & Dependencies with If

Alex Inführ: PHP non alpha numeric 7 and 6 char code

James Morris' Blog: Removing Dependencies with the Observer Pattern (SplObserver, SplSubject)


Community Events





Don't see your event here?
Let us know!


symfony community zendserver framework deployment series language opinion update release bugfix podcast package version unittest library laravel api introduction interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework