Improving coverage with metacpan

I've been reviewing the coverage of the tests of modules using metacpan.org.

It is pretty handy for finding stuff which is not tested.

I tried it on this module:

https://metacpan.org/release/Directory-Diff

I noticed that a lot of the code had no tests, and there were also some completely unused subroutines.

coverage-before.png

I removed some of the unused subroutines and wrote some tests for the remaining things, and was able to improve the coverage:

coverage-after.png

This seems quite handy.

2 Comments

I love this new feature.

Absolutely love it.

My core dists have 98%+ coverage, and the reason behind not having 100% is due to the fact that I've got a "_vim_placeholder()" type sub that is untested, because it's literally just a stop-gap between code and POD in my IDE.

Guess I'll rectify that by throwing a test at it.

Very glad you've brought this new MCPAN feature to the forefront here.

-stevieb

Leave a comment

About Ben Bullock

user-pic Perl user since about 2006, I have also released some CPAN modules.