I'm doing some work on a large body of code which lacks an automated test suite (MKDoc). My job at the moment isn't to add automated tests to the code, although I hope to take a crack at that in the near future. I figured I'd just wing it like I used to in the bad old days. How bad could it be?
However, I didn't realize just how strong my addiction to tests had become! After a few hours of coding I couldn't keep going. The code felt wrong. I couldn't see any problems but I knew they must be there. I hadn't proved the code worked, so why would it? I started getting paranoid and my code got more and more defensive. Clearly this wasn't going to work.
So I broke down, added a t/ directory with a single test file and started back into test-driven development. The newish prove command made this particularly easy since I didn't need to add a Makefile, just:
$ prove t
Ah, much better now!
-sam
Re:prove!
petdance on 2004-10-17T00:59:16
And here's the link to my slides about prove:http://www.petdance.com/perl/use-prove-lt.pdf
Maybe I should distribute it with Test::Harness!
Re:MKDoc?
samtregar on 2004-10-18T16:01:52
I'm actually doing development *on* MKDoc, rather than with it. They lost their lead developer a couple months ago and I answered the call.As to what MKDoc offers, I'm not entirely up-to-speed. It's a dynamic application platform, which makes it a very different kind of content-management system than Krang or Bricolage. It supports a lot of front-end interactivity that's hard to do with a static publisher: personalization, forums, polls, search, etc. There's also a lot of emphasis on accessability and internationalization but I haven't gotten into that aspect much yet.
Internally it's an interesting system. The documentation is lacking and there are no automated tests, but the code is uniformly high-quality. I'm learning Petal as a result and I have to agree with your assessment, it's good stuff. Nothing I'd trust a typical web designer around, but a good tool for a programmer hacking HTML.
-sam