News Feed
Jobs Feed
Sections




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


blog comments powered by Disqus

Similar Posts

Wouter Lagerweij's Blog: Reading Up: Books Every Programmer Should Read

Codewalkers.com: New Tutorial - Coding \"Best Practices\" - or at least \"Better Practices\"

Bhaskar Karambelkar\'s Blog: Prototyping LAMP with WAMP

Juozas Kaziukenas' Blog: Zend Framework and Doctrine. Part 2

Felix Geisendörfer's Blog: Containable 2.0 BETA


Community Events









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


phpunit object podcast tool example introduction zendframework2 release language interview unittest testing development code opinion framework database api community composer

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