Joel Hainley : San Francisco Bay Area Software Consultant

  • rss
  • Home
  • About
  • Reading Lists
    • 2008 Reading List
    • 2007 Reading List
    • 2006 Reading List
    • 2005 Reading List
    • 2004 Reading List
    • 2003 Reading List
    • 2002 Reading List
    • 2001 Reading List
    • 2000 Reading List
    • 1999 Reading List
    • 1998 Reading List
  • Software
    • mcalc - a tournament poker utility
    • Joel’s "Super Fancy"(tm) Maximum Heart Rate [MHR] Worksheet

Unit Testing….NUnit, PHPUnit, Smarty..and stuff

October 17, 2006

My personal project has been coming along quite nicely recently, I have been retooling my PHP framework to be able to utilize the Smarty templating engine and it has been going really well. I rewrite several pages using smarty and i am terribly enthused about how clean things have become. My framework went to great efforts to keep things as clean as possible but this makes the whole system significantly cleaner. Very VERY nice.

I have also been spending some time fiddling around with unit testing in both php and .net using PHPUnit and NUnit respectively.

In the .NET project i’ve been working on I started writing unit tests alongside the creation of the application. This has already saved me quite a bit of time in terms of changes in various objects/classes breaking things in unexpected ways. I am almost sold on the whole concept, my initial thoughts around this were that the unit tests would be instructive for the initial development but their benefits would not be realized until the client requested new features to be implemented, at this point I could make the changes and then ensure that the application had been broken because of these changes. However, there have been many times that I have found the unit tests very useful during development, whether it is catching coding errors, or providing a convenient way to run a bit of code and see how it behaves.
This has carried over to the personal project and efforts to get PHPUnit setup and tests written for all of my business objects. Work is going a little slower on this mostly due to challenges I had with Centos but I have done a few small tests and everything seems to be in working order. I am probably going to write tests for all of the new classes, and then build the tests for the existing objects when I touch them.

One thing that has worked extremely well for me is to start each session off by writing a couple of unit tests, or going through the testing code and seeing if there’s any way I can test something better. It helps get me into the groove of writing code, and gets my head in the project, but it doesn’t just dump me right into the middle of the business logic. I can sorta ease my way into it. Write a test..did it pass? Cool..or damn! why not?. I’m a big believer in inertia when it comes to development, you’ve gotta crank through a few things, get the mind, and fingers, warmed up then start to tackle some of the bigger things.

Categories
programming
Comments rss
Comments rss
Trackback
Trackback

« Foxys Fall Classic Proof of my lack of brilliance »

Leave a comment

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>

Navigation

  • .NET
  • 30-Day-Challenge
  • Amateur Radio
  • bicycle
  • books/reading
  • business
  • c#
  • cackl
  • Exercise
  • flex
  • friends
  • hamtesting.com
  • knuth
  • lectures
  • life
  • observations
  • people watching
  • personal finance
  • philosophy
  • php
  • picprep
  • programming
  • reading
  • santa barbara
  • scheme
  • school
  • seo
  • uISV
  • Uncategorized
  • web services
  • website

Search

Archives

  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • November 2007
  • October 2007
  • September 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • January 2007
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006

Site Pages

  • About
  • Reading Lists
    • 1998 Reading List
    • 1999 Reading List
    • 2000 Reading List
    • 2001 Reading List
    • 2002 Reading List
    • 2003 Reading List
    • 2004 Reading List
    • 2005 Reading List
    • 2006 Reading List
    • 2007 Reading List
    • 2008 Reading List
  • Software
    • Joel’s "Super Fancy"(tm) Maximum Heart Rate [MHR] Worksheet
    • mcalc - a tournament poker utility

friends

  • Ashley McNamara Photography
  • Colin McNamara

my websites

  • HamTesting.com
  • Photos
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox