Testing coverage is used to show which lines of code the test is run against and which ones still need to be tested. A test coverage is composed of the following:

  • Statement: statements that we run at least once
  • Branches: percentage of branches that we run. Branch is one part of conditional statement like if or ternary.
  • Functions: percentage of functions that were run at least once
  • Lines: percentage of lines that were run at least one.

Quite a lot of companies force their developers to have 100% coverage but
You shouldn’t aim for 100% coverage all the time.