XP is just a number | |
PerlMonks |
Re: Automated Edge Testingby pernod (Chaplain) |
on Apr 04, 2005 at 08:23 UTC ( [id://444600]=note: print w/replies, xml ) | Need Help?? |
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 :) pernod
In Section
Seekers of Perl Wisdom
|
|