Experimenting with Test Driven Development: BEHOLD The GUMBALL machine!

by Zachary on December 2, 2009

in Creations

Last weekend I got the itch to do some development again, so I built myself a gumball machine out of PHP. I haven’t built an actual interface for the machine, but I wanted to see if I could create a system using TDD that didn’t require a user interface at all. I normally build interface back, so this was something of a challenge for me.

The source code is freely available to steal, call your own, and sell for billions of dollars without crediting me. However, if I see a gumball machine in Windows 8 I’ll know why! Download it right now!

{ 1 comment… read it below or add one }

Matt December 9, 2009 at 8:21 pm

Are there TDD style unit test for anything but the machine class?

Before any one can steal it and make 1 billion dollars they need a gum ball class that does not get randomly constructed.

Also, you gum ball machine is not too profitable because it does not seem to store the coins! Save them! The proprietor will need them to buy more gum balls for the machine!

OO note: Your verbs are on the wrong object. Like retrieveGumballFromPedastel. A hungry little kid should be doing it; not the machine itself.

Leave a Comment