in reply to Perl Code Quality

Right off the bat, the code should also come with a decent set of tests that can be used to check functionality.

Tests are useful for verifying that the system works as specified, but are also useful for future development. Having to write tests generally motivates developers to create a clean API for their modules. And a comprehensive test suite gives more confidence, that when one does make changes, the original functionality doesn't break.

If the test suite is written in the context of a test-driven development process (i.e., tests first, then code), even better.

Update: corrected a grammar mistake.

-Mark

Replies are listed 'Best First'.
Re^2: Perl Code Quality
by biosysadmin (Deacon) on Sep 25, 2004 at 03:21 UTC
    I like this idea quite a bit, but one interesting question is who should write them? You could ask the software company to write tests for you as well if you're busy, but I think it would be a very interesting if you wrote them yourself. That way you have a very simple, quantifiable way of determining that they are fulfilling the terms of their contract. On the other hand, if you're busy enough to contract out programming work, you may too busy to write tests. Writing your own tests involves might involve you in the development process more than you (and possibly the software company) want.

    Now my question: How can I assure that the system written is well-done? I am assuming it should be OO, with clean documentation and sensible classes, a documented and thought-out database structure as well as abstraction where possible. These are things I can observe. What else could/should I check for?

    You can do a lot by explicitly defining the object structure and APIs that you want. If you don't want to be this involved in the design, you could just look at the code as it is returned to you and give the development team feedback. AFAIK there is no automated way of determining code "quality," so I think you'll have to just describe your desire for good, modular code and see how well the company can do with it. I'm assuming that you've already picked your software company of choice, if not you should definitely attempt to shop around and get code samples from a variety of places.

Re^2: Perl Code Quality
by Micz (Beadle) on Sep 26, 2004 at 18:13 UTC
    Thanks for the suggestion. Could you give me a pointer towards resources regarding unit testing in Perl?

    I am currently thinking of having one company write the code and a freelancer write the tests. This might lead to some conflict (pointing fingers), but it should provide me with quite good results.