<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://community.moertel.com/ss/rdf'>
    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#start/2005-02-19/1'
         s:name='start/2005-02-19/1'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:content>1 On the road to LectroTest 1.0: testing and code coverage {anchor:On the road to LectroTest 1.0: testing and code coverage}&#xA;In preparation for a big release, I spent quite a few hours&#xA;beefing up the test suite for [LectroTest].  I added 41 new&#xA;tests, an increase of 16 percent.  Some of the tests were&#xA;tricky to write, and I spent way more than 16 percent of my&#xA;testing effort on these last few tests.&#xA;&#xA;But the results of the effort were worth it: 100 percent&#xA;coverage.  According to the Perl code-coverage tool&#xA;{link:Devel::Cover|http://search.cpan.org/dist/Devel-Cover/},&#xA;the tests in the suite now cover 100 percent of LT&apos;s&#xA;statements, branches, conditions, and subroutines.  I sure&#xA;do like seeing green on the summary report.&#xA;&#xA;{image:coverage-summary.png|coverage summary report}&#xA;&#xA;The new tests uncovered one obscure bug, which I fixed.&#xA;They also uncovered some crufty code that I should have&#xA;cleaned up earlier and had forgotten.  Now the cruft&#xA;is gone.&#xA;&#xA;In a few places I had to refactor the code to eliminate&#xA;impossible conditions that were throwing off the coverage&#xA;report.  For example, consider the code below, in particular the portion in bold face.&#xA;&#xA;{code:none}&#xA;if ($content &amp;&amp; __s/(.*)/binding($1)/es__) {&#xA;    $content .= &quot; $1&quot;;&#xA;}&#xA;{code}&#xA;&#xA;The coverage tool indicated that I was not testing the&#xA;case in which the regex op in the second part of the ~~if~~&#xA;condition fails to match.  The reason, of course, is because&#xA;it cannot fail; the regex (.*) always matches.  So I rewrote&#xA;the code to remove the regex op from the condition:&#xA;&#xA;{code:none}&#xA;if ($content) {&#xA;    __s/(.*)/binding($1)/es;__&#xA;    $content .= &quot; $1&quot;;&#xA;}&#xA;{code}&#xA;&#xA;Problem solved.&#xA;&#xA;For the most part, however, when Devel::Cover said that&#xA;there were holes in my testing, they were real holes.&#xA;Having filled those holes, I now have the confidence in&#xA;[LectroTest] that I need to feel comfortable about recommending&#xA;its widespread use.&#xA;&#xA;And that&apos;s step one on the road to a big 1.0 release.&#xA;&#xA;</s:content>
        <s:mTime>2005-02-19 12:33:59.904</s:mTime>
        <s:cTime>2005-02-19 12:33:49.607</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#LectroTest'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/start/2005-02-19/1'/>
                <rdf:li rdf:resource='#ssuresh83'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments>
            <rdf:Bag>
                <rdf:li>
                    <s:Attachment rdf:about='http://community.moertel.com/ss/space/start/2005-02-19/1/coverage-summary.png'
                         s:fileName='coverage-summary.png'
                         s:contentType='image/png'
                         s:size='11113'>
                        <s:date>Sat Feb 19 12:33:59 EST 2005</s:date>
                    </s:Attachment>
                </rdf:li>
            </rdf:Bag>
        </s:attachments>
    </s:Snip>
</rdf:RDF>
