Doctest, a 'gateway drug'?

Posted by Peter Morris Mon, 14 Apr 2008 03:18:00 GMT

I am quite a proponent of TDD/BDD, my framework of choice being RSPEC within Rails

But, I also understand that for people unused to TDD, the upfront investment seems daunting. So, I was very interested to be told about…

DOCTEST

This seems to be a nice light introduction into TDD. I can see that for extensive test coverage it is going to be a bit of a problem, there being no concept of fixtures etc. But I can definitely see someone adopting DOCTEST and then moving on to Unit testing or RSPEC later.

If you do not already embrace TDD, and recoil at its apparent heaviness, give doctest a look, but remember, tdd can be habit forming.

Agile ain't about FAST.... 3

Posted by Peter Morris Thu, 06 Sep 2007 04:48:00 GMT

… it’s about GOOD.

Using Agile techniques, Rails for instance, or any of the other new frameworks popping up more quickly than mushrooms on a cowturn in a darkened room, and things like TDD, BDD, SPEC driven whatever, is NOT about writing code FASTER than previously.

Its about writing code in an acceptable timescale that is maintainable, extensible and more easily supportable.

Sure, if you develop in rails and forgo all the speccing, test script converage etc, you can write code more quickly than the guy in the next cubicle, but what about the poor bloke (possibly you) who has to support it into the future.

Writing in Rails with good test/spec coverage, and careful design, takes time. But the framework itself saves you enough time with respect to other platforms that this extra time is actually saved from other activities.

Expecting a well written RAILS development to be VASTLY quicker than using some other set of tools AND to expect it to be better quality and easier to support is wishing for your cake and eating it too.

Good code takes TIME, it takes THOUGHT.

RSPEC: Am I going too far.

Posted by Peter Morris Wed, 22 Aug 2007 09:41:00 GMT

I just had a nice idea for how to make my current application prettier.

Instead of stopping what I was doing (an item on the critical path, not ‘fluff’) and doing it, I added it as an unimplemented expectation in the appropriate place in the RSPEC files.

Which brings up a nice idea, I am going to capture the user requirements from my next meeting with the client in RSPEC.

Hmmmm, is this a spec too far?

The loneliness of the long distance tester

Posted by Peter Morris Tue, 21 Aug 2007 14:34:00 GMT

Well, today I have been coding a new section of the application my current client needs. I have been using RSPEC, and although I LOVE its expressiveness I find that if I use TDD/BDD to its upmost, I spend a lot of time writing the expectations and the model code, and for the longest time, don’t have anything to show for it, because nothing makes it to the controller/view side for a long time.

When I do get to the controller/view side, the models don’t give me any surprises and the methods defined really fit well with what is needed by the controller.

It just feels soo… dry, (and not in a good way).

Wonderful wonderful Copenhagen, no, wait, erm.... Autotest...

Posted by Peter Morris Wed, 15 Aug 2007 14:20:00 GMT

Over the last day or so, I have been playing with RSPEC. I must admit, its NICE.

What makes it even nicer, is using autotest

This is a nice addon that will automatically run your tests or rspecs when you change files and save them in your rails project.

Even nicer, you can coax it to talk to growl and get the tests to notify you onscreen as to progress.

Really wonderful. and not a daffodil in sight.