Jump to content

Talk:Code coverage

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nigelj (talk | contribs) at 11:50, 21 June 2010 ('Basic coverage criteria' a mess: clarify). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing Unassessed
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
???This article has not yet received a rating on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.

In the example: "If the function foo were called with variable bar set to −1, statement coverage would be achieved. Condition coverage, however, would not."

Isn't it contrary? --141.76.178.61 13:40, 13 November 2007 (UTC)[reply]


Yeah, I was thinking the same exact thing. Condition coverage WOULD be achieved. However if the number were 1 then condition coverage would be achieved but statement coverage would not. so perhaps this person means to imply that condition coverage does not imply statement coverage.

--Eric —Preceding unsigned comment added by 159.53.110.143 (talk) 22:12, 4 June 2008 (UTC)[reply]

I made the change

--Eric —Preceding unsigned comment added by 159.53.110.143 (talk) 22:15, 4 June 2008 (UTC)[reply]

But condition coverage DOES imply statement coverage. The example given in the article does not consider that the branch must also be executed for the 'true' case, therefore, having only one test case (bar = -1) does not achieve condition coverage. I have made the edit.

-- Tim —Preceding unsigned comment added by Gibber blot (talkcontribs) 01:48, 20 June 2008 (UTC)[reply]

The paragraph about code coverage as a form a debugger doesn't any sense to me. Can someone revisit that part? The rest of the article is great.

216.170.227.219 (talk) 16:52, 25 June 2008 (UTC)[reply]

-- Ryan: I would like to suggest that we change the second sentence from 'It describes the degree to which the source code of a program has been tested' to something more like: 'Code Coverage provides a way for developers to determine what percentage of code has had some form of testing, whilst specifically not imply any level of correctness'.

It is easily possible to have code that is not adequately tested and still report 100% code coverage in both statement and branch coverage. Such usage of code coverage can provide a false sense of security to coders and therefore we should not reinforce this. Test coverage indicates the coverage of testing (usually from a functional testing perspective) whilst Code coverage indicates what percentage of code has had some degree of unit testing executed over it, but doesn't imply correctness.

I am happy for someone to reword my suggestion to make it more readable, correct, etc. Distributedlife (talk) 14:10, 12 September 2008 (UTC)[reply]

  • Distributedlife, the existing wording does not imply any level of correctness. Perhaps the existing wording needs to explicitly say that testing only shows that the behavior of the code is consistent with the behavior expected by the test that were executed. Derek farn (talk) 14:57, 12 September 2008 (UTC)[reply]


  • I agree that it doesn't directly imply correctness, despite my belief that others may derive correctness from such a statement. Perhaps I should have said that code coverage doesn't directly imply test coverage. Code coverage and Test coverage are different. Test coverage is used in relation to the amount of functional testing that has been applied to a set of requirements. To be as accurate as I can be, 'Code Coverage is the percentage of lines of source code that have been executed by unit tests'. I would be happy with that, but what I would be more happy with is that there is some mention that Code Coverate should not be mistaken for Test Coverage. The primary reason for my concern is that I have stumbled across quotes about code coverage that sourced Wikipedia. This propagates the misnomer that code coverage measures the degree of testing that has been applied to source code. a link to the page where I originally sourced the Wikipedia reference

Let me provide an example of why code coverage shouldn't be promoted as way of representing test coverage. Excuse the source code sample:

float reciprocal (const float x)
{
  return (1.0f / x) ;
}

If we have a single test that tests the function with a value that is positive. The test will pass, statement and branch coverage will both be 100%. Test coverage is closer to 10% if you factor in positive, negative, zero and values > and < 1.0f. Distributedlife (talk) 16:11, 12 September 2008 (UTC)[reply]

Citation needed

However, a general-purpose algorithm for identifying infeasible paths has been proven to be impossible[citation needed](such an algorithm could be used to solve the halting problem).

the referenced page of the halting problem contains needed citation. Kagamin 15:34, 30 November 2008 (UTC)[reply]


External links added to this page is not so good. I miss definitions and examples of diffrent code coverages.

I propose these links for citation or at least external links:

But if you know about some other material with formal definitions available on net, add it instead. But really, I would expect more from wiki than one sentence about each type. Add formal definitions and examples. --Blacklily (talk) 10:03, 9 October 2009 (UTC)[reply]

We generally don't link to blogs, see the external link guideline. - MrOllie (talk) 13:49, 9 October 2009 (UTC)[reply]

First link is not blog. But I do not care what links ou add If it has valuable informations. In current external links there are tree links. First link

is very good and usefull.

Second link shoud be deleted, it is not very useful, no definitions of coverages.

Third link should be deleted too. It is just link to some pdf that is not publicly available.

So only first link is useful.

Delete these bad links and let's find someting useful. I found this:

a I found useful and simple table about coverages in next link, too: http://www.verifysoft.de/en_code_coverage.html

--80.95.113.25 (talk) 09:52, 14 October 2009 (UTC)[reply]

Insure++: does this belong?

In looking at Insure++'s site, I see no mention of code coverage. It appears to be a memory leak detector.

More Coverage Programms

In my opinion "NCover" should be on the list of available Software Code-Coverage Tools. (www.ncover.com [1])
213.174.237.28 (talk) 07:42, 3 March 2009 (UTC)[reply]

Software Code Coverage Tools?

Why does this page list hardware code coverage tools but not software code coverage tools? Surely hardware-based tools are more esoteric and less used? A table would be good showing tool, license, link, environment/OS, etc? Some to include are Cobertura, EMMA, NCover, rcov. —Preceding unsigned comment added by 62.232.250.50 (talk) 12:56, 5 August 2009 (UTC)[reply]

Software Code Coverage Tools were all removed by User:MrOllie due to this edit: [2] - reason: Vendor link sections not allowed per WP:EL. IMHO not a good decision to remove a complete paragraph because there are some vendor links in it. --> I've again added all tools without vendor links and added a reminder for not adding links again (what MrOllie should have done in the first place) --Sebastian.Dietrich (talk) 18:22, 25 August 2009 (UTC)[reply]

Coverage Metrics

Added both Linear Code Sequence and Jump (LCSAJ) & JJ-Paths as coverage metrics. Nat Hillary 18:50, 11 November 2009 (UTC) —Preceding unsigned comment added by Nat hillary (talkcontribs)

'Basic coverage criteria' a mess

In the bullet-point list, we now have 'Decision coverage' as well as 'Condition coverage' both listed twice, and 'branch coverage' and 'predicate coverage' thrown in there too. All these terms seem to refer to the same thing. There is also no mention in the multiple examples of anything involving multiple branches, like case statements, elseif or try-catch-catch. Can somebody who has access to the cited source (Glenford J. Myers (2004): The Art of Software Testing) tidy it up to be more general and more logical, or are we going to have to sort it out from first principles ourselves? --Nigelj (talk) 11:02, 21 June 2010 (UTC)[reply]