Sam Newman recently blogged that he was struggling with Test-Driven Clojure:
"Stuart Halloway said during his Clojure talk at Qcon SF that despite being a TDD fan he finds it hard to TDD in a new language, and I get exactly what he means. A big part of it is that you’re getting to grips with the idioms, capabilities, libraries and tools associated with your new language – and a lack of this knowledge is going to impact on your ability to write good tests, let alone worry about implementing them."
I thought the same thing, so I packaged up a set of scripts in a gem called Shubox. Shubox provides the ability to generate a TDD sandbox with all the libs and scripts you need for an automated suite of regressions tests. I have environments for Ruby, Java, and Clojure at the moment. The name comes from Shu Ha Ri - when you find yourself in a novice Shu state with all or part of a language, I hope that Shubox will provide a training ground for you to experiment, learn, and eventually move to the next level.
All the documentation you need to get started is with the code on Github at http://github.com/bobbyno/shubox. Shubox is built with RubiGen, the same generator framework in Rails. Adding support for a new environment really comes back to answering Sam’s question about finding an idiomatic approach for TDD in each language. I plan on adding many more environments and would like to at least keep up with Bruce Tate’s Seven Language in Seven Weeks. Patches for new language support or updates to the existing environments would be welcome.
Those of you who saw my presentation about Test-Driven Learning at Software Craftsmanship North America last summer know that I’m interested in using learning tests to better learn languages, patterns, idioms, etc. through repeated practice. I’ve found test-driven learning of this sort to be an excellent compliment to other forms of experimentation, such as katas or small applications.
I’ve been using TDL to experiment with functional programming as of late: Shubox contains an example in Clojure from Stu Halloway’s Programming Clojure. More on that soon.Tweet