Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Unit Testing in Perl

by skyknight (Hermit)
on Jun 26, 2005 at 13:26 UTC ( [id://470023]=note: print w/replies, xml ) Need Help??


in reply to Re: Unit Testing in Perl
in thread Unit Testing in Perl

Well, the kind of problem to which I was alluding is that to which mosquito refers to here.

And yes, it is extremely disappointing that so many people set about writing code without a formalized process for doing automated tests. I just finished graduate school and started a new job. On Friday I was introduced to an enormous blob of Perl code, entirely functional, completely undocumented, devoid of unit tests, and with data hard coded into it. I'm trying to figure out how best to suggest that I ought to be allowed to rewrite the thing. Perhaps I ought to suggest first that in order to learn how it works that I write some tests for it, and perhaps write some documentation as I figure out stuff, a Stone Soup strategy if you will. Oh, and did I mention that it's not in version control? The guy who developed it just takes occasional snapshots of the code.

So, basically I'm trying to figure out how to hijack this project and set it right, all without stepping on anyone's toes. I've got my work cut out for me... Or maybe I should just steer clear of it and work on something of my own from scratch. I seem to have a lot of flexibility in that regard, as developers in this group are basically just set free to find interesting problems to tackle. Maybe it'd be better to just lead by example than to try to beat a pre-existing project into good shape. I don't know... Entering a new group is a tricky and delicate process.

I'm starting to feel that it is my lot in life to be a Jonny Appleseed of the software development world.

Replies are listed 'Best First'.
Re^3: Unit Testing in Perl
by dws (Chancellor) on Jun 26, 2005 at 15:37 UTC

    So, basically I'm trying to figure out how to hijack this project and set it right, all without stepping on anyone's toes.

    "Draining the swamp" problems are fun, especially when there are people still living in the swamp.

    If you're starting from zero (tests), I'd suggest starting with strictly functional ones. If it's a web app, reach for WWW::Mechanize and Test::More (or Test::WWW::Mechanize, which I haven't used yet but am told is worth the effort), and figure out how to write functional tests that drive the application through various scenarios. If you're not dealing with a web app, the idea is the same.

    Then, when you go on a cleanup binge, start by writing functional tests to cover what you're about to change, then see if you can get under the covers, isolate the code you're working with, and write some unit tests for it. The combination of functional and unit tests will give you some comfort as you restructure and refactor.

    If the swamp dwellers don't want you writing unit tests, and won't be led gently in that direction, staying at the functional level is better than nothing.

Re^3: Unit Testing in Perl
by eyepopslikeamosquito (Archbishop) on Jun 26, 2005 at 21:53 UTC
Re^3: Unit Testing in Perl
by adrianh (Chancellor) on Jun 27, 2005 at 01:00 UTC
    Friday I was introduced to an enormous blob of Perl code, entirely functional, completely undocumented, devoid of unit tests, and with data hard coded into it. I'm trying to figure out how best to suggest that I ought to be allowed to rewrite the thing.

    If you don't already have a copy go get Perl Medic. Lots of useful tips for attacking this sort of evil task.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://470023]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found