Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Test/ Code Ratio

by xdg (Monsignor)
on Jan 28, 2005 at 12:35 UTC ( #425927=note: print w/ replies, xml ) Need Help??


in reply to Test/ Code Ratio

The other thing to consider is if your tests have a lot of repetitive code. You might look at Test::Class as a way of refactoring, particularly if your code has a lot of classes/subclasses and your tests are checking them for similar behaviors.

On the other hand, it wouldn't surprise me a priori if you have that kind of ratio. Perl is a very concise language and you can do a lot in only a few lines of code, but testing all the ways that code could be used could be quite lengthy. You've got to consider the branch and condition density of your code -- if that's high, then you'll need a lot of tests to verify behavior in all circumstances.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


Comment on Re: Test/ Code Ratio

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-09-21 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (174 votes), past polls