Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code coverage
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==In practice== {{more citations needed section|date=February 2015}}The target software is built with special options or libraries and run under a controlled environment, to map every executed function to the function points in the source code. This allows testing parts of the target software that are rarely or never accessed under normal conditions, and helps reassure that the most important conditions (function points) have been tested. The resulting output is then analyzed to see what areas of code have not been exercised and the tests are updated to include these areas as necessary. Combined with other test coverage methods, the aim is to develop a rigorous, yet manageable, set of regression tests. In implementing test coverage policies within a software development environment, one must consider the following: * What are coverage requirements for the end product certification and if so what level of test coverage is required? The typical level of rigor progression is as follows: Statement, Branch/Decision, [[Modified Condition/Decision Coverage]] (MC/DC), LCSAJ ([[Linear Code Sequence and Jump]]) * Will coverage be measured against tests that verify requirements levied on the system under test ([[DO-178B]])? * Is the object code generated directly traceable to source code statements? Certain certifications, (i.e. DO-178B Level A) require coverage at the assembly level if this is not the case: "Then, additional verification should be performed on the object code to establish the correctness of such generated code sequences" ([[DO-178B]]) para-6.4.4.2.<ref name="DO-178B" /> Software authors can look at test coverage results to devise additional tests and input or configuration sets to increase the coverage over vital functions. Two common forms of test coverage are statement (or line) coverage and branch (or edge) coverage. Line coverage reports on the execution footprint of testing in terms of which lines of code were executed to complete the test. Edge coverage reports which branches or code decision points were executed to complete the test. They both report a coverage metric, measured as a percentage. The meaning of this depends on what form(s) of coverage have been used, as 67% branch coverage is more comprehensive than 67% statement coverage. Generally, test coverage tools incur computation and logging in addition to the actual program thereby slowing down the application, so typically this analysis is not done in production. As one might expect, there are classes of software that cannot be feasibly subjected to these coverage tests, though a degree of coverage mapping can be approximated through analysis rather than direct testing. There are also some sorts of defects which are affected by such tools. In particular, some [[race condition]]s or similar [[Real-time computing|real time]] sensitive operations can be masked when run under test environments; though conversely, some of these defects may become easier to find as a result of the additional overhead of the testing code. Most professional software developers use C1 and C2 coverage. C1 stands for statement coverage and C2 for branch or condition coverage. With a combination of C1 and C2, it is possible to cover most statements in a code base. Statement coverage would also cover function coverage with entry and exit, loop, path, state flow, control flow and data flow coverage. With these methods, it is possible to achieve nearly 100% code coverage in most software projects.<ref>{{cite book | author=Boris beizer | title=Software testing techniques, 2nd edition |publisher=Dreamtech press | year=2009| isbn=978-81-7722-260-9}}</ref> ===Notable code coverage tools=== <!-- DO NOT place red links as a means of requesting articles here - see [[WP:COMPREQ]]. DO NOT place external links to non-notable (i.e. not a Wiki-article) software here.--> ====Hardware manufacturers==== * [[Aldec]] * [[Mentor Graphics]] * [[Silvaco]] * [[Synopsys]] ====Software==== * [[LDRA Testbed]] * [[Parasoft]] ===== [[C (programming language)|C]] / [[C++]] ===== * [[Cantata++]] * [[Gcov]] * [[Insure++]] * [[LDRA Testbed]] * [[Tcov]] * [[Testwell CTC++]] * [[Trucov]] * [[Squish (Froglogic)]] ===== [[C Sharp (programming language)|C#]] [[.NET]] ===== * [[DevPartner Studio]] * [[JetBrains]] * [[NCover]] ===== [[Java (programming language)|Java]] ===== {{main article|Java code coverage tools}} * [[Clover (software)|Clover]] * [[DevPartner Java]] * [[EMMA (code coverage tool)|EMMA]] * [[Jtest]] * [[LDRA Testbed]] ===== [[PHP]] ===== * [[PHPUnit]], also need [[Xdebug]] to make coverage reports
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)