Code Coverage
With libraries you can aim for 100% code coverage.
four metrics:
- lines
- branches
- functions
- statements
It tells you that one of these run or were evaluated. It does not say how it was called, only that it was hit. It instruments the code, using a global _coverage_ = {}
variable. It then adds variables to it (keys are hashes) then counts how many times they were run. It adds these markers at each line and statement. :
__coverage__['strtsf']++
if (..) {
__coverage__['rtnef']++
}
does the same for functions, assignments, etc. Each key is unique.