The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Unit Testing: Don't be Fooled by the Coverage Report

3 replies on 1 page. Most recent reply: Mar 2, 2006 4:11 PM by Chris Dailey

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Unit Testing: Don't be Fooled by the Coverage Report Posted: Feb 27, 2006 7:50 AM
Reply to this message Reply
Advertisement
A developerWorks article by Richard Hightower discusses the limits of code coverage tools in providing insight into the quality of your tests.

http://www-128.ibm.com/developerworks/java/library/j-cq01316/

To what extent do you rely on code coverage tools to give you metrics on how complete your testing is, and what other ways do you decide when you're "done" writing tests?


Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: Unit Testing: Don't be Fooled by the Coverage Report Posted: Feb 27, 2006 9:48 AM
Reply to this message Reply
The pitfalls of code coverage techniques are well known in the literature:

http://www.bullseye.com/coverage.html

Nevertheless a nice to read and very *colorfull* article.

sergio mendez-rueda

Posts: 1
Nickname: maxi4
Registered: Mar, 2005

Re: Unit Testing: Don't be Fooled by the Coverage Report Posted: Feb 27, 2006 9:49 AM
Reply to this message Reply
In pursuit of code quality: Don't be fooled by the coverage
Are your test coverage measurements leading you astray?
Level: Introductory
Andrew Glover (aglover@vanwardtechnologies.com), CTO, Vanward Technologies Bla, bla, bla ...
Andrew Glover == Richard Hightower ??
----------------------------------------
Oh god, my english is really bad!!!
link:
http://www-128.ibm.com/developerworks/java/library/j-cq01316/
s mendez

Chris Dailey

Posts: 56
Nickname: mouse
Registered: Dec, 2002

Re: Unit Testing: Don't be Fooled by the Coverage Report Posted: Mar 2, 2006 4:11 PM
Reply to this message Reply
There is another way of being fooled by code coverage; I rarely see it mentioned.

Basically, a test setup should put the test in a particular state; then a number of operations should be performed; then the state should be tested for correct results. A test should perform a set of actions that define a transition from one state to another and then verify that state.

You could write all the tests you want, get 100% coverage, and not test the resulting state of what was executed. You could then still have bad behaving code, even though you have 100% coverage.

Flat View: This topic has 3 replies on 1 page
Topic: JVM-Level Support for Dynamic Languages Proposed Previous Topic   Next Topic Topic: Does Open Source Matter?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use