{"id":100,"date":"2007-10-08T20:02:05","date_gmt":"2007-10-08T20:02:05","guid":{"rendered":"http:\/\/psyphi.net\/blog\/?p=100"},"modified":"2010-01-26T20:06:16","modified_gmt":"2010-01-26T20:06:16","slug":"7-utilities-for-improving-application-quality-in-perl","status":"publish","type":"post","link":"https:\/\/psyphi.net\/blog\/2007\/10\/7-utilities-for-improving-application-quality-in-perl\/","title":{"rendered":"7 utilities for improving application quality in Perl"},"content":{"rendered":"<p>I&#8217;d like to share with you a list of what are probably my top utilities for improving code quality (style, documentation, testing) with a largely Perl flavour. In loosely important-but-dull to exciting-and-weird order&#8230;<\/p>\n<p><a href=\"http:\/\/search.cpan.org\/~mschwern\/Test-Simple\/lib\/Test\/More.pm\">Test::More<\/a>. Billed as yet another framework for writing test scripts Test::More extends Test::Simple and provides a bunch of more useful methods beyond Simple&#8217;s ok(). The ones I use most being use_ok() for testing compilation, is() for testing equality and like() for testing similarity with regexes.<\/p>\n<p><a href=\"http:\/\/search.cpan.org\/~mschwern\/ExtUtils-MakeMaker\/lib\/ExtUtils\/MakeMaker.pm\">ExtUtils::MakeMaker<\/a>. Another one of Mike Schwern&#8217;s babies, MakeMaker is used to set up a folder structure and associated &#8216;make&#8217; paraphernalia when first embarking on writing a module or application. Although developers these days tend to favour <a href=\"http:\/\/search.cpan.org\/~kwilliams\/Module-Build\/lib\/Module\/Build.pm\">Module::Build<\/a> over MakeMaker I prefer it for some reason (probably fear of change) and still make regular mileage using it.<\/p>\n<p><a href=\"http:\/\/search.cpan.org\/~petdance\/Test-Pod-Coverage\/Coverage.pm\">Test::Pod::Coverage<\/a> &#8211; what a great module! Check how good your documentation coverage is with respect to the code. No just a subroutine header won&#8217;t do! I tend to use Test::Pod::Coverage as part of&#8230;<\/p>\n<p><a href=\"http:\/\/search.cpan.org\/~srshah\/Test-Distribution\/lib\/Test\/Distribution.pm\">Test::Distribution<\/a> . Automatically run a battery of standard tests including pod coverage, manifest integrity, straight compilation and a load of other important things.<\/p>\n<p><a href=\"http:\/\/search.cpan.org\/~elliotjs\/Perl-Critic\/bin\/perlcritic\">perlcritic<\/a>, <a href=\"http:\/\/search.cpan.org\/~thaljef\/Test-Perl-Critic\/lib\/Test\/Perl\/Critic.pm\">Test::Perl::Critic<\/a> . The Perl::Critic set of tools is amazing. It&#8217;s built on <a href=\"http:\/\/search.cpan.org\/~adamk\/PPI\/lib\/PPI.pm\">PPI<\/a> and implements the <a href=\"http:\/\/www.amazon.co.uk\/gp\/product\/0596001738?ie=UTF8&amp;tag=gardmalt-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0596001738\">Perl Best Practices<\/a> book by Damien Conway. Now I realise that not everyone agrees with a lot of what Damien says but the point is that it represents a standard to work to (and it&#8217;s not that bad once you&#8217;re used to it). Since I discovered perlcritic I&#8217;ve been developing all my code as close to perlcritic -1 (the most severe) as I can. It&#8217;s almost instantly made my applications more readable through systematic appearance and made faults easier to spot even before Test::Perl::Critic comes in.<\/p>\n<p><a href=\"http:\/\/search.cpan.org\/~pjcj\/Devel-Cover\/lib\/Devel\/Cover.pm\">Devel::Cover<\/a>. I&#8217;m almost ashamed to say I only discovered this last week after dipping into Ian Langworthy and chromatic&#8217;s book &#8216;Perl Testing&#8217;. Devel::Cover gives code exercise metrics, i.e. how much of your module or application was actually executed by that test. It collates stats from all modules matching a user-specified pattern and dumps them out in a natty coloured table, very suitable for tying into your CI system.<\/p>\n<p><a href=\"http:\/\/www.openqa.org\/selenium\/\">Selenium<\/a> . Ok, not strictly speaking a tool I&#8217;m using right this minute but it&#8217;s next on my list of integration tools. Selenium is a non-interactive, automated, browser-testing framework written in Javascript. This tool definitely has legs and it seems to have come a long way since I first found it in the middle of 2006. I&#8217;m hoping to have automated interface testing up and running before the end of the year as part of the Perl CI system I&#8217;m planning on putting together for the new sequencing pipeline.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;d like to share with you a list of what are probably my top utilities for improving code quality (style, documentation, testing) with a largely Perl flavour. In loosely important-but-dull to exciting-and-weird order&#8230; Test::More. Billed as yet another framework for writing test scripts Test::More extends Test::Simple and provides a bunch of more useful methods beyond &hellip; <a href=\"https:\/\/psyphi.net\/blog\/2007\/10\/7-utilities-for-improving-application-quality-in-perl\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;7 utilities for improving application quality in Perl&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[11],"tags":[13,21,138,137],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-programming","tag-code","tag-perl","tag-quality","tag-tools"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/comments?post=100"}],"version-history":[{"count":1,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":101,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/100\/revisions\/101"}],"wp:attachment":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/tags?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}