News Feed
Jobs Feed
Sections



Recent Jobs

News Archive
Jani Hartikainen's Blog:
Unit testing 5 test-driven development
July 06, 2009 @ 22:06:27

Jani Hartikainen has posted part five of his look at unit testing in PHP (with PHPUnit) focusing on test-driven development.

The difference between "normal" and test-driven development (TDD) is that when doing TDD, you write unit tests for your new code before writing the code itself. This way you ensure good test coverage for your code, and your code will also be more flexible and reusable, as you have to design the class interfaces for easy testing.

He looks at some of the basics - like preconditions and postconditions - and how to create the tests for your application before you write a single line of (non-test) code. His examples show evaluations for testing for an empty order and to see if an object has an item in it after it's been added.

0 comments voice your opinion now!
tutorial testdrivendevelopment tdd unittest



Similar Posts

Deepak Radhakrishnan\'s Blog: Configuring Apache - PHP - MySQL on Windows (WAMP Configuration)

Icemelon.com: Dynamic Images in PHP (with GD)

Zend Developer Zone: Create your own widget with PHP-GTK

DevShed: Building Your Own System Tray Application Using PHP-GTK

Padraic Brady's Blog: Mysteries Of Asynchronous Processing w/PHP - Pt 3: Spawned Child Processes


Community Events

phpnw10 PHP Conference 09/10/2010




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


job opinion suggestion conference unittest database symfony plugin curl phpunit development zendframework wordpress framework developer book example podcast codeigniter application

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