You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Ramandeep Kaur <ra...@gmail.com> on 2007/04/19 21:22:12 UTC

code coverage for junit tests for svn trunk revision 529822

Hi,

I ran code coverage for junit tests for svn trunk revision 529822 with sun
jdk142, sun jdk15, and sun jdk16.  Code coverage has improved by about 6%
for classes, 9% for methods, 6% for blocks, and 6% for lines since last run
for svn trunk revision 508283.

Here are the code coverage results:

OVERALL COVERAGE SUMMARY
classes 81%  (1040/1282)
Methods 64%  (13583/21372)
Blocks  56%  (376021/675405)
Lines   55%  (77087.9/139559)

OVERALL STATS SUMMARY
total packages: 79
total executable files: 1202
total classes: 1282
total methods: 21372
total executable lines: 139559
-- 
Ramandeep Kaur

Re: code coverage for junit tests for svn trunk revision 529822

Posted by Andrew McIntyre <mc...@gmail.com>.
On 4/19/07, Ramandeep Kaur <ra...@gmail.com> wrote:
> Hi,
>
> I ran code coverage for junit tests for svn trunk revision 529822 with sun
> jdk142, sun jdk15, and sun jdk16.  Code coverage has improved by about 6%
> for classes, 9% for methods, 6% for blocks, and 6% for lines since last run
> for svn trunk revision 508283.
>
> Here are the code coverage results:
>
> OVERALL COVERAGE SUMMARY
> classes 81%  (1040/1282)
> Methods 64%  (13583/21372)
> Blocks  56%  (376021/675405)
> Lines   55%  (77087.9/139559)
>
> OVERALL STATS SUMMARY
> total packages: 79
> total executable files: 1202
> total classes: 1282
> total methods: 21372
> total executable lines: 139559

These results are now visible at:

http://people.apache.org/~fuzzylogic/codecoverage/529822/

andrew

Re: code coverage for junit tests for svn trunk revision 529822

Posted by Daniel John Debrunner <dj...@apache.org>.
Ramandeep Kaur wrote:
> All suites - lang, derbynet, tools, jdbcapi, store.

As individual test runs? Or through junit-all?

Dan.


Re: code coverage for junit tests for svn trunk revision 529822

Posted by Ramandeep Kaur <ra...@gmail.com>.
All suites - lang, derbynet, tools, jdbcapi, store.

On 4/19/07, Daniel John Debrunner <dj...@apache.org> wrote:
>
> Ramandeep Kaur wrote:
> > Hi,
> >
> > I ran code coverage for junit tests
>
> Which tests were run?
>
> Dan.
>
>


-- 
Ramandeep Kaur

Re: code coverage for junit tests for svn trunk revision 529822

Posted by Daniel John Debrunner <dj...@apache.org>.
Ramandeep Kaur wrote:
> Hi,
>  
> I ran code coverage for junit tests

Which tests were run?

Dan.


Re: code coverage for junit tests for svn trunk revision 529822

Posted by Ramandeep Kaur <ra...@gmail.com>.
> When inspecting the results for Blob, it seems like the tests for
> the jdbc4 methods has not been run (e.g., Blob.free).  Do you know
>why?
First let me explain about how Emma collects code coverage data.
Basically, Emma collects code coverage during test run only for those
classes which have been instrumented for code coverage. For Derby, when I
run code coverage, I instrument files - derby.jar, derbytools.jar,
derbynet.jar, and derbyclient.jar.
Therefore, when you look at code coverage results, you only see code
coverage numbers for all the classes that are part of above jar files. Now
during test run, if other files such as java package files are called, code
coverage is not collected for those. It seems like Blob is part of package
java.sql and therefore you don't see any coverage numbers for that.

I hope I answered your question. Please let me know.

On a side note, to get some more information on code coverage for derby,
check out document
http://db.apache.org/derby/binaries/DerbyCodeCoverageUsingEmma.pdf. You
might want to look at section 6.2 of this document which gives information
on how to run code coverage only for selected files.


Thanks, Raman


>  -  What is the meaning of blocks?  I thought it was a block of
>     statements, but the report says there are more blocks than lines.
>     (E.g., Blob.isBinaryStream is reported to have 1 line and 10
>     blocks.)
John already answered your question. Thanks John.




-- 
Ramandeep Kaur

Re: code coverage for junit tests for svn trunk revision 529822

Posted by John Embretsen <Jo...@Sun.COM>.
Øystein Grøvlen wrote:

>   - What is the meaning of blocks?  I thought it was a block of
>     statements, but the report says there are more blocks than lines.
>     (E.g., Blob.isBinaryStream is reported to have 1 line and 10
>     blocks.)

A basic block is basically a sequence of bytecode instructions with a single
entry point and a single exit point. I found an explanation on the Emma web site:

http://emma.sourceforge.net/faq.html#q.blockcoverage

I don't think I remember enough from grad school to be able to explain exactly
why Blob.isBinaryStream() is reported to have 10 blocks; it may also be possible
that the code coverage tool has its own interpretation. The method's bytecode
would look something like this:

public boolean isBinaryStream();
   Code:
    0:   aload_0
    1:   getfield        #2; //Field dataType_:I
    4:   aload_0
    5:   getfield        #3; //Field BINARY_STREAM:I
    8:   iand
    9:   aload_0
    10:  getfield        #3; //Field BINARY_STREAM:I
    13:  if_icmpne       20
    16:  iconst_1
    17:  goto    21
    20:  iconst_0
    21:  ireturn


(I used javap to find this)

-- 
John




Re: code coverage for junit tests for svn trunk revision 529822

Posted by Øystein Grøvlen <Oy...@Sun.COM>.
Ramandeep Kaur wrote:
 > Hi,
 >
 > I ran code coverage for junit tests for svn trunk revision 529822 with
 > sun jdk142, sun jdk15, and sun jdk16.  Code coverage has improved by
 > about 6% for classes, 9% for methods, 6% for blocks, and 6% for lines
 > since last run for svn trunk revision 508283.

Thanks for doing this.  I will use this to check the coverage for
testing of Blob/Clob that I am currently working with.  A few
questions:

   - When inspecting the results for Blob, it seems like the tests for
     the jdbc4 methods has not been run (e.g., Blob.free).  Do you know
     why?
   - What is the meaning of blocks?  I thought it was a block of
     statements, but the report says there are more blocks than lines.
     (E.g., Blob.isBinaryStream is reported to have 1 line and 10
     blocks.)

--
Øystein