develooper Front page | perl.fwp | Postings from December 2001

perl golf test programs

From:
Matthew Wickline
Date:
December 13, 2001 04:17
Subject:
perl golf test programs
Message ID:
3C189C60.8EAFF303@wickline.org
introduce a bit of randomness into the test program.

Have it ship with some default 'troublesome' cases, and then generate
random other cases. So, for a mid.pl test, the program might ship with
input files having one line, two lines, three lines, four lines, lines
with \n from three different platforms, maybe files without
terminating \n characters (if these inputs are expected to be dealt
with), etc. It could then generate a handful of random files (on
*each* test run) as input as well.

As the test program is merely advisory, golfers shouldn't expect that
a 'pass' necessarily means that they will *always* pass. As with any
competition, some days you may do very well, and some days you may
trip on your shoelaces. Prepare to the best of your ability to not
trip on your shoelaces, and hope it doesn't happen on the day of the event.

Perhaps to facilitate this preparation, the test program could be
given a parameter indicating how many random input files should be
created (for those tests for which random input files are
appropriate). That way golfers can abuse their computers and their
patience exactly (or at least approximately) as much as is appropriate
for their needs.

-matt

(who is too used to writing code that coworkers can maintain to be a
decent golfer, but finds the entries and their discusssion absolutely fascinating)



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About