Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: What is your development process for Perl modules and apps?

by jwest (Friar)
on Aug 09, 2002 at 21:42 UTC ( #189063=note: print w/ replies, xml ) Need Help??


in reply to What is your development process for Perl modules and apps?

I typically edit in a development area. Almost without exception, this is a working copy of the project from CVS.

To answer the second question, I always use h2xs to generate the framework for my modules. So, in the general case, I can put all of my test code in test.pl (or t/whatever.pl, depending on how I'm feeling that day) and running 'make test' takes care of any library path issues for me.

The caveat to this is when the library in question requires the presence of another module in the project currently under development to be tested adequately. In this case, I've been known to take several approaches.

First, I might temporarily adjust the Makefile to have it include the apropriate paths in my library path. I like this solution because it's clean - running 'perl Makefile.PL' undoes whatever damage I did to the Makefile. I dislike this solution for the same reason. I rarely use this method for any project on which I'll be spending more than four hours.

Second, I might set up a better test.pl to convince the module I'm testing that it's got all the bits it needs. chromatic has written an excellent module for this purpose, called Test::MockObject. I like this approach because it feels like the right thing to do - it gives me the satisfaction of a job well done. I dislike this approach because doing the right thing often requires more effort than I really want to expend.

The third method I use for getting around this problem is writing the installation script for the package that I know I'll have to write anyway. Since I only modify the script from project to project, it's no longer as big of a hassle. So, I'll check out the project into another working directory, install it, and run it there for testing. I like this method because all the effort is eventually recycled into making sure my installation procedure is working. On the downside, it requires a lot of extra work - especially for incremental fixes. Checking that your module is at least compilable with perl -c is critical when you use this approach. I almost never use this approach unless I'm fixing a piece of code that's already been released. I never use this approach if I've been good and gone with the second option.

--jwest

-><- -><- -><- -><- -><-
All things are Perfect
    To every last Flaw
    And bound in accord
         With Eris's Law
 - HBT; The Book of Advice, 1:7


Comment on Re: What is your development process for Perl modules and apps?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-07-29 21:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (228 votes), past polls