A Path Less Taken

Breaking with convention in a very conventional fashion. Powered by WordPress

"What would you attempt to do if you knew you could not fail?"
Dr. Robert Schuller

Sunday, May 24, 2009

Category: PHP Development Author: JJ 0 Comments

Recently I followed some blog posts to an interesting link. It was a video of Robert Martin giving the keynote address to the RailsConf 09. The conference is a gathering of Ruby developers and is specifically targeted at (or hosted by) the Ruby on Rails community. This year’s keynote speech was entitled “What Killed Smalltalk Could Kill Ruby, Too.”

The link to the video is here. Although the speech is intended as a cautionary tale for the Ruby community, there is a section where Robert pontificates on Unit Testing. In particular, he says that Test Driven Development has 3 main tenants. These include:

  1. You cannot write a line of production code until you have written a failing unit test.
  2. You cannot write more of a unit test than is sufficient to fail.
  3. You are not allowed to write more production code than is sufficient to pass the failing test.

Being new to unit testing this got my attention. I decided to kill 2 birds with one stone by resuming my work on http://www.legendrefamily.org and using this as an opportunity to try out one of the unit testing frameworks.

Choosing a losing framework seems to be my middle name. It came down to 2 likely candidates. Marcus Baker’s SimpleTest and Sebastian Bergmann’s PHPUnit. I decided to give PHPUnit a go since I follow Sebastian’s blog. I found an article here that I’m going to use as a starting point. As always, I’ll let you know how it goes.

Peace

No comments found. Please enter a comment if you have a question or contribution.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">