Tuesday, November 20, 2012

Kata battles: Toolset edition

I was fiddling with the Coin Changer Kata, an exercise meant to build skill through repetition.  It turns out that a Code Kata is also an interesting way to compare toolsets.  I was working in two very different languages with different environments.  We will give the languages a little anonymity in order to delay judgement.

The first language I tried is a runtime interpreted language, scripting language if you will.  The environment I used was very light: Vim, a simple testing framework and the interpreter.  It took a little time to get setup and become accustom to the testing style but not long.  The biggest problems I had were with unfamiliarity with the language with checking a list of value.  The red, green, refactor cycle was smooth and fast.  The tests would run super fast so I could write a test, watch it fail, make it pass faster than I can.  The environment was not the bottleneck.  A good setup for increasing skill.

The second language is a compile it then run it language.  Compiled programs are faster right?  Not from what I experienced last night.  The environment is much heavier.  Full IDE, everything is build in.  A simple key combination and the whole project will build.  Automatic completion of nearly everything. Really a cool system, after you download and install all it.  And pay for it if you want even more features.  And pay more for it if you want EVEN MORE features.  So I get the IDE up and runnning.  Start a new project.  Start a test project.  Realize I have no test framework.  Install the test framework we use at work and get going.  And get stuck.  I can no longer build because the test runner has files open that the IDE needs to overwrite.  At this point I decide I need the refactoring tool we have at work.  The refactoring tool comes with a test runner that I like a lot better, but the at home budget dictates that the tool will have to wait.  So I do what we all do when we get stuck.  Google said I need to enable a service on the host computer.  Ok, still does not work.  Restart test runner, no go. Restart IDE and we are in business.  Write a test............red.  Make it pass......... green.  Not time to refactor yet, there is barely any code.  Just enough code to make the test pass in fact.  And good thing we don't have to refactor it takes too long to run the tests.  A few more red and green cycles and I have run out of time.  It take FOREVER to run the tests, and I don't even have to do anything to run them they automatically kick off each time I build.  This is not TDD at its best.  This is not fun.  This is not over.  I know I can get a better setup.  It will just take a little tweaking and fiddling.  I am willing to do that because I know there is a better way.

How many people have tried this TDD thing and become frustrated with a lousy environment?  How many people have been totally turned off to TDD because of issues like this?

Anyway stay tuned to find out how I improve the environment.  I will be benchmarking the before and after times for a whole Kata and also test run times.  I hope to end up with an environment that will let me focus on improving skill rather than de-focus and wander off while my tests are trying to run.


No comments:

Post a Comment