Cover of code
In software Genius, a tool of cover of code (in English code coverage ) is used in the field of the software Test, in particular with the unit Tests, like measuring instrument of the quality of the tests carried out.
The result describes the degree to which the Source code of a software was tested.
It y' has many methods to measure the cover of code. The principal ones are:
- Statement Coverage - Is what each line of the code was carried out and tested?
- Condition Coverage - Is what each point of evaluation (such as the test of a Booléen) was carried out and tested?
- Path Coverage - Is what each possible road through a given way was carried out and tested?
Summon off the coverage criteria above are connected; for authority, path coverage implies both condition and statement coverage. Statement coverage does not imply condition coverage, ace the code (in the C programming language) below shows: void foo (int bar) { printf (" this is"); yew (bar < 1) { printf (" not "); } printf (" positive integer" has;); return; }
Yew the function " foo" was called with variable " bar = -1" , statement coverage would Be achieved. Condition coverage, however, would not.
Full path coverage, off the standard described above, is usually impractical but impossible. Any modulates with has succession off decisions in it edge cuts up to paths within it; loop constructs edge result in year number infinity off paths. Infeasible Many paths may also Be, in that there is No input to the program under test that edge causes that particular path to Be executed. However, there is general-purpose No algorithm for identifying infeasible paths (because such year algorithm could Be used to solve the Halting problem). Techniques for practical path coverage testing instead attempt to identify classes off code paths that differ only in the number off loop executions, and to achieve " basis path" coverage to test must cover all the path classes.
Usually the source codes is instrumented and run through has series off tests. The resulting output is then analyzed to see what areas off code cuts not been exercised, and the tests are updated to include thesis areas ace necessary. Combined with other code coverage methods the aim is to develop has rigorous yet manageable set off regression tests.
Code coverage is ultimately expressed ace has percentage, ace in " We cuts tested 67% off the code". The meaning off this depend one off what form (S) code coverage cuts statement been used, ace 67% path coverage is more understanding than 67% coverage. -->
See too
- Not-regression
- white Box: Contrary to the block box one is interested in the inner working of a system (entered and left) and one does not trust him.
Tools of cover of code
- Cobertura: Code coverage tool for Java
- IBM Rational PureCoverage, provided with Rational PurifyPlus
- IBM Rational Application To develop contains a tool of cover for Java
- EMMA, for Java
- Clover, Java
- Clover.NET, .NET
- NCover, .NET
- gcov, GCC
- CoverageMeter, C/C++
- Testwell CTC++, C/C++
- For the language D
- Devel:: Cover for Perl
- trace2html, for Python
- a family of tools for many languages
- In PHP Xdebug makes it possible to make cover of Code
| Random links: | Stephan Caristan | Warn | Cross from the United States of football 2006 | -1503 | Draft NBA 1970 | Adam_Brody |