![]() | This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||||||||||||
|
C language has
short circuit evaluation property. I guess this shall be considered in examples like foo(0,1)
. In this case second condition is not evaluated at all. — Preceding
unsigned comment added by
2A01:111F:4305:3C00:2DBE:582:9150:1AF5 (
talk)
09:20, 30 March 2017 (UTC)
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)
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)
I made the change
--Eric —Preceding unsigned comment added by 159.53.110.143 ( talk) 22:15, 4 June 2008 (UTC)
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 ( talk • contribs) 01:48, 20 June 2008 (UTC)
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)
-- 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)
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)
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)
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)
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)
In looking at Insure++'s site, I see no mention of code coverage. It appears to be a memory leak detector.
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)
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)
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 ( talk • contribs)
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)
I don't see why hardware tool vendors are listed here, and software tool vendors are not. Some earlier discussin here suggests that *links* to tools/vendors/products (presumably tool/vendor websites were meant) are not good. I don't see why a link to a vendor's company name listed under Wikipedia is different. If you allow this, companies that are big enought to get listed in Wikipedia get an unfair advantage, since there's a one-to-one relationship between "wikilink to vendor" and link to vendor commecial website.
Either let people list all the tools they know about, or insist that none of them are reasonable. —Preceding unsigned comment added by 75.34.85.234 ( talk) 03:52, 23 August 2010 (UTC)
For MCDC, the independence of a conditions effect on the decision is achieved by holding all other conditions constant while toggling that condition between true and false.
In the test set suggested to satisfy MC/DC, there is no MCDC pair for condition 'c' where the values for 'a' and 'b' remain constant:
a=false, b=false, c=true a=true, b=false, c=true a=false, b=true, c=true a=true, b=true, c=false
I suggest changing the last row of the set to:
a=false, b=true, c=false
Alonergan76 ( talk) 08:09, 2 August 2012 (UTC)
The article says
In languages, like Pascal, where standard boolean operations are not short circuited, condition coverage does not necessarily imply decision coverage. For example, consider the following fragment of code:
if a and b then
Condition coverage can be satisfied by two tests:
a=true
, b=false
a=false
, b=true
However, this set of tests does not satisfy decision coverage as in neither case will the if
condition be met.
Except that makes no sense. In all languages, if at least one of "a" and "b" aren't true, then "a and b" ("a && b", "a and then b", "a andalso b") won't be true, whether or not it uses short-circuit evaluation. That's what "and" means.-- Prosfilaes ( talk) 09:10, 20 February 2013 (UTC)
The article cites Glenford J. Myers (2004). The Art of Software Testing, 2nd edition, as source for the various types of coverage. However, Myers doesn't talk about function coverage. — Preceding unsigned comment added by 131.155.216.160 ( talk) 11:14, 29 February 2016 (UTC)
Strangely this article describes code coverage as test coverage in the lead, but they are not the same thing. Code coverage means "what code got executed" while test coverage means "what requirements got tested". I'll go track down some good sources, if anyone has suggestions on sources or improved wording let me know. CodeCurmudgeon ( talk) 20:32, 11 July 2018 (UTC)
The title says "code coverage", but then the lead (and most of the rest of the article) says "test coverage". This is confusing.
-- Mortense ( talk) 15:14, 28 January 2020 (UTC)
I think we need an example where the Edge and Branch coverage differs. In addition in the header it talks about Brnach being a subset of edge, but then later on when Branch coverage is refereed to it is "Branch (or Edge)" implying they are the same. 96.95.228.129 ( talk) 21:15, 12 February 2020 (UTC)
If the lead identifies the topic as test coverage, then why wasn't the page moved to Test coverage?
As presently written, this page is only in a (relatively) Narrow Topic context in stating that test coverage is a synonym for code coverage. I can appreciate that in an exclusively coding and code-based testing environment, code coverage is the only test coverage there is and there is no point in making the distinction. If this page is limited to that context, because code coverage is a common name for the measures listed in the page, the lead should read either:
or
The phrase In computer science does not restrict "test coverage" to "code coverage", because requirements-based testing is also practiced within computer science, and its primary test concern is test coverage of requirements. A Broad Topic test coverage article would have to include the requirements-based testing definition that "test coverage" means coverage of the requirements.
See also: Talk:Fault coverage#Split
IveGoneAway ( talk) 22:01, 15 February 2023 (UTC) 22:23, 15 February 2023 (UTC) 15:52, 17 July 2023 (UTC)
Code Analyzer for the Maniac computer. Analysis of problem codes on the Maniac, Math. Comp. 9 (1955), 14-20. MarMi wiki ( talk) 19:57, 12 July 2023 (UTC)
![]() | This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||||||||||||
|
C language has
short circuit evaluation property. I guess this shall be considered in examples like foo(0,1)
. In this case second condition is not evaluated at all. — Preceding
unsigned comment added by
2A01:111F:4305:3C00:2DBE:582:9150:1AF5 (
talk)
09:20, 30 March 2017 (UTC)
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)
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)
I made the change
--Eric —Preceding unsigned comment added by 159.53.110.143 ( talk) 22:15, 4 June 2008 (UTC)
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 ( talk • contribs) 01:48, 20 June 2008 (UTC)
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)
-- 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)
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)
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)
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)
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)
In looking at Insure++'s site, I see no mention of code coverage. It appears to be a memory leak detector.
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)
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)
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 ( talk • contribs)
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)
I don't see why hardware tool vendors are listed here, and software tool vendors are not. Some earlier discussin here suggests that *links* to tools/vendors/products (presumably tool/vendor websites were meant) are not good. I don't see why a link to a vendor's company name listed under Wikipedia is different. If you allow this, companies that are big enought to get listed in Wikipedia get an unfair advantage, since there's a one-to-one relationship between "wikilink to vendor" and link to vendor commecial website.
Either let people list all the tools they know about, or insist that none of them are reasonable. —Preceding unsigned comment added by 75.34.85.234 ( talk) 03:52, 23 August 2010 (UTC)
For MCDC, the independence of a conditions effect on the decision is achieved by holding all other conditions constant while toggling that condition between true and false.
In the test set suggested to satisfy MC/DC, there is no MCDC pair for condition 'c' where the values for 'a' and 'b' remain constant:
a=false, b=false, c=true a=true, b=false, c=true a=false, b=true, c=true a=true, b=true, c=false
I suggest changing the last row of the set to:
a=false, b=true, c=false
Alonergan76 ( talk) 08:09, 2 August 2012 (UTC)
The article says
In languages, like Pascal, where standard boolean operations are not short circuited, condition coverage does not necessarily imply decision coverage. For example, consider the following fragment of code:
if a and b then
Condition coverage can be satisfied by two tests:
a=true
, b=false
a=false
, b=true
However, this set of tests does not satisfy decision coverage as in neither case will the if
condition be met.
Except that makes no sense. In all languages, if at least one of "a" and "b" aren't true, then "a and b" ("a && b", "a and then b", "a andalso b") won't be true, whether or not it uses short-circuit evaluation. That's what "and" means.-- Prosfilaes ( talk) 09:10, 20 February 2013 (UTC)
The article cites Glenford J. Myers (2004). The Art of Software Testing, 2nd edition, as source for the various types of coverage. However, Myers doesn't talk about function coverage. — Preceding unsigned comment added by 131.155.216.160 ( talk) 11:14, 29 February 2016 (UTC)
Strangely this article describes code coverage as test coverage in the lead, but they are not the same thing. Code coverage means "what code got executed" while test coverage means "what requirements got tested". I'll go track down some good sources, if anyone has suggestions on sources or improved wording let me know. CodeCurmudgeon ( talk) 20:32, 11 July 2018 (UTC)
The title says "code coverage", but then the lead (and most of the rest of the article) says "test coverage". This is confusing.
-- Mortense ( talk) 15:14, 28 January 2020 (UTC)
I think we need an example where the Edge and Branch coverage differs. In addition in the header it talks about Brnach being a subset of edge, but then later on when Branch coverage is refereed to it is "Branch (or Edge)" implying they are the same. 96.95.228.129 ( talk) 21:15, 12 February 2020 (UTC)
If the lead identifies the topic as test coverage, then why wasn't the page moved to Test coverage?
As presently written, this page is only in a (relatively) Narrow Topic context in stating that test coverage is a synonym for code coverage. I can appreciate that in an exclusively coding and code-based testing environment, code coverage is the only test coverage there is and there is no point in making the distinction. If this page is limited to that context, because code coverage is a common name for the measures listed in the page, the lead should read either:
or
The phrase In computer science does not restrict "test coverage" to "code coverage", because requirements-based testing is also practiced within computer science, and its primary test concern is test coverage of requirements. A Broad Topic test coverage article would have to include the requirements-based testing definition that "test coverage" means coverage of the requirements.
See also: Talk:Fault coverage#Split
IveGoneAway ( talk) 22:01, 15 February 2023 (UTC) 22:23, 15 February 2023 (UTC) 15:52, 17 July 2023 (UTC)
Code Analyzer for the Maniac computer. Analysis of problem codes on the Maniac, Math. Comp. 9 (1955), 14-20. MarMi wiki ( talk) 19:57, 12 July 2023 (UTC)