View ScreencastDownload code

Before I begin posting code for this library, I just wanted to say a few words about how I develop software. I generally follow a test-driven development (TDD) methodology when writing code. For those not familiar with TDD, it is an automated unit testing method where you write a single test that describes a feature you are attempting to implement. You then write code and run your test to verify that the feature has been implemented successfully. As development progresses, you continually add tests for each feature that you want to implement. Each time you retest your code, you are also regression testing previously implemented features. And at the end of it all, assuming you have written good tests, you should have a very well unit-tested code base.

As a single developer, it is vitally important for me to be able to test code quickly and repeatedly without having to spend a lot of time manually testing or reviewing test outputs. Regression testing to make sure new code hasn’t broken old code, can take a particularly long time to test. Automated test-driven development results in a single pass or fail result, and points to the exact feature that failed. You can go back to your code months later, add a new feature, and fully test the whole code base again. TDD is thorough and efficient.

I use YUI Test for automated test-driven development. Perhaps I’ll create my own testing suite at some point (as part of this new library), but that’s not a wheel I want to re-invent right now. Watch the screencast to see a basic overview of how I use the YUI Test library to unit-test my code.