Statement coverage is one of the simplest program coverage criteria available. It is also the easiest to satisfy. The idea is, when given a program, cover all statements in the program 100% statement coverage.

The following are the steps to collect statement coverage:

  • Start with an input
  • Trace the execution
  • Mark each statement reached
  • The statement coverage is the proportion of statements reached to the overall number of statements.

Statements in Python

Function definitions are statements in Python.”if”s are statements. elif” is a statement. “else” is not a statement. “for”, “while”, “match” are also statements.


Back to parent page: Software Testing

Web_and_App_Development Software_Testing Software_Validation SOFT3202 Whitebox_Testing Test_Evaluation Test_Coverage Statement_Coverage