In perl.git, the branch smoke-me/jkeenan/data-dumper-testing has been created
<http://perl5.git.perl.org/perl.git/commitdiff/8dc625ada64652f621283a462d4ede805fd321a6?hp=0000000000000000000000000000000000000000> at 8dc625ada64652f621283a462d4ede805fd321a6 (commit) - Log ----------------------------------------------------------------- commit 8dc625ada64652f621283a462d4ede805fd321a6 Author: James E Keenan <[email protected]> Date: Sat Jan 19 19:20:21 2013 -0500 Data-Dumper: Boost test coverage and refactor. Thanks to coverage data posted by Paul Johnson as part of Perl Foundation-sponsored work, we know that as of Jan 01 2013, Data::Dumper (v2.139) had the following coverage of its code by its test suite: stmt bran cond sub Dumper.xs 94.8 64.5 blib/lib/Data/Dumper.pm 85.3 76.7 69.6 71.4 The coverage levels reported for Dumper.pm are unacceptably low, particularly for a library which is part of the Perl 5 core distribution. With this commit, we significantly improve coverage of Dumper.pm; Dumper.xs will need attention from those with XS expertise. Attempting to write tests for every line in a codebase frequently uncovers places in the code that are superfluous or cannot be reached. The close study of the code required to achieve high test coverage also discloses places where the code and its documentation are at odds with each other. This work on Data::Dumper is no exception, so we have made changes to Dumper.pm where appropriate. In addition, in order to facilitate this analysis and to make the codebase easier to maintain going forward, the code in Dumper.pm has been tidied up in certain locations, mostly with respect to tabs vs. whitespace in indentation and cuddled elses. Specifics of this commit: * Modifications to Dumper.pm ** Eliminate subs Dumpf() and Dumpp, which were neither documented nor tested anywhere in the codebase. (They will be reinstated if and only if someone can provide a rationale for that, along with documentation and testing.) ** For both Values() and Names(): explicit handling (croak) of the case where the method is provided with a defined argument that is not an array reference. ** Tidying, mostly in _dump(). ** Deletion of commented-out code. * New test files ** t/deparse.t ** t/dumpperl.t ** t/indent.t ** t/misc.t ** t/names.t ** t/purity_deepcopy_maxdepth.t ** t/quotekeys.t ** t/seen.t ** t/sortkeys.t ** t/sparseseen.t ** t/toaster.t ** t/values.t ** t/lib/Testing.pm - package holding subs used in the new test files * Expanded test files ** t/freezer.t ** t/terse.t The work done so far has significantly improved the coverage. As of Jan 19 2013 we are at: stmt bran cond sub Jan 01: blib/lib/Data/Dumper.pm 85.3 76.7 69.6 71.4 Jan 19: blib/lib/Data/Dumper.pm 97.6 94.3 82.1 97.6 ----------------------------------------------------------------------- -- Perl5 Master Repository
