News Feed
Jobs Feed
Sections




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

Dagfinn Reiersol's Blog:
Don't refactor without unit tests
September 04, 2009 @ 13:45:59

In a (sort of) response to some of the refactoring posts that Brandon Savage has been posting, Dagfinn Reiersol has suggested something that should have been done from the start - write unit tests before you refactor.

That said, I do have something important to add. The series is missing the first, most basic rule: Don't refactor unless you have good automated test coverage (typically with unit tests). And if there are no test, write them before you start refactoring.

He notes that with successful unit tests in place, you can freely change the underlying structure of the application with (almost) no worries that your application will fall apart the next time it's run. He does point out the need for a bit of refactoring before the tests could really be successfully run (since there's a need for an external twitter connection).

0 comments voice your opinion now!
refactor unittest peerreview


blog comments powered by Disqus

Similar Posts

Fabian Schmengler's Blog: "Mocking" built-in functions like time() in Unit

Sebastian Bergamnn's Blog: SeleniumTestCase Improvements in PHPUnit 3.2

Christer Edvartsen's Blog: Running Multiple Versions of PHPUnit

Sebastian Bergmann's Blog: Copy & Paste Detection in PHPUnit 3.2

Sebastian Bergmann's Blog: PHPUnit 3.5: Refactoring to Components


Community Events











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


symfony2 install introduction podcast facebook component language release database project hhvm composer framework example performance application unittest package security hack

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