Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

samtregar (2699)

  (email not shown publicly)

Journal of samtregar (2699)

Saturday October 16, 2004
11:25 AM

I can't stop testing!

[ #21373 ]
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!


The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • somehow in all the press of things to study I somehow missed out reading about 'prove'. Thanks, I needed that! :D
  • I had the same experience recently. I was working on a web app that we were told needed to be done very quickly. I figured I didn't have time for automated tests, so I was back to refreshing in the browser.

    What a nightmare! After about half a day, I was back writing tests again and I finally got productive. It truly is a myth that automated tests take more time.
  • What are you using it for? I can't quite tell what it offers by looking at the website. Are you doing something hat requires internationalized text?
    • 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