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

Re: Automated Edge Testing

by pernod (Chaplain)
on Apr 04, 2005 at 08:23 UTC ( #444600=note: print w/replies, xml ) Need Help??

in reply to Automated Edge Testing

This looks very interesting. Writing tests that are valid for different subroutine signatures will be a challenge, though. Your example above creates a test where each subroutine is excercized with an empy argument list. Generating the input with non-empty argument lists is non-trivial. What happens when you have five subroutines that expect hashrefs and one that expects a scalar? I've pondered this problem a bit earlier, and perhaps it is possible to add more code to parse subroutine signatures and feeding the results to some sort of test factory. This will at least reduce overhead in writing new test types.

Your title includes "Edge Testing". By concentrating on edge cases, i assume that you attempt to improve code coverage. Perhaps you could piggyback on Devel::Cover to get statistics on your code? Devel::Cover presents its data in a structured way, which is (normally) used to generate the pretty HTML-presentations. Maybe it is possible to analyse test input, and what branches are excercised, and then to generate more input data to excercise the uncovered branches? This does not sound trivial, but then again, your solution isn't either ;)

Lastly, I think your code parsing is a bit fragile. Regular expressions are wonderful, but Perl syntax is notoriously flexible. Therefore, reuse of your work depends on a code standard. This is fine, of course, as powerful tools will put restrictions on what you are allowed to do (viz static analysis tools). Still, Perl hackers are notoriously TIMTOWTDI. Maybe PPI can help with the parsing?

Your code is very interesting, and I wish you good luck in your project. Please keep us posted as you progress :)

Mischief. Mayhem. Soap.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2019-08-24 00:01 GMT
Find Nodes?
    Voting Booth?

    No recent polls found