Daily Archives: September 20, 2008

Chuck *has* learned a little bit in the past five years

I am pretty happy with myself – in the past five years – I have learned the importance of unit testing. Here I am hacking at my NG LMS based on IMS Learning Tool Interoperability – and instead of just writing a ton of code, I first spend two hours and wrote a PHP unit test framework so I could unit test all of my PHP utility code. It is pretty cool – it makes it so you don’t have to keep pressing REFRESH when you write code and also when you write debug code to exercise code – you just keep it in a unit test as well. I also wrote a PHP logging/debugging mechanism – so I don’t have to keep printing out stuff and then commenting out the prints – the logging automatically gets verbose during unit tests.

Part of this is that I miss Rails – I liked the fact that you could write less mainstream code and fall back on Rails conventions for stuff. Now you might ask – which not use a Rails clone like Ignitor or a bunch of others – the problem with those is that they are too big. I want something that gives me functionality with a single require_once() in my code – and that the distribution is a single or a few PHP scripts and not a BUNCH of hacking on my PHP installation. I want it clean and simple and a natural extension to basic PHP work patterns.

So I have progressed to understanding the importance of Unit tests but have not yet gotten to the point where I am willing to pull in a terabyte of some other framework. Ah well.

Here is sample output:

======Running Unit Tests for ALL-Tests
===Running Unit Test:ALL-Tests function:unittest_debug_01
Line 1
Line 2 <tag>
=============
Line 1
Line 2 <tag>
=============
Line 1
Line 2 <tag> ===Running Unit Test:ALL-Tests function:unittest_debug_02 Line 1 Line 2 <tag> ===Running Unit Test:ALL-Tests function:unittest_nonce_01 2008-09-20T15:22:27Z 9423067 3600 Expired ===Running Unit Test:ALL-Tests function:unittest_nonce_02 Presha1 5a10e285-6a52-4dc6-816b-d917c28302692008-06-03T13:51:20Zsecret postsha1 zhA0wHlwZaavrEIUw0wNPlTR3PQ= digest zhA0wHlwZaavrEIUw0wNPlTR3PQ= Match ===Running Unit Test:ALL-Tests function:unittest_nonce_03 Presha1 5a10e285-6a52-4dc6-816b-d917c28302692008-06-03T13:51:20Zsecret postsha1 zhA0wHlwZaavrEIUw0wNPlTR3PQ= digest zhA0wHlwZaavrEIUw0wNPlTR3PQ= Match ======Completed unit tests for ALL-Tests Result: PPPPP

Saying: Rome was prototyped in a Weekend

I was talking with by buddy Rich on the phone this morning and he was teasing me about trying to write the next generation LMS in a weekend. Last weekend I wrote the client side prototype and this weekend I am writing the server side prototype.
He laughed at my silliness and said “Rome was not built in a day” – my quick retort was “Rome *was* prototyped in a weekend.” He thought it was funny – so I blogged it.