I have been doing a lot of Unit Testing in my day job using NUnit as the framework. I find writing code to test code is very interesting and makes my coding efforts less bug prone. However in my off time I often mess around with non .Net programming projects and I miss the ability to write test code in these projects. Well it is not too hard to follow the same sort of unit testing practices when you do not have a testing framework in place.

Just recently I was writing some BX24 code for a robotic project. I needed to create some conversion procedures to go from a Byte/Integer to a String and a String to a Byte/Integer. How would I determine that my new procedures would work as designed? Certainly I could not rely on the production robot code to test the conversion procedure.

The BX24 programming language has the concept of projects and source modules. A project is nothing more than a collection of source modules. One of the source modules must be the main entry point of the project for starting execution. This concept allows me to simply create test projects that are designed to test a single source module.

So I moved my conversion procedures into a Conversion Module and made a Conversion Test project. Then I proceeded to write test code in the main module of the Conversion Test project to exercise the Conversion Module. I now had unit tests that exercised the outer bounds of the Conversion Module. I proceeded to fix bugs in the Conversion Module until all tests passed.

Of course without a framework I did not have the nice GUI with Red/Green lights to tell me a test passed or failed but it sure did help me determine if my module was fully functional or not. So if you have a programming project that does not have a nice unit testing harness but your IDE supports module level programming you to can use the above techniques to write bug free code.

Looks like Scott Hanselman is gearing up for some .Net Hardware related articles. Some of his brainstorming ideas are similar to my Home Automation Ideas. Like the use of X10 and a Video Monitor for the front door (Although I see I never documented the Video idea on my wiki). Maybe I can leverage some of the ideas Scott is going to write about.

Although his Lego Robot idea may not be Home Automation specific it sure comes close to the project I did with the ER1 robot from Evolution Robotics a couple years ago. I used C# to extend the capabilities of this wonderful robot.

I think I should break my project into more manageable sub-projects just to get something going. My Home Automation project is not getting off the ground so far. At least I documented a few ideas so I can get back to it.

A while back I wrote some small articles on robotics for the local Hobby Robotics Web Page

Building a Maze Robot - How I built a maze robot to win a robotic competition in Phoenix Arizona

30 Days of ER1 - Details about using the ER1 robot from Evolution Robotics for 30 days.

These guys used some of my Vector 2X code I published a long time ago in their class project