nosewheelie

Technology, mountain biking, politics & music.

A New Style of Atomic Testing

without comments

Via Stacy, PicoUnit presents us with a different style writing tests. While I don’t like all of it’s features (take this with a grain of salt as I’ve only read the examples on the site), it takes a radical step away from the traditional XUnit testing frameworks. I’ll dissect it’s features below.

  • Mocking framework - This looks similar to JMock combined with the BDD styles of Ruby mocking RSpec. The syntax is a little confusing, also not sure how it’ll stand up to refactoring.
  • Test discovery - This looks like something I write on most projects (now in Boost). Doesn’t look like there is a way to narrow down the test aggregation, to only pick unit tests as opposed to acceptance tests for example.
  • Injection - This is a neat idea, basically all dependencies are injected (looks like setter & test class constructor are supported). I don’t think this is as clean as the EasyDoc/Boost automocker, though as the code is more explicit, less “magic” is involved.
  • Testing lifecycle - Splitting the idea of a test lifecycle out of a base class is neat. As LifeCycle claims to be a marker interface, I’m assuming that the methods in the implementing class can be named whatever you wish. Not sure how it them differentiates for setUp() tearDown(), etc.
  • Ignore - Not sure how much simpler this is than sticking a couple of letters in front of a test case, or adding an empty suite. Nice idea though.

All in all, PicoUnit is a very healthy thing for the current crop of testing frameworks, a sprinkling of annotations can only get you so far.

While I’m on the new mocking framework bandwagon, here’s another I didn’t know about, Mocha.

Written by Tom Adams

September 15th, 2006 at 1:01 pm

Posted in Java, Ruby, TDD

Leave a Reply