For software development professionals interested in quality code

QualityCode Projects

Significant projects I am working on or have worked on

Test-First Design (TFD) Experiments

Each of these projects was coded purely test-first, in Ruby. That is, I would write a line or two of test code, and then write the actual code that would make the test pass. In the first two cases, the design that evolved was not even close to the design I had anticipated when I started. Unfortunately, I didn't have a pair available, so they were coded solo (XP-for-one).

Roman Numeral Converter. Convert between integers and roman numerals. This was inspired by a post on the XP list. Initially I wrote integer-to-roman. Later, I added roman-to-integer, and was surprised how it fell into the same pattern. Here is the ruby source code and here are the unit tests

Bowling scorer. This was inspired by a mention on the XP list about this ObjectMentor article. Here is the ruby source code and here are the unit tests

BigHoleFinder. This was inspired by a posting on the XP list asking how one might use TFD to solve this problem: Given a grid, with cells that are "full" or "empty", find the largest contiguous group of empty cells. Continguous means connected horizontally, vertically, or diagonally. Perhaps this is related to a Go game. My solution is straightforward, but not particularly efficient. The problem as stated didn't have space or speed constraints. Here is the ruby source code and here are the unit tests

Refactoring Experiments

I love to refactor. Simplifying code, removing duplication, and making it clearer...ah, those are just so much fun.

Here's how I refactored a string parser in Ruby.