Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

perl metrics 1

Status
Not open for further replies.

uida1154

Programmer
Mar 1, 2004
163
NL
I am looking for some time now for some method to measure perl scripts (and modules) for their quality.

Since quality is not simply expressed in a single number you will need a set of metrics like:
- cyclomatic complexity
- fan in/fan out (number of functions referenced and number of functions referring to)
- use of "use strict" and the -w option
- etc.

Can somebody help me out here?
 
Good question, but given that no two tasks are identical, their solutions are not going to equate.

Software metrics are IMHO not necessarily qualitative. By assigning a index of quality to a script, you'd have to consider weightings and what you consider most important. Another quality engineer might have a different notion of what's important.

A script with a 100% hit rate on a database might score poorly compared to a simple monitoring script because some of the iterative logic could be catered for with a scheduler such as cron, but they're both doing different jobs, and they're doing it in that way because that's how they were designed, and they're similar only in that they're perl scripts

Just my €0.02
--Paul

Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
Thank you for your comments Paul.

Metrics should always serve as an indication to help you analyse the situation, often metrics are used as shotguns: wrong number and you're dead. I am happy that you too warn on this.

Concerning complexity: one can think of the "natural complexity" (how complex is the problem being solved) versus the "actual complexity" (how complex is the problem solved), see also Safer C from Les Hatton. In your example the script causing a 100% hit rate on the database will have a higher natural complexity than the monitoring script.

Besides the difficult metrics like cyclomatic complexity metrics like "use strict is used", "#filehandles opened/closed without check on result" etc. can be used which are not so hard to analyse and without exeption do describe a bit of the quality.

So again the question: Is there some module available?
 
Thanks for the start. I will look at the stuff in detail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top