Code coverage

related topics
{math, number, function}
{system, computer, user}
{theory, work, human}
{line, north, south}
{law, state, case}

Code coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested. It is a form of testing that inspects the code directly and is therefore a form of white box testing.[1] In time, the use of code coverage has been extended to the field of digital hardware, the contemporary design methodology of which relies on hardware description languages (HDLs).

Code coverage was among the first methods invented for systematic software testing. The first published reference was by Miller and Maloney in Communications of the ACM in 1963.

Code coverage is one consideration in the safety certification of avionics equipment. The standard by which avionics gear is certified by the Federal Aviation Administration (FAA) is documented in DO-178B.[2]

Contents

Coverage criteria

To measure how well the program is exercised by a test suite, one or more coverage criteria are used.

Basic coverage criteria

There are a number of coverage criteria, the main ones being:[3]

  • Function coverage - Has each function (or subroutine) in the program been called?
  • Statement coverage - Has each node in the program been executed?
  • Decision coverage or branch coverage - Has every edge in the program been executed? For instance, have the requirements of each branch of each control structure (such as in IF and CASE statements) been met as well as not met?
  • Condition coverage (or predicate coverage) - Has each boolean sub-expression evaluated both to true and false? This does not necessarily imply decision coverage.
  • Condition/decision coverage - Both decision and condition coverage should be satisfied.

Full article ▸

related documents
True BASIC
Initialization vector
Bourne shell
AutoLISP
Computer algebra system
Denormalization
SNOBOL
Serial number
Wikipedia:Free On-line Dictionary of Computing/I - K
Curl (programming language)
World file
Command-line interpreter
Client-side scripting
X.500
Server-side scripting
E.164
Thread safety
Randomizer
Information hiding
RenderMan Interface Specification
Portable Distributed Objects
Java Naming and Directory Interface
Document Object Model
ActiveX Data Objects
Oberon programming language
BASIC09
Maclisp
Linker
IBM 1620 Model I
Adapter pattern